In the early days of word processing, writers would control the overall appearance of their printed documents through commands they embedded into their texts. One of the best known programs adopting this approach was WordStar, with its set of markup codes to be entered through special key sequences at the time of writing. Those codes would remain visible on screen within your document alongside your text, just like in HTML editors today. Because of the need to enter both words and codes with the keyboard, interaction with the writing software still closely resembled working with a typewriter. And the fact that no point-and-click activity with a mouse was involved made electronic writing inherently stress-free, as it let writers concentrate on words rather than on the word processor.

Today WYSIWYG point-and-click environments enjoy general acceptance, and text-based applications are usually seen as useless scrap, good only for console dinosaurs. Yet all the pros of non-graphical writing software are still there, and it is a known fact that text-based word processors tend to improve their users' productivity. In addition, using a lightweight text-based console word processor would enable you to recycle old machines, thus protecting the environment from electronic waste while at the same time letting you save your money.

Text editors aside, unfortunately, under the Un*x/Linux console you find very few character-based applications for writers. As I needed one such console tool, and I wanted it to be simple to install and use and not too demanding in terms of required dependencies, I eventually decided to write this naive script (I am not a professional programmer or developer). Enpi sits on top of LaTeX (the actual text processor), and is capable of generating printable ps files from a human readable lightly tagged text source.

What happens in practice when using enpi, is that you write and edit your documents as plain text files in your text editor of choice, then you add a few unobtrusive markup codes to control the typesetting details (justification of paragraphs, font family and dimensions, italicized or bold characters or whatever) and leave to the script the actual task of letting you preview and then properly print your work. The markup is made up of BBCode-like tags, so using enpi is in fact as difficult as posting to a bulletin board. This simple script works for me, and my hope is that enpi can somehow prove useful to others as well.

Enpi is GPLed software. If you want to try it, you can download it here. The console dinosaur drawing above is based on a drawing by my daughter when she was three years old, and is GPLed too.

How To Install and Use Enpi

To install the program unpack the tarball

$ tar xzvf enpi.tar.gz

The compressed archive contains the script in two versions: one is generic (enpi.nn, nn being the version number), and one is customized to work with Ubuntu (enpi-nn.ub). Just rename the main executable script you are planning to use as enpi, and copy it to somewhere in your PATH.

Ubuntu users may have to install two additional packages to their computers:

- texlive-latex-recommended
- psutils

If you are updating from an older version of Enpi, do not forget to remove the hidden .enpi directory located inside your home directory before using version 0.3 of the script.

The tags

To use the script, first you must annotate your plain text document with a few simple formatting tags; to preview your document and to generate a printable formatted output, start enpi from the command line or from an x terminal with

$ enpi filename

where filename is the file you are editing.

Below is a list of the basic text-formatting commands you can use with enpi. Tags are either the same as in the regular BBCode for bullettin boards, or made up after them. More commands are available to handle page numbering, images, lists, and to work with tabs. For the complete list of tags, see the manual coming with the script in the tarball.

Font formatting: [12pt] is for normal fonts, [10pt] is for small fonts, and [14pt] is for larger fonts; [rm] is for Roman, [hl] is for Helvetica, and [co] is for Courier. In addition

this text is [b] bold [/b] - this text is bold
this text is [i] italic [/i] - this text is italic
this text is [u] underlined [/u] - this text is underlined.

You can nest tags to have - say - [rm][u][i] underlined italicized text [/i][/u] in Roman; with other font families your mileage may vary, as under enpi not all LaTeX fonts seem to allow all possible combinations.

Paragraph formatting: tags and commands will not show up in the printable output, of course (see the screenshots below). Fully justified paragraphs are the default but

[le]This would be a left-hand aligned paragraph.[/le]


these words would be centered
and finally this paragraph would be aligned to the right

With a double backslash \\
you can force line breaks.
Footnotes can be added to your documents by putting them between double squared brackets. [[ As an example, this would appear as a footnote in your document ]].

Quotations: the opening and closing tags are the same as in any BBCode-based bulletin board. Though margins are fixed and cannot be changed from within enpi, the script will have LaTeX nicely indent quoted text as necessary

The quoted excerpt can be of any length. It will appear as slightly smaller and both left- and right-hand side indented text.

Enpi and the JOE editor

If you are editing your text inside the JOE editor you need not write the tags by hand. The task of adding the BBCode tags to your file can be handled through a specific set of key sequences coded into a JOE macro, called enpi4joe, in a manner which is reminiscent of the way old word processors used to work.

The enpi4joe key sequences are based on the F2 through F9 function keys followed by one more character or number.

As an example F5-based key sequences are for font formatting. F5-B will cause JOE to add the [b] bold [/b] text tags to your document; similarly, the F5-I sequence is for adding [i] italic [/i] text to documents, whereas F5-U is for [u] underlined [/u] text.

Font families and dimensions can be managed through F6- and F7- key sequences respectively. F6-H is for [hl] (Helvetica), F6-C is for [co] (courier), and F6-R is for [rm] (roman); F7-B is for big [14pt] fonts, while F7-S is for smaller [10pt] fonts; F7-D is for the default [12pt] font dimension.

The manual contains the full list of key bindings you can use with enpi4joe and it also explains how to activate the macro. Key sequences are not case-sensitive.


Here are two screenshots of enpi at work:

In fact the first image is not a real screenshot, but a sample of the temporary file generated for previewing in the console. You can see the title line and article 5 of the Universal Declaration of Human Rights appearing in a Roman font; part of the title is bold and italicized. Article 18 is Helvetica, and article 19 is Courier text.

You can also use enpi as a lightweight substitute for your word processor in the GUI. Here you see the "source" (i.e. the tag-annotated plain text) being edited with Nedit, the terminal from which you start enpi, and gv showing the formatted output. In the GUI you can usually print out your text either from within enpi or through your viewer of choice.


Enpi can be downloaded from here.

Previous versions are available from the University of Macerata Language Centre website.


My "enpi" script is Free Software, released under the terms of the GNU General Public License, either version 2 of the License, or any later version published by the Free Software Foundation.

The Enpi manual is released under the GNU Free Documentation License Version 1.2 or any later version published by the Free Software Foundation.