Linux.com

Feature

Minimalist tools for writers

By Dmitri Popov on August 24, 2006 (8:00:00 AM)

Share    Print    Comments   

Doing word processing without a dedicated word processor may seem like an absurd idea, but it actually makes a lot of sense, as long as you have the right set of writing tools -- a solid text editor, the txt2tags utility, and Aspell spelling software.

Why would you want to dump your word processor? For a number of reasons:

  • Simplicity. With a text editor, there is nothing to distract you from the writing process: no context toolbars, no myriad of formatting options, no confusing menus -- just you, an empty window, and a blinking cursor.
  • Concentrate on what you write, not how you write. OpenOffice.org Writer is a great word processor, but is it really your job to fiddle with paragraph styles, page formatting, table layout, image settings, and so on? Using the right text tools, you can concentrate on the actual writing, without worrying about the formatting.
  • Compatibility. The result of your labour is a plain text file, which is the most compatible file format out there. You won't have to worry about whether your peers can open it in Word, or whether the text will be rendered correctly in some other obscure word processor.

Opting for a simple text editor can be tempting, but you might want to consider something more powerful. Vim is one such editor, and although it has a steep learning curve, once you've gotten to grips with it, the sky is the limit. If you are eager to start using Vim right away, use the vimtutor command to learn some Vim basics. Alternatively, this tutorial provides a good introduction to the editor's essential features. There are also a few handy Vim cheatsheets and reference cards available on the Web to help you to keep tabs on Vim's commands and options. Vim is available on Linux, Windows, and Mac OS X.

If you find Vim intimidating, you might want to opt for gVim instead; it features a graphical interface, menus, and buttons that will make you feel a bit more comfortable. There are also two Vim commands that can be immediately useful. The set lbr! command enables line wrap at word, which makes the text easier to manage, while :set mouse=a enables the mouse.

txt2tags

While Vim offers some powerful text editing tools, you may still need at least some basic formatting functionality, and you may also need a way to output the finished text file in different formats. This is where txt2tags comes in. txt2tags is a so-called document generator that can convert a text file into several formats, such as HTML, XHTML, SGML, LaTeX, and others. More importantly, txt2tags supports some basic markup and different configuration options that allow you to format your text file and do some other clever stuff. txt2tags' markup resembles a wiki's, and it is extremely easy to use. Although the list of markup tags supported by txt2tags is not as extensive as in an average wiki, it still includes the most used ones, such as titles, lists, links, images, and tables, as well as the so-called beautifiers (bold, italic, underline, etc.).

txt2tags also allows you to do some advanced stuff. For example, you can use macros in your text file; add the %%TOC line in the beginning of the text, and txt2tags replaces it with a table of contents in the output file. The %!include command can be used to include other text files into the current one, which allows you to divide long texts into several files and assemble them into a "master," exactly as in OpenOffice.org Writer.

Another of text2tags' nifty features is the ability to specify search and replace filters. Let's say you are working on text that contains links to an online article. If the article's URL changes, you have to correct every link in the text. With txt2tags, you can specify a search and replace filter that looks something like this: %!preproc: URL_ARTICLE "http://linktothearticle". Then, instead of writing the link itself, you use the specified URL_ARTICLE filter. If the URL changes, you have to correct it only once in the filter definition, and txt2tags will take care of the rest. txt2tags' Web site provides extensive documentation that covers other clever features and options.

txt2tags is written in Python, and it's available for different platforms. Many major Linux distributions contain txt2tags in their software repositories, so the software can easily be installed using your distro's package manager (for example, Synaptic on Ubuntu and Adept on Kanotix). If you prefer to use the most recent version of txt2tags, you can download the source as well. Since txt2tags is a Python script, you don't have to install or compile anything. Simply run it using the python txt2tags command (provided you have Python installed on your system).

