Portfolio: Added most of the sections to report.

parent 86bee751
......@@ -13,14 +13,14 @@ compile:
pdflatex -interaction=nonstopmode latex-answers.tex
rm -vf *.log
graph: graph.dot
graph: graph.tex
highlight: foo.py
highlight: foo.tex
%.py: %.tex
pygmentize -O style=colorful -o $^ $@
foo.tex: foo.py
pygmentize -O style=colorful -o $@ $^
%.dot: %.tex
dot2tex --autosize --usepdflatex $@ | \
sed 's/\\\(use\|enl\|doc\|page\|\(end\|begin\){doc\).*//' > $^
graph.tex: graph.dot
dot2tex -t math $^ | \
sed 's/\\\(use\|enl\|doc\|page\|\(end\|begin\){doc\).*//' > $@
digraph A {
node [label="$q_0$"] q_0 ;
q_0 -> q_1;
q_1 -> q_1;
q_1 -> q_2;
q_2 -> q_0;
q_3 -> q_4;
q_4 -> q_4;
q_4 -> q_7;
q_3 -> q_6;
q_6 -> q_7;
q_7 -> q_3;
}
......@@ -3,6 +3,9 @@
\usepackage{listings}
\usepackage{hyperref}
\usepackage{amsmath}
\usepackage{appendix}
\usepackage{booktabs}
% Graphviz graph (using tikz)
\usepackage[x11names, rgb]{xcolor}
......@@ -25,6 +28,16 @@
\begin{document}
\maketitle
\begin{abstract}
This assignment is about practising with the \LaTeX{} typesetting system. This
assignment should at least contain an abstract (this), table of content (below
on this page), different sections, some source code, a graph, a table, a
mathematical equation (including a theorem and proof), footnotes, hyperlinks, a
quotation, a reference to an existing scientific article and, last by not least,
should use BibTeX.
\end{abstract}
\tableofcontents
\pagebreak
......@@ -32,11 +45,66 @@
\section{Basic typography} % {{{
\label{sec:Basic typography}
% abstract
% table of contents
% list
% footnote
% hyperlink
\subsection{Ordered and unordered list} % {{{
\label{sub:Ordered and unordered list}
Let's start with an example of an unordered list containing the names of some
``randomly chosen'' countries.
\begin{itemize}
\item The Netherlands.
\item Belgium.
\item Germany.
\item England.
\item France.
\end{itemize}
\noindent And an ordered list, which is used when the order matters.
\begin{enumerate}
\item First item.
\item Second item.
\item Third item, which is \\
splitted into two lines.
\item Fourth and last item.
\end{enumerate}
% }}}
\subsection{Footnotes and hyperlinks} % {{{
\label{sub:Footnotes and hyperlinks}
When writing an article, it is sometimes unclear if the audience of the article
understands every detail. Therefore, it is wise to add additional information
(or the address of a web page containing additional information) about details
inside footnotes\footnote{This is an example of a footnote in \LaTeX{}.}.
Manuals contain often hyperlinks to introduce a subject, which is out of the
scope of the manual. This is a hyperlink to Google's homepage:
\url{http://www.google.com}, which will help while writing an advanced \LaTeX{}
document.
% }}}
\subsection{Quotation and references} % {{{
\label{sub:Quotation and references}
It is possible that another author wrote a brilliant text about your subject. It
is even so brilliant that describes everything and your description would be
fuzzy compared to his description. That could be a reason to quote the relevant
part of his text. \footnote{Note: Plagiarism looks like quoting but is in fact
very different. Plagiarism is when someone is quoting, for example, an entire
article, without mentioning the source of the article. I would call it stealing,
but that is just my humble opinion.}
This a quote of the famous Linus Torvalds, which is one the reason why I choose
to study Computer Science:
\begin{quote} \emph{``Most good programmers do programming not because they
expect to get paid or get adulation by the public, but because it is fun to
program.'' $-$ Linus Torvalds} \end{quote}
% }}}
% quotation
% reference to existing article.
% BibTex
......@@ -50,7 +118,7 @@ One of the requirements of this assignment is demonstrating some (highlighted)
pseudo code, therefore I took the initiative to write some example python code
used for this demonstration.
\begin{program} % {{{
\begin{program}[H] % {{{
\label{lst-example-foo}
......@@ -78,29 +146,52 @@ overall compilation process.
\subsection{Look all those tables!} % {{{
\label{sub:Look, it's a table!}
\begin{table}[H]
\begin{table}[H] \centering
\begin{tabular}{|l|l|l|} \hline
$r_1c_1$ & $r_1c_2$ & $r_1c_3$ \\ \hline
$r_2c_1$ & $r_2c_2$ & $r_2c_3$ \\ \hline
$r_3c_1$ & $r_3c_2$ & $r_3c_3$ \\ \hline
\end{tabular}
\caption{Basic table with three columns and rows}
\caption{Basic table with three columns and rows.}
\end{table}
\begin{table}[H]
\begin{table}[H] \centering
\begin{tabular}{|l|ll|} \hline
$r_1c_1$ & $r_1c_2$ & $r_1c_3$ \\ \hline
$r_2c_1$ & $r_2c_2$ & $r_2c_3$ \\ \cline{2-3}
$r_3c_1$ & $r_3c_2$ & $r_3c_3$ \\ \hline
\end{tabular}
\caption{Basic table with three columns and rows}
\caption{Basic table with three columns and rows.}
\end{table}
\begin{table}[H]
\begin{tabular}{@{}rrrrcrrrcrrr@{}}\toprule
& \multicolumn{3}{c}{$w = 8$} & \phantom{abc}& \multicolumn{3}{c}{$w = 16$} \\
\cmidrule{2-4} \cmidrule{6-8} \cmidrule{10-12}
& $t=0$ & $t=1$ & $t=2$ && $t=0$ & $t=1$ & $t=2$ \\\midrule
$dir=1$\\
$c$ & 0.0790 & 0.1692 & 0.2945 && 0.3670 & 0.7187 & 3.1815 \\
$c$ & -0.8651& 50.0476& 5.9384&& -9.0714& 297.0923& 46.2143 \\
$c$ & 124.2756& -50.9612& -14.2721&& 128.2265& -630.5455& -381.0930 \\
$dir=0$\\
$c$ & 0.0357& 1.2473& 0.2119&& 0.3593& -0.2755& 2.1764 \\
$c$ & -17.9048& -37.1111& 8.8591&& -30.7381& -9.5952& -3.0000 \\
$c$ & 105.5518& 232.1160& -94.7351&& 100.2497& 141.2778& -259.7326 \\
\bottomrule
\end{tabular}
\caption{Example table using the \texttt{booktabs} package.}
\end{table}
% }}}
\subsection{Graph (GraphViz to PSTikz)} % {{{
\label{sub:Graph-GraphViz-to-PSTikz}
% \input{graph}
\begin{figure}[H]
\input{graph}
\caption{Two graphs, written in GraphViz' \texttt{dot} and generated using \texttt{dot2tex}.}
\end{figure}
% }}}
% }}}
......@@ -108,7 +199,67 @@ $r_3c_1$ & $r_3c_2$ & $r_3c_3$ \\ \hline
\section{Mathematics} % {{{
\label{sec:Mathematics}
\subsection{Example matrix} % {{{
\label{sub:Example matrix}
Matrix A is an $M \times N$ matrix, which is written as
\[
\left(
\begin{array}{cccc}
\alpha_{0,0} & \alpha_{0,1} & \cdots & \alpha_{0,n-1} \\
\alpha_{1,0} & \alpha_{1,1} & \cdots & \alpha_{1,n-1} \\
\vdots & \vdots & \ddots & \vdots \\
\alpha_{m-1,0} & \alpha_{m-1,1} & \cdots & \alpha_{m-1,n-1}
\end{array}
\right)
\]
% }}}
\subsection{Equations} % {{{
\label{sub:Equations}
\LaTeX{} makes it possible to write equations (with for example sub and
superscript, braces and summations) easily.
\[
\left|\sum_{i=1}^n a_ib_i\right|
\le
\left(\sum_{i=1}^n a_i^2\right)^{1/2}
\left(\sum_{i=1}^n b_i^2\right)^{1/2}
\]
And it is possible to break the equation into smaller, numbered parts.
\begin{align}
(a+b)^3 &= (a+b)^2(a+b)\\
&=(a^2+2ab+b^2)(a+b)\\
&=(a^3+2a^2b+ab^2) + (a^2b+2ab^2+b^3)\\
&=a^3+3a^2b+3ab^2+b^3
\end{align}
% }}}
\subsection{Mathematical Theorem} % {{{
\label{sub:Mathematical Theorem}
% }}}
% }}}
\begin{appendices}
\pagebreak
\section{Example appendix} % {{{
\label{sec:Example}
Additional information (or information which will fill many pages) is in most
cases added at the end of a document in the Appendix. This is just an example,
but without any additional information :-).
% }}}
\end{appendices}
\end{document}
% vim: foldmethod=marker:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment