User Guide

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

GY

AF
I NS LO
TIT U HN O
TE
OF T EC
DW
2022
-09

Air Force Institute of Technology

LATEX Thesis Template


User Guide

Edition 0.1
David Woodburn, Ph.D.
Contents
1 Template Options 2
1.1 Class Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Document Variables . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Standard Form 298 . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Prefatory Lists . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Content Location . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 LATEX Help 5
2.1 Quotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Math and Units . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.5 Code and Pseudocode . . . . . . . . . . . . . . . . . . . . . . 9
2.6 Including PDF Pages . . . . . . . . . . . . . . . . . . . . . . . 11
2.7 Citations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.8 Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3 Slides 13

1
1 Template Options
This thesis and dissertation template can be found on OverLeaf under Tem-
plates. It follows the soon-to-be-published 2024 AFIT Style Guide. The fol-
lowing subsections cover specific options provided by this template.

1.1 Class Options


The afitthesis class takes an optional parameter to specify the default
font size: 10pt, 11pt, or 12pt:

\documentclass[12pt]{afitthesis}

If not specified, the default is 11pt.


The afitthesis.cls class defines a vector notation with the command
\ul{}. However, some package such as soul also define this command. To
remove the conflict, you can specify that the afitthesis.cls class not define
the \ul{} command by using the noul parameter:

\documentclass[noul]{afitthesis}

1.2 Document Variables


Rather than having to type your name or the title of the thesis (or disser-
tation) over and over, you instead just need to write each detail once as
the inputs to some macros. The following macros are the meta data of your
document, like the title, author, and department. Some of these apply to the
whole document. Some, like in the subsection after this, apply only to the
SF 298 form at the end of your paper.

\title{} \address{}
\author{} \disclaimer{}
\rank{} \copyrightstatement{}
\previousdegrees{} \committee{{name\\Chair},
\newdegree{} {name\\Member}}
\graduationdate{} \abstract{}
\department{} \keywords{}
\doctype{} \dedication{}
\docdesignator{} \acknowledgments{}

Several of these variables already have default values if you do not define
them yourself:

2
department Can be filled with manually typed text or one of the
following predefined macros: \ENY, \ENG, \ENP, \ENC, \ENS, or \ENV.
doctype Should be one of thesis, dissertation, or
graduate research paper but defaults to thesis.
docdesignator Will be provided to you by AFIT.
address Defaults to AFIT’s address.
disclaimer Defaults to absolving the Air Force of supporting the author’s
views.
copyrightstatement Defaults to claiming ownership by the government.
committee Is a comma-separated list of people and their roles. Each
should be encased in braces. The “\\” puts the role onto a separate
line from the name.
abstract Should be a paragraph of text summarizing your paper.
keywords Should be a semicolon-delimited list of keywords (maximum of
4) for your document.
If you have a distribution statement other than A, you need a CUI state-
ment. This means that in the \cui{} command, you need to provide the
following kind of text:
Controlled By: AETC
Controlled By: AFIT/ENG
CUI Category(ies): CTI, Proprietary Business Information
Distribution Statement E. Distribution
authorized to DoD only; Proprietary
Business Information; 18 OCT 2008. Other
requests for this document must be
referred to Defense Advanced Research
Projects Agency, ATTN: TIO, 675 North
Randolph Street Arlington, VA
22203-2114.
POC: John Smith, 555-123-4567
You also need to specify that “CUI” should be in the headers and footers
of your pages with the \banner{CUI} command. If your paper also contains
classified information, you need to use the \classified{} command to enter
the details of that classification.
If you have more than one author for your document, you can define
additional authors and their ranks using the following commands:

3
\authorsecond{} \ranksecond{}
\authorthird{} \rankthird{}
\authorfourth{} \rankfourth{}

1.3 Standard Form 298


All theses and dissertations must be accompanied by a Standard Form 298.
This LATEX class file has an updated 2020 version of the form builtin. The
form can also be downloaded from www.gsa.gov. The instructions for this
form are provided at the end of the LATEX template. To add the form to
your paper, the last command before \end{document} should be
\sfTwoNineEight. To fill in the fields of this form, use the following
commands:

\sfStartDate{} \sfSponsorReportNumber{}
\sfEndDate{} \sfDistribution{}
\sfContractNumber{} \sfSupplementaryNotes{}
\sfGrantNumber{} \sfReportClassification{}
\sfProgramElementNumber{} \sfAbstractClassification{}
\sfProjectNumber{} \sfPageClassification{}
\sfTaskNumber{} \sfAbstractLimitation{}
\sfWorkUnitNumber{} \sfResponsiblePerson{}
\sfSponsorAgency{} \sfPhoneNumber{}
\sfSponsorAcronyms{} \sfClassification{}