Many text editors, including Vim, support syntax highlighting, and at txt2tags' Web site you can download syntax files for different editors. To install and enable syntax highlighting in Vim, download the txt2tags.vim file, move it to the ~/.vim/syntax directory (you may need to create it if it doesn't exist), then run the :syntax enable and :set syntax=txt2tags commands. Vim's help provides a more detailed description of how to install and enable the syntax file (use the :help mysyntaxfile command).

To process the formatted text file, launch txt2tags using the txt2tags command. Most of txt2tags' options are obvious, so you shouldn't have problems figuring out how to configure and use the tool.

Aspell

A spellchecker is an indispensable utility for any writer. Most Linux distributions come with Aspell, a capable command-line spellchecking utility. Aspell is straightforward in use: the aspell check filename command will run spellcheck on the specified file using the default dictionary. Aspell can, of course, accept different options. For example, if you want to spellcheck a text in German, use the following command: aspell check -d de_DE filename. Using Windows? No problem: Aspell is available on Windows as well.

Other useful utilities

Every writer has his own tools of choice, but there are at least two utilities no writer should be without. wc is a tiny tool that counts lines, words, and characters in a specified text file. Just use the wc filename command to see the line, word, and number of bytes in the text file. To view the number of characters in the file, use the -c option: wc -c filename. You can also use this utility from within Vim; in the Command mode, enter the command as follows: !wc filename.

A decent language reference is essential no matter whether you write technical manuals or science fiction. And WordNet is a must-have language reference for any self-respecting writer. WordNet's capabilities deserve an article of their own, so make sure to read the accompanying documentation to get the most out of this superb tool. WordNet is available for most major platforms, and you can run it from within Vim using the command !wn word (or !wnb word if you prefer to use the WordNet browser), where word is the word you want to look up.

If you are used to work in OpenOffice.org or any other graphical word processor, moving to text-based tools can be a bit of a cultural shock. But once you've learned to work the "text way," you may never look back.

Dmitri Popov is a freelance writer whose articles have appeared in Russian, British, German, and Danish computer magazines.

Dmitri Popov is a freelance writer whose articles have appeared in Russian, British, US, German, and Danish computer magazines.

Share    Print    Comments   

Comments

on Minimalist tools for writers

Note: Comments are owned by the poster. We are not responsible for their content.

aspell

Posted by: Anonymous Coward on August 25, 2006 12:07 AM
aspell struck me as a bit deficient as an interactive spell checker. If I recall correctly, while in aspell there is no way to edit the document itself. So if it finds a misspelling, but the right spelling is not in its suggestion list, you've got no way to edit the document and put in the right spelling.

Maybe a better choice for spell check would be the facility built in to vim 7.0.

#

Re:aspell

Posted by: Anonymous Coward on August 25, 2006 02:33 AM
The aspell replacement ispell has the ability to replace a word that is not in the word list. Ispell uses the BSD licence though, not GPL.

In terms of pure word processing, I've found the pico replacement nano can't be beat. Much simpler than vi for this dedicated purpose.

#

Re:aspell

Posted by: Anonymous Coward on August 25, 2006 03:52 AM
If I recall correctly, while in aspell there is no way to edit the document itself.



That is not correct, at least with any recent version of aspell. Use the 'r' option (replace).

#

Hate vim, try emacs

Posted by: Anonymous Coward on August 25, 2006 09:58 AM
No article mentioning vi (aka vim) would be complete without a corresponding post mentioning emacs. To my mind emacs is dead easy to learn: you only need remember one thing -- to stop the program hold down the Control key and press the C key. Emacs will walk you through everything else, and will walk you through stopping the program too if you use a more recent version that runs under X.

Of course, the vi-or-emacs question is a religious one going back to the dawn of time. I write this for those who are just starting and not yet indoctrinated into either camp and so still retain their free will.

Regards,
Karl O. Pinc kop aatattt meme dottt com

#

Re:Hate vim, try emacs

Posted by: Anonymous Coward on August 26, 2006 01:03 AM
Read the title again, friend. It says "minimalist tools for writers" and not "dinosaur environment for coders".

