# 1 Intro

LyX is a free open source document processor (not a word processor) which allows you to create beautiful documents without the need to learn the intricacies of TeX and LaTeX.
It is in my opinion the best computer program ever written. I use it for all my documents. LyX is a graphic front end to the LaTeX application written by Leslie Lamport who in turn uses the TeX typesetting program created by Donald E Knuth now professor emeritus of Stanford University. With LyX you don’t need to know anything of the TeX or LaTeX languages. LyX provides menus and pulldown lists of all the effects that you would want to apply. LyX was started in 1995 by Matthias Ettrich and has subsequently been taken over and rewritten rewritten by another team.

# 2 TeX

In the 1970s Donald Knuth began work on a 7 volume series of books on computer principles entitled The Art of Computer Programming.
He had quickly become dissatisfied with the publishers’ efforts at printing the books. So he diverted after the 1st volume to writing a program to do beautiful typesetting. This he called TeX (from the Greek word τεχνη which means both art and technology). The X is not pronounced like the x in box but rather like the ch in Christ or loch. Knuth says in his book the TeXbook that when you say it, the screen should become a little moist! The rather strange mixture of upper and lower case is an attempt to render with 7 bit ASCII characters something that looks like the shape of the Greek character.
Using TeX you write the content of your document and put TeX commands usually preceded by backslashes: e.g. for upright (i.e. Roman text ) \textrm{ .... } to provide typesetting instructions (analogous to markup in HTML).
Knuth’s aim was to produce beautiful documents. He succeeded brilliantly and the world of academe, especially mathematics and science, have adopted TeX and LaTeX.

## 2.1 Ligatures

English has a number of combinations of letters: fi fl ffl ffi etc which trained typesetters replace with a specially created type called a ligature which has the combination designed into it. TeX recognises where this is appropriate and uses the ligature instead of the sequence of separate characters. Other languages have different ligatures.

## 2.2 Kerning

Most word processors space letters apart evenly even when using proportional fonts. TeX adjusts the spacing appropriately so that they appear evenly spaced. This means combinations like AV and VA are moved closer. This is called Kerning from the typesetters name for the little lead slugs which they placed between letters.

## 2.3 Widows and Orphans

Widows and Orphans are lines which appear on a page separate from the paragraph they belong to. A line is called a widow if it is the last line of a paragraph and appears on the next page. A line is an Orphan if is the 1st line of a paragraph and appears at the bottom of a page. TeX recognise these and reformats the page so the interword spaces are expanded or contracted to fix the layout.

## 2.4 Languages

In the beginning TeX only accepted ASCII 7 bit characters. It now accepts 8 bit characters (256 character set) and can present beautiful documents in most languages: e.g.
Greek, Right to left ( Hebrew, Arabic ).

## 2.5 Linguistics

TeX also supports the International Phonetic Alphabet (IPA). e.g.: /ɭɪŋɡʊwistiks/

## 2.6 Columns

Documents are readible when they average about 7 to 14 words to a line. When lines become more than 15 words to a line a document becomes less readable. To accomplish the need to keep the wordcount per line reasonable, TeX allows you to present a document in 2 or more columns per page. LyX does not attempt to typeset the multi-column format but LaTeX does the job.

## 2.7 DVI

When you are ready to print or publish your document, TeX translates the file into a Device Independant format (DVI). This standard form for all TeX documents can then be translated into other formats such as Postscript, PDF, etc. Unix provides a program xdvi to display the appearence of the typeset result.

## 2.8 WYSIWYM

While you are creating or editing a LyX/LaTeX document, Lyx makes no attempt to do the job of typesetting. This would be time-consuming and computationally costly. It satisfies itself with a rough and ready layout control called WYSIWYM (What you see is what you mean) rather that WYSIWYG (What you see is what you get). To see the typeset result you call the appropriate process (to create dvi, pdf, html, etc) and LyX invokes a viewer to display that. Using LyX you can set the LyX window wide or narrow and LyX will expand the words per line or shrink them to fit. This has no bearing no the typeset output files.

# 3 LaTeX

Leslie Lamport created a set of macros to enforce systematic and consistent layout for types of document e.g.:
• book
• article
• report
• letter
Each of these document types has a set of macros to offer consistent of relevant parts: parts, chapters, sections, subsections, quotes, etc. This means that you get totally appropriate properties such as font size, boldness, shape, spacing, etc which are totally consistent throughout the document.

## 3.1 Margins

LyX and LaTex expect you to set margins so that the inner margins are half the width of the outside margins. This is so that when a book is opened out the 2 inner margins look equally spaced as the outside margins. This is how both any ancient scroll (liber) and any modern book (codex) look. The default margins follow this pattern.

## 3.2 Indentation

LyX and LaTeX expect that if you set paragraphs to be indented, the indentation will only apply to the 2nd and subsequent paragraphs within a section, subsection, or subsubsection. There is no need for the first paragraph to be indicated by indentation.

# 4 elyxer.py

You can use LyX to create HTML documents - but is not necessarily the best way to do it. In the past we used a program latex2html to do the conversion (from the LaTeX output from LyX). Unfortunately the program is not maintained any more and LaTeX has moved on leaving the latex2html not always able to support recent changes. To meet this defect a Python program as been devised by Alex Fernandez to convert the LyX code directly into HTML format. This works but not perfectly because browsers cannot create beautiful HTML because of limitations in HTML. In particular mathematics cannot be rendered anywhere near as well as LaTeX. As browsers improve in the future, so they will do a better job of rendering the output of elyxer.py.

# 5 Screenshot

So you can see what LyX looks like: Note the select list of document components on the left.