Skip to content

Instantly share code, notes, and snippets.

@benhourigan
Last active August 17, 2020 05:55
Show Gist options
  • Save benhourigan/9ab0cc721519b3fb73aa547b6a520db7 to your computer and use it in GitHub Desktop.
Save benhourigan/9ab0cc721519b3fb73aa547b6a520db7 to your computer and use it in GitHub Desktop.

LaTeX has a few ways of typing special characters that you need to know before you start.

Key things covered:

  • Paragraph separation.
  • Commenting with %
  • Special symbols that need to be escaped as \% \$ \&
  • Different opening and closing quote marks.
  • Dashes and non-breaking spaces.
  • Italic and bold formatting.
  • Chapter and section headings.
  • Formatting that begins with \begin{command} and ends with \end{command}. This includes bulleted and numbered lists, centering, verse, and quotes.

One of the most important things to note is that you must put a blank line between paragraphs. Eg,

First paragraph.

Second paragraph.

If you write this:

First paragraph.
Second paragraph.

the two lines will be joined in the formatted output and will appear like this:

First paragraph. Second paragraph.

Now a list of key commands and special characters:

%     Anything after this on a line is a comment and will not be printed.  
\%    a percentage sign (escaped). Will otherwise comment out text.
\$    a dollar sign (escaped). Will otherwise start math formatting.
\&    an ampersand. Will otherwise apply table formatting.

``    an open double quote. The ` symbol is often in the top-left of a keyboard, above the Tab key.
''    a close double quote

`     open single quote
'     apostrophe or close single quote

---   en dash
--    em dash
...   ellipsis (three dots)
~     non-breaking space (used in situations like Mr.~Roberts)

\emph{text}        Italic text, with “text” the text shown on the page,
\textbf{text}      Bold text, with “text” shown.

\chapter{11}        Marks a chapter, with 11 the text shown on the page.
\section{Heading}   Marks a subheading, with “Heading” the text shown.
\begin{itemize}     Starts a bulleted list
\item               Begins an item within a list.
\end{itemize}       Ends a bulleted list.
\begin{enumerate}   Starts a numbered list.
\begin{center}      Starts centering.
\begin{verse}       Starts verse formatting for poetry and other things where line breaks are important.
\begin{quote}       Starts a block quote.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment