| Want to learn how to tackle those tough MATHCOUNTS and AMC counting and probability problems? Check out Art of Problem Solving's Introduction to Counting & Probability by David Patrick. |
Space
Comments
Including Packages
You'll develop your own style of using LaTeX. The sections below outline some tips that you'll find helpful.
Please note: These pages are no longer updated and maintained. We have moved all the information in these pages into the AoPSWiki, which are updated and improved by the AoPS Community. Click here to go to the corresponding page in the AoPSWiki.
In LaTeX, you can use as much space as you like - LaTeX won't see it when it compiles. If you put in three spaces, it will only see one. If you put in 6 empty lines, it's the same as one. Therefore, this:
results in the same as this:
Generally, write so that it's easy for you to read the source code. Don't pour in tons of space, but leave enough that you can easily find parts of the source file later.
TeXnicCenter (and most editors you might use for LaTeX) treats line numbering differently than your typical text editor. If you just type and type text without ever hitting <Enter> so that your text scrolls on to the next line, TeXnicCenter sees all that text on the next line as just a continuation of the previous line. This is no big deal if you never make a mistake, but when an error occurs when you compile, you usually have to find the mistake in your source file by line number. If you have a 4 or 5 line 'line', finding the error can be a real headache. (You can see what line you are on in TeXnicCenter by looking at the bottom towards the right.)
Just as LaTeX doesn't see tons of extra space, it won't see space that isn't there. One primary example of this is that LaTeX will only see linebreaks if there is an empty line or if you use the \linebreak command. Hence, this:
will produce the same result as:
You can leave yourself (or later users of your source files) notes by using %. Anything in a line after % is ignored when the file is compiled. Try this:
You'll see that comments are grayed out in TeXnicCenter. Comments are very useful to guide other readers of your source file, and to guide you in case you'll come back to a file later. You'll find comments throughout our sample files.
If you have commands that you have created or a specific layout you like to use, you don't have to always copy and paste all that LaTeX code into the top of each LaTeX source file. Instead, you can create your own style files to include in your document. Read the Packages section of the Guide to learn how to create and include files of your own. Beginners should hold off on this until they've become more comfortable with LaTeX.

