Jens Nöckel's Homepage

Computer notes home

LaTeX Info Page

LaTeX: separating content from style, the scientific way

LaTeX is the de facto standard for scientific typesetting; in a nutshell, it's the markup language for maths-oriented print media, in the same way that HTML is the language with which hypertext on the web is formatted. But LaTeX had "style sheets" long before they appeared on the internet as CSS.

LaTeX is capable of essentially everything that you can do in HTML/CSS, including hyperlinks and multimedia, but it can do much more because its foundation, TeX, is actually a kind of programming language, albeit not one that implements the latest fashions. It is from a time when graphical user interfaces (GUIs) were still in their infancy, and most user-interfaces were text or script based. Of course as GUIs matured, they themselves became "scriptable" (see, e.g., ApppleScript on the Mac). The moral of the story is that scripting is still the only way to do serious work on a computer, so why abandon a powerful program like TeX only because it isn't GUI-oriented?

Word processors versus LaTeX

LaTeX allows you to produce high-quality PDF output, and can also be converted to other formats such as RTF, OpenOffice or HTML. But just like HTML, it isn't so easy to see what the output will look like while you're typing the source code. That immediate feedback is something you only get with WYSIWYG editors, i.e., the garden-variety word processor to which MS Word has become eponymous. This is a drawback of LaTeX. The advantage of LaTeX is that the styling of your document can be changed by loading different packages and setting options in a few lines, without having to go back to the content and make changes at the level of paragraphs and equations.

If you want the best of both worlds, you should use LyX. Since this is a page about LaTeX, I will just point you to this introductory video explaining the easy with which LaTeX can be used from within LyX.

As LyX shows, the two worlds of WYSIWYG and LaTeX aren't completely disconnected. One can also, within limits, convert a given document from word processor format to LaTeX format and back. Here are two pages that deal with the conversion problem under various aspects:

The return journey from LaTeX to word processor format is, however, a more advanced topic, because it involves the tex4ht package - a highly customizable but also highly intricate system for translating both the semantic and stylistic content of a LaTeX document into HTML and related markup languages (Here is an example for the uses of tex4ht.). These conversion problems become much easier to solve if you write your documents in LyX right from the start. The reason is that the internal format used by LyX is much closer than LaTeX to the XML structure underlying web pages and Office documents.

Where to get LaTeX

Fancy formatting with LaTeX

Your computer comes with many fonts installed. In a word processor, you are usually limited to a certain set of font sizes, and of course the text flows along horizontal lines. In LaTeX, this is similar for basic usage, but with only a few customizations it's possible to go much further. There is, e.g., the scalefnt package, and the rotating package. With these you can create text that is either huge or microscopically small, and criscrosses the page at any desired angle. Scaling to arbitrary sizes doesn't work with all maths fonts (the age of TeX shows here), but it does work, e.g., with mathtime or mathpazo.

But how can I switch from Word to LaTeX?

That can be very easy if you don't have complicated formatting going on, and if you aren't using math formulas, cross references and other fancy things. OK, so in other words, for the audience I'm talking to here, it is not easy.

So don't even start with Word for serious work. It's hard to keep it future-proof and portable (unless you're able to spend the money on upgrades and site-licensing etc.)

For people who want to go through with the switch, I'll try to give some advice on a separate page.

Learning LaTeX

There is an inexhaustible amount of information on LaTeX on the web -

Useful LaTeX/PDF tools

This is a random and incomplete list!
noeckel@uoregon.edu
Last modified: Sat Nov 12 18:41:49 PST 2011