Atlas Preamble

My personal standard LaTeX preamble, written as a modular package.

Category

Other

License

Free to use (MIT)

File

examples/compsci.tex

compsci.texRead-only preview
\documentclass[11pt, a4paper]{article}

\usepackage[english]{babel}

\usepackage[compsci]{atlas-preamble}


\title{Computer Science and \texttt{atlas-preamble}}
\author{Responsible for \texttt{compsci} preset: Tassilo Schwarz\footnote{Email: \texttt{lastname@maths.ox.ac.uk}}}
\date{\today}



\begin{document}

\maketitle


\section{Introduction}
To use computer science notation and packages in your document with \texttt{atlas-preamble}, use the \texttt{compsci} preset option:
\begin{verbatim}
	\usepackage[compsci]{atlas-preamble}
\end{verbatim}


\section{Theoretical notation macros}
The following often-used symbols in theoretical computer science get abbreviated macros:
\begin{align*}
	&\texttt{\textbackslash Oh\{\}} & &\texttt{\textbackslash oh\{\}} & &\texttt{\textbackslash Th\{\}} & &\texttt{\textbackslash Om\{\}} & &\texttt{\textbackslash om\{\}} \\
	&\Oh{\frac{n^2}{m}} & &\oh{\frac{n^2}{m}} & &\Th{\frac{n^2}{m}} & &\Om{\frac{n^2}{m}} & &\om{\frac{n^2}{m}}
\end{align*}


\section{Pseudocode}
For the example algorithm using \texttt{algpseudocode} from the \texttt{algorithmicx} documentation, see Algorithm \ref{alg:ex1}.

\begin{algorithm}
	\caption{The Bellman-Kalaba algorithm}
	\label{alg:ex1} % note that \label should be given AFTER \caption and BEFORE \begin{algorithmic}

	\algorithminput{Some input} 
	\algorithmoutput{Some output} 

	\begin{algorithmic}[1]
		\Procedure{BellmanKalaba}{$G$, $u$, $l$, $p$}
			\RepeatTimes{$t$}
				\State{This will be repeated $t$ times}
			\EndRepeatTimes  \CommentLine{This is one line only for a comment.}
	
			\ForAll{$v \in V(G)$}
				\State $l(v) \leftarrow \infty$
			\EndFor
			\State $l(u) \leftarrow 0$
			\Repeat
				\For{$i \leftarrow 1, n$}
					\State $min \leftarrow l(v_i)$
					\For{$j \leftarrow 1, n$}
						\If{$min > e(v_i, v_j) + l(v_j)$}
							\State $min \leftarrow e(v_i, v_j) + l(v_j)$
							\State $p(i) \leftarrow v_j$
						\EndIf
					\EndFor
					\State $l'(i) \leftarrow min$
				\EndFor
				\State $changed \leftarrow l \not= l'$
				\State $l \leftarrow l'$
			\Until{$\neg changed$}
		\EndProcedure
		\Statex
		\Statex \Comment{Here we have extra space}
		\Statex
		\Procedure{FindPathBK}{$v$, $u$, $p$}
			\If{$v = u$}
				\State \textbf{Write} $v$
			\Else
				\State $w \leftarrow v$
				\While{$w \not= u$}
					\State \textbf{Write} $w$
					\State $w \leftarrow p(w)$
				\EndWhile
			\EndIf
		\EndProcedure
	\end{algorithmic}
\end{algorithm}


\section{Complexity theoretic terms}
The \texttt{complexity} package provides nice typesetting for complexity theoretic terms like \P, \NP, \EXPSPACE, etc. However, it redefines the following built-in commands as follows: \texttt{\L} (originally \defaultL), \texttt{\P} (originally \defaultP), and \texttt{\S} (originally \defaultS). Access these using \texttt{\string\default\string{L,P,S\string}}, respectively.
\end{document}
Preview
Atlas Preamble preview
Atlas Preamble LaTeX Template | Bibby | Bibby AI