Disclaimer:
This was never completed and some of the sections are barren. I don't
know when I will get back to it.
Instructions:
If someone told you LaTeX was cool and you want to know what it is, read
"What is LaTeX?" (and for enrichment, possibly also
the examples comparing it to html). If you
already know (or don't care) and just want to install a program to use
LaTeX, go to "How do I get it?"
Once you have a way of creating LaTeX documents, you can get some sample files or read about special characters. When you modify the samples or make your own files, some frustration may be averted by checking the items in the "Why won't it compile?" list.
Finally, when you want to spread your wings a little, there are some other options for TeXing programs, suggested references, and slightly more advanced topics.
Contents:
What is LaTeX?
How do I get it? (TeXShop)
Examples comparing to html
Very basic and noncomprehensive sample files
Dollar signs and other special characters
Why won't it compile???
Other options for TeXing programs (iTeXMac, LyX,
any other suggestions?)
Links to other introductory documents and list of
reference books
More advanced topics (on different page):
What does the documentclass do and where can I find descriptions of them?
What is this usepackage business and where can I find descriptions of
packages?
Okay, I'm ready for the pdf/ps/dvi viewing and printing discussion.
LaTeX is a markup language, a system of document creation where you write plain unformatted text (as you might in TextEdit or Notepad), and that is turned into pretty formatted (or typeset) text (as you might see in Word, only prettier) by a compiler. That is, instead of selecting "italics" from a menu and seeing your text instantly italicized, you type a markup command that will be interpreted by the compiler as "put this text into italics". Another markup language you might be familiar with is html (which stands for hypertext markup language); if not, you can see an example by selecting "view source" from one of the menus in your browser (Netscape, IE, Safari, etc.). Compare what you see in the original browser (here) to what you see in the source window -- the source file has a lot of text that does not appear in the webpage. The source file has been rendered into the webpage image, using the information from the extra text, or commands. In LaTeX, we speak of a text file being compiled, into a pdf, dvi, or ps file. The first kind you're probably familiar with from web browsing; the other two are just different file formats which we can get into later.
The markup commands have different purposes: some change the size or form of letters (italics, boldface), some change the overall layout of the document (margins, columns, chapters, sections), some produce characters one can't type (Greek letters, mathematical symbols), and some change the local layout of the document (tables, graphics, lists, indentation). See the example files for some commands and their use. The point is, essentially everything you want to do to your text will appear in the file as a markup command.
The best way to learn LaTeX in the beginning is by looking at other people's files (as is also true for html and most programming languages). Once the syntax (way of writing it) starts to make more intuitive sense to you, there are a number of excellent reference books from which to learn more commands. See below for other introductions and reference guides.
To use LaTeX, you need a "front end" and a "back end" (or "foundation"). The front end is the editor and viewer: where you type your text and where you view the compiled result. The back end is the program that does the compilation along with all the information it uses to do so. These pieces are all put together for html in the form of web browsers (well, those with built-in web design programs, like Netscape Composer), but for LaTeX (if you want it for free) you must download and install them separately.
I am enamored of TeXShop by Richard Koch and Dirk Olmes for TeX editing and typesetting. To get it, see "Installing TeXShop" in the above page. It will take you to Gerben Wierda's i-Installer page for the back end (TeXShop is the front end). After everything is installed you have a very user-friendly TeX editor.
Now some examples, comparing to html:
* To begin and end a webpage, you use the commands <html> and
</html>. To begin and end a LaTeX document, you use \begin{document}
and \end{document}. LaTeX has more options than html, though, so you will
also have to include some information before the \begin{document} to tell
the program which options you're exercising. In particular, you must
include the command \documentclass{classname}, where classname is replaced
by the kind of document you want to make: article, book, letter,... the
list goes on and is added to regularly.
* To italicize in html, you enclose the text in <em> and </em>, as
so: <em>this text is italicized</em>. In LaTeX, it's a single
command with the italicized text enclosed in curly braces: \emph{this text
is italicized}.
* To center in html, you enclose the text in <center> and </center>.
In LaTeX, these change to \begin{center} and \end{center}.
Probably should just link to Will's. Or maybe smaller files split by topic and/or documentclass.
Dollar signs and other special characters:
If you've looked at some LaTeX files, your next question might be "what's with all the dollar signs?" Some commands in LaTeX only work in math mode, and you tell the program you're entering or leaving math mode via a dollar sign. This gives LaTeX the ability to double up on commands - to give one command two meanings, depending on whether it's in math mode or not. An example is the dash: out of math mode, that is, simply -, it is a short dash. Inside math mode, $-$, it is a minus sign and so is longer.
That brings us to one other point: some symbols are used specially, like \ and $, and so there are different commands that produce that symbol on the page. If you type a single \, LaTeX expects the next thing it reads to be a command. If you want a backslash to appear on the page, that next command should be "backslash": \backslash will print a backslash. To get other special characters, you generally precede them with a backslash, as in \$ for a dollar sign or \{ and \} for curly braces.
Provided the program is actually running, here's a bare-bones list of things to check: Does every { have a matching }? Likewise for $...$ and \[...\]. Does every \begin{...} have a corresponding \end{...}?
If possible, you can try hitting enter repeatedly in the compiler window until it finishes - often the file will compile to some extent, and if you're, say, missing a dollar sign, it should become very obvious where the error occurred.
Other options for TeXing programs (iTeXMac, LyX, any other suggestions?)
Links to other introductory documents and list of reference books
First off, there is the TeX on Mac OS X page. Other general information about TeX on the Mac can be found on Gary Gray and Joseph Slater's Mac-TeX site, which includes the address for subscribing to the Mac OS X TeX email list.
Back to the old stuff page