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.
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.
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 LaTeX2e, 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
The nearest thing to a general reference for LaTeX is LaTeX2e 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.
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 LaTeX2e usage9 helps you develop sound habits, by saying what not to do.
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.
There are many excellent books about LaTeX. Visit the TeX Users Group’s book list for a selection, and for discounts.
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.)
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.
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.
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
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.
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
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.)
The documentation for font use commands from the LaTeX developers is LaTeX2e 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 (this may make your source file 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,
X ETeX,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.
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.
Pronounce LaTeX as 'la-tech' or 'lay-tech', with emphasis on either syllable. We prefer the first, with emphasis on the first syllable.
To contact this document’s authors with suggestions and corrections please see its page at https://ctan.org/pkg/latex-doc-ptr.
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.
_________________________________________________________________________________________
1 lshort 2 amshelp 3 amsmath 4 latex2e 5 comprehensive 6 faq 7 latexcheat 8 undergradmath 9 l2tabuen 10 geometry 11 multicol 12 amsmath 13 amssymb 14 amsthm 15 rsfs 16 bm 17 mathtools 18 microtype 19 enumitem 20 caption 21 float 22 hyperref 23 cleveref 24 url 25 upquote 26 listings 27 pythontex 28 array 29 siunitx 30 tcolorbox 31 babel 32 lipsum 33 xcolor 34 graphics 35 pdfpages 36 media9 37 tikz 38 asymptote 39 titlesec 40 fancyhdr 41 tocloft 42 footmisc 43 makeindex 44 answers 45 mla 46 bibtex 47 biblatex 48 exam 49 beamer 50 fntguide 51 pdftex 52 xetex 53 luatex 54 fontspec