\documentclass[12pt, a4paper]{article}
\usepackage{setspace} 

\usepackage[dvips]{graphicx}
\usepackage[dvipsnames]{xcolor}

\usepackage[french, ngerman, australian]{babel}
\usepackage{hyphenat}
\hyphenation{}

\usepackage[useregional, showdow]{datetime2}

\usepackage[TS1,T1]{fontenc}

\usepackage[left=1in, top=1in, bottom=1.25in, right=1in, headheight=18pt]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{}
\chead{}
\rhead{\thepage}
\lfoot{}
\cfoot{}
\rfoot{}
\renewcommand{\headrulewidth}{0.0pt}
\renewcommand{\footrulewidth}{0.0pt}

\usepackage[title, toc]{appendix}

%opening
\title{
Yet Another Guide \\
to \\
\LaTeXe \\ 
v0.5 \\}

\author{Michael P. Morris \footnote {Copyright \copyright  2020--2022  M. P. Morris. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". Any error reports for this work can be sent to the author at \texttt{mmorris-500@hotmail.com}.} \\ 
\texttt{{\footnotesize mmorris-500@hotmail.com}}} 

\date{}

\usepackage[pdftex, colorlinks=true, allcolors=Blue]{hyperref}


\hypersetup{pdfinfo={
 		Title={Yet Another Guide to LaTeX2e. v0.5},
		Author={M.P. Morris},
		Subject={LaTeX2e},
		Keywords={Latex2e; Guide}
}}

\begin{document}

\maketitle
\thispagestyle{empty}

\begin{abstract}
This document is a short guide to using \LaTeXe\ to typeset high quality documents. It focuses on users of Windows 10 OS and guides the reader through installation, some of \LaTeXe's conventions, and creating the front matter, body and end matter of a document. The appendices contain a list of useful facilities not covered in this document and a list of helpful resources.
\end{abstract}

%\clearpage
\pagenumbering{roman}
\tableofcontents

\clearpage
\listoffigures

\clearpage
\listoftables

\clearpage
\pagenumbering{arabic}

\section{Introduction}

LaTeX (pronounced \emph{lah-tek}) is a markup language designed to typeset high quality documents. It was created by Donald Knuth who generously released it into the public domain and is freely available from the Comprehensive TeX Archive Network (\textsc{ctan}) at \texttt{\url{www.ctan.org}}. Since it’s release it has been greatly added to, and as of this writing there are currently over 6100 add-on packages from over 2800 contributors. The most recent version is \LaTeXe and LaTeX 3 is under development. 

This document grew from my own efforts to become a proficient LaTeX user. It is not a comprehensive guide to using LaTeX. It is aimed at giving an overview of the elements of how to mark up a document and then compile it into either postscript or \textsc{pdf} format in English. It is a very bare bones outline of LaTeX and only touches on the possibilities. The best source of information is package documentation which is available from \textsc{ctan}. There are also a number of published guides and the reference list contains several useful references. A more comprehensive list, and a helpful list of texts on typography is also available from \textsc{ctan}. 

This document focuses on the Windows 10 operating system. Users of \textsc{unix}-alike or Mac systems should consult their OS documentation for issues specific to them. There are a large number of packages and some of them overlap in functionality. There are multiple options for citation systems, for document templates and for fonts. The recommendations made in this document reflect my own experiences and prejudices.

Finally, I'd like to mention The TeX Users Group, of which I am a member. This is a not-for-profit group for those interested in LaTeX. Membership is inexpensive and members are sent \textsc{tug}boat, the Journal of the Tex Users Group, three times a year, and the TeX Collection on \textsc{dvd} annually. This is a good way of keeping up with developments and also with changes to TeX distributions.

A previous version of this document was titled `Getting Started with \LaTeXe'. The name has been changed as it was very similar to other documents relating to LaTeX. This version contains corrections, clarifications and some additions. This document was produced with Pro\TeX\ v3.2-031721, the most recent version available at the time of this writing.

The author is very interested in hearing about errors and suggestions for improvements, especially code that doesn't function as advertised. These reports can be sent to the author at \texttt{\color{Blue}mmorris-500@hotmail.com}. 



\clearpage

\section{Installation}

\LaTeXe is freely available from \texttt{\url{www.ctan.org}} in three main distributions: 


\begin{itemize}
\item TeXLive is cross platform and will install on \textsc{unix}-alike, Mac and Windows systems.\\
	
\item MacTeX is aimed at Mac OS users.\\
	
\item ProTeX is aimed at Windows users.\\
\end{itemize}


The most current version of ProTeX, as of this writing, is \texttt{protext-3.2-031721}. To install this on a Windows system, download it from \textsc{ctan} and unzip it. This will create a new directory called \texttt{protext-3.2-031721}. Click on this, then \texttt{setup.exe}. This will bring up the global setup console. Click \texttt{manual} to bring up a \textsc{pdf} document with easy installation instructions. The distribution also contains TeXstudio, an editor, and Sumatra, a \textsc{pdf} viewer in their respective directories. These should be installed after LaTeX. The \texttt{doc} directory contains several manuals on using LaTeX. 

After ProTeX is installed, the next step for Windows users is to place it in the Windows search path. This will allow Windows to find it if it is run from the command line. To do this, go to the Control Panel:


\begin{flushleft}
\texttt{Control Panel $\rightarrow$ System and Security $\rightarrow$ System $\rightarrow$ Advanced System Settings $\rightarrow$ Environmental Variables $\rightarrow$ Path in the User Variables box $\rightarrow$ Edit}
\end{flushleft}


Then navigate to the directory containing the binary files and add it to the path. If it is a ProTeX distribution running on 64 bit Windows 10 they are in: 


\begin{flushleft}
\texttt{C:\textbackslash Program Files\textbackslash MikTeX2.9\textbackslash miktex\textbackslash bin \textbackslash x64}
\end{flushleft}


\subsection{Package Management}

\textsc{ctan} currently has over 6100 packages for LaTeX from over 2800 contributors. These provide additional features, fonts, document templates and documentation. ProTeX provides the MiKTeX Console to help manage them. This provides facilities for updating packages, accessing package documentation and installing new packages. \textsc{unix}-alike and MacTeX users should consult their documentation. 

The MikTeX Console can be accessed from the Windows 10 desktop by clicking 


\begin{flushleft}
\texttt{Windows Start $\rightarrow$ \texttt{MiKTeX 2.9} $\rightarrow$ \texttt{MiKTeX Console}}
\end{flushleft}


When the Console appears, select the Operation Mode: \texttt{Administrator} or \texttt{User}. Select \texttt{Administrator} if you want to manage a system wide installation, such as on a single workstation, or \texttt{User} if you are working on a workstation which is part of a larger system.

To add packages to LaTeX, click \texttt{Packages} and a list of all the packages available from \textsc{ctan} will appear along with the date it was installed on your system. If the date is missing, the package is not present on your installation. To install it, click the package name so that it is highlighted, then click \texttt{+} at the top of the list to install it.

To update currently installed packages, select


\begin{flushleft}
\texttt{Updates $\rightarrow$ Check for updates}
\end{flushleft} 


If any updates are found, they will appear as a list. To perform the update, click \texttt{Update now} and they will be downloaded and installed automatically. 

Following the package installation or update the file name and package databases have to be updated so that LaTeX can find the updated packages. If new fonts have been installed, the font map files have to be refreshed. To do this, go to the console Menu, click on 


\begin{flushleft}
\texttt{\texttt{Tasks $\rightarrow$ Refresh file name database}}
\end{flushleft}


\begin{flushleft}
When this is finished, go to 
\end{flushleft}


\begin{flushleft}
\texttt{Tasks $\rightarrow$ Update package database}
\end{flushleft}


\begin{flushleft}
If fonts have been updated or installed, select 
\end{flushleft}


\begin{flushleft}
\texttt{Tasks $\rightarrow$ Refresh font map files}
\end{flushleft}


Package documentation can be accessed by clicking \texttt{Documentation} on the console. A list of all the packages on \texttt{ctan} will appear along with a tick in the \texttt{Installed} column if it is present on the system. Documentation may be installed in the same way as packages.

A number of packages must be present on your installation so that you can use the examples in this document. Not all of them come with every distribution due to size constraints. The ProTeX distribution's download size had grown to about 3gb, and to reduce this, a number of packages were omitted. This reduced the download size to about 1gb. If any of the required packages are missing, they can be installed using the instructions in the section on Package Management below. Some packages access other packages and these must be present on your installation as well: \texttt{ragged2e}, for instance, requires the packages \texttt{everysel} and \texttt{footmisc}. BibLaTeX, which automatically generates references and reference lists, has 12 additional packages, not including style packages! A list is in Table 1.


\begin{table}
\begin{center}
\begin{tabular}{ll}
\hline
\LaTeXe    & Bib\LaTeX                                               \\
\hline
\texttt{babel}       &  \texttt{babel v3.9r or above or polygossia}  \\
\texttt{datetime2}   &  \texttt{biber}                               \\
\texttt{everysel}    &  \texttt{csquotes}                            \\
\texttt{fancyhdr}    &  \texttt{etoolbox}                            \\
\texttt{fontenc}     &  \texttt{etex}                                \\
\texttt{footmisc}    &  \texttt{ifthen}                              \\
\texttt{geometry}    &  \texttt{keyval}                              \\
\texttt{graphicx}    &  \texttt{kvoptions}                           \\
\texttt{hyphenat}    &  \texttt{logreq}                              \\
\texttt{ragged2e}    &  \texttt{pdftexcmds v0.27 or above}           \\
\texttt{setspace}    &  \texttt{url}                                 \\
\texttt{xcolor}      &  \texttt{xpatch}                              \\
\texttt{xmp}         &                                               \\
            &  Bibliographical Styles                      \\
            &  \texttt{biblatex-apa}                       \\
            &  \texttt{biblatex-chicago}                   \\
            &  \texttt{biblatex-mla}                       \\
            &  \texttt{biblatex-vancouver}                 \\
\hline
\end{tabular}
\caption{Required and recommended packages}
\end{center}
\end{table}


\subsection{Additional Software}

The software listed below is helpful for managing projects in LaTeX. An editor makes marking up a text file and compiling it much simpler. Two freely available editors are \TeX studio and Kile. \TeX studio comes with ProTeX and the most recent version is available from: 

\begin{flushleft}
\texttt{\url{www.texstudio.org}}
\end{flushleft}

Kile is another popular choice with similar functionality to TeXstudio. It has a preview feature which shows how your document will look. It is available from:

\begin{flushleft}
\texttt{\url{www.kile.sourceforge.io/}}
\end{flushleft}

A reference manager is helpful for scholarly writing because it can keep all the references in a single place, and if the references and reference list is are to be generated automatically, it forms a database that the generator can refer to. Jabref imports 15 reference formats and links to full text documents on the web. It is freely available from:

\begin{flushleft}
\texttt{\url{www.jabref.org}}
\end{flushleft}

Zotero is also freely available and supports a large number of reference formats. It allows users to add pdf's, images and web pages to its databases and users can also add annotations to each entry:

\begin{flushleft}
\texttt{\url{www.zotero.org}}
\end{flushleft}


A fundamental requirement for LaTeX is a viewer so that typesetters can view the results of their labours. There are a large number of viewers for \textsc{pdf} files, and ProTeX comes with Sumatra \textsc{pdf}. The latest version is available from:


\begin{flushleft}
\texttt{\url{www.sumatrapdfreader.org/free-pdf-reader}}
\end{flushleft}


GSView is a free postscript viewer for Windows. It requires Ghostscript which is installed automatically by ProTeX. GSview v5.0 is available from:

\begin{flushleft}
\texttt{\url{www.ghostgum.com.au/software/gsview.htm}}
\end{flushleft}


LaTeX handles a limited range of graphic formats so an image converter is useful. Image Magic is freely available and reads and writes over 200 graphic formats. It is available from:

\begin{flushleft}
\texttt{\url{www.imagemagick.org/script/index.php}}
\end{flushleft}

\clearpage


\section{Running \LaTeXe}
LaTeX is run from the command line by navigating to the project folder and then run on a marked-up text file. These have a \texttt{.tex} extension. To run it on a file named \texttt{TestFile.tex}: 


\begin{flushleft}
\texttt{latex TestFile.tex}
\end{flushleft}


This produces a \textsc{dvi} file called \texttt{TestFile.dvi} that can be converted to postscript with \texttt{dvips}:


\begin{flushleft}
\texttt{dvips TestFile.dvi}
\end{flushleft}


If \textsc{pdf} format is preferred, use \textsc{pdf}latex:


\begin{flushleft}
\texttt{pdflatex TestFile.tex}
\end{flushleft}


It is convenient to run this from a \textsc{gui} interface. In TeXstudio, load a marked-up text file then go to 


\begin{flushleft}
\texttt{Tools $\rightarrow$ Commands $\rightarrow$ LaTeX or PDFLaTeX}
\end{flushleft}


\begin{flushleft}
and it will run automatically. In Kile, go to 
\end{flushleft}
 
 
\begin{flushleft}
\texttt{Build $\rightarrow$ Compile $\rightarrow$ LaTeX or PDFLaTeX }
\end{flushleft}



\clearpage


\section{Project Management}

The first step in creating a document with LaTeX is to write the text and save it as a plain text file into a project directory created specifically for that project. This text file is then marked up so that when it is compiled it becomes a formatted postscript or \textsc{pdf} document. The normal suffix for this file is \texttt{.tex}. During compilation, LaTeX will produce several other files and having a project directory will help keep all of them together. This directory should also contain any graphic files and reference databases so that LaTeX can find them.


\subsection{Postscript vs \textsc{pdf}}

One of the first things to consider is if the document is to be produced in postscript or Portable Document Format (\textsc{pdf}). Postscript is the `gold standard’ for printed documents and produces the highest quality files for printing. \textsc{pdf} supports hypertext links and live connections to websites and are somewhat smaller than postscript files. Postscript documents require no specific instructions. \textsc{pdf} files have options for file metadata and hyperlinks and these require \textsc{pdf}LaTeX. See the section on \textsc{pdf} document compilation below for how to include these in your document.


\clearpage


\section{LaTeX Conventions}

LaTeX documents have two parts: the preamble and the document text. The preamble defines the document's global properties such as the template for the document, paper size, fonts and margins and loads packages that contain functions that will be used to format the text. The first command is \texttt{\textbackslash documentclass\{TemplateName\}}  Packages are loaded with the \texttt{\textbackslash usepackage[Options]\{PackageName\}} command. The required package name is placed between the curly braces and a list of options separated by commas are listed between square brackets: 


\begin{flushleft}
\texttt{\textbackslash documentclass\{TemplateName\} \\	
\textbackslash usepackage[Option1, Option2]\{PackageName\}}
\end{flushleft}


After the preamble comes the document text. This is contained inside the \texttt{document} environment and includes the text, graphs, tables, lists etc. 

The simplest document uses LaTeX's default settings and requires only that the document class be specified and that the text be placed in the \texttt{document} environment. The following creates an article class document with everything else left at the default settings:

\begin{flushleft}
\texttt{\textbackslash documentclass\{article\} \\
\textbackslash begin\{document\} \\
Document Text Here \\
\textbackslash end\{document\}} \\
\end{flushleft}


\subsection{Commands}

Commands in LaTeX begin with a \texttt{\textbackslash}. This is one of LaTeX's special characters and alerts LaTeX that the following is an instruction rather than text. This is followed by a command and the object of the command is often placed between curly braces: \texttt{\textbackslash Command\{Object\}}. To format a section of text in italics, the \texttt{\textbackslash textit\{\}} command tells LaTeX that the text inside the curly braces is to be formatted in italics:


\begin{flushleft}
\texttt{\textbackslash textit\{Lorem ipsum dolor sit amet, consectetur adipiscing elit.\}}
\end{flushleft} 


\begin{flushleft}
produces
\end{flushleft}


\begin{flushleft}
\textit{Lorem ipsum dolor sit amet, consectetur adipiscing elit.}
\end{flushleft}


Commands are also used to select special characters: A \$ is one of LaTeX's control characters, so a \texttt{\textbackslash} must be added to tell LaTeX that it should be processed as text: \texttt{\textbackslash \$} produces \texttt{\$}. Commands for all of LaTeX's control characters is in Table 8.

It is always a good idea to annotate your code. Annotations can be added to LaTeX code by starting comment lines with a \texttt{\%}. This will stop LaTeX from attempting to run it and returning an error message:


\begin{flushleft}
\texttt{
\% This is a comment. \\
}
\end{flushleft}


\clearpage


\section{Preamble}


Every LaTeX document has a preamble which contains instructions regarding document template, page size and other options that will affect it as a whole. It is the first part of any document and goes before the body of the text. The first line of the preamble is:


\begin{flushleft}
\texttt{\textbackslash documentclass[Options]\{DocumentTemplate\}} \\
\end{flushleft}


This specifies the template for the document. The base options are \texttt{article}, \texttt{book}, \texttt{letter} or \texttt{report}. There are a wide range of templates and some organisations produce their own. If one of these is required, it is named here and will be loaded when the document is compiled. After the template is selected, options define font size, paper size, number of columns and whether it is to be printed on one side of the page or two. 

LaTeX's defaults are: a 10pt font size, a paper size of 8.5'' x 11'', which is the US standard letter size, portrait orientation, a separate title page for the report class but not the others, typesetting in one column, and printing on one side of the page only. All these can be customised. A summary of commands and options are outlined in Tables 2 and 3.

\begin{table}
\small
\begin{center}
\begin{tabular}{ll}
\hline
Option               &  Command \\
\hline
Document Type        &  \texttt{letter, article, report, book} \\
Typeface Size (pts)  &  \texttt{10, 11, 12} \\
Title Page           &  \texttt{titlepage, notitlepage} \\
Columns              &  \texttt{onecolumn, twocolumn} \\
Layout               &  \texttt{oneside, twoside} \\
\hline
\end{tabular}
\caption{Document class options}
\end{center}
\end{table}


\begin{table}
\small
\begin{center}
\begin{tabular}{lll}
\hline
Size   &   Measurement(mm)   &   Command \\
\hline
A4         &  210 x 297  &     \texttt{a4paper}   \\
A5         &  148 x 210  &     \texttt{a5paper}   \\
B5         &  176 x 250  &     \texttt{b5paper}   \\
Executive  &  185 x 267  &     \texttt{executivepaper}   \\
Legal      &  216 x 356  &     \texttt{legalpaper}   \\
Letter     &  216 x 279  &     \texttt{letterpaper}   \\
\hline
\end{tabular}
\caption{Paper sizes}
\end{center}
\end{table}


The following code creates an article class document with A4 sized paper and a 12-point font. The other options will stay at their default settings:


\begin{flushleft}
\texttt{\textbackslash documentclass[12pt, a4paper]\{article\}} \\
\end{flushleft}


After the document type is defined, packages that will be used are loaded with


\begin{flushleft}
\texttt{\textbackslash usepackage[Options]\{PackageName\}} \\
\end{flushleft}


The first package is \texttt{setspace}. This package supports single, one-and-a-half and double spacing with \texttt{\textbackslash singlespacing}, \texttt{\textbackslash onehalfspacing} and \texttt{\textbackslash doublespacing}. This will change the spacing of the entire document, but figures, tables and footnotes will be unaffected. \texttt{setspace} is loaded in the preamble and the required spacing is specified in the document text after \texttt{\textbackslash begin\{document\}}. LaTeX's default spacing is single spaced:


\begin{flushleft}
\texttt{\textbackslash documentclass[a4paper]\{article\} \\
\textbackslash usepackage\{setspace\} \\
\textellipsis \\
\textbackslash begin\{document\} \\
\textbackslash doublespacing \\
\textellipsis \\
\textbackslash end \{document\} 
}
\end{flushleft}


The next package is \texttt{graphicx} which is part of the `graphics' bundle. It provides facilities to include graphics in documents with it's \texttt{\textbackslash includegraphics\{\}} command. 


\begin{flushleft}
\texttt{\textbackslash usepackage\{graphicx\}} \\
\end{flushleft}


\texttt{xcolor} provides support for coloured text, text background, page colour or a coloured box surrounding text. This is especially helpful for \textsc{pdf} documents that contain hot links as they can be highlighted. If no options are specified, 19 colours are available. Options \texttt{dvipsnames}, \texttt{svgnames} and \texttt{x11names} provide 68, 151 and 317 colours respectively. Colours and their designations for each of these options are provided in \texttt{xcolour's} documentation (Kern, 2021). If specific colours are required, this package can produce them in rgb and cmyk format. The following loads \texttt{xcolor} with \texttt{dvipsnames} to provide 68 colour choices:  


\begin{flushleft}
\texttt{\textbackslash usepackage[dvipsnames]\{xcolor\} }
\end{flushleft}


The \texttt{babel} package supports hyphenation for justified text and has facilities for about 200 languages. This includes three dialects of English: \texttt{english} refers to American and Canadian, \texttt{UKenglish} refers to British, and \texttt{australian} refers to Australian and New Zealand English. If the document contains text in multiple languages, all of them should be listed as options. There may be multiple options for language: English has three and German, two. Consult the documentation for details on each one. The language listed last is the document’s main language:


\begin{flushleft}
\texttt{\textbackslash usepackage[french, ngerman, australian]\{babel\}}
\end{flushleft}


This loads French, German and Australian English with Australian being the document's main language. To swap to one of the other languages in the text, use \texttt{\textbackslash selectlang- uage\{LanguageName\}} for blocks of text such as paragraphs, and \texttt{\textbackslash foreignlanguage\{Lang- uageName\}\{Text\}} for text that is part of a paragraph: 


\begin{flushleft}
\texttt{Text in English. \\
\textbackslash selectlanguage\{french\} \\
Texte en Francais. \\
\textbackslash selectlanguage\{australian\} \\
Returns to Australian English. \\}
\end{flushleft}

\begin{flushleft}
or
\end{flushleft}

\begin{flushleft}
\texttt{\textbackslash foreignlanguage\{french\}\{Texte en Francais.\}}
\end{flushleft}


If LaTeX doesn't hyphenate words properly, they will run into the right-hand margin. To fix this, a list of troublesome words and their syllables can be specified with the \texttt{hyphenat} package and it's \texttt{hyphenation\{\}} command. These words are placed in hyphenation's curly braces divided into syllables with a -. For example, `hyphenate' is defined as \texttt{hy-phen-ate} and preamble is \texttt{pre-am-ble}. Multiple words are separated by commas: 

\begin{flushleft}
\texttt{\textbackslash usepackage[french, ngerman, australian]\{babel\} \\
\textbackslash usepackage\{hyphenat\} \\
\textbackslash hyphenation\{hy-phen-ate, pre-am-ble\}} \\
\end{flushleft}


Dates can be added with datetime2. This package is loaded with 

\begin{flushleft}
\texttt{\textbackslash usepackage\{datetime2\}}
\end{flushleft}

\begin{flushleft}
and the date itself inserted in the text with 
\end{flushleft}

\begin{flushleft}
\texttt{\textbackslash today}
\end{flushleft}

This will add the date the document was compiled in \textsc{yyyy-mm-dd} format so it will look like 2020-09-19. The format can be changed with the \texttt{useregional} option. This will set the date format so that it matches the language specified when \texttt{babel} was loaded. The \texttt{babel} example above specifies Australian English and will format the timestamp to \textsc{dd mm yyyy}. To add the day of the week, add the \texttt{showdow} option:


\begin{flushleft}
\texttt{\textbackslash usepackage[useregional, showdow]\{datetime2\}}
\end{flushleft}


The \texttt{fontenc} package gives access to the glyphs of language. This is done through what LaTeX refers to as encodings. The default, and LaTeX's original encoding option, is \texttt{OT1}. This gives access to glyphs for the English alphabet. Unfortunately, this encoding doesn’t allow hyphenation of accented characters that appear in non-English latin alphabets. If the document is in English this doesn’t matter, but if the document contains glyphs from other latin alphabets, the encoding should be changed to \texttt{T1}. This has a wider range of glyphs. LaTeX provides encodings for a range of languages: Cyrillic, African Latin, Vietnamese, Greek, Armenian etc. If text for languages in alphabets other than latin are included in your document, encodings for these will have to be loaded as well. For this, see Mittelbach, et al (2016). 

TS1 is a coding that gives access to symbols. This can be loaded at the same time as the font encoding(s). The required encodings are specified in options. To load both T1 and TS1 encodings:

\begin{flushleft}
\texttt{\textbackslash usepackage[TS1, T1]\{fontenc\}}
\end{flushleft}

LaTeX's default setting for text alignment is justified with both edges of the text block aligned evenly. If the text block should be left aligned with a ragged right side, \texttt{ragged2e} will format the text as this for the entire document with the \texttt{document} option. To use this package, two additional packages should be present on your LaTeX installation. These are \texttt{everysel} and \texttt{footmisc}. The following loads \texttt{ragged2e} and sets the document text alignment to left aligned with a ragged right side:

\begin{flushleft}
\texttt{\textbackslash usepackage[document]{ragged2e}}
\end{flushleft}

The next line loads the font for the document. If it is not defined, it will default to Computer Modern, which is LaTeX's original font. LaTeX provides a wide range of fonts with an option to install more if required. This example loads Latin Modern with the package name \texttt{lmodern}. 


\begin{flushleft}
	\texttt{\textbackslash usepackage\{lmodern\}}
\end{flushleft}


Table 4 contains a short font sampler and package names. A wide range of fonts is available. The TeX User Group maintains the LaTeX font catalogue. See the Resources section for a link to this.




\begin{table}
\small
\begin{center}
\begin{tabular}{lll}
\hline
Font Name               & Package Name         & Sample Text \\
\hline
Avant Garde             & \texttt{avant}	   & \fontfamily{pag}\selectfont Lorem ipsum dolor sit amet \\
Bookman                 & \texttt{bookman}	   & \fontfamily{pbk}\selectfont Lorem ipsum dolor sit amet \\
Charter                 & \texttt{charter}	   & \fontfamily{bch}\selectfont Lorem ipsum dolor sit amet \\ 
Courier                 & \texttt{courier}     & \fontfamily{pcr}\selectfont Lorem ipsum dolor sit amet \\ 
Computer Modern         & \texttt{cmodern}	   & \fontfamily{cmr}\selectfont Lorem ipsum dolor sit amet \\
Helvetica               & \texttt{helvet}      & \fontfamily{phv}\selectfont Lorem ipsum dolor sit amet \\
Latin Modern            & \texttt{lmodern}	   & \fontfamily{lmr}\selectfont Lorem ipsum dolor sit amet \\
New Century Schoolbook  & \texttt{newcent}	   & \fontfamily{pnc}\selectfont Lorem ipsum dolor sit amet \\
Palatino                & \texttt{mathpazo}    & \fontfamily{ppl}\selectfont Lorem ipsum dolor sit amet \\
Times New Roman         & \texttt{mathptmx}    & \fontfamily{ptm}\selectfont Lorem ipsum dolor sit amet \\
Utopia                  & \texttt{utopia}      & \fontfamily{put}\selectfont Lorem ipsum dolor sit amet \\
\hline		
\end{tabular}
\caption{A short font sampler}
\end{center}
\end{table}


Margins can be adjusted from the defaults with the \texttt{geometry} package. The left, right, top, and bottom margins can all be specified with this, and an allowance made for binding if the document is to be bound. It accepts units in millimetres, centimetres, points, and inches (mm, cm, pt, in). The options are listed in Table 5.

\begin{table}
\small
\begin{center}
\begin{tabular}{ll}
\hline
Option & Comment \\
\hline
\texttt{left}          & Left Margin \\
\texttt{right}         & Right Margin \\
\texttt{top}           & Top Margin \\
\texttt{bottom}        & Bottom Margin \\
\texttt{bindingoffset} & Add space for binding \\
\texttt{headheight}    & Changes the size of the header \\
\hline
\end{tabular}
\caption{Geometry options}
\end{center}
\end{table}


If headers and footers are contained in the document, LaTeX may sometimes return an error message to say that the headheight is too small. This can be corrected with the \texttt{\textbackslash headheight} option. For this document I have set the headheight to $1.5\times$ the point size of the text for a headheight of 18pt. The header is designed to hold a single line of text, but can be adjusted to accommodate multiple lines. The following code sets the left margin at 1.5 inches, the right margin at 1 inch, the top margin at 1 inch, the bottom margin at 1.75 inches and the height for the header to 18 point:

\begin{flushleft}
\texttt{\textbackslash usepackage[left=1.5in, right=1.0in, top=1.0in, bottom=1.75in, 
headheight=18pt]\{geometry\}}
\end{flushleft}

The page margins can be changed mid-document with \texttt{\textbackslash newgeometry\{\}}. It reverts to the original settings with\texttt{ \textbackslash restore\{geometry\}}. The \texttt{\textbackslash newgeometry\{\}} command has the same options as those used by geometry in the preamble:


\begin{flushleft}
\texttt{\textbackslash newgeometry\{left=0.5in, right=0.5in, top=0.5in, bottom=0.5in\}}
\end{flushleft}

This changes the margins to a uniform 0.5 inches. To change it back:

\begin{flushleft}
\texttt{\textbackslash restore\{geometry\}}
\end{flushleft}


Headers and footers are handled by the \texttt{fancyhdr} package. This package provides header and footer placement to the left, centre and right and customizable lines for both headers and footers. The pagestyle should be changed to fancy if this package is used:

\begin{flushleft}
\texttt{\textbackslash usepackage\{fancyhdr\} \\
\textbackslash pagestyle\{fancy\}}
\end{flushleft}

There are six locations available: left, centre and right headers and footers. The location and contents of each header or footer is specified as:


\begin{flushleft}
\texttt{\textbackslash lhead\{Left Top\} \\
\textbackslash chead\{Centre Top\} \\
\textbackslash rhead\{Right Top\} \\
\textbackslash lfoot\{Bottom Left\} \\
\textbackslash cfoot\{Bottom Centre\} \\
\textbackslash rfoot\{Bottom Right\}} \\
\end{flushleft}

The text of the header or footer is contained between the curly braces. These can contain page numbers and dates generated using \texttt{\textbackslash thepage} and \texttt{\textbackslash today} respectively. Decorative lines can be added to both headers and footers with 

\begin{flushleft}
\texttt{\textbackslash renewcommand{headrulewidth}{0.5pt} \\
\textbackslash renewcommand{footrulewidth}{0.5pt}}
\end{flushleft}

This will place lines that are 0.5 points wide beneath the header and above the footer. Line weights can be increased and decreased between 0.0 and 1.0. A line weight of 0.0pt produces no lines.

The following code loads \texttt{fancyhdr} and places a running header or title top left, page numbers top right, today’s date stamp bottom left and decorative lines 0.5 points thick below the footer and above the header:

\begin{flushleft}
\texttt{\textbackslash usepackage\{fancyhdr\} \\
\textbackslash pagestyle\{fancy\} \\
\textbackslash lhead\{Running Header or Title.\} \\
\textbackslash chead\{\} \\
\textbackslash rhead\{\textbackslash thepage\} \\
\textbackslash lfoot\{\textbackslash today\} \\
\textbackslash cfoot\{\} \\
\textbackslash rfoot\{\} \\
\textbackslash renewcommand\{\textbackslash headrulewidth\}\{0.5pt\} \\
\textbackslash renewcommand\{\textbackslash footrulewidth\}\{0.5pt\}} \\
\end{flushleft}


\clearpage


\section{Text}

The body of the text for LaTeX documents is enclosed in the document environment:

\begin{flushleft}
\texttt{\textbackslash begin\{document\} \\
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla est purus, ultrices in porttitor in, accumsan non quam. Nam consectetur porttitor rhoncus. \\
\textbackslash end\{document\}} \\
\end{flushleft}


Either a blank line between two sections of text, or \texttt{\textbackslash par}, denotes a paragraph break and \texttt{\textbackslash \textbackslash} starts a new line.

Page breaks can be inserted with, \texttt{\textbackslash newpage} or \texttt{\textbackslash clearpage}. \texttt{\textbackslash clearpage} is preferred if the document contains chapters or sections with tables, figures, or graphics. This will place them at the end of their section if LaTeX is unable to place them in the text.



\subsection{Fonts and Styles}

The base font and size for LaTeX documents is loaded in the preamble. Font styles, such as \textbf{bold} or \textit{italic} can be changed in the body of the text. A list and their commands are contained in Table 6. These can be changed in two ways. The first is to insert the text in curly braces following a command. This

\begin{flushleft}
\texttt{\textbackslash textit\{Lorem ipsum dolor sit amet . . .\}}
\end{flushleft}
 
\begin{flushleft}
formats the text between the curly braces in italics as
\end{flushleft}
 
\begin{flushleft}
\textit{Lorem ipsum dolor sit amet . . . }
\end{flushleft}
 

This is useful for single words or sentences, but for blocks of text an environment is convenient:
 
 
\begin{flushleft}
\texttt{\textbackslash begin\{itshape\} \\
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla est purus, ultrices in porttitor in, accumsan non quam. Nam consectetur porttitor rhoncus. Curabitur eu est et leo feugiat auctor vel quis lorem. \\
\textbackslash end\{itshape\}} \\
\end{flushleft}
 
\begin{flushleft}
This produces:
\end{flushleft}
 
\begin{flushleft}
\begin{itshape}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla est purus, ultrices in porttitor	in, accumsan non quam. Nam consectetur porttitor rhoncus. Curabitur eu est et leo feugiat auctor vel quis lorem.
\end{itshape}
\end{flushleft}


Fonts can be made larger or smaller from {\tiny Tiny} to {Normal Size} to {\Huge Huge} in a similar way. Table 7 gives commands for resizing fonts.


\begin{table}
\small
\begin{center}
\begin{tabular}{lll}
\hline
Style         & Command                                &  Sample                \\
\hline
Roman         & \texttt{\textbackslash textrm\{\}}     & \textrm{Roman}         \\
Sans Serif    & \texttt{\textbackslash textsf\{\}}     & \textsf{Sans Serif}    \\
Typewriter    & \texttt{\textbackslash texttt\{\}}     & \texttt{Typewriter}    \\ 
Italics       & \texttt{\textbackslash textit\{\}}     & \textit{Italics}       \\
Boldface      & \texttt{\textbackslash textbf\{\}}     & \textbf{Boldface}      \\
Small Caps    & \texttt{\textbackslash textsc\{\}}     & \textsc{Small Caps}    \\
Underline     & \texttt{\textbackslash underline\{\}}  & \underline{Underline}  \\
Emphasis      & \texttt{\textbackslash emph\{\}}       & \emph{Emphasis}        \\
Slanted       & \texttt{\textbackslash textsl\{\}}     & \textsl{Slanted}       \\    		
\hline
\end{tabular}
\caption{Text styles}
\end{center}
\end{table}



\begin{table}
\small
\begin{center}
\begin{tabular}{lc}
\hline
Command & Sample \\
\hline
\texttt{\textbackslash tiny\{\}}          &  \tiny{Lorem ipsum dolor sit amet}         \\
\texttt{\textbackslash scriptsize\{\}}    &  \scriptsize{Lorem ipsum dolor sit amet}   \\
\texttt{\textbackslash footnotesize\{\}}  &  \footnotesize{Lorem ipsum dolor sit amet} \\
\texttt{\textbackslash small\{\}}         &  \small{Lorem ipsum dolor sit amet}        \\
\texttt{\textbackslash normalsize\{\}}    &  \normalsize{Lorem ipsum dolor sit amet}   \\
\texttt{\textbackslash large\{\}}         &  \large{Lorem ipsum dolor sit amet}        \\
\texttt{\textbackslash Large\{\}}         &  \Large{Lorem ipsum dolor sit amet}        \\
\texttt{\textbackslash LARGE\{\}}         &  \LARGE{Lorem ipsum dolor sit amet}        \\
\texttt{\textbackslash huge\{\}}          &  \huge{Lorem ipsum dolor sit amet}         \\
\texttt{\textbackslash Huge\{\}}          &  \Huge{Lorem ipsum dolor sit amet}         \\
\hline
\end{tabular}
\caption{Font sizes}
\end{center}
\end{table}



If \texttt{xcolor} is loaded, fonts, font backgrounds and pages can be re-coloured. \texttt{\{\textbackslash color\{Col- orName\} Text\}} changes the colour of text inside the curly braces. To change it to red:


\begin{flushleft}
\texttt{\{\textbackslash color\{red\} Lorem ipsum dolor sit amet, consectetur adipiscing elit.\}}
\end{flushleft}


\begin{flushleft}
produces:
\end{flushleft}


\begin{flushleft}
{\color {red} Lorem ipsum dolor sit amet, consectetur adipiscing elit.}\\
\end{flushleft}


\begin{flushleft}
\texttt{\textbackslash colorbox\{\}} changes the background colour, in this case to Sea Green:
\end{flushleft}


\begin{flushleft}
\texttt{{\textbackslash colorbox\{SeaGreen\}\{Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet\}\}}}
\end{flushleft}


