August 4, 2006

Take note: Xournal

Author: Nathan Willis

For intensive word-only writing, most of us can type on a keyboard far faster than we can scrawl with a pen, but the speed advantage is reversed for anything that requires diagramming or mathematical formulas. The open source application Xournal, which is designed to provide keyboard-less text entry and drawing features, is one solution. Taking freehand notes without that clunky, old-fashioned keyboard has never been easier.

Download Xournal from the project's SourceForge.net site. Source code tarballs are available; the only external dependencies are GTK, libgnomecanvas, and libgnomeprint. If you have Ghostscript and Xpdf, though, you can also use Xournal to take notes on PDF files -- very useful for making annotations or signatures. With the dependencies in place, installation is a simple three-step ./configure; make; make install.

Xournal uses the XInput X Window extension to capture input. This is the same extension used by Wacom tablets and is part of the standard distribution included with most Linux distros. For those of us without a tablet PC or a touch-sensitive screen, this is the easiest way to use Xournal.

If you have trouble getting your tablet to cooperate, the Xournal documentation page has an entire troubleshooting section devoted to finding and fixing the problem. Note that problems with the XInput system involve fixes to your X.org installation, not patching the Xournal code itself.

The pen is mightier than the 'board

Once you get it started, you may notice that the Xournal interface mimics other note-taking applications such as Microsoft Journal. It displays a large canvas resembling a piece of notebook paper and a small toolbar at the top. You can change the background from the Journal -> Paper Style menu; options include plain, lined, and graph paper and a variety of colors.

Xournal - Click to enlarge

Dive right in and start writing and sketching. You can alter the pen width and color from the toolbar. The other writing tools are, from left to right, the eraser, the highlighter (which draws at 50% alpha transparency so you can read text beneath it), and the ruler (which draws perfectly straight lines when you select the endpoints).

Everything that you write or draw in Xournal is stored internally as vector data. This has two distinct advantages over taking notes by, say, drawing in the GIMP. The first is that the resulting note data is considerably smaller; you only work at the screen resolution, and human pen strokes are quite low-resolution when compared to raster images. The second is that the letters and shapes you draw can be manipulated as objects, moved around, and rearranged on screen as whole units without fear of accidentally cutting or clipping.

The latter advantage enables the next two tools on the toolbar: the selection rectangle and the vertical space tool. The selection rectangle allows you to draw a rectangle around any portion of your note and move it, just as you would in a raster of vector graphics editor. In order to select a line segment, the rectangle you draw must completely enclose it. For letters, this can be important -- make sure you get all the pen strokes, or else you may leave part of a letter or word behind as you rearrange.

The vertical space tool is for pushing notes on the page up or down to create more space to write in between. Click and hold the pointer, then drag it up or down; as you do so, notes and sketches in the way non-destructively slide up or down to create more blank space on the page. This is doubtless a handy feature for classroom note-taking; many was the time in Complex Analysis when I had to backtrack through long proofs to make corrections or additions, and on paper, the eraser and the margin are your only options.

Saving your work

Each journal you create can have multiple pages; to add and remove pages you use the options under the Journal menu. In addition, each page can have multiple layers, which you can add and remove from the Journal menu. The status bar at the bottom of the window shows you which page and layer you are currently writing in and lets you navigate between pages and layers.

It may seem superfluous to have a layers feature, since you can write vector-based sketches and notes on top of each other. But using layers helps you avoid overwriting and erasing the wrong thing -- when on layer 2, for instance, you cannot erase or move anything on layer 1.

Xournal uses the file extension .xoj for its saved journal files. Each file is gzip-compressed, containing XML for the note and sketch vector data, plus any background images for the paper. Xournal lets you name your files anything you want, but it auto-generates and fills in a date-and-time-stamped name in the file save dialog if you choose to use it. Having your notes automatically time-stamped could come in handy.

Some will no doubt criticize Xournal for not using an established file format such as SVG for its data, but I think the developers made the right choice. Choosing SVG would impose on the developers a phenomenally larger specification to implement. Whatever features may be adding to Xournal in the future, they will still add up to only a fraction of the enormous SVG spec.

As mentioned above, Xournal can open and sketch onto PDF documents. It does this by in effect rendering the PDF as the background image for a Xournal, not by altering the original PDF file. You can save the resulting document as a Xournal journal, or print it out as a new PDF, but it's not a real PDF-editing environment.

That's all she wrote

While I have not used proprietary tablet PC note-taking applications for comparison, I found Xournal a breeze to set up and use. There is a short learning curve to writing with a stylus on a Wacom graphics tablet, though presumably some of the difficulty is because you are not writing directly on the surface where your lines appear. Such would not be the case on a tablet PC. Nevertheless, don't enter a penmanship contest on your first day with Xournal.

One feature I would like to see in future releases is some kind of adjustable curve-smoothing; it would increase legibility, and ignoring the jitter inherent in the stylus interface should result in fewer points per line, which could shrink file size noticeably.

The Xournal Web site points out a couple of similar open source projects: Jarnal and Gournal. I tried all three and was happiest with Xournal's results. Jarnal is a Java application, so it has a cross-platform advantage, and it also incorporates a collaborative editing feature that Xournal lacks. Gournal is more or less comparable to Xournal in features, but I found Xournal's interface more intuitive and easier to use. If you like what you see in Xournal but it just doesn't quite fit, try one of these other projects.

Click Here!