A First Set of LATEX Resources

This page suggests documentation, add-on components, and other resources for a beginning LATEX user.

The links here are to freely available materials, so you can click to see the documentation online. Where the documentation is also available offline in a typical TEX installation, we provide its name as an end note. View it by running `texdoc name' in a terminal.

Starting

To run LATEX, you must use an online service or install a distribution. Online services are commercial; find them by entering `online latex' in a search engine. For distributions, your choices are TEX Live on a Unix system, including GNU/Linux, or on Windows, or the related MacTEX on Macintosh, or MiKTEX on Windows or a Unix system.

Tutorials The site learnlatex.org teaches you the basics in a sound way, and also lets you play with the commands to see the results. For a more traditional document, the most widely recommended one is The Not-So Short Guide to LATEX2ε, available in many languages.1

Many people use LATEX to write mathematical text and for this the premier choice is from the American Mathematical Society. See their Getting up and running with AMS-LATEX,2 and more detail is in Users Guide for the amsmath package.3

Documentation

References The nearest thing to a general reference for LATEX is LATEX2ε unofficial reference manual.4 Look for symbols in the Comprehensive List of Symbols.5 And, TUGboat, the journal of the TEX Users Group, has published many articles, at levels from beginner to expert, almost since the inception of TEX.

FAQs Many web pages offer quick help with LATEX, although they can be out of date. Particularly useful and reliable are the TEX FAQ,6 as well as TEX Resources on the Web. You can also get a handy general LATEX Cheat Sheet,7 as well as the Math for Undergraduates Cheat Sheet.8 Also, An essential guide to LATEX2ε usage9 helps you develop sound habits, by saying what not to do.

Questions If you are stuck on an issue, the TEX-LATEX Stack Exchange site and the mailing list texhax@tug.org are where knowledgeable people hang out. You are likely to find an answer in their past discussions, which cover decades, and if not then you can post a question yourself.

Books There are many excellent books about LATEX. Visit the TEX Users Group's book list for a selection, and for discounts.

Packages

One of LATEX's strengths is the tremendous number of available add-on packages. This list covers most of what beginners want to do. (There are some comments in parentheses that often come up in conjunction with these recommendations.)

Our archive The Comprehensive TEX Archive Network, CTAN, has the latest official versions of the packages that are in the distributions, along with documentation. Browsing by topic can be very handy.

If you have trouble finding something, it may be the house package of a journal or institution. Look on their web page as well as on CTAN.

Every document To change page size, margins, and orientation, use geometry.10 Get multiple columns with multicol.11

As referred to above, any document containing significant amounts of mathematics should use the American Mathematical Society's packages amsmath12 and amsfonts.13 Also use their amsthm14 for producing theorem environments. Notes: (1) amssymb inputs amsfonts so load the former instead of the latter, (2) many authors also use the calligraphic characters in rsfs,15 (3) get bold math symbols with bm,16 (4) don't load amsmath directly, instead get it by loading mathtools17 for some useful improvements, and (4) load amsthm after mathtools.

Also, include microtype.18 It will make your document have fewer awkward lines.

Inside a document Tweak the layout of lists with enumitem.19