\begin{flushleft}
produces
\end{flushleft}


\begin{flushleft}
{\colorbox {SeaGreen}{Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet}}
\end{flushleft}


\begin{flushleft}
Both can be changed by specifying the background colour and the text colour:
\end{flushleft}


\begin{flushleft}
\texttt{\textbackslash colorbox\{SkyBlue\}\textbackslash color\{Red\}\{Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet\}}
\end{flushleft}


\begin{flushleft}
produces:
\end{flushleft}


\begin{flushleft}
\colorbox{SkyBlue}{\color{Red} Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet}
\end{flushleft}



\subsection{Special Characters}


The following symbols are used by LaTeX as part of it's programming instructions so require marking up if they are to be placed in a document as text:

\begin{center}
\{ \} \% \& \$ \_ \# \textbackslash \~{} \^{} \\
\end{center}


These and the commands to produce them along with a range of other common symbols are in Table 8.

Quotation marks are produced by using the \texttt{\textasciigrave} and \texttt{\textquotesingle} keys or \texttt{\textbackslash textquoteleft} and \texttt{\textbackslash textquoteright}: \texttt{\textasciigrave Word'} produces `Word'. For double quotes, use two of each or \texttt{\textbackslash textquotedblleft and \textbackslash textquotedblright} : \texttt{\textasciigrave \textasciigrave Word''} produces ``Word''. The \texttt{\textasciigrave} key is located at the top left of the keyboard below the \texttt{esc} key. The \texttt{\textquotesingle} symbol is the usual single quotation mark. The \textquotedbl\ key on the keyboard is not used. Three dashes are available: the hyphen (\texttt{\textminus} produces -: `The syllables of hyphenate are hy-phen-ate') the en dash for ranges (\texttt{\textminus \textminus} produces --: 1939--45)  and the em dash for punctuation (\texttt{\textminus \textminus \textminus} produces ---: `Your profundities --- My truisms'). 


\begin{table}
\begin{center}
\begin{tabular}{llll}
\hline
Symbol & Command & Symbol & Command \\
\hline
\{     &    \texttt{\textbackslash \{ }  &  ---  &  \texttt{\textminus \textminus \textminus or \textbackslash textemdash}  \\
			
\}     &     \texttt{\textbackslash \}}    &   \textasciigrave  &  \small \texttt{\textbackslash asciigrave}  \\
			
\%     &      \texttt{\textbackslash \%}    &   \textasciiacute  & \texttt{\textbackslash textasciiacute}  \\
			
\&     &      \texttt{\textbackslash \& }   &  \textasciibreve  &  \texttt{\textbackslash textasciibreve}  \\
			
\$     &      \texttt{\textbackslash \$ or \textbackslash textdollar}    &  \textbullet  &   \texttt{\textbackslash textbullet}  \\
			
\_     &     \texttt{\textbackslash \_}    &  \textopenbullet  &  \texttt{\textbackslash textopenbullet}  \\
			
\#     &      \texttt{\textbackslash \#}    &  \textellipsis  &  \texttt{\textbackslash textellipsis}  \\
			
\textbackslash   & \texttt{\textbackslash textbackslash}  & \textasteriskcentered  & \texttt{\textbackslash textasteriskcentered}  \\
			
\~{}   &     \texttt{\textbackslash \textasciitilde\{\} }  &  \textdagger  &  \texttt{\textbackslash textdagger} \\
			
\^{}   &      \texttt{\textbackslash \textasciicircum\{\} }  &  \textdaggerdbl  &  \texttt{\textbackslash textdaggerdbl}  \\		
			
\textquoteleft     &     \texttt{\textbackslash textquoteleft or \textasciigrave}  &  \textparagraph  & \texttt{\textbackslash textparagraph}  \\
			
\textquoteright  &  \texttt{\textbackslash textquoteright or \textquotesingle}  & \textsection  & \texttt{\textbackslash textsection}  \\
			
\textquotedblleft  &     \texttt{\textbackslash textquotedblleft or \textasciigrave \textasciigrave}  & \texttildelow & \texttt{\textbackslash texttildelow}  \\
			
\textquotedblright  &    \texttt{\textbackslash textquotedblright or \textquotesingle \textquotesingle}  &  \textasciitilde  & \texttt{\textbackslash textasciitilde}  \\
			
--     &      \texttt{\textminus \textminus or \textbackslash textendash}  &  
\textperiodcentered  & \texttt{\textbackslash textperiodcentered} \\

\textsterling  &  \texttt{\textbackslash textsterling} &  \texteuro  &  \texttt{\textbackslash texteuro} \\

\textcent  &  \texttt{\textbackslash textcent}  & \textyen  &  \texttt{\textbackslash textyen} \\

\textdegree  &  \texttt{\textbackslash textdegree} & \textcelsius  &  \texttt{\textbackslash textcelsius} \\

\textcopyleft  &  \texttt{\textbackslash textcopyleft} & \texttrademark  &  \texttt{\textbackslash texttrademark} \\
  
\texttimes  & \texttt{\textbackslash texttimes} &  \textdiv  & \texttt{\textbackslash textdiv} \\

\textminus  &  \texttt{\textbackslash textminus} &  \textgreater  &  \texttt{\textbackslash textgreater} \\
   
\textless  &  \texttt{\textbackslash textless}  &  \textcopyright  &  \texttt{\textbackslash textcopyright} \\ 
  
\hline
\end{tabular}
\caption{Special characters and some common symbols}
\end{center}
\end{table}			

This list is a very small sample of the symbols available in LaTeX. Scott Pakin maintains `The Comprehensive LaTeX Symbol List' which provides a list of over 18,000 symbols. This list is freely available from \textsc{ctan}. A link is provided in the Reference section.


\subsection{Accents and Non-Latin Glyphs}

Most glyphs that have diacritics in latin alphabets, such as German \"{A} \"{a}; \"{O} \"{o}, \"{U} \"{u}, Spanish \~{n}, Polish \k{A} \k{a}, \'{C} \'{c}, \k{E} \k{e}, \'{N} \'{n}, etc can be represented by using the commands in Table 9. LaTeX also provides non-latin glyphs for the alphabets that have them, such as the German Eszett \ss\ and Scandinavian O-Slash \O\ or \o.\ These can be produced by the commands in Table 10. Table 11 contains commands for some punctuation marks such as the guillemots, Spanish \textexclamdown\ and \textquestiondown\ and base quotes \quotedblbase.\ Some of these glyphs combine with the following word automatically so it can be challenging to represent them as single letters if this is required. The code \texttt{\textbackslash ss is a German letter} might compile as `\ss is a German letter'. This may be fixed by inserting a \texttt{\textbackslash} after \texttt{\textbackslash ss}: \texttt{\textbackslash ss\textbackslash\ is a German letter} compiles as `\ss\ is a German letter'.  

\begin{table}
\small
\begin{center}
\begin{tabular}{lll}
\hline
Diacritic          & Code                          & Example         \\
\hline
Acute             & \texttt{\textbackslash \'{}\{\}}  & {\Large \'{a}}  \\
Breve             & \texttt{\textbackslash u\{\}}  & {\Large \u{a}}  \\
Caron / Ha\v{c}ek & \texttt{\textbackslash v\{\}}  & {\Large \v{a}}  \\
Cedilla           & \texttt{\textbackslash c\{\}}  & {\Large \c{a}}  \\
Circumflex        & \texttt{\textbackslash \^{}\{\}} & {\Large \^{a}} \\
Dot               & \texttt{\textbackslash .\{\}}  & {\Large \.{a}}  \\
Grave             & \texttt{\textbackslash \textquotesingle\{\}}  & {\Large \`{a}}  \\
Hungarian Umlaut  & \texttt{\textbackslash  H\{\}} & {\Large \H{o}}  \\
Macron            & \texttt{\textbackslash =\{\}}  & {\Large \={a}}  \\
Ogonek            & \texttt{\textbackslash k\{\}}  & {\large \k{a}}  \\
Tilde             & \texttt{\textbackslash $\sim$\{\}}  & {\Large \~{a}}  \\
Umlaut            & \texttt{\textbackslash "\{\}}  & {\Large \"{a}}  \\
\hline
\end{tabular}
\caption{Common diacritics}
\end{center}
\end{table}


\begin{table}
\small
\begin{center}
\begin{tabular}{lll}
\hline
Name &            Upper Case & Lower Case \\
\hline
\textbf{German} & & \\
Eszett          & & \texttt{\textbackslash ss} \ss  \\
& & \\
\textbf{Polish} & & \\
Barred L       & \texttt{\textbackslash L}     \L     &  \texttt{\textbackslash l}     \l \\
& &  \\
\textbf{Scandinavian}    & &\\
Ash      & \texttt{\textbackslash AE}          \AE    & \texttt{\textbackslash ae}     \ae   \\
Eth      & \texttt{\textbackslash dh}          \DH    & \texttt{\textbackslash dh}     \dh   \\
OE ligature & \texttt{\textbackslash OE}       \OE    & \texttt{\textbackslash oe}     \oe   \\
O-Slash  & \texttt{\textbackslash O}           \O     & \texttt{\textbackslash o}      \o    \\
Ring-A   & \texttt{\textbackslash r\{A\}}      \r{A}  & \texttt{\textbackslash r\{a\}} \r{a} \\
Thorn    & \texttt{\textbackslash TH}          \TH    & \texttt{\textbackslash th}     \th   \\
\hline
\end{tabular}
\caption{Some non-latin alphabetical glyphs}
\end{center}
\end{table}


\begin{table}
\small
\begin{center}
\begin{tabular}{lll}
\hline
Name                    & Symbol            & Command \\
\hline
Double Guillemot: Left  & \guillemetleft    & \texttt{\textbackslash guillemetleft}    \\ 
Double Guillemot: Right & \guillemetright   & \texttt{\textbackslash guillemetright}   \\
Single Guillemot: Left  & \guilsinglleft    & \texttt{\textbackslash guilsinglleft}    \\
Single Guillemot: Right & \guilsinglright   & \texttt{\textbackslash guilsinglright}   \\
Exclamation Down        & \textexclamdown   & \texttt{\textbackslash textexclamdown}   \\
Question Mark Down      & \textquestiondown & \texttt{\textbackslash textquestiondown} \\
Base quote: Double      & \quotedblbase     & \texttt{\textbackslash quotedblbase}     \\
Base Quote: Single      & \quotesinglbase   & \texttt{\textbackslash quotesinglbase}   \\
Elipsis                 & \textellipsis     & \texttt{\textbackslash textellipsis}     \\
\hline
\end{tabular}
\caption{Punctuation marks}
\end{center}
\end{table}


\clearpage


\section{Body}


\subsection{Sectioning}

Sectioning is the division of a document into parts, chapters, sections, subsections, subsubsections, paragraphs, and subparagraphs. These divisions are available for all LaTeX document classes, apart from letter. Chapters are not available for article class documents. Sectioning commands have the same format as text formatting commands: \texttt{\textbackslash SectionType\{SectionTitle\}}. LaTeX numbers them automatically and the text of the \texttt{SectionTitle} will appear in the Table of Contents. The following creates two sections, each with two subsections:


\begin{flushleft}
\texttt{\textbackslash section\{Section 1\}} \\
\texttt{\textbackslash subsection\{1A\}} \\
\texttt{\textbackslash subsection\{1B\}} \\

\texttt{\textbackslash section\{Section 2\}} \\
\texttt{\textbackslash subsection\{2A\}} \\
\texttt{\textbackslash subsection\{2B\}} \\
\end{flushleft}


\subsection{Environments}

Environments are used in the body of the document to define a particular behaviour. These range from abstracts, tables, and figures, lists and sections of text with differing justification. LaTeX environments are enclosed with \texttt{\textbackslash begin\{EnvironmentName\}} and \texttt{\textbackslash end\{EnvironmentName\}}. A short list of environments is in Table 12:

\begin{flushleft}
\texttt{\textbackslash begin\{EnvironmentName\} \\
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla est purus, ultrices in porttitor in, accumsan non quam. Nam consectetur porttitor rhoncus.\\
\textbackslash end\{EnvironmentName\} \\}
\end{flushleft}

\begin{table}
\small
\begin{center}
\begin{tabular}{ll}
\hline
Environment & Description\\
\hline
abstract    & Text of a document’s abstract. \\
centre      & Centred text. \\
flushleft   & Left aligned text. \\
flushright  & Right aligned text. \\
description & Labelled lists. \\
enumerate   & Numbered lists. \\
itemize     & Bulleted lists. \\
quotation   & Include quotes. \\
verbatim    & Text in typewriter font that that will appear exactly as typed. \\
table       & Floating tables. \\
figure      & Floating figures. \\
\hline
\end{tabular}
\caption{Environment options}
\end{center}
\end{table}


The verbatim environment prints the entered text in a typewriter font with no formatting. If the text isn't broken with a \texttt{<return>}, it produces text in one long line which may run across the page, into the right-hand margin and then off the page entirely. The first 100 digits of $\pi$ may appear on your editor as


\begin{verbatim}
The first 100 digits of pi:
3.14159265358979323846264338327950288419716939937510582097494459
23078164062862089986280348253421170679
\end{verbatim}


\begin{flushleft}
but when the document is compiled, it produces:
\end{flushleft}

\begin{verbatim}
The first 100 digits of pi:
3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
\end{verbatim}

This can be fixed by breaking the text into lengths that don't cross into the margins. In this example, it is broken into 25-digit sections with a \textbackslash \textbackslash to signal the end of a line: 


\begin{verbatim}
The first 100 digits of pi: \\
3.141592653589793238462643  \\
38327950288419716939937510  \\
58209749445923078164062862  \\
089986280348253421170679    \\
\end{verbatim}


\begin{flushleft}
This produces:
\end{flushleft}

\begin{flushleft}
The first 100 digits of pi: \\
3.141592653589793238462643 \\
38327950288419716939937510 \\
58209749445923078164062862 \\
089986280348253421170679 \\
\end{flushleft}



\subsection{Lists}

Lists may be bulleted or numbered and are created with the \texttt{itemize} and \texttt{enumerate} environments respectively. List items are specified with \texttt{\textbackslash item Item Text}. For a bulleted list:


\begin{flushleft}
\texttt{\textbackslash begin\{itemize\} \\
\textbackslash item Item 1 \\
\textbackslash item Item 2 \\
\textbackslash item Item 3 \\
\textbackslash end\{itemize\}}
\end{flushleft}

\begin{flushleft}
produces:
\end{flushleft}

\begin{itemize}
\item Item 1
\item Item 2
\item Item 3
\end{itemize}


The symbol denoting each item in a bulleted list can be changed by adding an option after each \texttt{\textbackslash item} command in square brackets:

\begin{flushleft}
\texttt{\textbackslash begin\{itemize\} \\
\textbackslash item[--] Item 1 \\
\textbackslash item[\textbackslash textasteriskcentered] Item 2 \\
\textbackslash item[\textbackslash textdagger] Item 3 \\
\textbackslash end\{itemize\}}
\end{flushleft}

\begin{flushleft}
produces:
\end{flushleft}

\begin{itemize}
\item[--] Item 1
\item[\textasteriskcentered] Item 2
\item[\textdagger] Item 3
\end{itemize}


Numbered lists are created by the enumerate environment:

\begin{flushleft}
\texttt{\textbackslash begin\{enumerate\} \\
\textbackslash item Item 1 \\
\textbackslash item Item 2 \\
\textbackslash item Item 3 \\
\textbackslash end\{enumerate\} \\}
\end{flushleft}

\begin{flushleft}
produces:
\end{flushleft}

\begin{enumerate}
\item Item 1
\item Item 2
\item Item 3
\end{enumerate}



Lists can be nested with additional enumerate commands. Each sub-category is contained within its own enumerate environment.


\begin{flushleft}
\texttt{\textbackslash begin\{enumerate\} \\
\textbackslash item Item 1 \\
\textbackslash begin\{enumerate\} \\
\textbackslash item Item A \\
\textbackslash item Item B \\
\textbackslash item item C \\
\textbackslash end\{enumerate\} \\
\textbackslash item Item 2 \\
\textbackslash item Item 3 \\
\textbackslash end\{enumerate\} \\}
\end{flushleft}


\begin{flushleft}
produces:
\end{flushleft}


\begin{enumerate}
\item Item 1
\begin{enumerate}
\item Item A
\item Item B
\item Item C
\end{enumerate}
\item Item 2
\item Item 3
\end{enumerate}





\subsection{Tables and Figures}

Tables and figures are placed inside their own environments. LaTeX places them so that they don’t break across pages. Because their location can vary from the location specified by typesetters, they are referred to as floats. Using \texttt{\textbackslash clearpage} at the end of each section places any outstanding floats at the end of the section before the new one starts.



\subsubsection{Tables}
Tables are placed within the \texttt{table} environment. A caption can be added with \texttt{\textbackslash caption \{Caption Text\}} just before \texttt{\textbackslash end\{table\}} so that it appears below the table. LaTeX numbers them automatically and the caption will appear in the List of Tables. 

Tables consist of three nested environments: \texttt{table}, \texttt{table alignment} and \texttt{tabular}. After \texttt{\textbackslash begin\{table\}}, comes the table’s alignment on the page. This can be \texttt{centre}, \texttt{flushleft} or \texttt{flushright}. The table's contents and formatting instructions are contained in the \texttt{tabular} environment. Instructions relating to the number of columns, their alignment and if there are vertical lines separating the columns are on the same line as \texttt{\textbackslash begin\{tabular\}} in curly braces. The alignment commands are \texttt{l} = left aligned, \texttt{c} = centred and \texttt{r} = right aligned. Vertical lines are added with a \texttt{|}. This key is located on the keyboard below \texttt{backspace}. 

The code below shows the three nesting levels for a table with four columns with column 1 left aligned, columns two and three centred and column 4 right aligned. Vertical lines separate columns 1--2, 2--3 and 3--4.  


\begin{flushleft}
\texttt{\textbackslash begin\{table\} }\\
\texttt{\textbackslash begin\{center\}} \\
\texttt{\textbackslash begin\{tabular\}{l|c|c|r}} \\
\bigskip		
\texttt{. . . Table Contents . . . }\\
\bigskip
\texttt{\textbackslash end\{tabular\}} \\	
\texttt{\textbackslash caption\{Caption text\}} \\
\texttt{\textbackslash end\{center\}} \\
\texttt{\textbackslash end\{table\}} \\
\end{flushleft}


The data for the table is placed inside the \texttt{tabular} environment. Each cell is separated with an \texttt{\&} and the end of each row is specified with \texttt{\textbackslash \textbackslash}. The following example creates a table with four columns and four rows. The first row contains the column headings with horizontal lines above and below it with another horizontal line at the bottom of the table. These lines are added with \texttt{\textbackslash hline}. Table 13 shows the compiled output.


\begin{flushleft}
\texttt{\textbackslash begin\{table\}} \\
\texttt{\textbackslash begin\{center\}} \\
\texttt{\textbackslash begin\{tabular\}\{l|c|c|r\}} \\
\texttt{\textbackslash hline} \\
\texttt{Column 1 \& Column 2 \& Column 3 \& Column 4 \textbackslash \textbackslash} \\
\texttt{\textbackslash hline} \\
\texttt{Row 1 \& Text 2 \& Text 3 \& 3.157 \textbackslash \textbackslash} \\
\texttt{Row 2 \& Text 2 \& Text 3 \& 14.930 \textbackslash \textbackslash} \\
\texttt{Row 3 \& Text 2 \& Text 3 \& 0.720 \textbackslash \textbackslash} \\
\texttt{\textbackslash hline} \\
\texttt{\textbackslash end\{tabular\}} \\
\texttt{\textbackslash caption\{Example Table.\}} \\
\texttt{\textbackslash end\{center\}} \\
\texttt{\textbackslash end\{table\}} \\
\end{flushleft}





\begin{table}
\small
\begin{center}
\begin{tabular}{l|c|c|r}
\hline
Column 1 & Column 2 & Column 3 & Column 4 \\
\hline
Row 1 & Text 2 & Text 3 & 3.157 \\
Row 2 & Text 2 & Text 3 & 14.930 \\
Row 3 & Text 2 & Text 3 & 0.720 \\
\hline
\end{tabular}
\caption{Sample table}
\end{center}
\end{table}


\subsubsection{Figures}

The first step in importing graphic files is to place the file in the project directory so that LaTeX can find it. Graphics are placed within documents inside the \texttt{figure} environment. The placement of the figure on the page can be: \texttt{centre}, \texttt{flushleft} or \texttt{flushright}. 

The code below loads a graphic file named \texttt{Drawing} as a centred graphic in the \texttt{figure} environment with a caption. The caption text will appear as the figure title in the List of Figures in the front matter. \texttt{\textbackslash includegraphics\{\}} tells LaTeX the name of the graphic file to load and \texttt{scale} specifies whether to reduce or enlarge: 1.0 is original size, 0.5 is half size and 2.0 is double. In this case, the file size is reduced to 50\% of the original which is about 10cm square.
 

\begin{flushleft}
\texttt{\textbackslash begin\{figure\}} \\
\texttt{\textbackslash center} \\
\texttt{\textbackslash includegraphics[scale=0.5]\{Drawing.pdf\}} \\
\texttt{\textbackslash caption\{Spiral\}} \\
\texttt{\textbackslash end\{figure\}} \\
\end{flushleft}


\begin{flushleft}
produces:
\end{flushleft}


\begin{figure}
\center
\includegraphics[scale=0.5]{Drawing.eps}
\caption{Spiral}
\end{figure}


LaTeX works with a quite limited range of graphic formats. Documents in postscript format can only contain graphics in postscript (\texttt{ps}) or encapsulated postscript (\texttt{eps}) formats. These are vector formats. Postscript is the `gold standard' for printed documents but unfortunately, postscript only works with whole pages. \texttt{eps} works with graphics of any size so this is the preferred format for graphics that are smaller than this. Documents in \textsc{pdf} format created by \textsc{pdf}LaTeX can contain graphics in \texttt{pdf}, \texttt{png}, \texttt{jpeg} or \texttt{jbig2} formats. If the file is in a different format, it will have to be converted to one of these. 

There are two types of graphic formats: vector and raster. Vector formats, such as postscript (\texttt{ps}), encapsulated postscript (\texttt{eps}) and Portable Document Format (\texttt{pdf}), are based on geometric concepts such as points, lines, and curves. Vector format file sizes are relatively small because the file contains only the instructions for the points, lines and curves that make up the graphic. It is most often used for line art, such as diagrams, graphs, 3D models, etc. It has the advantage that it can be upsampled or downsampled (enlarged or shrunk) without any loss of quality. 

Raster graphics are made up of pixels. Each pixel has a value relating to its individual colour attached to it. They are produced by digital cameras, scanners, etc and the file sizes are relatively large. These formats cannot be manipulated, that is resized, rotated, etc without losing information which lowers quality. Any image processing should be completed before they are inserted into a document and the image sized to the dimensions that it will be printed at.

If the document is to be printed professionally and it includes raster graphics, it is worth consulting the printers for their requirements. This may include specific file formats, resolution, which is often 300ppi, a colour space, often cmyk or rgb, and colour depth which may be restricted to 8bit. 


\clearpage


\subsection{Page Numbering}
The default page numbering in LaTeX is Arabic numerals which begin on the first page. Table 14 shows the available styles: 


\begin{table}
\small
\begin{center}
\begin{tabular}{lll}
\hline
Style  &  Numeral Type  &  Example Text \\
\hline
\texttt{arabic}  &  Arabic numerals            &  1, 2, 3, 4, 5      \\
\texttt{roman}   &  Lower-case Roman numerals  &  i, ii, iii, iv, v  \\
\texttt{Roman}   &  Upper-case Roman numerals  &  I, II, III, IV, V  \\
\texttt{alph}    &  Lower-case letters         &  a, b, c, d, e, f   \\
\texttt{Alph}    &  Upper-case letters         &  A, B, C, D, E, F   \\
\hline
\end{tabular}
\caption{Page numbering options}
\end{center}
\end{table}




If the page numbering for the document is to be other than arabic, it can be specified after \texttt{\textbackslash begin\{document\}} with \texttt{\textbackslash pagenumbering\{StyleName\}}:

\begin{flushleft}
\texttt{\textbackslash documentclass[a4paper]\{article\}} \\
\bigskip
\texttt{. . . \\}
\bigskip
\texttt{\textbackslash begin\{document\}} \\	
\texttt{\textbackslash pagenumbering\{StyleName\}} \\
\bigskip
\texttt{Document Text} \\
\bigskip
\texttt{\textbackslash end\{document\}} \\
\end{flushleft}

It is possible to have two styles in a document, for instance lower case Roman numerals for the front matter including the index, Table of Contents, List of Figures, etc, and Arabic numerals for the remainder of the text. 

This is handled with \texttt{\textbackslash pagenumbering\{StyleName\}}. At the beginning of the front matter, insert \texttt{\textbackslash pagenumbering\{roman\}} and when the main matter of the document begins, insert \texttt{\textbackslash pagenumbering\{arabic\}}. If the title page is to be un-numbered, insert \texttt{\textbackslash thispagestyle\{empty\}} following \texttt{\textbackslash maketitle}.  

The following creates an article class document with an un-numbered title page containing an abstract, a Table of Contents, List of Figures and List of Tables on separate pages with Roman numerals and the body text in Arabic numerals.

\begin{flushleft}
\texttt{\textbackslash documentclass[a4paper]\{article\}} \\
\texttt{\textbackslash title\{The Lost Secrets of \textbackslash LaTeXe\}} \\
\texttt{\textbackslash author\{Anonymous\}} \\

\texttt{\textbackslash begin\{document\}} \\
\texttt{\textbackslash maketitle} \\
\texttt{\textbackslash thispagestyle\{empty\}} \\
\texttt{\textbackslash begin\{abstract\}} \\
\texttt{Abstract text.} \\
\texttt{\textbackslash end\{abstract\}} \\
\texttt{\textbackslash clearpage} \\
\texttt{\textbackslash pagenumbering\{roman\}} \\
\texttt{\textbackslash tableofcontents} \\
\texttt{\textbackslash clearpage} \\
\texttt{\textbackslash listoffigures} \\
\texttt{\textbackslash clearpage} \\
\texttt{\textbackslash listoftables} \\
\texttt{\textbackslash clearpage} \\
\texttt{\textbackslash pagenumbering\{arabic\}} \\

\texttt{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla est purus, ultrices in porttitor in, accumsan non quam. Nam consectetur porttitor rhoncus . . . } \\

\texttt{\textbackslash end\{document\}} \\
\end{flushleft}

To change the page numbering counter, use \texttt{\textbackslash setcounter\{page\}\{PageNumber\}}. 

\begin{flushleft}
\texttt{\textbackslash pagenumbering\{arabic\}} \\
\texttt{\textbackslash setcounter\{page\}\{5\}} \\
\end{flushleft}

This changes the page numbering to Arabic and begins the page count at page 5.


\clearpage


\section{Mathematics in LaTeX}

One of LaTeX’s strengths is its facilities for mathematical equations. This is done by either activating math mode, or by using the \texttt{equation} or \texttt{displaymath} environments. 

Math mode is activated by enclosing a mathematical expression within a pair of \texttt{\$}. This is especially useful when an equation is set within text such as when you need to include mathematics, such as the results of a statistical test, in a report:


\begin{flushleft}
\texttt{... main effect for the interaction between the factors was significant \$(F(2,125) = 3.146, p < 0.05, \textbackslash omega\^{}2 = 0.032)\$, though the practical significance ...}
\end{flushleft}


\begin{flushleft}
produces
\end{flushleft}


\begin{flushleft}
. . . main effect for the interaction between the factors was significant $(F(2,125) = 3.146, p < 0.05, \omega^2 = 0.032)$, though the practical significance . . .
\end{flushleft}

\texttt{\^{}} and \texttt{\_} produce superscripts and subscripts respectively, and fractions can be typeset with \texttt{\$\textbackslash frac\{Numerator\}\{Denominator\}\$}. Three quarters is \texttt{\$\textbackslash frac\{3\}\{4\}\$}: $\frac{3}{4}$ and square roots are \texttt{\$\textbackslash sqrt\{16\}\$}: $\sqrt{16}$. Special characters can be created with diacritics: \texttt{\$\textbackslash bar\{X\}\$} produces $\bar{X}$ and \texttt{\$\textbackslash hat\{Y\}\$} produces $\hat{Y}$. 

Summation notation is available with the \texttt{\$\textbackslash sum\$} command which produces the Greek letter $\sum$. The \texttt{\textbackslash limits} command places upper and lower limits. The lower limit of summation is defined with a subscript and the upper limit of summation is defined with a superscript: \texttt{\$\textbackslash sum \textbackslash limits\_\{i=1\}\^{}\{n\}\$} produces $\sum\limits_{i=1}^{n}$. Elements can be added with \texttt{\$x\_i = x\_1 + x\_2 + x\_3 \textbackslash ldots x\_n\$}. This produces

\begin{displaymath}
\sum\limits_{i=1}^{n}x_i = x_1 + x_2 + x_3 \ldots x_n
\end{displaymath}

Some common mathematical symbols and the commands to produce them are shown in Table 15. LaTeX comes with Greek letters in upper and lowercase fonts. It provides all the lower-case letters and some of the upper-case letters. Pakin (2021) recommends that upper case Latin glyphs be used for the missing Greek upper-case letters. A list of these and their commands are in Table 16. 


\begin{table}
\begin{center}
\begin{tabular}{ll}
\hline
$a \times b + c - d \div e$  &  \texttt{a \textbackslash times b + c - d \textbackslash div e} \\
$a < b > c$                  &  \texttt{a < b > c}  \\	
$a^2 + b^2 = c^2$            &  \texttt{a\^{}2 + b\^{}2 = c\^{}2} \\                                           
$y - y_1 = m(x - x_1)$       &  \texttt{y - y\_1 = m(x - x\_1)}  \\
$f'$                         &  \texttt{f'} \\  
$n!$                         &  \texttt{n!} \\             
$\frac{a}{b}$                &  \texttt{\textbackslash frac\{a\}\{b\}} \\ 
$a \choose b$                &  \texttt{a \textbackslash choose b} \\
$\sqrt a$                    &  \texttt{\textbackslash sqrt a} \\                         
$\root n \of {a}$            &  \texttt{\textbackslash root n \textbackslash of \{a\}}  \\     
$\overbrace{abc}$            &  \texttt{\textbackslash overbrace\{\}} \\                         
$\underbrace{abc}$           &  \texttt{\textbackslash underbrace\{\}} \\ 	
$\sum$                       & 	\texttt{\textbackslash sum} \\ 	
$\sum\limits_{i=0}^{\infty}$   &  \texttt{\textbackslash sum \textbackslash limits \_\{i=0\}\{\textbackslash infty\} }\\ 
\hline
\end{tabular}
\caption{Some common mathematical symbols}
\end{center}
\end{table}



\begin{table}
\begin{center}
\begin{tabular}{llllllllll}
\hline
$\Gamma$  &  \texttt{\textbackslash Gamma}  &  $\Delta$ &  \texttt{\textbackslash Delta}  &  $\Theta$ &  \texttt{\textbackslash Theta}  &  $\Lambda$  &  \texttt{\textbackslash Lambda}  &  $\Xi$    &  \texttt{\textbackslash Xi}  \\
			
$\Pi$  &  \texttt{\textbackslash Pi}  &  $\Sigma$    &  \texttt{\textbackslash Sigma}  &  $\Upsilon$  &  \texttt{\textbackslash Upsilon}  &  $\Phi$    &  \texttt{\textbackslash Phi}  &  $\Psi$    &  \texttt{\textbackslash Psi}  \\
			
$\Omega$    &  \texttt{\textbackslash Omega}  \\
			
$\alpha$ &  \texttt{\textbackslash alpha}  &	$\beta$  &  \texttt{\textbackslash beta}  &  $\gamma$  &  \texttt{\textbackslash gamma}  &  $\delta$  &  \texttt{\textbackslash delta}	 &  $\epsilon$  &  \texttt{\textbackslash epsilon}	\\
			
$\zeta$ &  \texttt{\textbackslash zeta}  &  $\eta$  &  \texttt{\textbackslash eta}  &  $\theta$  &  \texttt{\textbackslash theta}  &  $\iota$  &  \texttt{\textbackslash iota}  &  $\kappa$  &  \texttt{\textbackslash kappa}  \\
			
$\lambda$  &  \texttt{\textbackslash lambda}  & 	$\mu$  &  \texttt{\textbackslash mu}  &		$\nu$&  \texttt{\textbackslash nu}  &	$\xi$&  \texttt{\textbackslash xi}  &	$\pi$&  \texttt{\textbackslash pi}  \\	
			
$\rho$  &  \texttt{\textbackslash rho}  &  $\sigma$  &  \texttt{\textbackslash sigma}  &  $\tau$  &  \texttt{\textbackslash tau}  &  $\upsilon$  &  \texttt{\textbackslash upsilon}  &  $\phi$  &  \texttt{\textbackslash phi}  \\
			
$\chi$  &  \texttt{\textbackslash chi}  &  $\psi$   &  \texttt{\textbackslash psi}  &  $\omega$   &  \texttt{\textbackslash omega}  \\

\hline
\end{tabular}
\caption{Upper and lowercase Greek letters}
\end{center}
\end{table}


Both \texttt{equation} and \texttt{displaymath} environments print one-line equations. The difference between them is that formulae set with \texttt{equation} are numbered:


\begin{flushleft}
\texttt{\textbackslash begin\{equation\}} \\
\texttt{\textbackslash bar\{X\} = \textbackslash frac\{\textbackslash Sigma X\}\{n\}} \\
\texttt{\textbackslash end\{equation\}} \\
\end{flushleft}


\begin{equation}
\bar{X} = \frac{\Sigma X}{n}
\end{equation}



\begin{flushleft}
\texttt{\textbackslash begin\{displaymath\}} \\
\texttt{\textbackslash bar\{X\} = \textbackslash frac\{\textbackslash Sigma X\}\{n\}} \\
\texttt{\textbackslash end\{displaymath\}} \\
\end{flushleft}



\begin{displaymath}
\bar{X} = \frac{\Sigma X}{n}
\end{displaymath}

This is a very short preview of LaTeX's mathematical capabilities. It has extensive facilities for matrices and functions and symbols and diacritics. For documentation on mathematics and symbols in LaTeX, see Berry (2021) and for a comprehensive list of symbols, see Pakin (2021).


\clearpage


\section{Front Matter}

\subsection{Title Pages}

Title pages are defined in the final part of the preamble with \texttt{\textbackslash title\{\}}, \texttt{\textbackslash author\{\}} and \texttt{\textbackslash date\{\}}. The current date can be placed inside \texttt{\textbackslash date\{\}} with \texttt{\textbackslash today}, or a date can be entered manually. The title page is created with \texttt{\textbackslash maketitle} which follows \texttt{\textbackslash begin\{document\}}:

\begin{flushleft}
\texttt{\textbackslash documentclass[a4paper]\{article\}} \\

\texttt{\textbackslash title\{The Lost Secrets of \textbackslash LaTeXe\}} \\
\texttt{\textbackslash author\{Herodotus\}} \\
\texttt{\textbackslash date\{\textbackslash today\}} \\

\texttt{\textbackslash begin\{document\}} \\
\texttt{\textbackslash maketitle} \\

\texttt{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla est purus, ultrices in porttitor in, accumsan non quam. Nam consectetur porttitor rhoncus . . . }

\texttt{\textbackslash end\{document\}} 
\end{flushleft}


\subsection{The Abstract}

Abstracts are created by the abstract environment:

\begin{flushleft}
\texttt{\textbackslash begin\{abstract\}} \\
	
\texttt{Lorem ipsum dolor sit amet . . .  }

\texttt{\textbackslash end\{abstract\}} \\
\end{flushleft}


The abstract can appear on the title page or on a page of its own by inserting pagebreaks following \texttt{\textbackslash maketitle} and after the end of the abstract environment. This example places the abstract on a page of its own after the title page: 


\begin{flushleft}
\texttt{\textbackslash documentclass[a4paper]\{article\}} \\

\texttt{\textbackslash title\{The Lost Secrets of \textbackslash LaTeXe\}} \\
\texttt{\textbackslash author\{Herodotus\}} \\
\texttt{\textbackslash date\{\textbackslash today\}} \\

\texttt{\textbackslash begin\{document\}} \\
\texttt{\textbackslash maketitle }\\
\texttt{\textbackslash clearpage}  \\
\texttt{\textbackslash begin\{abstract\}} \\
\texttt{Lorem ipsum dolor sit amet . . .}  \\
\texttt{\textbackslash end\{abstract\}} \\

\texttt{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla est purus, ultrices in porttitor in, accumsan non quam. Nam consectetur porttitor rhoncus . . . }


\texttt{\textbackslash end\{document\}} \\ 
\end{flushleft}



\subsection{Table of Contents, List of Figures and List of Tables.}

The Table of Contents, List of Figures and List of Tables are inserted with:

\begin{flushleft}
\texttt{\textbackslash tableofcontents} \\

\texttt{\textbackslash listoffigures} \\

\texttt{\textbackslash listoftables} \\
\end{flushleft}

A page break after each command will place them on separate pages. LaTeX will generate these automatically and number them when the document is compiled from the sectioning commands and the figure and table captions. 

The following creates a document with a title page containing the title and abstract, a Table of Contents, List of Figures and List of Tables. These are placed on separate pages and numbered in Roman numerals, with the body of the text in Arabic numerals. It is double spaced with a ragged right margin. Page breaks are specified with \texttt{\textbackslash clearpage}:

\begin{flushleft}
\texttt{\textbackslash documentclass[a4paper]\{article\}} \\

\texttt{\textbackslash title\{The Lost Secrets of \textbackslash LaTeXe\}} \\
\texttt{\textbackslash author\{Herodotus\}} \\
\texttt{\textbackslash date\{\textbackslash today\}} \\

\texttt{\textbackslash begin\{document\}} \\
\texttt{\textbackslash maketitle} \\
\texttt{\textbackslash doublespacing} \\

\texttt{\textbackslash begin\{abstract\}} \\

\texttt{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla est purus, ultrices in porttitor in, accumsan non quam. Nam consectetur porttitor rhoncus . . . }

\texttt{\textbackslash end\{abstract\}} \\
\texttt{\textbackslash thispagestyle\{empty\}} \\
\texttt{\textbackslash clearpage} \\
\texttt{\textbackslash pagenumbering\{roman\}} \\
\texttt{\textbackslash tableofcontents} \\
\texttt{\textbackslash clearpage} \\
\texttt{\textbackslash listoffigures} \\
\texttt{\textbackslash clearpage} \\
\texttt{\textbackslash listoftables} \\
\texttt{\textbackslash clearpage} \\
\texttt{\textbackslash pagenumbering\{arabic\}} \\

\texttt{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla est purus, ultrices in porttitor in, accumsan non quam. Nam consectetur porttitor rhoncus . . . }

\texttt{\textbackslash end\{document\}} \\

\end{flushleft}


\clearpage


\section{End Matter}


\subsection{References}
A reference list allows readers to verify sources used by scholars, gives information about the type of source, and allows readers to locate them. Referencing is a fundamental requirement of scholarly writing. In LaTeX, these may be placed in the text manually or generated automatically. 


\subsubsection{The Olde Fashioned Way}
References can be inserted into a document manually for referencing systems such as MLA, Chicago, Vancouver, and APA styles. A reference list can be added in the appropriate place in the document with \texttt{\textbackslash section\{title\}} command, and the references listed below this manually. Footnotes can be created by placing a \texttt{\textbackslash footnote\{Your Text\}} at the appropriate location in the text. When the document is compiled, the location is numbered with a superscript, and \texttt{Your Text} appears at the bottom of the page. Doing this by hand can be quite laborious and painstaking but it has the advantage that it will match any style requirement.


\subsubsection{Automatically Generated References: Bib\LaTeX}
LaTeX has facilities to generate references and reference lists automatically. BibLaTeX is a modern package for managing references and a wide range of packages with reference styles are available for it from \textsc{ctan}.

BibLaTeX requires that several packages be present on your LaTeX installation. Not all of them may be present so it is worth checking. These are: \texttt{e-TeX}, \texttt{etoolbox}, \texttt{kvoptions}, \texttt{logreq}, \texttt{pdftexcmds v0.27 or above}, \texttt{keyval}, \texttt{ifthen}, \texttt{url}, \texttt{xpatch}. Recommended packages are \texttt{babel v3.9r or above}, or \texttt{polyglossia} and \texttt{csquotes}. These recommended packages provide facilities for languages other than American English and should be loaded before \texttt{biblatex}. \texttt{biber} is also required as this processes and sorts the reference list during the document's compilation. 

The first step in using LaTeX's automated reference system is to create a reference database for the project. This contains a list of primary, secondary, and tertiary sources used in the document in \texttt{.bib} format and is saved to the project directory so that LaTeX can find it when the document is compiled. LaTeX's format for entries for books and articles is this:

\begin{verbatim}
	@book{Paper10,
		author = {A Paper and F Pen and B L K Ink},
		title = {Our Book},
		publisher = {First Authors Press},
		year = {2010},
		address = {Booktown} 
	}
	
	@article{Kliker12,
		author = {G Kliker and L Flash},
		title = {Photographing Critics},
		Journal = {The Journal of Critical Photography},
		Year = {2012},
		Volume = {12},
		pages = {50-60}
	}
\end{verbatim}

The standard reference types are \texttt{article}, \texttt{book}, \texttt{booklet}, \texttt{conference}, \texttt{inbook}, \texttt{incollection}, \texttt{inproceedings}, \texttt{manual}, \texttt{mastersthesis}, \texttt{misc}, \texttt{phdthesis}, \texttt{proceedings}, \texttt{techreport} and \texttt{unpublished}. This list is saved in \texttt{.bib} format. 

All bibliographical entries contain a unique key. This is contained in the first line. It can be anything, but the first author's surname and year of publication is memorable. If the database contains more than one publication by the same author(s) in the same year, they can be uniquely identified by adding a letter: Paper10a, Paper10b, Paper10c. This key is used to identify specific entries in the bibliography for use as identifiers in the text when automatic citation generators are used. 

A short list of common referencing styles and their packages is listed in Table 17. These can be installed if they are missing with LaTeX's Console. Additional information on these styles including limitations and incompatibilities is available in each package's documentation. 

\begin{table}
\small
\begin{center}
\begin{tabular}{ll}
\hline
Reference Style   & Package Name \\
\hline
American Psychological Association, 7th Edition              &  \texttt{biblatex-apa}      \\  
Chicago Manual of Style, 17th Edition                        &  \texttt{biblatex-chicago}  \\
MLA Handbook for Writers of Research Papers, 9th Edition     &  \texttt{biblatex-mla}      \\
Vancouver Style                                              &  \texttt{vancouver}         \\
\hline
\end{tabular}
\caption{BibLaTeX citations styles}
\end{center}
\end{table}


\texttt{biblatex} is loaded in the preamble along with the required citation style and the name of the reference database. Required packages that are not automatically loaded, such as \texttt{babel} and \texttt{csquotes}, should be loaded with \texttt{\textbackslash usepackage{}} prior to \texttt{biblatex}. The required style is specified as an option in square brackets:


\begin{flushleft}
\texttt{\textbackslash usepackage[style=apa]{biblatex}} 
\end{flushleft}


\begin{flushleft}
loads the American Psychological Association, 7th Edition style. \texttt{vancouver} loads the Vancouver style and \texttt{mla} loads the MLA style. There is no need to use the entire package name.
\end{flushleft} 

The code below loads \texttt{biblatex}, specifies the name of the reference database with \texttt{\textbackslash addbibresource\{Databasename.bib\}} and places the reference list on a new page:


\begin{verbatim}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=CitationStyle]{biblatex}
\addbibresource{DatabaseName.bib}
\begin{document}
	
Document Text.
	
\clearpage	
\nocite{*}
\printbibliography
\end{document}
\end{verbatim}


The \texttt{biblatex-chicago} style package is an exception to this. This package is loaded in place of \texttt{biblatex}, and the format is defined in options. This can be any of BibLaTeX's standard formats: \texttt{numeric}, \texttt{alphabetic}, \texttt{authordate} and \texttt{authortitle}. The following loads \texttt{biblatex-chicago} with the \texttt{authordate} option:


\begin{verbatim}
\usepackage[authordate]{biblatex-chicago}
\end{verbatim}


The reference list is placed inside the document environment at the desired location in the text with \texttt{\textbackslash printbibliography}. An optional command is \texttt{\textbackslash nocite\{\}}. This allows items that have not been explicitly referred to in the text, but are in the bibliographical database, to be included in the reference list. To include a specific item, it's unique key should be placed inside the curly brackets: \texttt{\textbackslash nocite\{ItemKey\}}. To include all the items in the bibliography, use a \texttt{\textasteriskcentered: \textbackslash nocite\{\textasteriskcentered\}}.

Citations are placed in the text with \texttt{\textbackslash cite\{\}} or \texttt{\textbackslash parencite\{\}} with the reference key placed between curly braces. \texttt{\textbackslash cite\{Kliker12\}} produces a reference that is something like Kliker and Flash (2012). \texttt{\textbackslash parencite\{Kliker12\}} produces a citation in parentheses (Kliker and Flash, 2012). 

When documents with BibLaTeX citations are compiled, the citation processing package \texttt{biber} must also be run to process and sort the citations and reference list.

Referencing styles are regularly revised, new ones appear, and institutions and publications may have their own versions of these. If an automated referencing system is used, the documentation should be consulted for shortcomings and possible incompatibilities with style requirements. 



\subsection{Appendices}

Appendices can be added to documents with the \texttt{appendix} package. This is loaded in the preamble with 

\begin{verbatim}
\usepackage{appendix}
\end{verbatim}

Options for this package are listed in Table 18:


\begin{table}
\small
\begin{center}
\begin{tabular}{ll}
\hline
\texttt{toc}       &  Includes a title in the Table of Contents prior to listing the appendices \\
\texttt{page}      &  Places a title prior to the beginning of the appendices \\
\texttt{title}     &  Adds the name `Appendix' to each appendix title \\
\texttt{titletoc}  &  Does the same to each appendix title in the Table of Contents \\
\texttt{header}    &  Does the same for each page header \\
\hline
\end{tabular}
\caption{Options for package appendix}
\end{center}
\end{table}


The appendices themselves are placed inside the appendix environment and are sectioned in the same way as the document text:

\begin{flushleft}
\texttt{\textbackslash begin\{appendices\}} \\
\texttt{\textbackslash section\{Appendix 1\}} \\
\texttt{\textbackslash section\{Appendix 2\}} \\
\texttt{\textbackslash end\{appendices\}} \\
\end{flushleft}

To begin the appendices on a new page, and to place each new appendix on a new page, insert a page break before the appendix’s environment and the beginning of a new appendix.


\clearpage


\section{Compiling Documents}

\subsection{Postscript Format}

When the text is marked up, it must be compiled to produce a readable document. LaTeX can produce postscript and \textsc{pdf} files. Postscript is the `Gold Standard’ for printed documents and LaTeX produces these without any special commands in the preamble. These files are compiled by running LaTeX multiple times to resolve the front and back matter, tables, and lists, and if the document contains references created through BibLaTeX, Biber will also have to be run to sort and resolve these. The following scheme is suggested for documents that contain BibLaTeX references. \texttt{biber} can be omitted if they are not present. 


\begin{center}
\texttt{latex} \\
\texttt{biber} \\
\texttt{latex} \\ 
\texttt{latex} \\
\end{center}

This can be done through an editor’s \textsc{gui} interface. To do this in TeXstudio, go to the Menu: \\

\begin{flushleft}
\texttt{Tools $\rightarrow$ Commands $\rightarrow$ LaTeX} \\
\end{flushleft}

\begin{flushleft}
In Kile: \\
\end{flushleft}

\begin{flushleft}
\texttt{Build $\rightarrow$ Compile $\rightarrow$ LaTeX} \\
\end{flushleft}

If the document contains BibLaTeX references, \texttt{biber} is in the same menu. \\

This creates a Device Independent (\texttt{.dvi}) file. This intermediate file is then converted to postscript. In TeXstudio: \\


\begin{flushleft}
\texttt{Tools $\rightarrow$ Commands $\rightarrow$ DVI->PS} \\
\end{flushleft}

\begin{flushleft}
In Kile: \\
\end{flushleft}

\begin{flushleft}
\texttt{Build $\rightarrow$ Convert $\rightarrow$ DVItoPS} \\
\end{flushleft}


LaTeX saves the resulting files to the project directory. \texttt{dvi} files can be viewed with \textsc{yap} (Yet Another Previewer), which comes with ProTeX. Click on the dvi file to activate it. Postscript files can be viewed with GSView.

\subsection{\textsc{pdf} Format}

\texttt{dvi} and postscript files can be converted to \textsc{pdf} format if required using the \texttt{DVI->PDF} or \texttt{PS->PDF} options in TeXstudio or the \texttt{DVItoPDF} or \texttt{PStoPDF} options in Kile. These will not contain any hyperlinks and there will be no metadata attached to the file. \textsc{pdf}LaTeX supports these features so is the recommended way to produce \textsc{pdf} files. 

Hypertext links can be inserted into \textsc{pdf} documents with the \texttt{hyperref} package. This automatically turns all internal references, such as the table of contents and lists of tables and figures, cross references, and citations into active hyperlinks. Clicking on the link will take you to the appropriate place in the text. This should be the last package loaded in the preamble.

By default, text with hyperlinks appear framed in a colour depending on the type of link: citations in green, \textsc{url}'s in magenta and links in red, etc. This can be changed to coloured text by adding the \texttt{colorlinks=true} option. As with the default colours, this has different colours for each type of link. The \texttt{allcolors} option changes all links to a single colour. This colour can be any in the \texttt{xcolor} option nominated when \texttt{xcolor} was loaded in the preamble. The following code loads \texttt{hyperref} with hyperlinks being flagged with text coloured blue:


\begin{flushleft}
\texttt{\textbackslash usepackage[pdftex, colorlinks=true, allcolours=blue]\{hyperref\}} \\
\end{flushleft}


It is worth specifying a backend driver for this package, in this case, \texttt{pdftex}. This helps configure \texttt{hyperref} to the compiler used for the document. In the case of \textsc{pdf} files, \textsc{pdf}LaTeX. 

Links to external web pages can be created in the text with \texttt{\textbackslash url\{WebAddress\}}. The following code will create a link to \textsc{ctan}'s homepage at \texttt{www.ctan.org}:

\begin{flushleft}
\texttt{\textbackslash url\{www.ctan.org\}}
\end{flushleft}


The file metadata can be edited with \texttt{\textbackslash hypersetup\{pdfinfo=\{ . . .\}\}}. This contains information regarding the title, author, subject, creation date, modification date and keywords. It can be seen by accessing the document's properties. The following code provides only title, author, subject and keywords. It omits the creation date and modification date, so \textsc{pdf}LaTeX will automatically fill these fields with the current date:

\begin{flushleft}
\texttt{\textbackslash hypersetup\{pdfinfo=\{}  \\
\texttt{Title=\{The Lost Secrets of LaTeX2e\},} \\
\texttt{Author=\{Herodotus\},}                  \\
\texttt{Subject=\{LaTeX2e\},}                   \\
\texttt{Keywords=\{PDFD; Latex; Guide\}}           \\
\texttt{\}\}}  	                                \\

\end{flushleft}

The creation date and modification date fields can be specified if required. The format is \texttt{\textsc{yyyymmddhhmmss}}: \texttt{\textsc{yyyy}} = year, \texttt{\textsc{mm}} = month, \texttt{\textsc{hh}} = hour, \texttt{\textsc{mm}} = minute and \texttt{\textsc{ss}} = second.

As with postscript documents, \textsc{pdf}LaTeX will have to be run multiple times to resolve the front and back matter, tables, hyperlinks, etc.



\clearpage


\section{References}

\begin{flushleft}
Berry, K (2021) \LaTeXe: An Unofficial Reference Manual. Retrieved from: \\
\texttt{\url{www.latexref.xyz/dev/latex2e.pdf}} \\
\bigskip
Carlisle, D.P. (2021). Packages in the `graphics’ bundle. Retrieved from: \\ \texttt{\url{www.ctan.org/pkg/graphicx}} \\
\bigskip
Clawson, J. (2021). biblatex-mla MLA Style Using Biblatex, Version 2.0. Retrieved from: \\ \texttt{\url{www.ctan.org/pkg/biblatex-mla}} \\
\bigskip
Fussner, D. (2021). The biblatex-chicago package: Style files for biblatex, Version 2.2. Retrieved from: \\ \texttt{\url{www.ctan.org/pkg/biblatex-chicago}} \\
\bigskip
Goosens, M., Mittelbach, F., Rahtz, S., Roegel, D. and Voss, H. (2008) \textit{The LaTeX Graphics Companion}. 2nd Edition. Boston: Addison-Wesley. \\
\bigskip
Kern, U. (2021).Extending LATEX’s color facilities: the xcolor package v2.13. Retrieved from: \\ \texttt{\url{www.ctan.org/pkg/xcolor}} \\
\bigskip
Kime, P. (2021). APA BibLaTeX Style. Citation and References macros for BibLaTeX, Version 9.15. Retrieved from: \\ \texttt{\url{www.ctan.org/pkg/biblatex-apa}} \\
\bigskip
Kime, P., Wemheuer, M., Lehman, P. (2020) The biblatex Package. Programmable Bibliographies and Citations. Retrieved from: \\
\texttt{\url{www.ctan.org/pkg/biblatex}} \\
\bigskip
Lamport, L. (1986) \textit{LaTeX: A Document Preparation System}. 2nd Edition. Boston: Addison-Wesley.\\
\bigskip
Mittelbach, F., Fairbairns, R., Lemberg, W. and the LaTeX Project Team (2016). LaTeX font encodings. Retrieved from:  \\
\texttt{\url{www.ctan.org/pkg/encguide}} \\
\bigskip
Mittelbach, F. and Goosens, M. (2004). \textit{The LaTeX Companion}. 2nd Edition. Boston: Addison-Wesley.\\
\bigskip
Mori, L.F. (2007). Tables in LaTeX2e: Packages and Methods. \textit{The PracTeX Journal}, 1, 1-38.\\
\bigskip
Pakin, S., (2021). \textit{The Comprehensive LaTeX Symbol List}. Retrieved from: \\ \texttt{\url{www.ctan.org/pkg/comprehensive}}\\
\bigskip
Th\'{a}nh, H.T., Rahtz, S., Hagen, H., Henkel, H., Schroder, M. and Berry, K. (2021) \textit{The pdfTeX User Manual}. Revision 849. Retrieved from: \\ 
\texttt{\url{www.ctan.org/pkg/pdftex}} \\
\bigskip
International Committee of Medical Journal Editors (2021). Recommendations for the Conduct, Reporting, Editing, and Publication of Scholarly Work in Medical Journals. Retrieved from: \\ \texttt{\url{http://icmje.org/icmje-recommendations.pdf}} \\

 
\end{flushleft}


\clearpage


\begin{appendices}

\section{Some Additional \LaTeXe Facilities}

LaTeX has a much wider range of functionality than described in this document. Some add-on packages enhance existing facilities and others support music, presentations, and line drawings. Some of these are outlined in this Appendix.


\paragraph{Languages}
LaTeX has facilities for a wide range of modern languages and supports non-latin alphabets, such as Cyrrilic, and Logosyllabary, Syllabary, Abjad and Abugida writing systems. It also supports a range of extinct languages such a Phonecian, Egyptian Hieroglyphics, Linear B and Runic and provides symbols for phonetics.


\paragraph{AMS-LaTeX}
AMS Maths is a production of the American Mathematical Society. It provides a range of enhanced mathematical facilities and enhancements including for the LaTeX's standard document classes.


\paragraph{Beamer}
Beamer produces presentations. It is a document class that is loaded in the preamble. It is compatible with \textsc{pdf}LaTeX and can create slides and handouts in \textsc{pdf} and supports overlays and hyperlinks.


\paragraph{PSTricks} 
PSTricks creates line drawings. It can draw mathematical functions, diagrams, and pictures. It creates postscript output, but it is possible to create \textsc{pdf} output with the \texttt{pdftricks} package.


\paragraph{Music}
A range of LaTeX packages support music. It can produce sheet music and sections of scores can be inserted into texts with \texttt{musixtex}. Songbooks can be created with the \texttt{songs} or \texttt{songbook} packages, \texttt{guitar}, \texttt{guitarchordschemes} and \texttt{guitartabs} support the guitar, \texttt{bagpipe} supports bagpipe music and gregorian chant is possible with \texttt{gregoriotex}.




\clearpage



\section{Resources}

There are many resources for LaTeX. A short list of helpful texts along with documentation for the packages used in this document are in the reference list. In addition to this, there are significant online resources that are regularly updated.


\paragraph{The Comprehensive \TeX Archive Network}
This is the home of \LaTeXe\ and contains distributions, additional packages, and documentation. The `Starting out with \TeX, \LaTeX, and friends' page is a good place to start.

\begin{flushleft}
\texttt{\url{www.ctan.org/starter}}
\end{flushleft} 


\paragraph{The TeX Users Group}
The \TeX Users Group (\textsc{tug}) is a not-for-profit group interested in \TeX. Their website has an informative page for those new to LaTeX: `Getting started with TeX, LaTeX, and friends'. This contains information on installing TeX and LaTeX, links to documentation and sample documents. 


\begin{flushleft}
\texttt{\url{http://tug.org/begin.html}}
\end{flushleft}

\textsc{tug} also hosts the `\LaTeX Font Catalogue'. This is a comprehensive list and sampler of freely available fonts for latin alphabets and documentation on how to use them.

\begin{flushleft}
\texttt{\url{http://tug.org/FontCatalogue/ }}
\end{flushleft}


\paragraph{The \TeX faq }
The \TeX faq addresses questions about \TeX with informative answers on a wide variety of topics.

\begin{flushleft}
\texttt{\url{http://texfaq.org}}
\end{flushleft}


\clearpage


\section{A Sample Script for a Postscript Document}

\begin{verbatim}
% Document Type
\documentclass[12pt, a4paper]{article}

% Line Spacing
\usepackage{setspace} 

% Graphic management
\usepackage{graphicx}

% Colour Support with a colour palette from dvipsnames
\usepackage[dvipsnames]{xcolor} 

% Hyphenation
\usepackage[french, ngerman, australian]{babel}
\usepackage{hyphenat}
\hyphenation{}

% Date formatting
\usepackage[useregional, showdow]{datetime2}

% Font and encoding
\usepackage[TS1, T1]{fontenc}
\usepackage{lmodern}

% Page margins
\usepackage[left=1.5in, right=1.0in, top=1.0in, bottom=1.75in, 
headheight=18pt]{geometry}

% Headers and footers
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{Running Header or Title.}
\chead{}
\rhead{\thepage}
\lfoot{\today}
\cfoot{}
\rfoot{}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}

% The document title
\title{The Lost Secrets of \LaTeXe}
% The author(s)
\author{Herodotus}

\begin{document}
% Create the title and abstract on the front page with no headers or 
% footers
\maketitle
\thispagestyle{empty}
	
% Write the abstract
\begin{abstract}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla est purus, 
ultrices in port titor in, accumsan non quam. Nam consectetur porttitor 
rhoncus. Curabitur eu est et leo feugiat auctor vel quis lorem.
\end{abstract}

% Create a new page for the Table of Contents and begin numbering the 
% pages in lower case Roman numerals for the front matter.
\clearpage
\pagenumbering{roman}
\tableofcontents
	
% Create a new page for the List of Figures
\clearpage
\listoffigures
	
% Create a new page for the List of Tables
\clearpage
\listoftables
	
% Create a new page to begin the text of the document and begin numbering 
% thepages in Arabic numerals.
\clearpage
\pagenumbering{arabic}
	
% Define line spacing
\doublespacing
% Page Numbering
\pagenumbering{arabic}
	
	
% Beginning of the text.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla est purus, 
ultrices in porttitor in, accumsan non quam. Nam consectetur porttitor 
rhoncus. Curabitur eu est et leo feugiat auctor vel quis lorem. Ut et 
ligula dolor, sit amet consequat lorem. Aliquam porta eros sed velit 
imperdiet egestas. Maecenas tempus eros ut diam ullamcorper id dictum 
liberotempor. Donec quis augue quis magna condimentum lobortis. Quisque 
imperdiet ipsum vel magna viverra rutrum. Cras viverra molestie urna, 
vitae vestibulum turpis varius id.
	
Vestibulum mollis, arcu iaculis bibendum varius, velit sapien blandit 
metus, ac posuere lorem nulla ac dolor. Maecenas urna elit, tincidunt in 
dapibus nec, vehicula eu dui. Duis lacinia fringilla massa. Cum sociis 
natoque penatibus et magnis dis parturient montes, nasceturridiculus mus. 
Ut consequat ultricies est, non rhoncus mauris congue porta. 		
	
% End of the Text
	
\end{document}

\end{verbatim}
\clearpage



\section{GNU Free Documentation License}

{\footnotesize
\begin{center}
		
Version 1.2, November 2002
		
		
Copyright \copyright 2000,2001,2002  Free Software Foundation, Inc.
		
\bigskip
		
51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
		
\bigskip
		
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
\end{center}
	
	
\begin{center}
Preamble
\end{center}
	
The purpose of this License is to make a manual, textbook, or other	functional and useful document "free" in the sense of freedom: to 	assure everyone the effective freedom to copy and redistribute it,	with or without modifying it, either commercially or noncommercially. 

Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.
	
This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense.  It complements the GNU General Public License, which is a copyleft license designed for free software.
	
We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the	software does.  But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book.  We recommend this License principally for works whose purpose is instruction or reference.
	
	
\begin{center}
1. APPLICABILITY AND DEFINITIONS
\end{center}
	
This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License.  Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein.  The \textbf{"Document"}, below, refers to any such manual or work.  Any member of the public is a licensee, and is addressed as \textbf{"you"}.  You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.
	
A \textbf{"Modified Version"} of the Document means any work containing the Document or a portion of it, either copied verbatim, or with	modifications and/or translated into another language.
	
A \textbf{"Secondary Section"} is a named appendix or a front-matter section of	the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject	(or to related matters) and contains nothing that could fall directly within that overall subject.  (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any	mathematics.)  The relationship could be a matter of historical	connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.
	
The \textbf{"Invariant Sections"} are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License.  If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant.  The Document may contain zero	Invariant Sections.  If the Document does not identify any Invariant	Sections then there are none.
	
The \textbf{"Cover Texts"} are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License.  A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.
	
A \textbf{"Transparent"} copy of the Document means a machine-readable copy, represented in a format whose specification is available to the	general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available	drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters.  A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart	or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text.  A copy that is not "Transparent" is called \textbf{"Opaque"}.
	
Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG.  Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.
	
The \textbf{"Title Page"} means, for a printed book, the title page itself,	plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page.  For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.
	
A section \textbf{"Entitled XYZ"} means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language.  (Here XYZ stands for a specific section name mentioned below, such as \textbf{"Acknowledgements"},	\textbf{"Dedications"}, \textbf{"Endorsements"}, or \textbf{"History"}.) To \textbf{"Preserve the Title"}	of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition.
	
The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document.  These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other	implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.
	
	
\begin{center}
2. VERBATIM COPYING
\end{center}
	
You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the	copyright notices, and the license notice saying this License applies	to the Document are reproduced in all copies, and that you add no other	conditions whatsoever to those of this License.  You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute.  However, you may accept compensation in exchange for copies.  If you distribute a large enough number of copies you must also follow the conditions in section 3.
	
You may also lend copies, under the same conditions stated above, and you may publicly display copies.
	
	
\begin{center}
3. COPYING IN QUANTITY
\end{center}
	
	
If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover.  Both covers must also clearly and legibly identify you as the publisher of these copies.  The front cover must present the full title with all words of the title equally prominent and visible.  You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.
	
If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit	reasonably) on the actual cover, and continue the rest onto adjacent pages.
	
If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy	a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material.	If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that	edition to the public.
	
It is requested, but not required, that you contact the authors of the	Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.
	
	
\begin{center}
4. MODIFICATIONS
\end{center}
	
You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release	the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it.  In addition, you must do these things in the Modified Version:
	
\begin{itemize}
\item[A.] 
Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document).  You may use the same title as a previous version if the original publisher of that version gives permission.
		
\item[B.]
List on the Title Page, as authors, one or more persons or entities	responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.
		
\item[C.]
State on the Title page the name of the publisher of the Modified Version, as the publisher.
		
\item[D.]
Preserve all the copyright notices of the Document.
		
\item[E.]
Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
		
\item[F.]
Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
		
\item[G.]
Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.
		
\item[H.]
Include an unaltered copy of this License.
		
\item[I.]
Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page.  If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
		
\item[J.]
Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on.  These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
		
\item[K.]
For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all	the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
		
\item[L.]
Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles.  Section numbers	or the equivalent are not considered part of the section titles.
		
\item[M.]
Delete any section Entitled "Endorsements".  Such a section	may not be included in the Modified Version.
		
\item[N.]
Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section.
		
\item[O.]
Preserve any Warranty Disclaimers.
\end{itemize}
	
If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all	of these sections as invariant.  To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice.  These titles must be distinct from any other section titles.
	
You may add a section Entitled "Endorsements", provided it contains	nothing but endorsements of your Modified Version by various	parties--for example, statements of peer review or that the text has	been approved by an organization as the authoritative definition of a standard.
	
You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list	of Cover Texts in the Modified Version.  Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or	through arrangements made by) any one entity.  If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of,	you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.
	
The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or	imply endorsement of any Modified Version.
	
	
\begin{center}
5. COMBINING DOCUMENTS
\end{center}
	
	
You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified	versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.
	
The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy.  If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by	adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.
	
In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled	"History"; likewise combine any sections Entitled "Acknowledgements",	and any sections Entitled "Dedications".  You must delete all sections Entitled "Endorsements".
	
\begin{center}
6. COLLECTIONS OF DOCUMENTS
\end{center}
	
You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in	the collection, provided that you follow the rules of this License for	verbatim copying of each of the documents in all other respects.
	
You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this	License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.
	
	
\begin{center}
7. AGGREGATION WITH INDEPENDENT WORKS
\end{center}
	
	
A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves	derivative works of the Document.
	
If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form.	Otherwise they must appear on printed covers that bracket the whole aggregate.
	
	
\begin{center}
8. TRANSLATION
\end{center}
	
	
Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections.  You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include	the original English version of this License and the original versions of those notices and disclaimers.  In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.
	
If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve	its Title (section 1) will typically require changing the actual title.
	
	
\begin{center}
9. TERMINATION
\end{center}
	
	
You may not copy, modify, sublicense, or distribute the Document except	as expressly provided for under this License.  Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License.  However,	parties who have received copies, or rights, from you under this	License will not have their licenses terminated so long as such parties remain in full compliance.
	
	
\begin{center}
10. FUTURE REVISIONS OF THIS LICENSE
\end{center}
	
	
The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time.  Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.  See	http://www.gnu.org/copyleft/.
	
Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this	License "or any later version" applies to it, you have the option of	following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation.  If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.
	
	
\begin{center}
ADDENDUM: How to use this License for your documents
\end{center}
	
To use this License in a document you have written, include a copy of the License in the document and put the following copyright and	license notices just after the title page:
	
\bigskip
\begin{quote}
Copyright \copyright  YEAR  YOUR NAME.\\
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
\end{quote}
\bigskip
	
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,	replace the "with...Texts." line with this:
	
\bigskip
\begin{quote}
with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
\end{quote}
\bigskip
	
If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation.
	
If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.

}

\end{appendices}


\end{document}



