Bonus: Customization

The following material is not part of the assignment but is useful to know.

Custom Section Headers

The titlesec package provides tools for customizing section headings.

\documentclass{article}

\usepackage{titlesec}
\usepackage{xcolor}

% custom \section headers
\titleformat{\section}{
    \large                          % text size
    \color{brown}                   % text color
    \bfseries                       % bold text
    \sffamily}                      % sans serif font
    {\thesection}{1em}              % Section numbering + space after number
    {}                              % no code before the heading
[\titlerule]                        % horizontal line after the heading

% custom \subsection headers
\titleformat{\subsection}[runin]{   % No newline after subsection heading
    \normalsize                     % text size
    \color{blue}                    % text color
    \scshape                        % small capitals
    \rmfamily}                      % serif font
    {\thesubsection}{0.5em}         % Subsection numbering + space after number
    {\underline}                    % underline heading
[]                                  % no horizontal line after the heading

\begin{document}

\section{Introduction}
This is the introduction.

\subsection{Subintroduction}
This is a subsection within the introduction.

\end{document}
../_images/bonus_1.svg

In the context of titlesec, the following commands format the font.

Command

Description

\bfseries

Bold

\itshape

Italics

\slshape

Slanted

\scshape

Small Capitals

\rmfamily

Roman (Serif)

\sffamily

Sans Serif

\ttfamily

Typewriter

The font size can be set to one of the following choices, from smallest to largest: \tiny, \scriptsize, \footnotesize, \small, \normalsize, \large, \Large, \LARGE, \huge, \Huge.

Headers and Footers

The fancyhdr package is helpful for setting the header and footer, including page numbers.

\documentclass{article}

\usepackage{fancyhdr}

\pagestyle{fancy}                           % use fancyhdr headers / footers
\fancyfoot{}                                % clear current footers
\fancyhead{}                                % clear current headers
\fancyhead[L]{Author Name \hfill \thepage}  % set the header text, left aligned

\begin{document}

This is the body.
The header appears on every page.

\end{document}
../_images/bonus_2.svg

The \hfill command adds as much horizontal space as possible before \thepage, which inserts the page number. Use \thispagestyle{plain} to remove the header and footer from the current page.

Citations with BibTex

LaTeX has a companion tool called bibtex for automatically handling citations to outside sources. To use bibtex, list biographical information on sources in a separate .bib file.

% references.bib

@book{poole2015linear,
    title = {Linear algebra: {A} modern introduction},
    author = {Poole, David},
    volume = {279},
    year = {2015},
    publisher = {Cengage Learning Florence, KY}
}

@article{shannon1948communication,
    author = {Shannon, C. E.},
    title = {A mathematical theory of communication},
    journal = {The Bell System Technical Journal},
    volume = {27},
    number = {3},
    pages = {379-423},
    year = {1948},
    doi = {10.1002/j.1538-7305.1948.tb01338.x}
}

Individual items in the .bib file are referenced with \cite{} in the body of the .tex file.

\documentclass{article}

\begin{document}

The curious student should may refer to the course textbook~\cite{poole2015linear}.
Shannon's seminal paper on information theory~\cite{shannon1948communication}
may be the most highly cited mathematics paper of all time.

\bibliographystyle{abbrvurl}        % Set the bibliography style.
\bibliography{references.bib}       % Link to the citation file.

\end{document}
../_images/bonus_3.svg