Enhance captions with caption20 and control floating environments with float.21 (In particular, this package provides the `H' option to override automatic float placement and put something exactly where you ask. This may cause issues — what if you want to include a two inch tall graphic on a page that has only an inch left? — but it sometimes is what you want.)

Get hyperlinks and turn references into links with hyperref22 (make sure to set it up, as with \hypersetup{colorlinks=true}). Have cross-references that say `Theorem 1.2' instead of just `1.2' with cleveref.23 For URL's and file paths that can break across lines, use url.24 (If you use hyperref then note that it has its own commands for the cleveref and url functions.)

Inside verbatim text, make single quotes come out correctly with upquote.25 For including computer code, the listings26 package is very popular. (Copy and paste for computer code is especially convenient. This is a start for the listings package.

\lstset{basicstyle=\ttfamily, 
        keepspaces=true, 
        columns=fullflexible}
But it is not a full solution. The results depend on the PDF viewer and worse, if your code line begins with blank spaces then after copy and paste those spaces are gone.)

If you use Python, pythontex27 will show code listings, but it also allows you to execute Python and put the results in your output. Do the same for the Sage mathematics software with sagetex, and similar support exists for other languages.

There are many packages that add table capabilities, such as multirow entries and breaking across pages. The first package to try is array,28 which lets you define your own column types. To handle scientific units, use siunitx29 (which also has a table column type for aligning on a decimal point).

Make boxes that are colored or framed, such as boxes for theorems, with tcolorbox.30

Use babel31 for internationalization, including changing the title of the abstract or the bibliography. (Note that LATEX now defaults to UTF-8 encoded input.)

Finally, when developing a document, you often want to generate filler text. Use lipsum.32

Color and graphics For colors, use xcolor.33

To include graphics and do simple manipulations such as resizing, use graphicx.34 Use the JPG format for photos, PNG for other kinds of raster graphics, and PDF for vector graphics. If your graphic is in another format then convert it to one of these three. (Usually in your LATEX source, you give the file name without the extension, as with \includegraphics{myplot}.) Include parts of an outside PDF document with pdfpages.35 Include video or sound using media9.36

In your plots and graphics, you want that the fonts and notations match your document. You have a few choices. Draw inside your document with TikZ.37 You can instead draw using an external command language such as Asymptote,38 and bring the results in as graphics. And there are other options, such as that the Gnuplot plotting software will output TikZ commands, and the Inkscape vector graphics editor allows you to embed LATEX-generated equations.

Front and back matter, headers, footers To style chapter and section titles, use titlesec.39 For page headers and footers, reach for fancyhdr.40 You can tweak the format of tables of contents, lists of figures, etc., with tocloft.41

For footnotes, use footmisc.42 Make an index with makeindex.43 With answers44 you can send exercise answers to an external file, where you can make them a separate document or include them at the end of the current one.

Bibliographies are a thorny area. Often you have strict requirements, such as from the MLA.45 CTAN is a big help here; check out the many styles for both BibTEX46 and BibLATEX.47

Special documents Make exams and problem sets with the exam48 class.

There are many, many resume and CV packages. Start with CTAN's cv topic.

To make presentations, use the beamer49 class. (However, with this package you are entering another world, where many of the packages discussed here do not work. For example, section title styling happens via a completely different mechanism.)

Fonts and engines

The documentation for font use commands from the LATEX developers is LATEX2ε font selection.50

To move beyond the default fonts, visit the LATEX Font Catalogue, which includes copy and paste code to make each one work.

Beyond that list, you can also use your computer system's fonts (beware this makes your source le harder to share with friends, though). The background is: to convert LATEX source to PDF output there are three varieties of the TEX engine. Currently the most common is pdfTEX.51 For instance, this document was generated with pdflatex latex-doc-ptr.tex. Two further developments, XeTEX,52 and LuaTEX,53 can leverage the fontspec54 package to use your system's fonts, such as OpenType and TrueType fonts, in addition to the ones from your TEX distribution. (Mathematics requires much special tuning, though, so most of the time you cannot use system fonts for math.)

More is on the TEX Users Group's font page.

Writing LATEX

There are many ways to make writing LATEX source easier. Most people use a source code editor, such as TEXstudio, or Emacs with the add-on mode AUC-TEX, or TEXShop on a Mac.

Pronunciation

Pronounce LATEX as 'la-tech' or 'lay-tech', with emphasis on either syllable. We prefer the first, with emphasis on the first syllable.

Welcome to the community!

One reason that all of these resources are available is the work of the many user groups, including the TEX Users Group. Please consider joining.

_________________________________________________________________________________________

Package names, for texdoc

1lshort 2amshelp 3amsmath 4latex2e 5comprehensive 6faq 7latexcheat 8undergradmath 9l2tabuen 10geometry 11multicol 12amsmath 13amssymb 14amsthm 15rsfs 16bm 17mathtools 18microtype 19enumitem 20caption 21float 22hyperref 23cleveref 24url 25upquote 26listings 27pythontex 28array 29siunitx 30tcolorbox 31babel 32lipsum 33xcolor 34graphics 35pdfpages 36media9 37tikz 38asymptote 39titlesec 40fancyhdr 41tocloft 42footmisc 43makeindex 44answers 45mla 46bibtex 47biblatex 48exam 49beamer 50fntguide 51pdftex 52xetex 53luatex 54fontspec