\documentclass{lia}

% \todo add bibliography handling with biblatex

\usepackage{layout} % used to produce the layout page

% mandatory declarations
\LiaWrittenBy{Arno Formella}
\LiaNumber{LIA-DOC-TEX-GUIDE}
\LiaVersion{1.10}

% optional declarations (uncomment and set accordingly)
%\LiaDate{\ddmmyyyydate\today} % the default declaration
%\LiaDate{10/01/2009}          % how you should set the date

\title{\LaTeX{} style for LIA documents}

\LiaSubTitle{how to use the LIA style file}
\LiaListOfTodos
%\LiaNoTableOfContents
%\LiaListOfTBD
\LiaListOfTables
%\LiaListOfFigures

%place you own commands here
\newcommand{\CC}[1]{{\ttfamily #1}}

% We use biblatex to build the bibliography
\usepackage[hyperref=true]{biblatex}
\bibliography{lia}
% So the \citetitle command generates hyperlinks as well.
\DeclareCiteCommand{\citetitle}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {%\ifciteindex % enable for biblatex 0.9
     %{\indexfield{indextitle}}
     %{}%
   \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\begin{document}
\maketitle

\section{Introduction}

\subsection{Purpose}

With this \LaTeX{} document template you can produce
uniform documents in the \Lia{} research group whenever you use \LaTeX.
Most of the formatting tasks are placed into the \LaTeX{} class file,
so you, as the author of a document, can concentrate on the content
of the document, rather than on its format.

\subsection{Revision history}

\begin{description}
\item[Version 1.10:]~
\begin{itemize}
\item Description how to directly include SVG-images added.
\end{itemize}
\item[Version 1.9:]~
\begin{itemize}
\item Flag to set page numbering without the reference to
the last page added.
\item More \Lia-logos and the \CC{qr}-logo added.
\item Using \CC{xcolor} instead of \CC{color}
\end{itemize}
\item[Version 1.8:]~
\begin{itemize}
\item Package for todo notes added.
\end{itemize}
\item[Version 1.7:]~
\begin{itemize}
\item UTF8 input encoding made the default character set.
\end{itemize}
\item[Version 1.6:]~
\begin{itemize}
\item Description for usage of \TeX-path to place files added.
\end{itemize}
\item[Version 1.5:]~
\begin{itemize}
\item Logos revised.
\end{itemize}
\item[Version 1.4:]~
\begin{itemize}
\item Logos for new \Lia{} group added.
\item Revision history added.
\end{itemize}
\end{description}

\subsection{Acronyms}

In this document there do not appear any acronyms.
This section is merely used to demonstrate the usage of the
implemented commands to deal with referenced acronyms.

\begin{longtable}{|c|c|}\hline
\ACR{SOME} & some acronym
\\\hline
\caption{\label{tab:acronyms}Alphabetically ordered list of all acronyms
used in this document.}
\end{longtable}

\section{Template description}

\subsection{\LaTeX{} files}

The class file is named \CC{lia.cls}.
No additional class options are implemented.
All specific commands and environments start with the \CC{Lia}-prefix,
besides those dealing with acronyms.
To process a document, you need two image files (the \Lia{} logos)
provided as \CC{.pdf}-files

\begin{longtable}{|l|c|}\hline
\CC{lia.cls} & the class file \\
\hline
\CC{logo\_lia\_112.pdf} & large \Lia{} logo \\
\CC{logo\_lia\_158.pdf} & small \Lia{} logo \\
\CC{lia\_qr0\_rt.png} & QR-code of URL of \Lia{} website \\
\hline
\caption{\label{tab:files}Files needed to process a document.}
\end{longtable}

You can place the files either in your local directory where you generate
the document, or you place is under a path that is inspected automatically
by your \LaTeX--processor.
A typical location would be \CC{\$(HOME)/texmf/tex/latex/lia} where you
should place all style and image files.
Don't forget to run the data base update command of your \LaTeX--system,
e.g.\ the \CC{texhash} command within your \CC{texmf} path, if required
by your \LaTeX--setup.

\subsection{Preamble}

The document preamble must contain all mandatory declarations and
may contain optional declarations.
As you can easily see, most of the commands are almost selfexplaining.

\subsubsection{Mandatory preamble declarations}

You must specify the author, the \Lia{} document identification, and
a version number.
The document identification should be a string uniquely identifying
the document among all \Lia{} documents.
The author should be a single name, if the document was written
by more than one person, the main author should be listed and the
other authors should be included in an appropriate section of the
document.
Usually, neither the author nor the identification number will be
changed in the future;
only the version number might increase with updates of the document.

\begin{verbatim}
\LiaWrittenBy{Arno Formella}
\LiaNumber{LIA-DOC-TEX-GUIDE}
\LiaVersion{1.5}
\end{verbatim}

\subsubsection{Optional preamble declarations}

The optional declaration allow you to automatically include certain
information at the beginning of the documents, mostly they are
contents tables.

\begin{verbatim}
%\LiaDate{\ddmmyyyydate\today} % the default declaration
\LiaDate{10/01/2009}           % how you should set the date

\LiaSubTitle{A subtitle you want to add}
\LiaListOfTodos
\LiaNoTableOfContents
\LiaListOfTables
\LiaListOfTBD
\LiaListOfFigures
\end{verbatim}

\subsection{Page layout}

The general page layout as generated by this style is shown on the next page.

\pagebreak
\layout

\pagebreak
\subsection{Commands}

The class file defines certain commands which are useful in many
situations and they must be used, if the corresponding information
they code is introduced readily in the document.

\subsubsection{Simple commands}

The following commands generate the fixed output as given:

\begin{longtable}{|l|l|}\hline
\verb+\Lia+ & \Lia\\
\verb+\LiaClsVersion+ & \LiaClsVersion\\
\verb+\LiaClsVersionDate+ & \LiaClsVersionDate\\
\verb+\LiaClsVersionOnly+ & \LiaClsVersionOnly\\
\hline
\caption{\label{tab:liafixcmds}Alphabetically ordered list of fixed content
\CC{Lia}-commands.}
\end{longtable}

According to the settings in the preamble, the following commands
generate the appropriate output:

\begin{longtable}{|l|l|}\hline
\verb+\LiaAuthorVar+ & \LiaAuthorVar\\
\verb+\LiaDateVar+ & \LiaDateVar\\
\verb+\LiaNumberVar+ & \LiaNumberVar\\
\verb+\LiaVersionVar+ & \LiaVersionVar\\
\hline
\caption{\label{tab:liavarcmds}Alphabetically ordered list of variable content
\CC{Lia}-commands.}
\end{longtable}

\subsubsection{To--be--determined entries}

The command \verb+\LiaTBD{explainatory text}+
produces a ``to be determined'' ({\bfseries TBD}) entry in the text.
The explainatory text is not written, rather it is added into a
summary list of all remaining such notes in the document.
You should switch-on the inclusion of the TBD table in the preamble
whenever you use this feature.

\subsubsection{Acronyms}

Acronyms are handled with two commands:
\verb+\ACR{acronym}+ and \verb+\rACR{acronym}+.
The first one defines an acronym which may be done, for instances, in a
\hyperref[tab:acronyms]{corresponding table}.
The second one references the acronym and should be used whenever
the acronym is cited.
An example is the \rACR{SOME} acronym.

\subsubsection{Margin entries}

\LiaMarginDotBlue Margin text is placed to the left of the text.
Besides some short text like done here with the command \LiaMargin{margin text}
\verb+\LiaMargin{margin text}+
you can use colored dots to mark certain lines or paragraphs.
The predefined commands are
\verb+\LiaMarginDot+,
\verb+\LiaMarginDotRed+,
\verb+\LiaMarginDotGreen+, and
\verb+\LiaMarginDotBlue+.
\LiaMarginDotGreen The available colors are the same colors as used for
the \Lia{} logo.
Note \LiaMarginDotRed that if you place several dots to close to each other
they may not be placed exactly where you expect.

\subsection{Already available packages}

The \Lia-class file includes already the following packages:

\begin{longtable}{|l|l|}\hline
\CC{afterpage} & to act at the end of a page \\
\CC{caption} & to typeset captions of tables and figures \\
\CC{colortbl} & to use color in tables \\
\CC{datetime} & to specify date time easily \\
\CC{fancyhdr} & to generate the header and footer lines \\
\CC{geometry} & to set-up the page layout \\
\CC{graphicx} & to include images in the document \\
\CC{hyperref} & to allow for hypertext references \\
\CC{ifthen} & for conditional executions \\
\CC{inputenc} & with option utf8 for input character set \\
\CC{lastpage} & to reference the last page \\
\CC{longtable} & to make long tables available \\
\CC{marginnote} & to typeset notes on the margins \\
\CC{pdfpages} & to handle external pdf pages \\
\CC{sectsty} & to deal with the section titles \\
\CC{todonotes} & to include todo notes \\
\CC{units} & to typeset units correctly \\
\CC{xcolor} & to use color in the document \\
\hline
\caption{\label{tab:packages}Alphabetically ordered list of all packages
already included by the style file.}
\end{longtable}

Consider reading their documentation if you want to use features
of the packages that go beyond the issues described in this short guide.

\subsection{Include complete PDF pages}

Sometimes it might be necessary to include some or all pages of an
external PDF-document into your \Lia-document.
An easy way is to take advantage of the \CC{pdfpages} package, for instance
with commands like:

\begin{verbatim}
\includepdf{filename}
\includepdf[pages=3]{filename}
\includepdf[pages=2-5]{filename}
\includepdf[pages=-5]{filename}
\includepdf[pages=5-]{filename}
\end{verbatim}

Then at that point, the current page is finished and the pages to
be included will be inserted without any change;
page numbering etc.~is continued afterwards correctly.
If you first want to fill the current page with text located
after your \verb+\includepdf+-command, you can use:

\begin{verbatim}
\afterpage{\includepdf[pages=2-3]{filename}}
\end{verbatim}

\subsection{Include of SVG-images}

SVG images can be included directly with the help of the
\CC{svg}-package.
Hence, include in your preamble the line
\begin{verbatim}
\usepackage{svg}
\end{verbatim}
and further on use
\begin{verbatim}
\includesvg{your-image-file-name}
\end{verbatim}

\LiaMarginDotBlue Note that you need some other tools being installed
on your system, e.g., the program \CC{inkscape},
which eventually performs the conversation from SVG to PDF.
See the corresponding documentation of the \CC{svg}-package.

\LiaMarginDotRed Note that you need to call \LaTeX{} with an additional
command line switch:
\begin{verbatim}
pdflatex --shell-escape your-latex-file
\end{verbatim}

\subsection{Mathematics}

\begin{eqnarray}
\sum_i^n \frac{\Delta(x)\sin(\alpha\omega t)}{\int_a^g f(x) y^2 dx}
\end{eqnarray}

\subsection{Todo notes}

When the document is still not finished, you might consider using
\emph{todo notes}, like this one:

\todo[inline]{I should read the todo notes documentation}

Missing images can be highlighted as well:

\missingfigure{This figure is still missing.}

For more information on how to use the todo notes please refer to
the documentation of the todo-package.

\section{Invocation}

You simply run

\begin{verbatim}
pdflatex your_document.tex
\end{verbatim}

Make sure that the files as mentioned in Table \ref{tab:files}
are accessible either in the same directory or in a search path of \LaTeX.
You should prefer soft links to some central place,
rather than copying the files directly,
so changes can be propagated easily.

As alternative you can use the \CC{Makefile} for \LaTeX--documents
as described in the \citetitle{lia-2013-tools}~\cite{lia-2013-tools} document.

\printbibliography

\end{document}