The rest of the needed information is automatically retrieved from the doc-
ument variables: \title, \author, etc. However, you can override those
definitions for the SF 298 with the following commands:

\sfReportDate{} \sfAddress{}
\sfReportType{} \sfDocDesignator{}
\sfTitle{} \sfAbstract{}
\sfAuthors{} \sfSubjectTerms{}
\sfDepartment{} \sfPageCount{}

1.4 Prefatory Lists


If your document has figures or tables, a corresponding list will be created
for you at the beginning of the document, automatically. You do not need to
specify this yourself with a command like \listoffigures. This automation,
however, does sometimes require multiple compilations.

4
1.5 Content Location
While you can certainly keep all your text in one main.tex file and all
your figures and supplemental files in one directory, it can be helpful to use
folders. You can put your figures into a folder and then let LATEX know to
search there for figures with the \graphicspath{{ }} command. (Notice
the double braces.) You can move each chapter into its own file and then
import it with something like \input{ch_1.tex}.
The default structure of this template provides a figures folder for you
figures and a chapters folder for your chapters and appendices.

2 LATEX Help
If you need help with writing LATEX code, refer to the GitLab project LATEX
Primer by David Woodburn.

2.1 Quotes
When you need to write a pair of single or double quotation marks, do
not use a pair of apostrophes or double-quotation mark characters. The left
marks will curl in the wrong direction: ”This is a test.” Instead, you want to
use back ticks (`) for the left side and apostrophes for the right side, never
the double-quotation mark character ("). So, for single quotes, use ` and ':
`This is a test.'
This will render as ‘This is a test.’ For double quotes, double these symbols:
``This is a test.''
This will render as “This is a test.”

2.2 Math and Units


Table 1 is a list of math commands that have been added to this document
class for your convenience.
The ISO standard notation1 used for non-variables, such as standard
functions (e.g., lim, sin, or log), constants (e.g., π, e, and i), and units is
non-italic, upright. It is standard to write variables in italic. To write the
upright Greek letter mu, use the builtin command \textmu. For example,
micrometers would be written \textmu m and would render “µm”.
1
International Organization for Standardization, ISO 80000-2:2019, 1st ed., p. 1, 2009.

5
Table 1: List of convenience macros.
Code Symbol Description
\ul{a} a vector
\bm{A} A matrix
\EE{2.7}{-3} 2.7×10−3 scientific notation value
dy
\diff{y}{x} dx derivative
∂y
\piff{y}{x} ∂x partial derivative
\abs{a} |a| absolute value
\norm{\ul{a}} ∥a∥ norm of vector
\ssm{\ul{a}} [a]× skew-symmetric matrix
\upc[x] cx abbreviated cosine
\ups[x] sx abbreviated sine
\upt[x] tx abbreviated tangent
\upd d differential operator
\upi i imaginary number
\upj j second basic quaternion
\upk k third basic quaternion
\upe e Euler’s number (2.718. . . )
\PI π Archimedes’ constant (3.141. . . )
\argmax arg max argument of maximum
\argmin arg min argument of minimum
\tr tr trace of matrix
\adj adj adjugate of matrix
\sgn sgn sign of expression

The \PI (π) macro differs from \pi (π). Constants should be
upright and variables should be italicized. Since the builtin \pi
(π) is italicized, \PI (π) was created.

6
Some conventions use no special notation to distinguish between vectors
and matrices. However, there is value to making a distinction since vectors
are a special case of matrices. Some make a distinction by restricting vectors
to lower-case letters and matrices to upper-case letters; however, this restric-
tion is not always practical. The ISO standard suggests using an arrow above
the letter, but this adds to the existing clutter above variables from hats,
bars, tildes, dots, and superscripts. Some use single underlines for vectors
and double underlines for matrices. While this might be practical for hand-
written math and creates distinction between vectors and matrices, it be-
comes very cluttered in print, especially for matrices. So, it is recommended
to use the ISO standard notation of bold italics for matrices (\bm{}) (e.g.,
M ) and the less standard notation of underline italics for vectors (\ul{})
(e.g., v). If this convention for vectors is repulsive, use the builtin command
for an arrow head above (\vec{}), which would render ⃗v .
When you want to express explicit values, use scientific notation like
“2.7×10−3 ” using the \EE{}{} macro. Do not use calculator notation like
“2.7e−3”. All units, except angle degrees (◦ ) and plane angle minutes (′ ) and
seconds (′′ ), should be separated from their numerical values by a space2 .
So, write “15 km”, not “15km”.

2.3 Figures
Your figures should be clear and easy to understand (see Fig. 1). Avoid
pixelated figures and text that is too small to read. To prevent pixelation,
it is generally a good idea to save your figures as vector pdf images. This is
one excellent reason to use LATEX instead of Word, because Word does not
handle vector images well. Please note that for pdf images to load correctly,
you need to use the pdfLaTeX compiler, not the LATEX compiler. In Python
(using MatPlotLib) you can use the savefig command to save your figure
as a pdf. Take care to make sure the image is not so large compared to the
font size that when it is inserted into your paper, the text is so scaled down
that it is hard to read. Sadly, saving a figure in MATLAB as a pdf is not as
easy. While there is an option, the resulting figure will be a full letter-size
page with your image in the middle and large margins all around. To resolve
this you need a few additional commands. First, you should set the margins
and size of your figure:

1 set ( gcf , ' units ' , ' centimeters ' , ' position ' , ...
2
Bureau International des Poids et Mesures, The International System of Units (SI),
9th ed., p. 149, 2019.

7
2 [0 , 0 , width , height ])
For two-column documents, a width of 8.636 cm (3.4 in.) is a good choice.
For a thesis, a width of 15.24 cm (6 in.) is recommended. You might want
to set the font size and type too:

3 set ( gca , ' FontSize ' , 9) ;


4 set ( gca , ' FontName ' , ' Times New Roman ') ;
Finally, you need to export the graphic to a file:

5 exportgraphics ( gcf , ' fig_plot . pdf ' , ...


6 ' ContentType ' , ' vector ') ;
When you place your figure, make sure to put the captions below the
figure. Refer to the LATEX Primer for help.
Then again, rather than using Python or MATLAB to generate your
figures, you could generate them directly within LATEX from data saved to
a text file. Again, refer to the LATEX Primer for help. This approach can be
very convenient by letting you focus on generating data while in your Python
or MATLAB code, and on presentation while in your LATEX document. See
Fig. 1 as an example.

0.5
Amplitude

−0.5

Voltage (V)
−1 Current (A)

−150 −100 −50 0 50 100 150


Time, t (s)

Figure 1: This is a figure generated directly within LATEX.

8
2.4 Tables
Make sure to put table captions above the table (see Table 2).

Table 2: This is a table with left alignment for the first column and center
alignment for the rest of the columns.

Unit pt cm in
pt 1.0 28.45274 72.26999
cm 0.03514 1.0 2.54
in 0.01384 0.3937 1.0

2.5 Code and Pseudocode


If you have code you wrote or used for your thesis, generally you should not
show the actual code. Some readers might not be familiar with the particular
programming language you are using and often showing explicit code gets
too much into the details of the language. Rather, use pseudocode with math
expressions where appropriate. For this, use the pseudocode environment.
Keywords like if, then, else, while, and function will be automatically
formatted in bold. The reason for using the left arrow (\gets) instead of
an equals sign is that an equals sign implies that at all points in a flow of
equations the equality is true, whereas the left arrow implies that the equality
is only necessarily true at that point in the algorithm and henceforth until
it is redefined.
If you want to be able to cite the pseudocode, wrap the pseudocode
environment in a figure environment. An example is shown in Figure 2.
The code to make this happen is

9
1 function factorial(N )
2 print "Calculating factorial ..."
3 x←1
4 for n in 1, . . . , N
5 x←x·n
6 end for
7 return x
8 end function

Figure 2: This is some pseudocode.

\begin{figure}
\begin{pseudocode}
function factorial($N$)
print "Calculating factorial ..."
$x \gets 1$
for $n$ in $1, \dots, N$
$x \gets x \cdot n$
end for
return $x$
end function
\end{pseudocode}
\caption{This is some pseudocode.}
\label{alg_example}
\end{figure}
If for some reason, you really need to put actual computer code into
your paper, the python, matlab, and rlang environments have been created
for you. These will automatically syntactically highlight the source code.
You can control the starting line number by using the optional parameter:
\begin{matlab}[7].
You can also have LATEX read the source code directly from another file.
The commands are
Python \inputpython{file.py}{1}{6}
MATLAB \inputmatlab{file.m}{1}{6}
R \inputrlang{file.r}{1}{6}

The first parameter is the name of the file to read the code from. The second
parameter is first line to read, and the third parameter is the last line to read.

10
You can also include small code expressions in a paragraph using a com-
mand similar to the LATEX-builtin \verb command. For Python, write the
\py command followed by a character like ‘|’, the text, and then the same
character. So, \py|np.array(["A", 1.5])| will produce
np.array(["A", 1.5])
For MATLAB, the command is \mat, and for R it is \rlng.

2.6 Including PDF Pages


If you need to insert whole pages from some other pdf document, use the
\includepdf command. To include specific pages, use a comma-separated
list:
\includepdf[pages={2,3,5}]{paper.pdf}
To insert a range of pages, use a dash:
\includepdf[pages={2-5}]{paper.pdf}
To insert the whole document, drop the braces and just use a dash:
\includepdf[pages=-]{paper.pdf}

2.7 Citations
The AFIT Style Guide permits any standard style for citations, like IEEE or
APA. While LATEX does come with its own, built-in method for handling ref-
erences, it requires manually formatting the bibliography entries and sorting
them if your citation style requires order of appearance. Thankfully, there
are better options through packages like bibtex, natbib, and biblatex. This
guide recommends using biblatex. Refer to the Overleaf page on Bibliogra-
phy Management with BibLaTeX for guidance. Nonetheless, because there
are several options, the inclusion of the biblatex package is not actually in
the LATEX class file, but near the beginning of the main.tex file. The default
citation style there is APA. If you would prefer to use the IEEE style, change
the \usepackage command to
\usepackage[style=ieee]{biblatex}
The following command reads in the bibliography data from a separate
file:
\addbibresource{refs.bib}

11
Assuming you are using the biblatex package, to cite a reference, use
the \parencite{} command. If you have multiple things to cite together,
use the command once and separate the references with commas. So, the
command

\parencite{poor1989, savage2000, savage2015}

would produce (Poor, 1989; Savage, 2000, 2015). If you need the citation
to be part of the grammar of the sentence, use the \textcite{} command
instead. So,

\textcite{poor1989} wrote at length on this matter.

Would render as “Poor (1989) wrote at length on this matter.”


Finally the \printbibliography command near the end of the document
actually generates the bibliography. But, that command by itself does not
create a chapter, even though it does produce its own heading. So, we need
to include additional commands:

\clearpage % Start on a new page.


\phantomsection % Create a chapter marker.
\addcontentsline{toc}{appendix}{\bibname} % Add to ToC.
\printbibliography % Prints the bibliography.

2.8 Acronyms
If you wish, you can use more complicated methods for acronyms, such as the
glossaries package (see OverLeaf: Glossaries). There are several commands
required to setup, define, and print the acronyms. This package saves you the
trouble of having to manually write the definitions of the acronyms twice:
once in the body of the document and then once in a table of acronyms.
However, a simple alternative to an additional package is to just define a
macro for each acronym:

\def\afit{Air Force Institute of Technology}

In the body of your paper, if you want the acronym, just type it: AFIT. When
you want to write out the full meaning, use the macro: \afit. Then, when
you need to list all your acronyms, simply make a list, using those macros:

\begin{description}
\item[AFIT] \afit
\end{description}

12
3 Slides
Once you have written your thesis, you will likely also need to create a pre-
sentation. Rather than converting your content into a PowerPoint™-friendly
format, you can also create a pdf-based slide presentation using LATEX. The
template for this can be found on Overleaf Templates as “AFIT Defense
Template.” As an example, the following code would render the slide shown
in Fig. 3:

\section{Process Noise}\twocolumn\raggedright

\begin{itemize}\setlength{\itemsep}{0pt}
\item Envision no noise in $x_k$.
\item Propagate deterministically to $k+1$.
\item The PDF $\nu$ is the only PDF left to consider.
\end{itemize}
\paragraph{Highway Example}
\begin{itemize}\setlength{\itemsep}{0pt}
\item $T = 1$~s.
\item At $k = 0$, $x = 0$.
\item At $k = 1$, $x = v T \to 30$~m.
\item Add noise from $\nu \sim \mathcal{N}(0, 50^2)$.
\end{itemize}

\pagebreak
\begin{center}
\includegraphics[width=\linewidth]{fig_noise.pdf}
\end{center}

As you can see, there are no new commands to learn beyond what you
might use in a regular LATEX document. This can greatly simplify the process
of making slides if you already have much of your thesis written in LATEX.

13
Process Noise 1

• Envision no noise in xk . 0.008

• Propagate deterministically to
0.007
k + 1.
• The PDF ν is the only PDF left 0.006

to consider. 0.005
PDF p(x1 )

Highway Example 0.004

• T = 1 s. 0.003

• At k = 0, x = 0. 0.002

• At k = 1, x = vT → 30 m.
0.001
• Add noise from ν ∼ N (0, 502 ).
0.000
−100 −50 0 50 100 150
State x

Figure 3: Example slide using the AFIT Defense Template in LATEX.

14

You might also like