Crash Course in LaTeX

Basics: Formatting

So you can create a basic document. Big deal. The margins are goofy, and you'd like to make the text bigger / smaller / bold / italic / whatever. How do you do this?

End a line of text: Seems like this would be easy; just hit "Enter." Nope. Use the code \\ at the end of a line. If you want to indicate the end of a paragraph, just leave a blank line between paragraphs -- no \\ is necessary.

End a page: To force the end of a page and go onto the next page, insert the code

   \newpage

Page size: At the very top of the document is a line that begins with \documentclass. Change the page size to legal by making the line read

   \documentclass[legalpaper]{amsart}

Font size: The default font size is 10 points. Similarly, you can change the default font size for the document to 11 points or 12 points by changing the top line to read

   \documentclass[12pt]{amsart}

If you want the default text to be a size other than the standard sizes of 10, 11, or 12 points (72pt = 1 inch high capital letters) then you need to use a package called scalefnt. You can find information on this package under packages.

Orientation: If you want the entire document to print sideways, switch to "landscape" mode by inserting "landscape" in the class declaration:

   \documentclass[12pt,landscape]{amsart}
If you just want select pages to be sideways, add this to your header
   \usepackage{lscape}
then insert \begin{landscape} and \end{landscape} in the body of your document wherever the spirit moves you. You need to have them in matching pairs, as with any \begin{}...\end{} style command.

Margins: You can set "normal" page margins (one inch on all four sides) by inserting the following code in the header:

   \usepackage[margin=1in]{geometry}

Page numbering: Turn off page numbering on all pagesby inserting this line before \begin{document}:

   \pagestyle{empty}

Turn page numbers off on a single page using

   \thispagestyle{empty}
You might need to include both of these in your header to ensure that all pages do not have page numbers.

Bold, italic: Format text using these commands:

Type this... ...to see this
This is \textbf{bold}. This is bold.
I like \textit{italics}. I like italics.

Paragraph indenting: I don't care to have paragraphs indented, so I put this in the header

   \setlength{\parindent}{0mm}

Of course, If I want to "tab" something, there is a set of features for doing so. But an easy way to add a little horizontal space is to put this in the header

   \newcommand{\tab}{\hspace*{2em}}

Then, us the command \tab anywhere you want a little space. You can adjust the size of the space at the top -- right now it is 2em, twice the width of a capital M -- and it will change it throughout the document.

Justification: To center a single line, put the text to be centered in this command:

   \centerline{Text goes here.}

To center more than one line, use \begin{center} at the beginning, and \end{center} at the end.

To right justify a single line, type

   \hfill

If you want some text on the left margin, and some on the right margin, just type:

   Left stuff \hfill Right stuff

To put text on the right margin and fill in with dots or a line, use one of these instead of \hfill:

   \dotfill
   \hrulefill

Finally, to indent both margins a little (for extended quotes) use the command

   \begin{quote}
   Quoted text here.
   \end{quote}

Line spacing: Put this in your header:

   \usepackage{setspace}

Then put \doublespace to start double-spacing, \onehalfspace to start one-and-a-half spacing, and \singlespace to return to normal spacing.

Font styles: A little explanation is needed here -- bear with me.

The default font for LaTeX is Computer Modern, which is fine, but there are other fonts you can use. No, you can't just use any font you have installed on your computer. Remember LaTeX is a professional typesetting system, so it needs to know a lot about a font to lay it out just right, and sillyfnt.ttf just doesn't have enough information. So you need special LaTeX fonts. Other fonts can be converted to LaTeX fonts, but this (as of now) is a complicated procedure I've only done twice.

The easy way to use other fonts (and we're all about the easy way on this site) is to use fonts that came with your installation of LaTeX (MiKTeX). Now I poked around my machine and found these fonts:

All of these worked for me just by putting a line like this in the header

   \usepackage{avant}

The font is automatically set for the whole document. If you want to change a font just for a single word, there are ways to do this. However, I don't know an easy way. Besides, if you really want to go crazy with fonts, use MS Publisher or something like that for your newsletter.