Skip to Main Content
The University of Massachusetts Amherst

LaTeX

Common Components

  • Commands
    • A command is an instruction or direction you want to tell LaTeX to perform (ex: change font size).
    • Commands are indicated using a backslash:  \command{x}.
    • Commands will often make use of arguments that specify what exactly to do (ex: make font size bigger).
    • Some commands require an argument to function. To set a mandatory argument, use braces {x}.
    • Sometimes a command can use, but does not require, an argument. To set an optional argument, use brackets [x].

                    


  • Environments
    • An environment is used to create a specific piece of your document that will follow particular rules.
    • To open an environment, use the command \begin{x}. To close an environment, use the command \end{x}.
    • You will use environments when creating lists, tables, images, and more.

                                                


  • Packages
    • Packages introduce new sets of commands, formatting rules, etc. that you want to use in your document.
    • They are loaded in the document preamble (see General Document Structure). To load a package, use the command \usepackage{x}.
    • You can find packages on the CTAN website here.

               


  • Notes
    • You may want to write text in your LaTeX source code that you don't want to show up in your final output
    • Notes are indicated using a percent symbol: %notes
    • Anything written after the % will be ignored by LaTeX when compiling your document