Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document

Formatting Information — An introduction to typesetting with LATEX

Chapter 1: Writing documents

Section 1.4: Quick start for the impatient

If you already know all about editors and plaintext files and markup and how to run programs, and you know that LATEX is already fully installed on your system, including an editor that you know how to use, or you prefer to use Overleaf or another of the online LATEX services, you’d probably like to type something in and see LATEX do its job, so do the example ‘Quick start’ below.

Exercise 1.4 — Quick start

  1. Open your LATEX editor (or log into Overleaf) and create a new, empty document (delete any auto-template material if present)

  2. Make sure your editor is set up to use XƎLATEX

  3. Copy and paste the text from the first code listing in this section below. Make sure you get all of it, and don’t change anything yet.

  4. Save the document as quickstart.tex in your Documents folder or wherever you normally keep your documents (Overleaf already asked for the name in step 1 above)

  5. Click on the Run, Build, Typeset, Recompile or TEXFile menu or toolbar icon in your editor.

  6. Some editors open the preview automatically when a new document is typeset. If this does not open automatically for you, click on the View or Preview toolbar item (usually next to the Typeset icon).

  7. If you have a printer installed, you can click on the Print toolbar icon in your viewer (or open the PDF in any suitable viewer).

If you don’t know this stuff yet, then by all means do this section now, but treat it as part of the learning experience. In § 1.5 below you can read more about how LATEX works, and it's cross-refereced back to the code in this section so you can check it.

If you encounter any errors, it means you do need to read the rest of this chapter after all. There is a list of common error messages in § B.3.1 below. You need to fix the errors in your document and click on the Typeset button again (or whatever your editor uses).

\documentclass[12pt]{article}
\usepackage{fontspec,url}
\setmainfont{EB Garamond}
\setcounter{secnumdepth}{0}
\begin{document}

\section{My first document}

This is a short example of a \LaTeX\ document I wrote on \today.
It shows a few simple features of automated typesetting, including:

\begin{itemize}
  \item setting the font size to 12pt for the ‘article’ class;
  \item enabling the use of any font, not just the default;
  \item enabling special formatting for URLs (web addresses);
  \item using the Garamond typeface;
  \item preventing sections from being numbered;
  \item formatting a section heading;
  \item using the \LaTeX\ logo;
  \item generating today’s date;
  \item formatting this list of items;
  \item formatting a subsection heading;
  \item using opening and closing quotes;
  \item formatting a URI;
  \item boxing, centering, and italicisation;
  \item autonumbering the pages.
\end{itemize}

\subsection{More information}

This example was taken from the book ‘Formatting Information’, which you 
can read online at \url{http://latex.silmaril.ie/formattinginformation/}
and use as a teach-yourself guide.

\begin{center}
  \fbox{\textit{Have a nice day!}}
\end{center}

\end{document}
  1. You can check to see if LATEX is already installed on your computer by opening a command window and typing xelatex and pressing the Enter or  Return key. 

  2. If you’re using an online system like Overleaf instead, make sure you have created an account.