Thursday, December 2, 2010

What is LaTeX?

LaTeX (pronounced "lay-tech") is for typesetting documents. Microsoft Word is also for typesetting documents, but there are a few major differences between Word and LaTeX. The biggest difference is that Word provides a what-you-see-is-what-you-get (WYSIWYG) editor as a graphical user interface (GUI). LaTeX by itself does not a WYSIWYG editor or any sort of GUI. Instead, LaTeX requires the user to edit raw, unformatted, plain text, much as if he were writing HTML. In that way, creating a LaTeX document is like creating an HTML web page.

To create an HTML page (hypertext markup language), you type in the content you want in your document, then you "mark up" the content using HTML tags such as headings, paragraphs, lists, tables, and links. The HTML file itself a plain-text file with a ".html" file extension, such as "example.html". The HTML page is associated with a CSS file (cascading style sheets) which applies visual styles to the marked up text. Then a web browser like Internet Explorer or Firefox renders the document in the browser window. To summarize, the HTML file holds the marked-up content, the CSS file controls how the marked-up content looks, and the browser renders the final product.

LaTeX works much the same way. But instead of using HTML tags to mark up the content, one uses LaTeX tags to mark up the content. And instead of using a ".html" extension, a LaTeX file has a ".tex" extension, such as "example.tex". And instead of a CSS file to define the visual style, the LaTeX program itself defines the visual style. And instead of rendering the final product in a browser, LaTeX typically renders the final product as a PDF file.

If that seems restrictive, that's because it is. With no CSS file to define the visual layout of the document, the new user has little control over how the rendered document looks. But therein lies the power of LaTeX: Behind the scenes, LaTeX has thousands of rules and algorithms for determining the best way to visually present the content. A Stanford University math professor created the foundation for LaTeX in the 1970s, and with 40 years of development behind it, LaTeX does a very good job of deciding how to render your content. Users of LaTeX argue convincingly that authors should worry about content and let document designers worry about layout.

LaTeX is best used for creating text documents--essentially anything you would create in Microsoft Word is a fair candidate for LaTeX. For the beginning user, it is not the best choice for creating graphics or flow charts or slide presentations.

To get started using LaTeX (it's free), use the excellent installation instructions in the "Get LaTeX" page at www.latex-project.org.

No comments:

Post a Comment