2020-01-17 09:35:00 +00:00
|
|
|
\documentclass{scrartcl}
|
2019-11-25 20:46:06 +00:00
|
|
|
|
2019-11-27 17:24:33 +00:00
|
|
|
\usepackage{listings}
|
|
|
|
\usepackage{color}
|
2019-11-26 06:33:45 +00:00
|
|
|
\usepackage{graphicx}
|
2019-11-26 10:35:15 +00:00
|
|
|
\usepackage[backend=biber,style=alphabetic]{biblatex}
|
2019-11-26 10:14:57 +00:00
|
|
|
\addbibresource{$HOME/me/bibliotheca.bib}
|
2019-11-26 06:33:45 +00:00
|
|
|
|
2019-11-27 17:24:33 +00:00
|
|
|
\def\code#1{\texttt{#1}}
|
|
|
|
|
2019-11-25 20:46:06 +00:00
|
|
|
\title{Programming is fun!}
|
|
|
|
\author{DarkWiiPlayer}
|
|
|
|
|
2019-11-27 17:24:33 +00:00
|
|
|
\definecolor{listingbg}{rgb}{1,0.96,0.7}
|
|
|
|
|
2019-11-25 20:46:06 +00:00
|
|
|
\begin{document}
|
2019-11-27 17:24:33 +00:00
|
|
|
\lstset{
|
|
|
|
backgroundcolor=\color{listingbg},
|
|
|
|
tabsize=3, numbers=left,
|
|
|
|
}
|
|
|
|
|
2019-11-25 20:46:06 +00:00
|
|
|
\maketitle
|
2019-11-26 06:33:45 +00:00
|
|
|
|
2019-11-27 17:24:33 +00:00
|
|
|
Listings can be done fairly easily in LaTeX; one only has to include the \code{listings} package and start a new \code{lstlisting} block.
|
|
|
|
|
|
|
|
\lstset{language=[5.1]Lua,caption={A hello world program in Lua}}
|
|
|
|
\begin{lstlisting}
|
|
|
|
-- Comment
|
|
|
|
print "Hello World!"
|
|
|
|
\end{lstlisting}
|
|
|
|
|
|
|
|
\lstset{language=C,caption={The same program in C}}
|
|
|
|
\begin{lstlisting}
|
|
|
|
#include <stdio.h>
|
|
|
|
// Comment
|
|
|
|
int main() { printf("Hello World!\n") }
|
|
|
|
\end{lstlisting}
|
|
|
|
|
2019-11-26 06:33:45 +00:00
|
|
|
\begin{figure}[h]
|
|
|
|
\centering
|
|
|
|
\includegraphics{$HOME/image.png}
|
|
|
|
\caption{An image}
|
|
|
|
\label{fig:image1}
|
|
|
|
\end{figure}
|
|
|
|
|
2019-11-25 20:46:06 +00:00
|
|
|
Programming is fun! \cite{sicp}
|
2019-11-26 06:33:45 +00:00
|
|
|
|
2019-11-26 10:14:57 +00:00
|
|
|
\printbibliography
|
2019-11-25 20:46:06 +00:00
|
|
|
\end{document}
|