Saturday, August 06, 2011

Lyx free typesetting system

I started some updates of the Green Technology Strategies course using the Moodle Book module. However, this has only limited support for features such as Harvard style references. So I stopped to consider what other publishing software could be used. These needed to be available on Linux and preferably for free. I tried the Sigil editor for EPub format ebooks and Calibre which allows modification of existing eBook material, rather than creation from scratch. Following a discussion about the creation of course content and on the Link Mailing List, I thought I should try LaTex again. So I downloaded LyX, a WYSIWYG version of Latex. This required 300 Mbytes of files, but as it is included in the usual Linux sources it just took a few clicks to install. One problem was that I had to go back and get the optional extra HTML to LaTex converter.

When you start it up LyX warns it is not a word processor, but it looks like a word processor, with a window displaying your document and an editing menu along the top. The difference is that what you see on the screen is not exactly be what your final product looks like, as the content will be formatted to suit the final distribution media, be it on paper, or the web.

Importing HTML

I imported a copy of my green ICT course notes, exported from Moodle as one HTML document. The converted document looked like the web original, with some subtle changes. There were bars next to the numbered and bullet lists, presumably indicating that all these were items were part of the one list entity. A web address I included was abbreviated by LyX. The heading and sub headings looked okay, as did the rest of the structure, along with bold and italics.

Some bullet lists had line breaks in them which needed to be removed. This was also a problem when importing into Open Office: having a paragraph within a list item created excess whitespace.

Producing PDF

I selected "View > PDF" from a pull-down menu and within a few seconds was looking at a PDF rendering of my document. The default rendering uses a serif font, wide page margins and a page number centered at the bottom of the page. The text was fully justified, with hyphens as needed. The text length was correct for a printed page. The layout looked good, which is not surprising as this is LaTex's forte.

One problem was that all the hypertext links were missing from the document. What I like to do is write my notes with print style references, plus hypertext links. This way the same document can be used on-line and on paper. For the paper version I simply set the style so the hypertext links are not underlined and are in dark blue. When printed in monochrome they become black and indistinguishable from the rest of the text.

Also where a number on a list item also had a bullet point over the number. But the major problem was that the document was only 15 pages long: most of my approximately 100 pages of notes were missing. What I had was the front-matter, table of contents, chapter one and a later chapter. All the other chapters were missing.

Producing HTML

I selected "View > Other Formats > HTML" from a pull-down menu and had HTML source code. This was very clean code, without the excess of formatting produced by word processors. Curiously the hypertext links were also missing from this version, so perhaps they had been lost in the HTML to LaTex conversion. Also there were no paragraph markers

in the document, with DIVs being used instead. Each one was marked with class "unindented".

These problems are no worse that when trying out other publishing software for the first time and worth persisting with.

No comments: