\documentclass{projdoc}
% if the document compiles too slow (likely due to many/large images), try compiling
% with the [draft] option. this replaces all images with placeholders.
\input{meta.tex}

\title{Example Document}

\begin{document}

% generate table of contents, list of figures and list of tables
\tablestables

\bigskip
Look how nice and consistent these tables and lists look compared to the default in
MS Word!

% flush page
\newpage

\section{Introduction}

This is an example document that is meant to demonstrate various \LaTeX{} features,
as well as some macros specific to \hbox{projdoc.cls}.
% LaTeX has automatic line breaking. \hbox is used here to ensure projdoc.cls is
% never broken across lines.

\section{Sectioning}
\subsection{Subsections}
\subsubsection{Subsubsections}
\paragraph{Paragraphs (level 4)}

These don't show up in the table of contents by default

\section{Figures and tables}

\Cref{fig:example-a} definitely shows something. Referencing multiple things at once
is neatly handled by cleveref:
\cref{fig:example-a,fig:example-b,fig:example-puml,tab:gate-xor}.

\begin{figure}
	\centering
	\includegraphics[width=8cm]{example-image-a}
	\caption{This is the figure title}
	\label{fig:example-a} % label must be placed AFTER caption
\end{figure}

\begin{figure}
	\begin{subfigure}{0.45\textwidth}%
		\centering
		\fitimg{\includegraphics{example-image-b}}
		\caption{Example image B}
		\label{fig:example-b}
	\end{subfigure}%
	\hfill
	\begin{subfigure}{0.45\textwidth}%
		\centering
		\includepumldiag{img/example.puml}
		\caption{Example PlantUML diagram}
		\label{fig:example-puml}
	\end{subfigure}%
	\caption{Subfigures}
\end{figure}

\begin{table}
	\centering
	% i know, table code sucks
	\begin{tabular}{ll@{\qquad}r}
		\toprule
		$a$ & $b$ & $x$\\
		\midrule
		0 & 0 & 0\\
		0 & 1 & 1\\
		1 & 0 & 1\\
		1 & 1 & 0\\
		\bottomrule
	\end{tabular}
	% booktabs tables look very nice, but it seems the author hates vertical rules with
	% a burning passion. please avoid using vertical rules for consistency.
	\caption{XOR-gate truth table}
	\label{tab:gate-xor}
\end{table}

\begin{table}
	\begin{tabularx}{\linewidth}{lXr}
		\toprule
		left & & right\\
		\midrule
		This table & fills all available & horizontal space\\
		\bottomrule
	\end{tabularx}
	\caption{Really wide table}
\end{table}

\section{Other markup}

\subsection{Fonts}

The \codeinline{\emph} command can be used to \emph{emphasize} (i.e.~italicize) text.
% Note the ~ (non-breaking space) after "i.e.". LaTeX inserts some extra negative
% space after a full stop, but since the full stop is used to denote an abbreviation
% we need to tell LaTeX to insert a regular space. This can also be achieved by using
% "\ ", though this allows LaTeX to break a line after the "i.e." which looks ugly in
% my opinion.

The \codeinline{\codeinline} command can be used to insert inline code.

The \codeinline{blockcode} environment can be used to insert a code block:

\begin{blockcode}
This is all included verbatim: \verb|asdf| \ $%!(*@#&)$
\end{blockcode}

\subsection{Information dumps}

Unordered (bullet) list:

\begin{itemize}
	\item Foo
	\item Bar
	\item Baz
\end{itemize}

Numbered list:

\begin{enumerate}
	\item Foo
	\item Bar
	\item Baz
	\item \begin{enumerate}
		\item These
		\item Can
		\item Be
		\item Nested
		\item And
		\item \label{item:enum-nest-ref} Referenced
	\end{enumerate}
\end{enumerate}

(See \cref{item:enum-nest-ref})

Description:

\begin{description}
	\item[Item one] description of item one
	\item[Item two] description of item two
	\item[Item three] ...
\end{description}

\subsection{Comparisons}

\begin{comparison}
	\pro{Good thing}
	\con{Bad thing}
	\pro{Good thing 2}
	\con{Bad thing 2}
\end{comparison}

\subsection{Citations}

Citations are inserted using the \codeinline{\autocite} command \autocite{rfc:3339}.
The bibliography is automatically printed after \codeinline{\end{document}}.

\subsection{Glossary}

Glossary entries can be inserted using the \codeinline{\gls} commands. Example:
``\Gls{sdl2} handles \glspl{hid} as well!''. In following occurrences of acronyms,
only their short form is printed: `\gls{sdl2}' and `\gls{hid}'. All of these link to
the glossary that is automatically printed after \codeinline{\end{document}}.

\end{document}