Emacs is _not_ easy, neither is xemacs nor any other derivative of it. I don't claim vi is easier, but it is more minimalistic. And no, there is no convention that one _have_ to mention emacs when one talks about vi so the article is in itself very complete also without any word on emacs. As a matter of fact it would have contradicted its own title.<nobr> <wbr></nobr>:-)

#

Re:Hate vim, try emacs

Posted by: Administrator on August 25, 2006 08:16 PM
A Linux user should get to know both. A man is measured by the size of his toolbox.

#

Discipline

Posted by: Anonymous Coward on August 28, 2006 04:26 AM
Why do people keep trying to make poor writers better by trying to get them to use Vim or Emacs, and learn how to waste !#time with $$^formating commands?

It doesn't matter what you write with, as long as you get up early and write every day. The most important tools for a writer are an alarm, a coffee-pot and a room soundproofed against wives, children and pets. If you spend all day fiddling with formats in OpenOffice, then you will a way to waste even more time learning how to do it with Vim.

Mike Cosgrave

#

Re:Discipline

Posted by: Anonymous Coward on August 28, 2006 07:11 AM
Good point, not that I know any bad writers apart from myself that will waste time in this way, when there's nothing else on the desk to play with. Vim is like a paperclip. Simple, but if used correctly - opening locks, ejecting recalcitrant CDs, emergency repair on apollo 13 etc etc.- incredably powerful.

Neal Stephenson isn't such a bad writer (well, I think he's terrible, but people do buy his books, so..) and he uses BeOS!

<a href="http://www.cryptonomicon.com/beginning.html" title="cryptonomicon.com">http://www.cryptonomicon.com/beginning.html</a cryptonomicon.com>

Actually this article is way better than the book, and it's free!

#

Tools For Writers

Posted by: Anonymous Coward on August 28, 2006 11:33 PM
Writers don't need minimalist tools when there are so many good tools out there that were seemingly designed with them in mind. For composition, use OpenOffice. For layout, use Scribus. Both of these are portable and friendly tools. Just as there is no reason to use a slide rule to plan out the installation of a sprinkler system, there is no reason to descend to vi to write your next bestseller.

#

Re:another alternative... LyX

Posted by: Anonymous Coward on September 05, 2006 02:11 AM
Well, I'm stuck on the Windows platform at work due to reasons beyond my control<nobr> <wbr></nobr>... anyway, I use WinEdt to the same effect as Lyx. Viva to Tex. I believe thats the be all end all of typesetting.
My 2 pence.

Cheers
S

#

word count

Posted by: Administrator on August 25, 2006 02:36 AM
Vim has it's own built-in word count mechanism that you can use instead of wc. Just hit g followed by ctrl+g in normal mode, and it will list word count and other relevant statistics at the bottom of the window.

#

another alternative... LyX

Posted by: Administrator on August 28, 2006 10:27 PM
I use LyX, (<a href="http://www.lyx.org/" title="lyx.org">http://www.lyx.org/</a lyx.org>) which to me is the embodiment of substance over style. If you haven't seen it, LyX is a front-end for LaTeX. I recommend going through the included tutorial (which might take an hour or two) just to get up and running, but after that, you'll spend nearly 100% of your writing time on the logical structure and content of your document, and almost 0% on typesetting details such as setting up your table of contents, footnotes, bibliography, etc.


From the website:


LyX is for people that write and want their writing to look great, right out of the box. No more endless tinkering with formatting details, 'finger painting' font attributes or futzing around with page boundaries. You just write. In the background, Prof. Knuth's legendary TeX typesetting engine makes you look good.


My kid used to mess around with all the 'toys' of OpenOffice, procrastinating instead of writing. Once I put him on LyX, not only did he buckle down and get to work, but his documents looked much better since the LaTeX engine generates far superior results than did his often questionable formatting choices.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya