diff --git a/doc/book/amdis.pdf b/doc/book/amdis.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f64969c227ae7a94f327c9767ea46ded4e2f5a20
Binary files /dev/null and b/doc/book/amdis.pdf differ
diff --git a/doc/book/amdis.tex b/doc/book/amdis.tex
new file mode 100644
index 0000000000000000000000000000000000000000..dc7b94b1faba44e49675b9f0d72a0c60a388a099
--- /dev/null
+++ b/doc/book/amdis.tex
@@ -0,0 +1,66 @@
+\documentclass[dresden]{lotdiss}
+
+\include{declarations}
+\include{papers}
+% \makeindex
+
+
+% ======================================================
+\title{AMDiS\\[0.5\baselineskip]\Large Adaptive Multi-Dimensional Simulations}
+\subtitle{An overview about the Finite-Element Toolbox}
+
+\englishabstract{English summary}
+
+\germanabstract{Deutsche Kurzzusammenfassung}
+
+\author{Simon Praetorius}
+%\geboren{20. September 1985 \\in Nordhausen, Deutschland}
+
+\include{publishing}
+
+\promotors{
+Gutachter:  & Prof. Dr. A. Voigt \\
+	    & Prof. S.~M. Wise \\
+%[4pt] Co-promoters: &  Prof. Dr. H. Kopka\\
+%					  & Dr. P. W. Daly \\
+}
+
+% \dedicationfile{dedication}
+
+
+% ======================================================
+\begin{document}
+\FrontMatter
+
+%\include{acknowledgements}
+% \include{abbreviations}
+\include{preface}
+
+% ======================================================
+\MainMatter
+
+% The regular (numbered) chapters.
+\include{introduction}
+
+\include{ch1}
+\include{ch2}
+\include{ch3}
+\include{ch4}
+\include{ch5}
+\include{ch6}
+
+\include{conclusion}
+
+%\appendix
+%\include{appendix-a}
+
+% ======================================================
+\BackMatter
+
+\bibliographystyle{siam}
+%\bibliography{references,references_solver}
+
+%\printindex
+
+
+\end{document}
\ No newline at end of file
diff --git a/doc/book/ch1.tex b/doc/book/ch1.tex
new file mode 100644
index 0000000000000000000000000000000000000000..c503ba329ab6cf0fc69f5d490083bb621561e13c
--- /dev/null
+++ b/doc/book/ch1.tex
@@ -0,0 +1,63 @@
+\chapter{\label{ch1}AMDiS tutorial}
+\begin{abstract}
+Abstract
+\end{abstract}
+
+\section{Scalar linear second order PDEs}
+\[
+\left[\partial_t u\right] + cu + \underline{b}\cdot\nabla u - \nabla\cdot(\mathbb{A}\nabla u) = f,\quad\text{ in }\Omega\times(0,T]
+\]
+with $u=u(x)$ the unknown function and coefficients $c, \underline{b}, \mathbb{A}$ that can depend on space, time, and other quantities $v$ living in $\Omega$:
+\[\begin{split}
+c &= c(t,x,v,\nabla v),\\
+\underline{b} &= \underline{b}(t,x,v,\nabla v)\in\mathbb{R}^d,\\
+\mathbb{A} &= \mathbb{A}(t,x,v,\nabla v)\in\mathbb{R}^{d\times d},\\
+f &= f(t,x,v,\nabla v),
+\end{split}\]
+equipped with (initial- and) boundary conditions on $\partial\Omega$.
+
+
+\begin{minted}{c++}
+#include "AMDiS.h"
+using namespace AMDiS;
+
+int main(int argc, char** argv) 
+{
+  AMDiS::init(argc, argv);
+
+  // create and init the scalar problem
+  ProblemStat prob("poisson");
+  prob.initialize(INIT_ALL);
+
+  // define operators
+  Operator opLaplace(prob.getFeSpace(), prob.getFeSpace());
+    addSOT(opLaplace, 1.0); // <grad(u), grad(theta)>
+  Operator opF(prob.getFeSpace());
+    addZOT(opF, 1.0); // <f(x), theta>
+  
+  // add operators to problem
+  prob.addMatrixOperator(opLaplace, 0, 0);
+  prob.addVectorOperator(opF, 0);
+
+  // add boundary conditions
+  BoundaryType nr = 1;
+  prob.addDirichletBC(nr, 0, 0, new Constant(0.0));
+
+  AdaptInfo adaptInfo("adapt");
+  
+  // assemble and solve linear system
+  prob.assemble(&adaptInfo);
+  prob.solve(&adaptInfo);
+  
+  prob.writeFiles(&adaptInfo, true);
+  
+  AMDiS::finalize();
+}
+\end{minted}
+
+
+\section{Handling data on unstructured grids}
+
+\section{Adaptivity and systems of equations}
+
+\section{Time-dependent and nonlinear problems}
\ No newline at end of file
diff --git a/doc/book/ch2.tex b/doc/book/ch2.tex
new file mode 100644
index 0000000000000000000000000000000000000000..ecc9062569687219d3793e40ea320317c74b5cc9
--- /dev/null
+++ b/doc/book/ch2.tex
@@ -0,0 +1,4 @@
+\chapter{\label{ch2}Parallelization}
+\begin{abstract}
+Abstract
+\end{abstract}
\ No newline at end of file
diff --git a/doc/book/ch3.tex b/doc/book/ch3.tex
new file mode 100644
index 0000000000000000000000000000000000000000..6985fcc0bfbc7e253d2a70bc0760283697f78c79
--- /dev/null
+++ b/doc/book/ch3.tex
@@ -0,0 +1,4 @@
+\chapter{\label{ch3}Multi-Grid and Multi-Mesh}
+\begin{abstract}
+Abstract
+\end{abstract}
\ No newline at end of file
diff --git a/doc/book/ch4.tex b/doc/book/ch4.tex
new file mode 100644
index 0000000000000000000000000000000000000000..a6b5ab151e46c3718cddff0d8ac5867d41892d05
--- /dev/null
+++ b/doc/book/ch4.tex
@@ -0,0 +1,4 @@
+\chapter{\label{ch4}Working with Meshes}
+\begin{abstract}
+Abstract
+\end{abstract} 
\ No newline at end of file
diff --git a/doc/book/ch5.tex b/doc/book/ch5.tex
new file mode 100644
index 0000000000000000000000000000000000000000..b5dcb896f28cb40ff2261e59474556c919986828
--- /dev/null
+++ b/doc/book/ch5.tex
@@ -0,0 +1,350 @@
+\chapter{\label{ch5}Expression templates}
+\begin{abstract}
+Abstract
+\end{abstract}
+
+\section{Motivation}
+Beim Umsetzen einer Differentialgleichung ist der Standardweg in AMDiS diese zu zerlegen in einzelne Terme, zu klassifizieren als 0.-Orderung, 1.-Ordnung oder 2.-Ordnungs Term und dann alle in Operatoren zu packen, die wiederum dem zu lösenden Problem zugewiesen werden. Beispielsweise findet man folgenden Ausdruck im Navier-Stokes Beispiel:
+
+\begin{minted}{c++}
+DOFVector<double>* U = prob->getSolution(j);
+Operator opUGradU2(getFeSpace(i), getFeSpace(i));
+  opUGradU2.addTerm(new Vec2AndPartialDerivative_FOT(densityPhase, U, j), GRD_PHI);
+prob->addMatrixOperator(opUGradU2, i, i);
+\end{minted}
+
+Was genau dieser Operator nun implementiert lässt sich am Namen der Terme nur noch erahnen. Als Ausweg daraus und aus der Notwendigkeit für immer neue Termkonstallationen habe ich folgende Variante implementiert, die die Sytax zumindest einer Zeile etwas aufräumt:
+
+\begin{minted}{c++}
+DOFVector<double>* U = prob->getSolution(j);
+Operator opUGradU2(getFeSpace(i), getFeSpace(i));
+  addFOT(opUGradU2, valueOf(densityPhase) * valueOf(U), j, GRD_PHI);
+prob->addMatrixOperator(opUGradU2, i, i);
+\end{minted}
+
+Dies ist zwar nur unwesentlich kürzer, gibt dafür direkte Auskunft darüber, wie sich der Koeffizient des Terms zusammensetzt, nämlich als Produkt von 2 DOFVectoren (densityPhase und \cpp{solution[j]}). Die Syntax lässt sich aber nicht nur anwenden beim Füllen von Operatoren, sondern auch für die Integration über Ausdrücke von DOFVectoren und bei der Transformation von DOFVectoren. Dazu aber später mehr. Nachfolgend ist die neue Syntax aufgelistet.
+
+\section{Syntaxbeschreibung}
+\subsection{Header}
+Um die neue Sytax nutzen zu können muss folgende Header-datei eingebunden werden:
+
+\cppline{#include "Expressions.h"}
+
+\subsection{Elementare Ausdrücke}
+In der Folgenden Tabelle ist DV ein Pointer/Reference auf \cpp{DOFVector<T>} mit beliebigem \cpp{T}:
+%
+\begin{table}[H]
+\rowcolors{1}{}{lightblue}
+\begin{tabular}{p{.3\linewidth}|p{.65\linewidth}}
+\hline
+\textbf{Expression} & \textbf{Semantics} \\
+\hline\hline
+\cpp{valueOf(DV)} &
+Auswertung des DOFVectors an Quadraturpunkten \\
+\cpp{gradientOf(DV)} &
+Auswertung des Gradienten eines DOFVectors an Quadraturpunkten \\
+\cpp{derivativeOf(DV, i)} &
+Auswertung der partiellen Ableitung des DOFVectors nach der i-ten Koordinate an Quadraturpunkten \\
+\cpp{hessianOf(DV)} &
+Auswertung der Hesse-Matrix des DOFVectors: $\nabla^2 DV = H_{ij} = \partial_i(\partial_j(DV))$  (kann nur in \cpp{transformDOF}, bzw. \cpp{<<} verwendet werden) \\
+\cpp{laplacianOf(DV)} &
+Auswertung des Laplace des DOFVectors: $\Delta DV = \sum_i\partial_i(\partial_i(DV)))$ (kann nur in \cpp{transformDOF}, bzw. \cpp{<<} verwendet werden) \\
+\cpp{componentOf(DV, i)} &
+Auswertung der i-ten Komponente eines DOFVectors an Quadraturpunkten. Dies macht nur Sinn für \cpp{DOFVector<Vector<T> >} Objekten. \\
+\cpp{X(), X<i>()} & 
+Der Koordinatenvektor, bzw. die i-te Komponente des Koordinatenvektors an den QP. \\
+\cpp{N(b), N(b,i)} & 
+Der äußere Normalenvektor zurgörig zur Fläche mit dem Index b, bzw. deren i-te Komponente. \\
+\cpp{M(), M(i)} & 
+Der Elementnormalenvektor (bei Oberflächengittern), bzw. deren i-te Komponente \\
+\cpp{constant(c), c} &
+Konstanten (numeric values) sind z.B. double, float, int. Entweder eingeschlossen in \cpp{constant()}, oder direkt \\
+\cpp{constant<C>()} &
+(Compiletime) Konstanten sind Integer, die beim Differenzierten von Ausdrücken verwendet werden können (s.u.). \\
+\cpp{var(c)} &
+Eine Referenz oder ein Pointer auf einen Wert, der sich dynamisch verändern kann.\\
+\hline
+\end{tabular}
+\end{table}
+
+Der Ausdruck \texttt{valueOf(DV)} kann außerdem auf Vektoren und Matrizen von DOFVectoren angewendet werden: 
+%
+\begin{table}[H]
+\rowcolors{1}{}{lightblue}
+\begin{tabular}{p{.3\linewidth}|p{.65\linewidth}}
+\hline
+\textbf{Expression} & \textbf{Semantics} \\
+\hline\hline
+\cpp{valueOf(DV)} &
+Auswertung des DOFVectors an Quadraturpunkten \\
+\cpp{valueOf(vector<DV<T>>)} &
+Ergibt an den Quadraturpunkten einen \cpp{vector<T>} mit den Werten der einzelnen DOFVektoren and dieser Stelle. \\
+\cpp{valueOf(matrix<DV<T>>)} &
+Ergibt an den Quadraturpunkten eine \cpp{matrix<T>} mit den Werten der einzelnen DOFVektoren and dieser Stelle. \\
+\cpp{valueOf<Name>(X)} & 
+Eine Expression, der ein Name zugeordnet ist. \cpp{Name} ist dabei ein C++-Typ. Ist kein Name explizit angegeben, wird \cpp{_unknown} verwendet. (siehe auch Differenzieren von Ausdrücken)\\
+\hline
+\end{tabular}
+\end{table}
+
+\subsection{Operationen}
+In der folgenden Tabelle sind Operationen aufgelistet, über die die elementaren Term (s.o.) kombiniert werden können. Dabei steht \cpp{T}, bzw. \cpp{Tn} für einen Term und \cpp{F} für ein Funktor-Objekt (siehe unten).
+%
+\begin{table}[H]
+\rowcolors{1}{}{lightblue}
+\begin{tabular}{p{.3\linewidth}|p{.65\linewidth}}
+\hline
+\textbf{Expression} & \textbf{Semantics} \\
+\hline\hline
+\cpp{+, -, *, /} & 
+Elementare arithmetische Ausdrücke \\
+\cpp{pow<p>(T)} &
+Die p-te Potenz eines Term, wenn Term skalar ist. \\
+\cpp{sqrt(T)} &
+Die Wurzel des Ausdrucks \cpp{T} \\
+\cpp{exp(T)} &
+Die Exponentialfunktion angewendet auf das Ergebnis der Auswertung des Terms \cpp{T}. \\
+\cpp{log(T)} &
+Der natürlich Logarithmus der Auswertung des Terms \cpp{T}. \\
+\cpp{cos(T), sin(T), tan(T)} &
+Der Cosinus, Sinus, bzw. Tangens der Auswertung des Terms \cpp{T}. \\
+\cpp{acos(T), asin(T), atan(T)} &
+Der Arkus-Cosinus, Arkus-Sinus, bzw. Arkus Tangens der Auswertung des Terms \cpp{T}. \\
+\cpp{atan2(T1, T2)} &
+Der Arkus-Tangens 2 = \cpp{atan(T1 / T2)}. \\
+\cpp{cosh(T), sinh(T), tanh(T)} &
+Der Cosinus-Hyperbolicus, Sinus-Hyperbolicus, bzw. Tangens-Hyperbolicus der Auswertung des Terms \cpp{T}. \\
+\cpp{acosh(T), asinh(T), atanh(T)} &
+Der Arkus Cosinus-Hyperbolicus, Arkus Sinus-Hyperbolicus, Arkus Tangens-Hyperbolicus der Auswertung des Terms \cpp{T}. \\
+\cpp{max(T1,T2), min(T1,T2)} &
+Das Maximum/Minimum der Auswertungen von \cpp{T1}, bzw. \cpp{T2}. \\
+\cpp{absolute(T), signum(T)} &
+Der Absolutbetrag von T, bzw. das Vorzeichen (\cpp{if(T < 0) signum(T) = -1 else if(T > 0) signum(T) = 1 else signum(T) = 0}) \\
+\cpp{ceil(T), floor(T)} &
+die kleines ganze Zahl größer, bzw. die größte ganze Zahl kleiner als Wert von \cpp{T} \\
+\cpp{func(F, T1, T2,...)} &
+Die Anwendung eines Funktors \cpp{F} auf die Auswertung der Terme \cpp{T1,T2,...} \\
+\hline
+\end{tabular}
+\end{table}
+
+Ein Funktor ist dabei eine Klasse mit folgender Struktur:
+\begin{minted}{c++}
+struct Functor : public FunctorBase
+{
+  typedef (...) value_type;
+  int getDegree(int d1, int d2, ...) const { return (...); }
+
+  value_type operator()(const T1::value_type&, const T2::value_type&, ...) const { return (...); }
+};
+\end{minted}
+
+Die Argumente, die an die Funktion \texttt{getDegree} übergeben werden sind die Polynomgrade der Terme: 
+
+\cppline{getDegree(T1.getDegree(), T2.getDegree(), ...)}
+
+\subsection{Vektor-/Matrix-Ausdrücke}
+Für vektor- bzw. matrixwertige Term, wie z.B. \cpp{gradientOf(DV)} gibt es eine Reihe von Ausdrücken / Operationen, die im Folgenden aufgelistet sind. Dabei bezeichnet \cpp{V} eine vektorwerte Expression und \cpp{M} eine matrixwertige Expressions.
+%
+\begin{table}[H]
+\rowcolors{1}{}{lightblue}
+\begin{tabular}{p{.3\linewidth}|p{.65\linewidth}}
+\hline
+\textbf{Expression} & \textbf{Semantics} \\
+\hline\hline
+\cpp{+, -} &
+Elementare arithmetische Ausdrücke (Elementweise) \\
+\cpp{unary_dot(V)} &
+Skalarprodukt eines vektorwertigen Terms mit sich selbst: \cpp{result = V^H * V}. \\
+\cpp{dot(V1, V2)} &
+Skalarprodukt zweier vektorwertigen Terme: \cpp{result = V1^H * V2}. \\
+\cpp{one_norm(V)} &
+Die 1-Norm eines Vektors \cpp{result = sum_i(abs(V_i))}. \\
+\cpp{one_norm(M)} &
+Die 1-Norm einer Matrix \cpp{result = max_j(sum_i(abs(M_ij)))}. \\
+\cpp{two_norm(V)} &
+Die 2-Norm eines Vektors \cpp{result = sqrt(V^H * V)}. \\
+\cpp{p_norm<p>(V)} &
+Die p-Norm eines Vektors \cpp{result = [sum_i(abs(v_i)^p)]^(1/p)}. \\
+\cpp{cross(V1, V2)} &
+Kreuzprodukt zweier vektorwertigen Terme: \cpp{result = V1 x V2}. \\
+\cpp{diagonal(V)} &
+Diagonalmatrix aus einträgen eines vektorwertigen Terms: \cpp{matrix = diagonal(V)}. \\
+\cpp{outer(V1, V2)} &
+Äußeres Produkt (dyadisches Produkt / Tensorprodukt) zweier vektorwertigen Terme: \cpp{matrix = V1 * V2^T}. \\
+\cpp{trans(M)} &
+Das Transponierte eines matrixwertigen Terms: \cpp{result = M^T}. \\
+\cpp{at(V, i)} &
+Zugriff auf eine Komponente eines Vektors: \cpp{result = V_i}. \\
+\cpp{at(M, i, j)} &
+Zugriff auf eine Komponente einer Matrix: \cpp{result = M_ij}. \\
+\hline
+\end{tabular}
+\end{table}
+
+\subsection{Differenzieren von Ausdrücken}
+Terme / Expressions sind Ausdrücke mit Variablen und Operationssymbolen, die Formal nach einzelnen Variablen differenziert werden können. Variablen sind hierbei Ausdrücke \cpp{valueOf<Name>(DV)} denen ein Variablenname zugeordnet ist. Jedem \cpp{valueOf} Ausdruck ist standardmäßig der Name \cpp{_unknown} zugeordnet. Für skalare Terme (also Terme ohne Vektorausdrücke und vektorwertige Variablen) lässt sich die Differentiation automatisch durchführen.
+
+Um dies nutzen zu können, muss die Datei \cpp{diff_expr.hpp} eingebunden werden:
+
+\cppline{#include "expressions/diff_expr.hpp"}
+
+\begin{table}[H]
+\rowcolors{1}{}{lightblue}
+\begin{tabular}{p{.3\linewidth}|p{.65\linewidth}}
+\hline
+\textbf{Expression} & \textbf{Semantics} \\
+\hline\hline
+\cpp{diff<Name>(T)} & 
+Differentiation nach Variable "Name": \cpp{d_Name (Term)} \\
+\cpp{diff<Name>(T, U)}	&
+Richtungsableitung nach Variable "Name", in Richtung \cpp{U}:  \cpp{d_Name (Term)[U]} \\
+\cpp{simplify(T)} &
+Vereinfachen eines Terms. Insbesondere werden Multiplikationen mit 0 und mit 1 entfernt und verschachtelte Operationen zwischen Konstanten zusammengefasst.\\
+\hline
+\end{tabular}
+\end{table}
+
+\subsection{Anwendung}
+Diese verallgemeinerten Terme können nun beim Assemblieren, integrieren und transformieren von DOFVectoren verwendet werden: In der Folgenden Tabelle wird \cpp{Operator} für einen Pointer/Reference auf ein Operator Objekt verwendet und Term steht für einen Ausdruck, der sich aus den obigen Zutaten zusammensetzt. \cpp{Flag} ist entweder \cpp{GRD_PHI}, oder \cpp{GRD_PSI}, je nachdem, ob die Ableitung bei einem 1.-Ordnungs Term auf der Ansatzfunktion \cpp{u}, oder Testfunktion \cpp{v} steht.
+%
+\begin{table}[H]
+\rowcolors{1}{}{lightblue}
+\begin{tabular}{p{.3\linewidth}|p{.65\linewidth}}
+\hline
+\textbf{Expression} & \textbf{Semantics} \\
+\hline\hline
+\cpp{addZOT(Operator, Term)} &
+Ein 0.-Ordnungs Term $(\text{Term} \cdot u,\; v)$ \\
+\cpp{addFOT(Operator, Term, Flag)} &
+Ein 1.-Ordnungs Term $(\text{Term} \cdot \nabla{u},\; v)$, bzw. $(\text{Term} \cdot u,\; \nabla{v})$, wenn der \cpp{value_type} von \cpp{Term} einem \cpp{WorldVector<double>} entspricht, bzw. $(\mathbf{1}\text{Term} \cdot \nabla{u},\; v)$, bzw. $(\mathbf{1}\text{Term} \cdot u,\; \nabla{v})$, mit $\mathbf{1}=(1,1,1)^\top$, wenn der \cpp{value_type} von \cpp{Term} einem \cpp{double} entspricht. \\
+\cpp{addFOT(Operator, Term, i, Flag)} &
+Ein 1.-Ordnungs Term $(\text{Term} \cdot \partial_i{u},\; v)$, bzw. $(\text{Term} \cdot u,\; \partial_i{v})$ \\
+\cpp{addSOT(Operator, Term)} &
+Ein 2.-Ordnungs Term $(\text{Term} \cdot \nabla{u},\; \nabla{v})$, wobei \cpp{value_type} von \cpp{Term} einem \cpp{WorldMatrix<double>}, bzw. \cpp{double} entsprechen muss. \\
+\cpp{addSOT(Operator, Term, i, j)} &
+Ein 2.-Ordnungs Term $(\text{Term} \cdot \partial_j{u},\; \partial_i{v})$, wobei \cpp{value_type} von \cpp{Term} einem \cpp{double} entsprechen muss.\\
+\hline
+\end{tabular}
+\end{table}
+
+Für die Berechnung eines Integrals über einen Ausdruck von DOFVectoren kann folgender Befehl verwendet werden:
+\cpp{integrate(Term);}
+und für die Transformation eines DOFVectors folgendes:
+\cpp{DV << Term;}
+bzw.
+\cpp{transformDOF(Term, DV);}
+Wobei jeweils DV kein DOFVector-Pointer sein kann.
+
+\section{Beispiele}
+\subsection{Bilinearform}
+Folgende Bilinearform soll assembliert werden:
+\[
+a(c,\vartheta) := \big\langle\frac{1}{\epsilon}(\phi^2 - 1) c,\; \vartheta\big\rangle + \big\langle\max(10^{-5},\;(\phi+1))\nabla c,\; \nabla\vartheta\big\rangle
+\]
+Mit Hilfe der oben definierten Ausdrücke lässt sich dies nun wie folgt schreiben:
+
+\begin{minted}{c++}
+Operator op(feSpace, feSpace);
+addZOT(op, (1.0/epsilon) * (pow<2>(valueOf(phi)) - 1.0) );
+addSOT(op, max(1.e-5, valueOf(phi) + 1.0) )
+prob->addMatrixOperator(op, 0, 0);
+\end{minted}
+
+\subsection{Integration und Interpolation}
+Danach sollen folgende Integrale und ein Double-well berechnet werden:
+\[
+mean = \int \frac{1}{2}(c + 1)\;dx,\quad length = \int \|\nabla c\|\; dx,\quad DW=\frac{1}{2}(c^2\,(1-c)^2 + \frac{1}{\epsilon}\|\nabla c\|^2)
+\]
+Dazu können wieder die Expressions verwendet werden:
+
+\begin{minted}{c++}
+double mean = integrate( 0.5 * (valueOf(c) + 1.0) );
+double length = integrate( two_norm(gradientOf(c)) );
+
+DOFVector<double> DW(c.getFeSpace(), "Double-Well");
+DW << 0.5*( pow<2>(valueOf(c)) * pow<2>(1.0 - valueOf(c)) + unary_dot(gradientOf(c)) );
+\end{minted}
+
+\subsection{Funktoren}
+Komplexe Ausdrücken können auch zu einem Funktor zusammen gefasst werden. Dazu wird erst das Funktor-Objekt erstellt und dieses dann über den Term \texttt{func} in einem Expression eingebunden:
+\[
+V = \sum_{i=0}^{d-1} \alpha_i U_i
+\]
+Mit $\alpha_i$ sind Koeffizienten und $U=\{U_i\}$ ein DOFVector<WorldVector<double> >. Dieser Term kann umgesetzt werden, mittels
+
+\begin{minted}{c++}
+struct F : FunctorBase 
+{
+  typedef double value_type;
+  F(WorldVector<double>& alpha_) : alpha(alpha_) {}
+
+  int getDegree(int d0) const {
+    return d0;
+  }
+  value_type operator()(const WorldVector<double>& U) const {
+    double result = 0.0;
+    for (int i = 0; i < U.getSize(); i++)
+      result += alpha[i]*U[i];
+    return result;
+  }
+private:
+  WorldVector<double> alpha;
+};
+
+int main() {
+  // ... //
+  DOFVector<WorldVector<double> > U(feSpace, "U");
+  DOFVector<double> V(feSpace, "V");
+
+  WorldVector<double> alpha = (...);
+  U << (...)
+
+  V << func(F(alpha), valueOf(U));
+}
+\end{minted}
+
+Bisher wird in AMDiS anstelle von Objekten zur Basis \texttt{FunctorBase} die AbstractFunction verwendet. Um diese nutzen zu können, gibt es Wrapper, die diese implizit zu einem Funktor Konvertieren. Für den Spezialfall der Auswertung an Koordinaten gibt es zusätzlich einen Shortcut:
+
+\begin{minted}{c++}
+struct F : AbstractFunction<double, WorldVector<double> > 
+{
+  F() : AbstractFunction<double, WorldVector<double> >(1) {}
+
+  double operator()(const WorldVector<double>& x) const {
+    return cos(x[0]);
+  }
+};
+
+int main() {
+  // ... //
+  DOFVector<double> V(feSpace, "V");
+
+  V << function_(wrap(new F), X());
+  // bzw.
+  V << eval(new F)
+
+  // und auch verschobene Auswertungen sind möglich:
+  WorldVector<double> shift = (...)
+  V << function_(wrap(new F), X() + shift);
+}
+\end{minted}
+
+\subsection{Differentiation}
+Insbesondere in Newtonverfahren für nichtlineare PDEs und Rosenbrock-Verfahren für die Zeitintegration (nichtlinearer Gleichungen), wird die Jacobimatrix eines Differentialoperators benötigt. Den kann man häufig auf die Ableitung der Koeffizientefunktionen zurückführen. Siehe aus Motivation auch das Nonlinear Demo [[AMDiS:Demo:Nonlinear example]]. Grundlage der Implementierung könnte sein, dass die Terme automatisch differenziert werden  Als Beispiel soll hier ein einfaches Polynom als Term dienen:
+\[
+expr(u) = u^4
+\]
+Um nach $u$ zu differenzieren, müssen wir dem zugrundeliegenden DOFVector einen Namen geben:
+
+\begin{minted}{c++}
+struct u_ {};
+struct v_ {};
+...
+DOFVector<double> U(...);
+DOFVector<double> V(...);
+auto expr = pow<4>(valueOf<u_>(U));
+
+auto diff_expr = diff<u_>(expr);  // = 4 * u^3
+auto diff_expr2 = diff<u_>(expr, valueOf<v_>(V)); // 4 * u^3*v
+\end{minted}
\ No newline at end of file
diff --git a/doc/book/ch6.tex b/doc/book/ch6.tex
new file mode 100644
index 0000000000000000000000000000000000000000..0b97925461bb6ea5f5344ea45f9f0fc11f000353
--- /dev/null
+++ b/doc/book/ch6.tex
@@ -0,0 +1,4 @@
+\chapter{\label{ch6}Applications}
+\begin{abstract}
+Abstract
+\end{abstract}
diff --git a/doc/book/conclusion.tex b/doc/book/conclusion.tex
new file mode 100644
index 0000000000000000000000000000000000000000..b47a41942caee4d074d2729d27829864a58875ab
--- /dev/null
+++ b/doc/book/conclusion.tex
@@ -0,0 +1 @@
+\chapter{\label{ch:conclusion}Conclusion and outlook}
diff --git a/doc/book/declarations.tex b/doc/book/declarations.tex
new file mode 100644
index 0000000000000000000000000000000000000000..74d0f17eb945498485758e5e81a7fc979f08c790
--- /dev/null
+++ b/doc/book/declarations.tex
@@ -0,0 +1,172 @@
+\usepackage{amsmath}
+\usepackage[bbgreekl]{mathbbol}
+\usepackage{amsfonts}
+\usepackage{amssymb}
+\usepackage{amsthm}
+\usepackage{tabularx}
+\usepackage{multirow}
+\usepackage{graphicx}
+\usepackage{mathtools}
+\usepackage[table]{xcolor}
+\usepackage{wrapfig}
+\usepackage{relsize}
+\usepackage{hyperref}
+\usepackage{enumerate}
+\usepackage{algorithm}
+\usepackage{listings}
+\usepackage{minted}
+\usepackage[noend]{algpseudocode}
+
+\DeclareSymbolFontAlphabet{\mathbb}{AMSb}
+\DeclareSymbolFontAlphabet{\mathbbl}{bbold}
+
+\newcommand{\Du}{\mathbf{D}(\mathbf{u})}
+\newcommand{\eqdef}{\ensuremath{\overset{\text{def}}{=}}}
+\newcommand{\rrho}{\Bar{\Bar{\varrho}}}
+\newcommand{\kbt}{{k_\textup{B}{T}}}
+
+%\newcommand{\Eins}{\mathbf{1}}%
+%\newcommand{\Null}{\mathbf{0}}%
+\newcommand{\Diag}{\operatorname{diag}}%
+\newcommand{\esp}{\,\hat{=}\,}%
+\newcommand{\ii}{\mathrm{i}}%
+\newcommand{\Tr}{\operatorname{Tr}}%
+\newcommand{\Div}{\operatorname{div}}%
+\newcommand{\abs}[1]{\lvert#1\rvert}%
+\newcommand{\norm}[1]{\lVert#1\rVert}%
+\newcommand{\ie}{i.\,e.}%
+\newcommand{\eg}{e.\,g.}%
+\newcommand{\etal}{et\,al.}%
+\newcommand{\ZT}[1]{\textquotedblleft#1\textquotedblright}%
+\newcommand{\modulo}{\texttt{\%}}%
+\newcommand{\sign}{\operatorname{sign}}
+
+\newcommand{\R}{\mathbb{R}}%
+\newcommand{\C}{\mathbb{C}}%
+
+% dimensionless numbers
+\newcommand{\RE}{\textup{Re}}%
+\newcommand{\PE}{\textup{Pe}}%
+\newcommand{\CA}{\textup{Ca}}%
+\newcommand{\SC}{\textup{Sc}}%
+
+\newcommand{\xb}{\mathbf{x}}%
+\newcommand{\rb}{\mathbf{r}}%
+\newcommand{\ub}{\mathbf{u}}%
+\newcommand{\vb}{\mathbf{v}}%
+\newcommand{\pb}{\mathbf{p}}%
+\newcommand{\qb}{\mathbf{q}}%
+\newcommand{\nb}{\mathbf{n}}%
+\newcommand{\director}{\hat{\nb}}
+
+\newcommand{\Laplace}{\Delta}%
+\newcommand{\iDelta}{\mathlarger{\blacktriangle}}%
+\newcommand{\vecDelta}{\vec{\mathlarger{\Delta}}}%
+\newcommand{\vecLaplace}{\boldsymbol{\Delta}}%
+
+\newcommand{\Nabla}{\vec{\nabla}}%
+\newcommand{\inabla}{\mathlarger{\blacktriangledown}}%
+\newcommand{\iNabla}{\vec{\mathlarger{\blacktriangledown}}}%
+
+\newcommand{\Boundary}{\Sigma}
+
+\newcommand{\reflect}[1]{\text{\reflectbox{$#1$}}}
+
+\newcommand{\dif}{\textup{d}}%											d
+\newcommand{\tdif}[2]{\frac{\dif#1}{\dif#2}}%							du / dx
+\newcommand{\pdif}[2]{\frac{\partial#1}{\partial#2}}%					du / dx
+\newcommand{\ppdif}[2]{\frac{\partial^{2}{#1}}{\partial{#2}^{2}}}%	d^2 u / dx^2
+
+\newcommand{\ds}{\,\dif{s}}%                      dr
+\newcommand{\dr}{\,\dif\rb}%											dr
+\newcommand{\dx}{\,\dif\xb}%											dx
+\newcommand{\dxhat}{\,\dif\hat{\xb}}%											dx
+\newcommand{\dt}{\partial_t}%											d_t
+
+\newcommand{\Poly}[1]{\mathbb{P}_{#1}}%								P_p
+\newcommand{\Triang}{\mathcal{T}_{h}}%									T_h
+
+\newcommand{\fdif}{\operatorname{\delta}\!}%							d
+\newcommand{\Fdif}[2]{\frac{\fdif{#1}}{\fdif{#2}}}%				dF / du	
+\newcommand{\FFdif}[3]{\frac{\fdif^2{#1}}{\fdif{#2}\fdif{#3}}}%			d^2F / dudv	
+
+\newcommand{\drho}{\fdif\varrho}
+\newcommand{\phase}{{\phi}}
+
+\newcommand{\dotprod}[2]{\ensuremath{\langle{#1},\,{#2}\rangle}}
+\newcommand{\twoNorm}[1]{\ensuremath{\|{#1}\|}}
+
+% notation of energies
+\newcommand{\FF}{{F}}
+\newcommand{\F}[1]{\FF_\textup{#1}}
+\newcommand{\dotF}[1]{\dot{\FF}_\textup{#1}}
+\newcommand{\hatF}[1]{\hat{\FF}_\textup{#1}}
+\newcommand{\barF}[1]{\bar{\FF}_\textup{#1}}
+\newcommand{\Fourier}{\mathcal{F}}
+
+\newcommand{\ff}{\mathbbl{f}}
+
+%\theoremstyle{plain}
+\newtheorem{lem}{Lemma}
+\newtheorem{thm}{Theorem}
+\newtheorem{prop}[thm]{Proposition}
+\newtheorem{rem}{Remark}
+\newtheorem{exmp}{Example}[chapter]
+
+%\theoremstyle{definition}
+\newtheorem{defn}[thm]{Definition}
+
+\newcommand*{\End}{\hfill\ensuremath{\vartriangleleft}}%
+\newcommand*{\END}{\hfill\ensuremath{\blacktriangleleft}}%
+
+% abstracts at the begin of chapters
+\newenvironment{abstract}{\itshape}{}
+
+
+\newcommand{\algostep}[1]{{\tt {#1}:\newline}}
+
+\definecolor{hellgrau}{rgb}{0.9, 0.9, 0.9} 
+\definecolor{bgcolor}{rgb}{0.9, 0.9, 0.8} 
+\definecolor{framecolor}{rgb}{0.6, 0.6, 0.5} 
+\definecolor{dunkelgruen}{rgb}{0, 0.5, 0.0} 
+\definecolor{grau}{rgb}{0.4, 0.4, 0.4} 
+\definecolor{dunkelblau}{rgb}{0.3, 0.3, 0.5} 
+\definecolor{lightblue}{rgb}{0.93,0.95,1.0}
+
+\lstset{language=C++,
+        basicstyle=\ttfamily,
+        keywordstyle=\color{blue}\ttfamily,
+        directivestyle=\color{dunkelgruen}\bfseries\ttfamily,
+        stringstyle=\color{red}\ttfamily,
+        commentstyle=\color{grau}\ttfamily,
+        morecomment=[l][\color{dunkelblau}]{///},
+        morecomment=[s][\color{dunkelblau}]{/**}{*/},
+        morecomment=[s][\color{dunkelblau}]{/*!}{*/},
+        backgroundcolor=\color{bgcolor},
+        rulecolor=\color{framecolor},
+        frame=lines,
+        framerule=0.5pt,
+        numbers=left,
+        numbersep=1em,
+        numberstyle={\tiny\ttfamily},
+        showspaces=false,
+        showstringspaces=false,
+        xleftmargin=1cm,
+        title={C++ -- Code}
+}
+
+
+\setminted[c++]{mathescape,
+		linenos,
+		numbersep=5pt,
+		frame=lines,
+		framesep=2mm,
+		breaklines=true}
+
+\newcommand{\cpp}{\mintinline{c++}}
+\newcommand{\cppline}{\mint[frame=none,linenos=false,breaklines=true]{c++}}
+		
+% These are the default sizes for titles. Customize them if you wish:
+%\let\TitleSize=\huge
+%\let\SubtitleSize=\LARGE
+%\def\TitleStretch{1.4}
\ No newline at end of file
diff --git a/doc/book/dedication.tex b/doc/book/dedication.tex
new file mode 100644
index 0000000000000000000000000000000000000000..4ed2983a63f94eb8289f09515ffac1bc29437552
--- /dev/null
+++ b/doc/book/dedication.tex
@@ -0,0 +1,3 @@
+\raggedleft
+	This example is dedicated to everyone \\
+	who hates to read manuals.
\ No newline at end of file
diff --git a/doc/book/introduction.tex b/doc/book/introduction.tex
new file mode 100644
index 0000000000000000000000000000000000000000..0dc24e42675c6389b0c9e928ee6172f776cb11de
--- /dev/null
+++ b/doc/book/introduction.tex
@@ -0,0 +1 @@
+\chapter*{Introduction}
diff --git a/doc/book/lotdiss.cls b/doc/book/lotdiss.cls
new file mode 100644
index 0000000000000000000000000000000000000000..eea5ab6528188e9283ae9ae4598c5da4c9d8da53
--- /dev/null
+++ b/doc/book/lotdiss.cls
@@ -0,0 +1,673 @@
+%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesClass{lotdiss}[2013/08/13 LOT dissertation class]
+
+% LOT dissertation class. 
+
+% This LaTeX class is intended to satisfy the formatting requirements of 
+% the Landelijke Onderzoekschool Taalwetenschap (LOT), the Dutch National
+% Graduate School in Linguistics.
+% There are (or will be) class options for the different LOT member institutes
+
+% Alexis Dimitriadis 2009/2011
+%
+% This style comes with an associated example file, lotdiss-template.tex.
+%
+% Use: \documentclass[<institute>]{lotdiss}
+% Options: 
+%   Accepts all book class options, and the following additional ones:
+%
+%   utrecht, leiden, nijmegen, aclc, groningen:    These tailor the 
+%       style to the corresponding LOT member institute
+%
+%   [preview]  Change the paper size to the true LOT book size (24x16cm).
+%       Only works properly with pdf output.
+%       This is not the default because it can cause printing problems, and
+%       IS NOT NECESSARY: The printers expect A4 pages and will do the rest.
+%
+%   [notitlesec]  Do not override the format of chapter and section 
+%       titles with the package titlesec. Use this if you prefer the
+%       original latex style, or to customize with a different package.
+%       I don't recommend this: Use titlesec commands in your preamble
+%       to customize chapter and section titles to your taste.
+
+% REVISION HISTORY
+%
+% 2013/08/13 v. 1.3b  Changes to the LOT and Utrecht details. Inconsequential 
+%                     change to the page size computation.
+%
+% 2012/09/25 v. 1.3   Page height is set to exactly fit a (maximal) number of 
+%                     lines, avoiding ugly gaps in text-only pages. 
+%                     Fixed bug in the index ``improvements''.
+%
+% 2011/08/17 v. 1.2   \chapter* now resets all counters that \chapter would.
+%                     Three columns now allowed in Promotor page (for ":")
+%
+% 2011/01/28 v. 1.1b  Replaced fncychap with titlesec. Added [preview] option.
+%                     Corrected spacing for groningen style.
+%
+% 2011/01/23 v. 1.0   First distributable version. 
+
+
+
+% Retire the [(no)titlepage] option
+\def\title@off{\message{Class lotdiss Warning: The [(no)titlepage] option has been disabled. ^^J
+To suppress the title page and other front matter, comment out the command^^J
+\@backslashchar FrontMatter in your document}}
+
+\DeclareOption{titlepage}{\title@off}
+\DeclareOption{notitlepage}{\title@off}
+% (Restore if it causes any problems)
+%\PassOptionsToClass{notitlepage}{book}
+
+\def\@lotschool{dresden} % Default
+
+\DeclareOption{dresden}{\let\@lotschool=\CurrentOption}
+\DeclareOption{leiden}{\let\@lotschool=\CurrentOption}
+\DeclareOption{utrecht}{\let\@lotschool=\CurrentOption}
+\DeclareOption{nijmegen}{\let\@lotschool=\CurrentOption}
+\DeclareOption{aclc}{\let\@lotschool=\CurrentOption}
+\DeclareOption{groningen}{\let\@lotschool=\CurrentOption}
+
+% [notitlesec]: Don't load titlesec.sty package.
+%    User must deal with restyling manually.
+\newif\iflotdiss@restyle \lotdiss@restyletrue
+\DeclareOption{notitlesec}{\lotdiss@restylefalse}
+
+% [preview]: Set media dimensions to the true LOT book size (16x24cm).
+%    Only works with pdf.
+\newif\iflotdiss@preview \lotdiss@previewfalse
+\DeclareOption{preview}{\lotdiss@previewtrue}
+
+% Pass any other options to the parent class
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
+\ProcessOptions 
+
+% Start up the book class, which lotdiss.cls adds to.
+% Options declared to \PassOptionsToClass above are silently passed on.
+\LoadClass[a4paper,11pt]{book}
+
+\frenchspacing
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%           START OF CUSTOMIZABLE SECTION
+%
+% Redefining or overriding these settings should allow adaptation of
+% this style file to other dissertation specifications.
+%
+
+%***************PAGE DIMENSIONS**********************
+
+% The book will be printed on paper 16 x 24 cm. We normally don't declare this,
+% to prevent problems with printers who may refuse to print on A4
+% To generate pdf with the right media size, use the [preview] class option (below).
+%
+% A4 paper is 210 x 297 mm.
+% All text must appear in a block 12 x 20 cm. 
+% We center this block in the A4 page (the printshop will trim it for the book)
+
+% To avoid ugly gaps when there's only text on a page, \textheight must 
+% exactly fit some number of text lines.
+% The first line normally takes up \topskip; the rest take \baselineskip
+% We round the height *down* (bk12.clo etc. might round up as well):
+\def\UseTextheight#1{
+  \textheight=#1
+  % subtract the space of the running heads (we use no footer)
+  \advance\textheight by -\headheight
+  \advance\textheight by -\headsep
+  % Now round down, properly
+  \@tempdima = \textheight
+  \advance\@tempdima by -\topskip  % the top line is shorter
+  \divide\@tempdima\baselineskip
+  \@tempcnta=\@tempdima
+  \setlength\textheight{\@tempcnta\baselineskip}
+  \addtolength\textheight{\topskip}}  % add the top line back
+
+% The default \headheight is suitable for 10pt text; At 11pt, fancyhdr
+% issues a warning and adjusts it. So we fix it in time for the page size
+% calculations.
+\headheight=\baselineskip 
+
+\textwidth=16cm
+\UseTextheight{23cm}
+
+% The results:
+% at [10pt]: 538pt   (45 lines)
+% at [11pt]: 527.8pt (39 lines)
+% at [12pt]: 534pt   (37 lines)
+
+
+% Left/right margins = (210-160)/2 = 2.5 cm
+\oddsidemargin=3cm \advance\oddsidemargin by -1in % Correct by TeX's "zero" margin
+\evensidemargin=2.5cm \advance\evensidemargin by -1in
+% => textwidth = 15.5cm
+
+% Top/bottom margin = (29.7-24)/2 = 2.85 cm -- we round it up
+\topmargin=3cm \advance\topmargin by -1in % Correct by TeX's "zero" margin
+
+
+%=========
+
+
+% Running heads from Mark
+%***************FANCY HEADERS**********************
+\usepackage{fancyhdr}
+
+% This doesn't seem to work as advertized: It wipes out
+% the fancyhdr settings i've selected, unless i store them in {lotpage}
+%
+% The ``plain'' page style is activated on chapter title pages by default.
+% We actually want it to be completely empty:
+\fancypagestyle{plain}{\fancyhf{}\renewcommand\headrulewidth{0pt}}
+
+\fancypagestyle{lotpage}{%
+  \fancyhf{}% start on a clean slate: clear all fields
+  \renewcommand\headrulewidth{0pt} 
+  \fancyhead[LE,RO]{\textrm{\thepage}}
+  \fancyhead[LO]{\nouppercase{\textsl{\strut\leftmark}}}
+  \fancyhead[RE]{\nouppercase{\textsl{\strut\rightmark}}}}
+
+% Actual plain style: Just the page number
+\fancypagestyle{realplain}{%	
+  	\fancyhf{} % start with a clean slate: clear all fields
+    \renewcommand\headrulewidth{0pt}
+    \fancyhead[LE,RO]{\textrm{\thepage}}
+  }
+  
+\pagestyle{lotpage} % In case we never call \FrontMatter or \MainMatter
+
+% Commands to set the running head. Called by \chapter and \section. 
+% The actual defaults include \MakeUppercase, but fancyhdr disables it.
+
+% The default for \chaptermark is \markboth{#1}{}; but if we don't use 
+% \section for a couple of pages, we end up with no header on the even
+% page. So, we set it to ``Chapter N'' as a fall-back
+\renewcommand{\chaptermark}[1]{\markboth{#1}{Chapter \thechapter}}
+% This works fine as it is
+%\renewcommand{\sectionmark}[1]{\markright{#1}}
+
+%%%%%%%%%%%%%%%%%%%%
+% Fix package interactions that mess up the page headings
+
+% These settings must be delayed until after the author includes the relevant
+% packages. The result is that we then override the author's attempts to
+% redefine the same command in the preamble! Oh well, you can't have
+% everything... Authors must use \AtBeginDocument as well.
+
+% Endnotes.sty tries to mark both even and odd pages with \notesname.
+% Let's treat it like any other section:
+\AtBeginDocument{\def\enoteheading{\section*{\notesname\addcontentsline{toc}{section}{\notesname}}\markright{\notesname}%
+  \mbox{}\par\vskip-\baselineskip}}
+
+% The above is for endnotes at the end of each chapter.
+% Endnotes for the entire book should use \chapter* instead of 
+% \section* in the above definition (but then mark both sides); it's not the
+% default since chapter-by-chapter endnotes are less cumbersome.
+
+% Obsolete bugfix: natbib causes running heads to be capitalized; the new
+% "lotpage" pagestyle suppresses this-- no need to override them.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%         Definitions of front matter contents
+
+% Front matter elements are defined in the preamble and assembled in
+% the proper order by \FrontMatter.
+
+% The following commands should be used in the preamble to provide the
+% appropriate text or \input commands.  Some are optional; if not sure,
+% you can always just try leaving them out. The style will complain if they
+% are obligatory!
+
+% General 
+
+% \author and \title are already defined in latex
+\def\subtitle#1{\gdef\@subtitle{#1}}
+\def\germantitle#1{\gdef\@germantitle{#1}} 		
+\def\germansubtitle#1{\gdef\@germansubtitle{#1}}
+
+\def\englishabstract#1{\gdef\@englishabstract{#1}}
+\def\germanabstract#1{\gdef\@germanabstract{#1}}
+
+% LOT publication page
+\long\def\abovepublisher#1{\gdef\@abovepublisher{#1}} \abovepublisher{\relax}
+\long\def\imagecredit#1{\gdef\@imagecredit{#1}}		\imagecredit{\relax}
+\def\isbn#1{\gdef\@isbn{#1}} 
+\def\NUR#1{\gdef\@nurnumber{#1}}
+
+\def\copyrightyear#1{\gdef\@copyrightyear{#1}}  
+\copyrightyear{\number\year}         % may be overridden in the document
+
+\def\copyrightclaim#1{\gdef\@copyrightclaim{#1}}
+\copyrightclaim{Copyright \copyright\ \@copyrightyear\ \@author. All rights reserved.}
+
+% Main title page
+\def\promotionstext#1{\gdef\@promotionstext{#1}}
+\def\rectormagnificus#1{\gdef\@rectormagnificus{#1}}
+\def\promotiondate#1{\gdef\@promotiondate{#1}}		\promotiondate{}
+
+\def\geboren#1{\gdef\@geboren{#1}}
+
+% Promotors page
+\def\promotores#1{\gdef\@promotores{#1}}
+\let\promotors=\promotores
+
+
+% Contrive to \include a file without starting a new page (by temporarily
+% disabling \clearpage).  A new page is still begun at the end of the include.
+\def\@includehere#1{\bgroup\let\clearpage=\egroup\include{#1}}
+
+% This entirely disables page breaks from \include and \chapter; \newpage
+% can still be called.
+%
+%\def\CvPageFile#1{\cleardoublepage
+%  \bgroup\let\clearpage=\relax\include{#1}\egroup }
+
+
+% Example: \dedication{blah, blah} OR \dedicationfile{Dedication}
+%
+% The dedication is vertically centered on the page, and otherwise
+% formatted by the author
+\long\def\dedication#1{%
+    \long\def\@dedication{{\null\vfil\parindent=0pt\relax #1\par\vfil\null}}}
+
+\def\dedicationfile#1{\dedication{\@includehere{#1}}}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% The format and order of the preliminary pages.
+% Optional pages are only created if requested.
+% List of Figures and List of Tables pages are only created if there are
+% figures or tables. 
+% Syntax: 
+%    \FrontMatter 
+%    \include{Acknowledgments} % etc.
+%    \MainMatter
+%
+\def\FrontMatter{%
+  \pagenumbering{roman}\pagestyle{realplain}%
+  
+  % Most of these call \cleardoublepage
+%   \HalfTitlePage
+  \titleGM
+  	\newpage 
+  \LOTpage 
+	%\newpage
+  %\TitlePage
+  	%\newpage
+  %\PromotorPage
+  
+  \cleardoublepage	
+  \@ifundefined{@dedication} \relax
+      {\thispagestyle{empty}\@dedication \let\@dedication=\@undefined}%
+  \cleardoublepage
+  
+  \AbstractPage
+  	\newpage
+
+  % Our redefined \@schapter tries to add the TOC to the TOC.
+  \hidefromtoc{\tableofcontents}%
+  	
+%  \@ifundefined{pd@list@tables} \relax
+%      \listoftables
+%  \@ifundefined{pd@list@figures} \relax 
+%      \listoffigures
+}
+
+% Start the regularly-numbered part of the dissertation.  
+% We might want to extend what these do
+\def\MainMatter{\mainmatter\pagestyle{lotpage}}
+
+\def\BackMatter{\backmatter 
+	\addtocontents{toc}{\protect\vskip 0.5em \relax}} 
+% We separate last chapter TOC from back materials.
+% This amount plus the skip in l@schapter (defined below) should equal 1.0em, the skip in l@chapter.
+
+
+% Definitions of the frontmatter pages. This is all modular so that the parts 
+% can be redefined as necessary.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Initial empty page with just the title (``half-title'' or ``bastard-title'')
+%
+\newcommand\HalfTitlePage{%
+	\cleardoublepage
+	\thispagestyle{empty}
+	\begin{center}
+    
+  \null\vfill
+
+  % TODO: There MUST be a way for \ShowTitle to detect if it is passed
+  % an empty \@subtitle macro!
+  %
+  \@ifundefined{@subtitle}
+	{\ShowTitle{\@title}{}}
+	{\ShowTitle{\@title}{\@subtitle}}
+  
+  \vfill\vfill\null
+\end{center} }
+
+
+
+\newcommand*{\plogo}{\fbox{$\mathcal{PL}$}} % Generic publisher logo
+
+\newcommand*{\titleGM}{\begingroup % Create the command for including the title page in the document
+\cleardoublepage
+\thispagestyle{empty}
+\hbox{ % Horizontal box
+\hspace*{0.2\textwidth} % Whitespace to the left of the title page
+\rule{1pt}{\textheight} % Vertical line
+\hspace*{0.05\textwidth} % Whitespace between the vertical line and title page text
+\parbox[b]{0.75\textwidth}{ % Paragraph box which restricts text to less than the width of the page
+
+{\noindent\Huge\bfseries \@title}\\[2\baselineskip] % Title
+{\large \textit{\@subtitle}}\\[4\baselineskip] % Tagline or further description
+{\Large \textsc{\@author}} % Author name
+
+\vspace{0.5\textheight} % Whitespace between the title block and the publisher
+{\noindent The Publisher \plogo}\\[\baselineskip] % Publisher and logo
+}}
+\endgroup}
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Verso page with the LOT information and copyright notice
+%
+\newcommand\LOTpage{\bgroup
+	\parindent=0pt
+	\thispagestyle{empty}%
+
+	% Set text flush with the bottom of the page
+	\null \vfill
+
+\@ifundefined{@abovepublisher} \relax
+	{\@abovepublisher \bigskip }
+	
+Published by \\[4pt]
+Technische Universit\"{a}t Dresden  	\hfill	phone: +49 123 45 67 89  \\
+School of Sciences					\hfill 	e-mail: simon.praetorius@tu-dresden.de  \\
+D-01062 Dresden						\hfill	http://www.tu-dresden.de \\
+Germany 	\hfill	
+
+\bigskip\bigskip
+\@ifundefined{@imagecredit} \relax
+	{\@imagecredit \bigskip }
+	
+ISBN: \@isbn \\
+NUR: \@nurnumber
+
+\bigskip
+\@copyrightclaim
+
+\egroup}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Title page
+%
+% Elastic space at the top (but Groningen has special needs)
+\def\lotd@tp@topstuff{\null\vfill}
+% Groningen & Nijmegen will override this
+\def\lotd@tp@aftertitle{\bigskip \vfill}
+
+\newcommand\TitlePage{%
+  \newpage \begin{samepage}\thispagestyle{empty}\center
+  \parindent=0pt
+  \parsep=0pt
+  
+  \lotd@tp@topstuff
+  
+  \@ifundefined{@subtitle}
+	{\ShowTitle{\@title}{}}
+	{\ShowTitle{\@title}{\@subtitle}}
+
+  \bigskip \vskip 0pt minus 6pt % Squeeze a little if we're tight
+
+  \@ifundefined{@germantitle} \relax
+	{\bigskip
+	 \@ifundefined{@germansubtitle}
+		{\ShowTitle{\@germantitle}{}}
+		{\ShowTitle{\@germantitle}{\@germansubtitle}}
+	{\Large \vskip \baselineskip {\large (met een samenvatting in het Nederlands)}}}
+	
+  \lotd@tp@aftertitle
+	
+{\Large \proefschrift@name}\\[0.5cm]
+
+	\@promotionstext
+	\bigskip
+
+eingereicht von
+
+\vspace{3ex}
+{\Large \@author}
+
+\vspace{2ex}
+
+geboren am \@geboren 
+
+\vfill
+
+\normalsize
+\begin{center}
+\begin{tabular}{lll}
+	\@promotores
+\end{tabular}
+\end{center}
+%\vfill\null
+\end{samepage}\newpage }
+% End of title page
+
+% Utility command used in both title pages:
+% Format a title and subtitle (if any)
+\newcommand\ShowTitle[2]{\bgroup
+	\def\baselinestretch{\TitleStretch}%
+	\par
+	\TitleSize    #1\par
+	{\def\@subt{#2}%
+	  \ifx\@subt\@empty   % (empty) % debug
+      \else
+      	% provide linespacing appropriate for the (larger) \TitleSize
+		\vskip\baselineskip \SubtitleSize \vskip-\baselineskip 
+		#2\par 
+	  \fi
+	}%
+\egroup }
+
+\def\proefschrift@name{\Large Dissertation}  % For everyone but ACLC
+
+\let\TitleSize=\huge
+\let\SubtitleSize=\LARGE
+\def\TitleStretch{1.4}
+
+
+\newcommand\PromotorPage{\bgroup
+\newpage\thispagestyle{empty}\parindent=0pt
+\normalsize
+
+\begin{tabular}{lll}
+	\@promotores
+\end{tabular}
+
+\egroup}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Initial empty page with just the title (``half-title'' or ``bastard-title'')
+%
+\newcommand\AbstractPage{%
+	\cleardoublepage
+	\thispagestyle{empty}
+	{\section*{Summary}}
+	\@englishabstract	
+
+  \@ifundefined{@germanabstract} \relax
+	{\bigskip
+	{\section*{Zusammenfassung}}
+	\@germanabstract	}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Load titlesec unless the user suppressed it with [notitlesec]
+\iflotdiss@restyle
+  \RequirePackage{titlesec}
+  
+  \titleformat{\chapter}[display] 
+    {\Large}% General format
+    {\filleft\MakeUppercase{\chaptertitlename} \Huge\thechapter}% Chapter N
+    {52pt} % Space between label and title
+    {\titlerule[0.5pt] \vspace{1.75ex} \filleft\strut} % Before title body 
+    [\vspace{2.2ex}{\titlerule[0.5pt]}] % After title body
+
+  % \titlespacing*{left}{above}{below}[right] ; * = \noindent next par
+  \titlespacing*{\chapter}{0pt}{58pt}{40pt}
+
+  % Extra space below title for \chapter* (incl. TOC, References)
+  \titlespacing*{name=\chapter,numberless}{0pt}{58pt}{64pt}
+  
+  % Finetune sections too?
+\else
+  \message{^^JPackage titlesec: Loading suppressed by class option [notitlesec]^^J}
+\fi
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%                  END OF CUSTOMIZABLE SECTION
+%
+%  LaTeX magic beyond this point-- Use extreme care if you have to
+%  make changes!
+%
+
+
+% Keep a record of whether there were figures and tables
+\let\lot@svd@caption=\caption
+\def\caption
+  {\expandafter\gdef\csname pd@have\@captype s\endcsname{1} \lot@svd@caption}
+
+% The following code (standard latex) appends; I needed to prepend,
+% otherwise the implicit argument of \caption (the name of figure or 
+% table) is lost!
+%% (no \protect needed when defining directly)
+%\g@addto@macro\caption
+%  {\protect\expandafter\gdef\csname pd@have\@captype s\endcsname{1}}
+
+% Save a *different* flag in .aux (so it can turn off if the tables go away).
+\AtEndDocument{
+  \@ifundefined{pd@havetables} \relax
+     {\immediate\write\@mainaux{\string\gdef\string\pd@list@tables{1}}}
+  \@ifundefined{pd@havefigures} \relax
+     {\immediate\write\@mainaux{\string\gdef\string\pd@list@figures{1}}}}
+
+
+% Start a section in the front matter, adding it to the TOC
+% Syntax: \PreSection[TOC title]{Actual title}
+%
+\def\PreSection{\chapter*}
+% (This is trivial thanks to the following modification to default LaTeX
+% behavior: 
+
+
+% Modify the handler for \chapter* so that the title is automatically added 
+% to the toc. Must be called after we've customized \@schapter .
+% This also extends the \chapter[TOCtitle]{actual title} syntax to \chapter*.
+%
+% Instead of relying on the style for chapter titles, we define below a
+% special style for such TOC entries: l@schapter (triggered by specifying
+% style {schapter} to \addcontentsline).
+
+\AtBeginDocument{
+  \let\orig@@schapter=\@schapter
+  % If no optional argument in [ ] follows, \@dblarg copies the normal title
+  \def\@schapter{\@dblarg{\lot@schapter}}
+  \def\lot@schapter[#1]#2{\addcontentsline{toc}{schapter}{#1}  
+  \@mkboth{#1}{#1}
+  % advance, revert the chapter counter to zero any counters within it
+  % (\stepcounter triggers the auto-reset. \addtocounter does not.)
+  \stepcounter{chapter}\addtocounter{chapter}{-1} 
+  \orig@@schapter{#2}}}
+
+
+% TOC line style: Dotted line, not bold, flush left. 
+%    Less space between entries than the 1.0em used above chapter heads
+\newcommand*\l@schapter[2]{%
+    % Skip and add a suitable penalty, but only if the page number will be displayed.
+    \ifnum \c@tocdepth >\m@ne
+      \addpenalty{-\@highpenalty}% ok to break here
+      \vskip 0.5em \@plus\p@
+    \fi
+    \@dottedtocline{1}{0pt}{1.5em}{#1}{#2}}
+%   Syntax: \@dottedtocline{numbering level}{left indent}{hanging indent} {text}{page}
+
+
+% If you need to call a \chapter* (or any other section level) without
+% making an entry in the TOC, do it like this:
+%   \hidefromtoc{\chapter*{Non-TOC title}}
+\def\hidefromtoc#1{{\renewcommand\addcontentsline[3]{\relax}#1}}
+
+% STILL WANTED: A way to put the full chapter title in the TOC (but without 
+% any fragile commads or footnotes), but a short title in the header.
+% The right behaviour: Really the TOC should use the full title by
+% default. (The TOC macros already disable indexing commands and the like).
+% There's a package somewhere that fixes this...
+
+% Redefined to ensure that an extra blank page is completely blank
+\let\ldiss@svcldoub=\cleardoublepage
+\def\cleardoublepage{\clearpage\ifodd \c@page\else \thispagestyle{empty}\fi \ldiss@svcldoub}
+
+
+%% Better index support
+
+\RequirePackage{makeidx}
+% We won't call this automatically until we have a way to disable it
+%\makeindex
+
+% These were all defined in book.cls, hence could be redefined even if we don't load makeidx.sty:
+
+% Redefine the index environment, which is a disaster. Our version calls \chapter*, ensuring
+% that it will behave like other unnumbered chapters (start on odd page, add to TOC, provide
+% a consistent amount of whitespace at the top of the page).
+%
+\renewenvironment{theindex}
+               {\if@twocolumn
+                  \@restonecolfalse
+                \else
+                  \@restonecoltrue
+                \fi
+%                \twocolumn[\@makeschapterhead{\indexname}]%
+% Replaced by the following 2 lines:
+				\cleardoublepage 
+				\twocolumn\chapter*{\indexname}%	
+                \@mkboth{\MakeUppercase\indexname}%
+                        {\MakeUppercase\indexname}%
+                \thispagestyle{plain}\parindent\z@
+                \parskip\z@ \@plus .3\p@\relax
+                \columnseprule \z@
+                \columnsep 35\p@
+                \let\item\@idxitem}
+               {\if@restonecol\onecolumn\else\clearpage\fi}
+
+%% Adjust indentation so that page ranges are more likely to fit well in the LOT page width.
+\renewcommand\@idxitem{\par\hangindent 30\p@}
+\renewcommand\subitem{\@idxitem \hspace*{15\p@}}
+\renewcommand\subsubitem{\@idxitem \hspace*{22.5\p@}} % 3/4 of 30pt (same as the default proportion)
+
+
+%% Load school-specific definitions and texts
+
+\input{\@lotschool.clo}
+
+\endinput
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+	   END OF THE LOTDISS.CLS STYLE
diff --git a/doc/book/minted.ins b/doc/book/minted.ins
new file mode 100644
index 0000000000000000000000000000000000000000..0e9249c1c53b2f8fa8abcedae5619b48922718f3
--- /dev/null
+++ b/doc/book/minted.ins
@@ -0,0 +1,36 @@
+\input docstrip.tex
+\keepsilent
+\askforoverwritefalse
+
+\preamble
+Copyright 2013--2015 Geoffrey M. Poore
+Copyright 2010--2011 Konrad Rudolph
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+  http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+Additionally, the project may be distributed under the terms of the new BSD
+license.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Geoffrey Poore.
+
+This work consists of the files minted.dtx and minted.ins
+and the derived file minted.sty.
+\endpreamble
+
+\usedir{tex/latex/minted}
+
+\generate{%
+    \file{minted.sty}{\from{minted.dtx}{package}}%
+    \file{minted1.sty}{\from{minted.dtx}{packageone}}%
+}
+
+\endbatchfile
+% vim: ft=tex
diff --git a/doc/book/minted.sty b/doc/book/minted.sty
new file mode 100644
index 0000000000000000000000000000000000000000..197df6a01db257b5f8ce998cc0f60b12f7eabf48
--- /dev/null
+++ b/doc/book/minted.sty
@@ -0,0 +1,1506 @@
+%%
+%% This is file `minted.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% minted.dtx  (with options: `package')
+%% Copyright 2013--2015 Geoffrey M. Poore
+%% Copyright 2010--2011 Konrad Rudolph
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%% 
+%% Additionally, the project may be distributed under the terms of the new BSD
+%% license.
+%% 
+%% This work has the LPPL maintenance status `maintained'.
+%% 
+%% The Current Maintainer of this work is Geoffrey Poore.
+%% 
+%% This work consists of the files minted.dtx and minted.ins
+%% and the derived file minted.sty.
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{minted}
+    [2015/09/09 v2.1 Yet another Pygments shim for LaTeX]
+\RequirePackage{keyval}
+\RequirePackage{kvoptions}
+\RequirePackage{fancyvrb}
+\RequirePackage{float}
+\RequirePackage{ifthen}
+\RequirePackage{calc}
+\RequirePackage{ifplatform}
+\RequirePackage{pdftexcmds}
+\RequirePackage{etoolbox}
+\RequirePackage{xstring}
+\RequirePackage{lineno}
+\AtBeginDocument{%
+  \@ifpackageloaded{color}{}{%
+    \@ifpackageloaded{xcolor}{}{\RequirePackage{xcolor}}}%
+}
+\DeclareVoidOption{chapter}{\def\minted@float@within{chapter}}
+\DeclareVoidOption{section}{\def\minted@float@within{section}}
+\DeclareBoolOption{newfloat}
+\DeclareBoolOption[true]{cache}
+\StrSubstitute{\jobname}{ }{_}[\minted@jobname]
+\StrSubstitute{\minted@jobname}{*}{_}[\minted@jobname]
+\StrSubstitute{\minted@jobname}{"}{}[\minted@jobname]
+\newcommand{\minted@cachedir}{\detokenize{_}minted-\minted@jobname}
+\let\minted@cachedir@windows\minted@cachedir
+\define@key{minted}{cachedir}{%
+  \@namedef{minted@cachedir}{#1}%
+  \StrSubstitute{\minted@cachedir}{/}{\@backslashchar}[\minted@cachedir@windows]}
+\let\minted@outputdir\@empty
+\let\minted@outputdir@windows\@empty
+\define@key{minted}{outputdir}{%
+  \@namedef{minted@outputdir}{#1/}%
+  \StrSubstitute{\minted@outputdir}{/}%
+    {\@backslashchar}[\minted@outputdir@windows]}
+\DeclareBoolOption{kpsewhich}
+\DeclareBoolOption{langlinenos}
+\DeclareBoolOption{draft}
+\DeclareComplementaryOption{final}{draft}
+\ProcessKeyvalOptions*
+\ifthenelse{\boolean{minted@newfloat}}{\RequirePackage{newfloat}}{}
+\ifcsname tikzexternalrealjob\endcsname
+  \minted@drafttrue
+  \minted@cachefalse
+\else
+\fi
+\ifthenelse{\boolean{minted@cache}}{%
+  \AtEndOfPackage{\ProvideDirectory{\minted@outputdir\minted@cachedir}}}{}
+\newcommand{\minted@input}[1]{%
+  \IfFileExists{#1}%
+   {\input{#1}}%
+   {\PackageError{minted}{Missing Pygments output; \string\inputminted\space
+     was^^Jprobably given a file that does not exist--otherwise, you may need
+     ^^Jthe outputdir package option, or may be using an incompatible build
+     tool\ifwindows,^^Jor may be using the kpsewhich option without having
+     PowerShell installed\fi}%
+    {This could be caused by using -output-directory or -aux-directory
+     ^^Jwithout setting minted's outputdir, or by using a build tool that
+     ^^Jchanges paths in ways minted cannot detect\ifwindows, or by using the
+     ^^Jkpsewhich option without PowerShell\fi.}}%
+}
+\newcommand{\minted@infile}{\minted@jobname.out.pyg}
+\newcommand{\minted@cachelist}{}
+\newcommand{\minted@addcachefile}[1]{%
+  \expandafter\long\expandafter\gdef\expandafter\minted@cachelist\expandafter{%
+    \minted@cachelist,^^J%
+    \space\space#1}%
+  \expandafter\gdef\csname minted@cached@#1\endcsname{}%
+}
+\newcommand{\minted@savecachelist}{%
+  \ifdefempty{\minted@cachelist}{}{%
+    \immediate\write\@mainaux{%
+      \string\gdef\string\minted@oldcachelist\string{%
+        \minted@cachelist\string}}%
+  }%
+}
+\newcommand{\minted@cleancache}{%
+  \ifcsname minted@oldcachelist\endcsname
+    \def\do##1{%
+      \ifthenelse{\equal{##1}{}}{}{%
+        \ifcsname minted@cached@##1\endcsname\else
+          \DeleteFile[\minted@outputdir\minted@cachedir]{##1}%
+        \fi
+      }%
+    }%
+    \expandafter\docsvlist\expandafter{\minted@oldcachelist}%
+  \else
+  \fi
+}
+\ifthenelse{\boolean{minted@draft}}%
+  {\AtEndDocument{%
+      \ifcsname minted@oldcachelist\endcsname
+        \let\minted@cachelist\minted@oldcachelist
+        \minted@savecachelist
+      \fi}}%
+  {\AtEndDocument{%
+      \minted@savecachelist
+      \minted@cleancache}}%
+\ifwindows
+  \providecommand{\DeleteFile}[2][]{%
+    \ifthenelse{\equal{#1}{}}%
+      {\IfFileExists{#2}{\immediate\write18{del "#2"}}{}}%
+      {\IfFileExists{#1/#2}{%
+        \StrSubstitute{#1}{/}{\@backslashchar}[\minted@windir]
+        \immediate\write18{del "\minted@windir\@backslashchar #2"}}{}}}
+\else
+  \providecommand{\DeleteFile}[2][]{%
+    \ifthenelse{\equal{#1}{}}%
+      {\IfFileExists{#2}{\immediate\write18{rm "#2"}}{}}%
+      {\IfFileExists{#1/#2}{\immediate\write18{rm "#1/#2"}}{}}}
+\fi
+\ifwindows
+  \newcommand{\ProvideDirectory}[1]{%
+    \StrSubstitute{#1}{/}{\@backslashchar}[\minted@windir]
+    \immediate\write18{if not exist "\minted@windir" mkdir "\minted@windir"}}
+\else
+  \newcommand{\ProvideDirectory}[1]{%
+    \immediate\write18{mkdir -p "#1"}}
+\fi
+\newboolean{AppExists}
+\newread\minted@appexistsfile
+\newcommand{\TestAppExists}[1]{
+  \ifwindows
+    \DeleteFile{\minted@jobname.aex}
+    \immediate\write18{for \string^\@percentchar i in (#1.exe #1.bat #1.cmd)
+      do set >"\minted@jobname.aex" <nul: /p
+      x=\string^\@percentchar \string~$PATH:i>>"\minted@jobname.aex"}
+    %$ <- balance syntax highlighting
+    \immediate\openin\minted@appexistsfile\minted@jobname.aex
+    \expandafter\def\expandafter\@tmp@cr\expandafter{\the\endlinechar}
+    \endlinechar=-1\relax
+    \readline\minted@appexistsfile to \minted@apppathifexists
+    \endlinechar=\@tmp@cr
+    \ifthenelse{\equal{\minted@apppathifexists}{}}
+     {\AppExistsfalse}
+     {\AppExiststrue}
+    \immediate\closein\minted@appexistsfile
+    \DeleteFile{\minted@jobname.aex}
+  \else
+    \immediate\write18{which "#1" && touch "\minted@jobname.aex"}
+    \IfFileExists{\minted@jobname.aex}
+      {\AppExiststrue
+        \DeleteFile{\minted@jobname.aex}}
+      {\AppExistsfalse}
+  \fi
+}
+\newcommand{\minted@optlistcl@g}{}
+\newcommand{\minted@optlistcl@g@i}{}
+\let\minted@lang\@empty
+\newcommand{\minted@optlistcl@lang}{}
+\newcommand{\minted@optlistcl@lang@i}{}
+\newcommand{\minted@optlistcl@cmd}{}
+\newcommand{\minted@optlistfv@g}{}
+\newcommand{\minted@optlistfv@g@i}{}
+\newcommand{\minted@optlistfv@lang}{}
+\newcommand{\minted@optlistfv@lang@i}{}
+\newcommand{\minted@optlistfv@cmd}{}
+\newcommand{\minted@configlang}[1]{%
+  \def\minted@lang{#1}%
+  \ifcsname minted@optlistcl@lang\minted@lang\endcsname\else
+    \expandafter\gdef\csname minted@optlistcl@lang\minted@lang\endcsname{}%
+  \fi
+  \ifcsname minted@optlistcl@lang\minted@lang @i\endcsname\else
+    \expandafter\gdef\csname minted@optlistcl@lang\minted@lang @i\endcsname{}%
+  \fi
+  \ifcsname minted@optlistfv@lang\minted@lang\endcsname\else
+    \expandafter\gdef\csname minted@optlistfv@lang\minted@lang\endcsname{}%
+  \fi
+  \ifcsname minted@optlistfv@lang\minted@lang @i\endcsname\else
+    \expandafter\gdef\csname minted@optlistfv@lang\minted@lang @i\endcsname{}%
+  \fi
+}
+\newcommand{\minted@addto@optlistcl}[2]{%
+  \expandafter\def\expandafter#1\expandafter{#1%
+    \detokenize{#2}\space}}
+\newcommand{\minted@addto@optlistcl@lang}[2]{%
+  \expandafter\let\expandafter\minted@tmp\csname #1\endcsname
+  \expandafter\def\expandafter\minted@tmp\expandafter{\minted@tmp%
+    \detokenize{#2}\space}%
+  \expandafter\let\csname #1\endcsname\minted@tmp}
+\newcommand{\minted@def@optcl}[4][]{%
+  \ifthenelse{\equal{#1}{}}%
+    {\define@key{minted@opt@g}{#2}{%
+        \minted@addto@optlistcl{\minted@optlistcl@g}{#3=#4}%
+        \@namedef{minted@opt@g:#2}{#4}}%
+      \define@key{minted@opt@g@i}{#2}{%
+        \minted@addto@optlistcl{\minted@optlistcl@g@i}{#3=#4}%
+        \@namedef{minted@opt@g@i:#2}{#4}}%
+      \define@key{minted@opt@lang}{#2}{%
+        \minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#3=#4}%
+        \@namedef{minted@opt@lang\minted@lang:#2}{#4}}%
+      \define@key{minted@opt@lang@i}{#2}{%
+        \minted@addto@optlistcl@lang{%
+          minted@optlistcl@lang\minted@lang @i}{#3=#4}%
+        \@namedef{minted@opt@lang\minted@lang @i:#2}{#4}}%
+      \define@key{minted@opt@cmd}{#2}{%
+        \minted@addto@optlistcl{\minted@optlistcl@cmd}{#3=#4}%
+        \@namedef{minted@opt@cmd:#2}{#4}}}%
+    {\define@key{minted@opt@g}{#2}[#1]{%
+        \minted@addto@optlistcl{\minted@optlistcl@g}{#3=#4}%
+        \@namedef{minted@opt@g:#2}{#4}}%
+      \define@key{minted@opt@g@i}{#2}[#1]{%
+        \minted@addto@optlistcl{\minted@optlistcl@g@i}{#3=#4}%
+        \@namedef{minted@opt@g@i:#2}{#4}}%
+      \define@key{minted@opt@lang}{#2}[#1]{%
+        \minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#3=#4}%
+        \@namedef{minted@opt@lang\minted@lang:#2}{#4}}%
+      \define@key{minted@opt@lang@i}{#2}[#1]{%
+        \minted@addto@optlistcl@lang{%
+          minted@optlistcl@lang\minted@lang @i}{#3=#4}%
+        \@namedef{minted@opt@lang\minted@lang @i:#2}{#4}}%
+      \define@key{minted@opt@cmd}{#2}[#1]{%
+        \minted@addto@optlistcl{\minted@optlistcl@cmd}{#3=#4}%
+        \@namedef{minted@opt@cmd:#2}{#4}}}%
+}
+\edef\minted@hashchar{\string#}
+\edef\minted@dollarchar{\string$}
+\edef\minted@ampchar{\string&}
+\edef\minted@underscorechar{\string_}
+\edef\minted@tildechar{\string~}
+\edef\minted@leftsquarebracket{\string[}
+\edef\minted@rightsquarebracket{\string]}
+\newcommand{\minted@escchars}{%
+  \let\#\minted@hashchar
+  \let\%\@percentchar
+  \let\{\@charlb
+  \let\}\@charrb
+  \let\$\minted@dollarchar
+  \let\&\minted@ampchar
+  \let\_\minted@underscorechar
+  \let\\\@backslashchar
+  \let~\minted@tildechar
+  \let\~\minted@tildechar
+  \let\[\minted@leftsquarebracket
+  \let\]\minted@rightsquarebracket
+} %$ <- highlighting
+\newcommand{\minted@addto@optlistcl@e}[2]{%
+  \begingroup
+  \minted@escchars
+  \xdef\minted@xtmp{#2}%
+  \endgroup
+  \expandafter\minted@addto@optlistcl@e@i\expandafter{\minted@xtmp}{#1}}
+\def\minted@addto@optlistcl@e@i#1#2{%
+  \expandafter\def\expandafter#2\expandafter{#2#1\space}}
+\newcommand{\minted@addto@optlistcl@lang@e}[2]{%
+  \begingroup
+  \minted@escchars
+  \xdef\minted@xtmp{#2}%
+  \endgroup
+  \expandafter\minted@addto@optlistcl@lang@e@i\expandafter{\minted@xtmp}{#1}}
+\def\minted@addto@optlistcl@lang@e@i#1#2{%
+  \expandafter\let\expandafter\minted@tmp\csname #2\endcsname
+  \expandafter\def\expandafter\minted@tmp\expandafter{\minted@tmp#1\space}%
+  \expandafter\let\csname #2\endcsname\minted@tmp}
+\newcommand{\minted@def@optcl@e}[4][]{%
+  \ifthenelse{\equal{#1}{}}%
+    {\define@key{minted@opt@g}{#2}{%
+        \minted@addto@optlistcl@e{\minted@optlistcl@g}{#3=#4}%
+        \@namedef{minted@opt@g:#2}{#4}}%
+      \define@key{minted@opt@g@i}{#2}{%
+        \minted@addto@optlistcl@e{\minted@optlistcl@g@i}{#3=#4}%
+        \@namedef{minted@opt@g@i:#2}{#4}}%
+      \define@key{minted@opt@lang}{#2}{%
+        \minted@addto@optlistcl@lang@e{minted@optlistcl@lang\minted@lang}{#3=#4}%
+        \@namedef{minted@opt@lang\minted@lang:#2}{#4}}%
+      \define@key{minted@opt@lang@i}{#2}{%
+        \minted@addto@optlistcl@lang@e{%
+          minted@optlistcl@lang\minted@lang @i}{#3=#4}%
+        \@namedef{minted@opt@lang\minted@lang @i:#2}{#4}}%
+      \define@key{minted@opt@cmd}{#2}{%
+        \minted@addto@optlistcl@e{\minted@optlistcl@cmd}{#3=#4}%
+        \@namedef{minted@opt@cmd:#2}{#4}}}%
+    {\define@key{minted@opt@g}{#2}[#1]{%
+        \minted@addto@optlistcl@e{\minted@optlistcl@g}{#3=#4}%
+        \@namedef{minted@opt@g:#2}{#4}}%
+      \define@key{minted@opt@g@i}{#2}[#1]{%
+        \minted@addto@optlistcl@e{\minted@optlistcl@g@i}{#3=#4}%
+        \@namedef{minted@opt@g@i:#2}{#4}}%
+      \define@key{minted@opt@lang}{#2}[#1]{%
+        \minted@addto@optlistcl@lang@e{minted@optlistcl@lang\minted@lang}{#3=#4}%
+        \@namedef{minted@opt@lang\minted@lang:#2}{#4}}%
+      \define@key{minted@opt@lang@i}{#2}[#1]{%
+        \minted@addto@optlistcl@lang@e{%
+          minted@optlistcl@lang\minted@lang @i}{#3=#4}%
+        \@namedef{minted@opt@lang\minted@lang @i:#2}{#4}}%
+      \define@key{minted@opt@cmd}{#2}[#1]{%
+        \minted@addto@optlistcl@e{\minted@optlistcl@cmd}{#3=#4}%
+        \@namedef{minted@opt@cmd:#2}{#4}}}%
+}
+\newcommand{\minted@def@optcl@switch}[2]{%
+  \define@booleankey{minted@opt@g}{#1}%
+    {\minted@addto@optlistcl{\minted@optlistcl@g}{#2=True}%
+      \@namedef{minted@opt@g:#1}{true}}
+    {\minted@addto@optlistcl{\minted@optlistcl@g}{#2=False}%
+      \@namedef{minted@opt@g:#1}{false}}
+  \define@booleankey{minted@opt@g@i}{#1}%
+    {\minted@addto@optlistcl{\minted@optlistcl@g@i}{#2=True}%
+      \@namedef{minted@opt@g@i:#1}{true}}
+    {\minted@addto@optlistcl{\minted@optlistcl@g@i}{#2=False}%
+      \@namedef{minted@opt@g@i:#1}{false}}
+  \define@booleankey{minted@opt@lang}{#1}%
+    {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#2=True}%
+      \@namedef{minted@opt@lang\minted@lang:#1}{true}}
+    {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#2=False}%
+      \@namedef{minted@opt@lang\minted@lang:#1}{false}}
+  \define@booleankey{minted@opt@lang@i}{#1}%
+    {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang @i}{#2=True}%
+      \@namedef{minted@opt@lang\minted@lang @i:#1}{true}}
+    {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang @i}{#2=False}%
+      \@namedef{minted@opt@lang\minted@lang @i:#1}{false}}
+  \define@booleankey{minted@opt@cmd}{#1}%
+      {\minted@addto@optlistcl{\minted@optlistcl@cmd}{#2=True}%
+        \@namedef{minted@opt@cmd:#1}{true}}
+      {\minted@addto@optlistcl{\minted@optlistcl@cmd}{#2=False}%
+        \@namedef{minted@opt@cmd:#1}{false}}
+}
+\newcommand{\minted@def@optfv}[1]{%
+  \define@key{minted@opt@g}{#1}{%
+    \expandafter\def\expandafter\minted@optlistfv@g\expandafter{%
+      \minted@optlistfv@g#1=##1,}%
+    \@namedef{minted@opt@g:#1}{##1}}
+  \define@key{minted@opt@g@i}{#1}{%
+    \expandafter\def\expandafter\minted@optlistfv@g@i\expandafter{%
+      \minted@optlistfv@g@i#1=##1,}%
+    \@namedef{minted@opt@g@i:#1}{##1}}
+  \define@key{minted@opt@lang}{#1}{%
+    \expandafter\let\expandafter\minted@tmp%
+      \csname minted@optlistfv@lang\minted@lang\endcsname
+    \expandafter\def\expandafter\minted@tmp\expandafter{%
+      \minted@tmp#1=##1,}%
+    \expandafter\let\csname minted@optlistfv@lang\minted@lang\endcsname%
+      \minted@tmp
+    \@namedef{minted@opt@lang\minted@lang:#1}{##1}}
+  \define@key{minted@opt@lang@i}{#1}{%
+    \expandafter\let\expandafter\minted@tmp%
+      \csname minted@optlistfv@lang\minted@lang @i\endcsname
+    \expandafter\def\expandafter\minted@tmp\expandafter{%
+      \minted@tmp#1=##1,}%
+    \expandafter\let\csname minted@optlistfv@lang\minted@lang @i\endcsname%
+      \minted@tmp
+    \@namedef{minted@opt@lang\minted@lang @i:#1}{##1}}
+  \define@key{minted@opt@cmd}{#1}{%
+    \expandafter\def\expandafter\minted@optlistfv@cmd\expandafter{%
+      \minted@optlistfv@cmd#1=##1,}%
+    \@namedef{minted@opt@cmd:#1}{##1}}
+}
+\newcommand{\minted@def@optfv@switch}[1]{%
+  \define@booleankey{minted@opt@g}{#1}%
+    {\expandafter\def\expandafter\minted@optlistfv@g\expandafter{%
+      \minted@optlistfv@g#1=true,}%
+     \@namedef{minted@opt@g:#1}{true}}%
+    {\expandafter\def\expandafter\minted@optlistfv@g\expandafter{%
+      \minted@optlistfv@g#1=false,}%
+     \@namedef{minted@opt@g:#1}{false}}%
+  \define@booleankey{minted@opt@g@i}{#1}%
+    {\expandafter\def\expandafter\minted@optlistfv@g@i\expandafter{%
+      \minted@optlistfv@g@i#1=true,}%
+     \@namedef{minted@opt@g@i:#1}{true}}%
+    {\expandafter\def\expandafter\minted@optlistfv@g@i\expandafter{%
+      \minted@optlistfv@g@i#1=false,}%
+     \@namedef{minted@opt@g@i:#1}{false}}%
+  \define@booleankey{minted@opt@lang}{#1}%
+    {\expandafter\let\expandafter\minted@tmp%
+        \csname minted@optlistfv@lang\minted@lang\endcsname
+      \expandafter\def\expandafter\minted@tmp\expandafter{%
+        \minted@tmp#1=true,}%
+      \expandafter\let\csname minted@optlistfv@lang\minted@lang\endcsname%
+        \minted@tmp
+     \@namedef{minted@opt@lang\minted@lang:#1}{true}}%
+    {\expandafter\let\expandafter\minted@tmp%
+        \csname minted@optlistfv@lang\minted@lang\endcsname
+      \expandafter\def\expandafter\minted@tmp\expandafter{%
+        \minted@tmp#1=false,}%
+      \expandafter\let\csname minted@optlistfv@lang\minted@lang\endcsname%
+        \minted@tmp
+     \@namedef{minted@opt@lang\minted@lang:#1}{false}}%
+  \define@booleankey{minted@opt@lang@i}{#1}%
+    {\expandafter\let\expandafter\minted@tmp%
+        \csname minted@optlistfv@lang\minted@lang @i\endcsname
+      \expandafter\def\expandafter\minted@tmp\expandafter{%
+        \minted@tmp#1=true,}%
+      \expandafter\let\csname minted@optlistfv@lang\minted@lang @i\endcsname%
+        \minted@tmp
+     \@namedef{minted@opt@lang\minted@lang @i:#1}{true}}%
+    {\expandafter\let\expandafter\minted@tmp%
+        \csname minted@optlistfv@lang\minted@lang @i\endcsname
+      \expandafter\def\expandafter\minted@tmp\expandafter{%
+        \minted@tmp#1=false,}%
+      \expandafter\let\csname minted@optlistfv@lang\minted@lang @i\endcsname%
+        \minted@tmp
+     \@namedef{minted@opt@lang\minted@lang @i:#1}{false}}%
+  \define@booleankey{minted@opt@cmd}{#1}%
+    {\expandafter\def\expandafter\minted@optlistfv@cmd\expandafter{%
+      \minted@optlistfv@cmd#1=true,}%
+     \@namedef{minted@opt@cmd:#1}{true}}%
+    {\expandafter\def\expandafter\minted@optlistfv@cmd\expandafter{%
+      \minted@optlistfv@cmd#1=false,}%
+     \@namedef{minted@opt@cmd:#1}{false}}%
+}
+\newboolean{minted@isinline}
+\newcommand{\minted@fvset}{%
+  \expandafter\fvset\expandafter{\minted@optlistfv@g}%
+  \expandafter\let\expandafter\minted@tmp%
+    \csname minted@optlistfv@lang\minted@lang\endcsname
+  \expandafter\fvset\expandafter{\minted@tmp}%
+  \ifthenelse{\boolean{minted@isinline}}%
+   {\expandafter\fvset\expandafter{\minted@optlistfv@g@i}%
+    \expandafter\let\expandafter\minted@tmp%
+      \csname minted@optlistfv@lang\minted@lang @i\endcsname
+    \expandafter\fvset\expandafter{\minted@tmp}}%
+   {}%
+  \expandafter\fvset\expandafter{\minted@optlistfv@cmd}%
+}
+\newcommand{\minted@def@opt}[2][]{%
+  \define@key{minted@opt@g}{#2}{%
+    \@namedef{minted@opt@g:#2}{##1}}
+  \define@key{minted@opt@g@i}{#2}{%
+    \@namedef{minted@opt@g@i:#2}{##1}}
+  \define@key{minted@opt@lang}{#2}{%
+    \@namedef{minted@opt@lang\minted@lang:#2}{##1}}
+  \define@key{minted@opt@lang@i}{#2}{%
+    \@namedef{minted@opt@lang\minted@lang @i:#2}{##1}}
+  \define@key{minted@opt@cmd}{#2}{%
+    \@namedef{minted@opt@cmd:#2}{##1}}
+}
+\newcommand{\minted@def@opt@style}{%
+  \define@key{minted@opt@g}{style}{%
+    \minted@checkstyle{##1}%
+    \@namedef{minted@opt@g:style}{##1}}%
+  \define@key{minted@opt@g@i}{style}{%
+    \minted@checkstyle{##1}%
+    \@namedef{minted@opt@g@i:style}{##1}}%
+  \define@key{minted@opt@lang}{style}{%
+    \minted@checkstyle{##1}%
+    \@namedef{minted@opt@lang\minted@lang:style}{##1}}%
+  \define@key{minted@opt@lang@i}{style}{%
+    \minted@checkstyle{##1}%
+    \@namedef{minted@opt@lang\minted@lang @i:style}{##1}}%
+  \define@key{minted@opt@cmd}{style}{%
+    \minted@checkstyle{##1}%
+    \@namedef{minted@opt@cmd:style}{##1}}%
+}
+\newcommand{\minted@checkstyle}[1]{%
+  \ifcsname minted@styleloaded@\ifstrempty{#1}{default-pyg-prefix}{#1}\endcsname\else
+    \expandafter\gdef%
+      \csname minted@styleloaded@\ifstrempty{#1}{default-pyg-prefix}{#1}\endcsname{}%
+    \ifthenelse{\boolean{minted@cache}}%
+      {\IfFileExists
+       {\minted@outputdir\minted@cachedir/\ifstrempty{#1}{default-pyg-prefix}{#1}.pygstyle}%
+       {}%
+       {%
+        \ifwindows
+          \immediate\write18{%
+            \MintedPygmentize\space -S \ifstrempty{#1}{default}{#1} -f latex
+            -P commandprefix=PYG#1
+            > "\minted@outputdir@windows\minted@cachedir@windows\@backslashchar%
+                 \ifstrempty{#1}{default-pyg-prefix}{#1}.pygstyle"}%
+        \else
+          \immediate\write18{%
+            \MintedPygmentize\space -S \ifstrempty{#1}{default}{#1} -f latex
+            -P commandprefix=PYG#1
+            > "\minted@outputdir\minted@cachedir/%
+                 \ifstrempty{#1}{default-pyg-prefix}{#1}.pygstyle"}%
+        \fi
+        }%
+        \begingroup
+        \let\def\gdef
+        \endlinechar=-1\relax
+        \minted@input{%
+          \minted@outputdir\minted@cachedir/\ifstrempty{#1}{default-pyg-prefix}{#1}.pygstyle}%
+        \endgroup
+        \minted@addcachefile{\ifstrempty{#1}{default-pyg-prefix}{#1}.pygstyle}}%
+      {\ifwindows
+          \immediate\write18{%
+            \MintedPygmentize\space -S \ifstrempty{#1}{default}{#1} -f latex
+            -P commandprefix=PYG#1 > "\minted@outputdir@windows\minted@jobname.out.pyg"}%
+        \else
+          \immediate\write18{%
+            \MintedPygmentize\space -S \ifstrempty{#1}{default}{#1} -f latex
+            -P commandprefix=PYG#1 > "\minted@outputdir\minted@jobname.out.pyg"}%
+        \fi
+        \begingroup
+        \let\def\gdef
+        \endlinechar=-1\relax
+        \minted@input{\minted@outputdir\minted@jobname.out.pyg}%
+        \endgroup}%
+  \fi
+}
+\ifthenelse{\boolean{minted@draft}}{\renewcommand{\minted@checkstyle}[1]{}}{}
+\AtBeginDocument{\minted@checkstyle{}}
+\newcommand{\minted@patch@PYGZsq}{%
+  \ifcsname PYGZsq\endcsname
+    \ifx\upquote@cmtt\minted@undefined\else
+      \ifx\encodingdefault\upquote@OTone
+        \ifx\ttdefault\upquote@cmtt
+          \expandafter\ifdefstring\expandafter{\csname PYGZsq\endcsname}{\char`\'}%
+          {\expandafter\gdef\csname PYGZsq\endcsname{\char13 }}{}%
+        \else
+          \expandafter\ifdefstring\expandafter{\csname PYGZsq\endcsname}{\char`\'}%
+          {\expandafter\gdef\csname PYGZsq\endcsname{\textquotesingle}}{}%
+        \fi
+      \else
+        \expandafter\ifdefstring\expandafter{\csname PYGZsq\endcsname}{\char`\'}%
+        {\expandafter\gdef\csname PYGZsq\endcsname{\textquotesingle}}{}%
+      \fi
+    \fi
+  \fi
+}
+\ifthenelse{\boolean{minted@draft}}{}{\AtBeginDocument{\minted@patch@PYGZsq}}
+\newcommand{\minted@def@opt@switch}[2][false]{%
+  \define@booleankey{minted@opt@g}{#2}%
+    {\@namedef{minted@opt@g:#2}{true}}%
+    {\@namedef{minted@opt@g:#2}{false}}
+  \define@booleankey{minted@opt@g@i}{#2}%
+    {\@namedef{minted@opt@g@i:#2}{true}}%
+    {\@namedef{minted@opt@g@i:#2}{false}}
+  \define@booleankey{minted@opt@lang}{#2}%
+    {\@namedef{minted@opt@lang\minted@lang:#2}{true}}%
+    {\@namedef{minted@opt@lang\minted@lang:#2}{false}}
+  \define@booleankey{minted@opt@lang@i}{#2}%
+    {\@namedef{minted@opt@lang\minted@lang @i:#2}{true}}%
+    {\@namedef{minted@opt@lang\minted@lang @i:#2}{false}}
+  \define@booleankey{minted@opt@cmd}{#2}%
+    {\@namedef{minted@opt@cmd:#2}{true}}%
+    {\@namedef{minted@opt@cmd:#2}{false}}%
+  \@namedef{minted@opt@g:#2}{#1}%
+}
+\def\minted@get@opt#1#2{%
+  \ifcsname minted@opt@cmd:#1\endcsname
+    \csname minted@opt@cmd:#1\endcsname
+  \else
+    \ifminted@isinline
+      \ifcsname minted@opt@lang\minted@lang @i:#1\endcsname
+        \csname minted@opt@lang\minted@lang @i:#1\endcsname
+      \else
+        \ifcsname minted@opt@g@i:#1\endcsname
+          \csname minted@opt@g@i:#1\endcsname
+        \else
+          \ifcsname minted@opt@lang\minted@lang:#1\endcsname
+            \csname minted@opt@lang\minted@lang:#1\endcsname
+          \else
+            \ifcsname minted@opt@g:#1\endcsname
+              \csname minted@opt@g:#1\endcsname
+            \else
+              #2%
+            \fi
+          \fi
+        \fi
+      \fi
+    \else
+      \ifcsname minted@opt@lang\minted@lang:#1\endcsname
+        \csname minted@opt@lang\minted@lang:#1\endcsname
+      \else
+        \ifcsname minted@opt@g:#1\endcsname
+          \csname minted@opt@g:#1\endcsname
+        \else
+          #2%
+        \fi
+      \fi
+    \fi
+  \fi
+}%
+\minted@def@optcl{encoding}{-P encoding}{#1}
+\minted@def@optcl{outencoding}{-P outencoding}{#1}
+\minted@def@optcl@e{escapeinside}{-P "escapeinside}{#1"}
+\minted@def@optcl@switch{stripnl}{-P stripnl}
+\minted@def@optcl@switch{stripall}{-P stripall}
+\minted@def@optcl@switch{python3}{-P python3}
+\minted@def@optcl@switch{funcnamehighlighting}{-P funcnamehighlighting}
+\minted@def@optcl@switch{startinline}{-P startinline}
+\ifthenelse{\boolean{minted@draft}}%
+  {\minted@def@optfv{gobble}}%
+  {\minted@def@optcl{gobble}{-F gobble:n}{#1}}
+\minted@def@optcl{codetagify}{-F codetagify:codetags}{#1}
+\minted@def@optcl{keywordcase}{-F keywordcase:case}{#1}
+\minted@def@optcl@switch{texcl}{-P texcomments}
+\minted@def@optcl@switch{texcomments}{-P texcomments}
+\minted@def@optcl@switch{mathescape}{-P mathescape}
+\minted@def@optfv@switch{linenos}
+\minted@def@opt@style
+\minted@def@optfv{frame}
+\minted@def@optfv{framesep}
+\minted@def@optfv{framerule}
+\minted@def@optfv{rulecolor}
+\minted@def@optfv{numbersep}
+\minted@def@optfv{numbers}
+\minted@def@optfv{firstnumber}
+\minted@def@optfv{stepnumber}
+\minted@def@optfv{firstline}
+\minted@def@optfv{lastline}
+\minted@def@optfv{baselinestretch}
+\minted@def@optfv{xleftmargin}
+\minted@def@optfv{xrightmargin}
+\minted@def@optfv{fillcolor}
+\minted@def@optfv{tabsize}
+\minted@def@optfv{fontfamily}
+\minted@def@optfv{fontsize}
+\minted@def@optfv{fontshape}
+\minted@def@optfv{fontseries}
+\minted@def@optfv{formatcom}
+\minted@def@optfv{label}
+\minted@def@optfv@switch{numberblanklines}
+\minted@def@optfv@switch{showspaces}
+\minted@def@optfv@switch{resetmargins}
+\minted@def@optfv@switch{samepage}
+\minted@def@optfv@switch{showtabs}
+\minted@def@optfv@switch{obeytabs}
+\minted@def@optfv@switch{breaklines}
+\minted@def@optfv{breakindent}
+\minted@def@optfv@switch{breakautoindent}
+\minted@def@optfv{breaksymbol}
+\minted@def@optfv{breaksymbolsep}
+\minted@def@optfv{breaksymbolindent}
+\minted@def@optfv{breaksymbolleft}
+\minted@def@optfv{breaksymbolsepleft}
+\minted@def@optfv{breaksymbolindentleft}
+\minted@def@optfv{breaksymbolright}
+\minted@def@optfv{breaksymbolsepright}
+\minted@def@optfv{breaksymbolindentright}
+\minted@def@optfv{breakafter}
+\minted@def@optfv@switch{breakaftergroup}
+\minted@def@optfv{breakaftersymbolpre}
+\minted@def@optfv{breakaftersymbolpost}
+\minted@def@optfv@switch{breakanywhere}
+\minted@def@optfv{breakanywheresymbolpre}
+\minted@def@optfv{breakanywheresymbolpost}
+\minted@def@opt@switch{breakbytoken}
+\minted@def@opt@switch{breakbytokenanywhere}
+\minted@def@opt{bgcolor}
+\minted@def@opt@switch{autogobble}
+\newcommand{\minted@encoding}{\minted@get@opt{encoding}{UTF8}}
+\ifcsname KV@FV@breaklines\endcsname\else
+\newboolean{FV@BreakLines}
+\let\FV@ListProcessLine@Orig\FV@ListProcessLine
+\define@booleankey{FV}{breaklines}%
+  {\FV@BreakLinestrue
+    \let\FV@ListProcessLine\FV@ListProcessLine@Break}%
+  {\FV@BreakLinesfalse
+    \let\FV@ListProcessLine\FV@ListProcessLine@Orig}
+\newdimen\FV@BreakIndent
+\define@key{FV}{breakindent}{\FV@BreakIndent=#1}
+\fvset{breakindent=0pt}
+\newboolean{FV@BreakAutoIndent}
+\define@booleankey{FV}{breakautoindent}%
+  {\FV@BreakAutoIndenttrue}{\FV@BreakAutoIndentfalse}
+\fvset{breakautoindent=true}
+\define@key{FV}{breaksymbolleft}{\def\FancyVerbBreakSymbolLeft{#1}}
+\define@key{FV}{breaksymbol}{\fvset{breaksymbolleft=#1}}
+\fvset{breaksymbolleft=\tiny\ensuremath{\hookrightarrow}}
+\define@key{FV}{breaksymbolright}{\def\FancyVerbBreakSymbolRight{#1}}
+\fvset{breaksymbolright={}}
+\newdimen\FV@BreakSymbolSepLeft
+\define@key{FV}{breaksymbolsepleft}{\FV@BreakSymbolSepLeft=#1}
+\define@key{FV}{breaksymbolsep}{\fvset{breaksymbolsepleft=#1}}
+\fvset{breaksymbolsepleft=1em}
+\newdimen\FV@BreakSymbolSepRight
+\define@key{FV}{breaksymbolsepright}{\FV@BreakSymbolSepRight=#1}
+\fvset{breaksymbolsepright=1em}
+\newdimen\FV@BreakSymbolIndentLeft
+\settowidth{\FV@BreakSymbolIndentLeft}{\ttfamily xxxx}
+\define@key{FV}{breaksymbolindentleft}{\FV@BreakSymbolIndentLeft=#1}
+\define@key{FV}{breaksymbolindent}{\fvset{breaksymbolindentleft=#1}}
+\newdimen\FV@BreakSymbolIndentRight
+\settowidth{\FV@BreakSymbolIndentRight}{\ttfamily xxxx}
+\define@key{FV}{breaksymbolindentright}{\FV@BreakSymbolIndentRight=#1}
+\newcommand{\FancyVerbFormatBreakSymbolLeft}[1]{%
+  \ifnum\value{linenumber}=1\relax\else{#1}\fi}
+\newcounter{FancyVerbLineBreakLast}
+\newcommand{\FV@SetLineBreakLast}{%
+  \setcounter{FancyVerbLineBreakLast}{\value{linenumber}}}
+\newcommand{\FancyVerbFormatBreakSymbolRight}[1]{%
+  \ifnum\value{linenumber}=\value{FancyVerbLineBreakLast}\relax\else{#1}\fi}
+\newboolean{FV@BreakAnywhere}
+\define@booleankey{FV}{breakanywhere}%
+  {\FV@BreakAnywheretrue
+    \let\FancyVerbBreakStart\FV@Break
+    \let\FancyVerbBreakStop\FV@EndBreak
+    \let\FV@Break@Token\FV@Break@AnyToken}%
+  {\FV@BreakAnywherefalse
+    \let\FancyVerbBreakStart\relax
+    \let\FancyVerbBreakStop\relax}
+\fvset{breakanywhere=false}
+\let\FancyVerbBreakStart\relax
+\let\FancyVerbBreakStop\relax
+\edef\FV@hashchar{\string#}
+\edef\FV@dollarchar{\string$}
+\edef\FV@ampchar{\string&}
+\edef\FV@underscorechar{\string_}
+\edef\FV@tildechar{\string~}
+\edef\FV@leftsquarebracket{\string[}
+\edef\FV@rightsquarebracket{\string]}
+\newcommand{\FV@EscChars}{%
+  \let\#\FV@hashchar
+  \let\%\@percentchar
+  \let\{\@charlb
+  \let\}\@charrb
+  \let\$\FV@dollarchar
+  \let\&\FV@ampchar
+  \let\_\FV@underscorechar
+  \let\\\@backslashchar
+  \let~\FV@tildechar
+  \let\~\FV@tildechar
+  \let\[\FV@leftsquarebracket
+  \let\]\FV@rightsquarebracket
+} %$ <- highlighting
+\define@key{FV}{breakafter}{%
+  \ifstrempty{#1}%
+   {\let\FV@BreakAfter\@empty
+    \let\FancyVerbBreakStart\relax
+    \let\FancyVerbBreakStop\relax}%
+   {\def\FV@BreakAfter{#1}%
+    \let\FancyVerbBreakStart\FV@Break
+    \let\FancyVerbBreakStop\FV@EndBreak
+    \let\FV@Break@Token\FV@Break@AfterToken}%
+}
+\fvset{breakafter={}}
+\newboolean{FV@BreakAfterGroup}
+\define@booleankey{FV}{breakaftergroup}%
+ {\FV@BreakAfterGrouptrue}%
+ {\FV@BreakAfterGroupfalse}%
+\fvset{breakaftergroup=true}
+\def\FV@BreakAfterPrep{%
+  \ifx\FV@BreakAfter\@empty\relax
+  \else
+    \gdef\FV@BreakAfter@Def{}%
+    \begingroup
+    \def\FV@BreakAfter@Process##1##2\FV@Undefined{%
+      \expandafter\FV@BreakAfter@Process@i\expandafter{##1}%
+      \expandafter\ifx\expandafter\relax\detokenize{##2}\relax
+      \else
+        \FV@BreakAfter@Process##2\FV@Undefined
+      \fi
+    }%
+    \def\FV@BreakAfter@Process@i##1{%
+      \g@addto@macro\FV@BreakAfter@Def{%
+        \@namedef{FV@BreakAfter@Token\detokenize{##1}}{}}%
+    }%
+    \FV@EscChars
+    \expandafter\FV@BreakAfter@Process\FV@BreakAfter\FV@Undefined
+    \endgroup
+    \FV@BreakAfter@Def
+  \fi
+}
+\expandafter\def\expandafter\FV@FormattingPrep\expandafter{%
+  \expandafter\FV@BreakAfterPrep\FV@FormattingPrep}
+\define@key{FV}{breakanywheresymbolpre}{%
+  \ifstrempty{#1}%
+    {\def\FancyVerbBreakAnywhereSymbolPre{}}%
+    {\def\FancyVerbBreakAnywhereSymbolPre{\hbox{#1}}}}
+\fvset{breakanywheresymbolpre={\,\footnotesize\ensuremath{_\rfloor}}}
+\define@key{FV}{breakanywheresymbolpost}{%
+  \ifstrempty{#1}%
+    {\def\FancyVerbBreakAnywhereSymbolPost{}}%
+    {\def\FancyVerbBreakAnywhereSymbolPost{\hbox{#1}}}}
+\fvset{breakanywheresymbolpost={}}
+\define@key{FV}{breakaftersymbolpre}{%
+  \ifstrempty{#1}%
+    {\def\FancyVerbBreakAfterSymbolPre{}}%
+    {\def\FancyVerbBreakAfterSymbolPre{\hbox{#1}}}}
+\fvset{breakaftersymbolpre={\,\footnotesize\ensuremath{_\rfloor}}}
+\define@key{FV}{breakaftersymbolpost}{%
+  \ifstrempty{#1}%
+    {\def\FancyVerbBreakAfterSymbolPost{}}%
+    {\def\FancyVerbBreakAfterSymbolPost{\hbox{#1}}}}
+\fvset{breakaftersymbolpost={}}
+\newcommand{\FancyVerbBreakAnywhereBreak}{%
+  \discretionary{\FancyVerbBreakAnywhereSymbolPre}%
+   {\FancyVerbBreakAnywhereSymbolPost}{}}
+\newcommand{\FancyVerbBreakAfterBreak}{%
+  \discretionary{\FancyVerbBreakAfterSymbolPre}%
+   {\FancyVerbBreakAfterSymbolPost}{}}
+\newsavebox{\FV@LineBox}
+\newsavebox{\FV@LineIndentBox}
+\let\FV@LineIndentChars\@empty
+\def\FV@GetNextChar{\let\FV@NextChar=}
+\def\FV@CleanRemainingChars#1\FV@Undefined{}
+\def\FV@GetLineIndent{\afterassignment\FV@CheckIndentChar\FV@GetNextChar}
+\def\FV@CheckIndentChar{%
+  \ifx\FV@NextChar\FV@Undefined
+    \let\FV@Next=\relax
+  \else
+    \expandafter\ifx\FV@NextChar\FV@Space
+      \g@addto@macro{\FV@LineIndentChars}{\FV@Space}%
+      \let\FV@Next=\FV@GetLineIndent
+    \else
+      \expandafter\ifx\FV@NextChar\FV@Tab
+        \g@addto@macro{\FV@LineIndentChars}{\FV@Tab}%
+        \let\FV@Next=\FV@GetLineIndent
+      \else
+        \let\FV@Next=\FV@CleanRemainingChars
+      \fi
+    \fi
+  \fi
+  \FV@Next
+}
+\def\FV@Break{%
+  \def\FV@Tmp{}%
+  \FV@Break@Scan
+}
+\def\FV@EndBreak{\FV@Tmp}
+\begingroup
+\catcode`\$=3%
+\gdef\FV@Break@Scan{%
+  \@ifnextchar\FV@EndBreak%
+   {}%
+   {\ifx\@let@token$\relax
+      \let\FV@Break@Next\FV@Break@Math
+    \else
+      \ifx\@let@token\bgroup\relax
+        \let\FV@Break@Next\FV@Break@Group
+      \else
+        \let\FV@Break@Next\FV@Break@Token
+      \fi
+    \fi
+    \FV@Break@Next}%
+}
+\endgroup
+\begingroup
+\catcode`\$=3%
+\gdef\FV@Break@Math$#1${%
+  \g@addto@macro{\FV@Tmp}{$#1$}%
+  \FV@Break@Scan}
+\endgroup
+\def\FV@Break@Group#1{%
+  \g@addto@macro{\FV@Tmp}{{#1}}%
+  \FV@Break@Scan}
+\def\FV@Break@AnyToken#1{%
+  \g@addto@macro{\FV@Tmp}{\FancyVerbBreakAnywhereBreak#1}%
+  \FV@Break@Scan}
+\def\FV@Break@AfterToken#1{%
+  \ifcsname FV@BreakAfter@Token\detokenize{#1}\endcsname
+    \let\FV@Break@Next\FV@Break@AfterTokenBreak
+  \else
+    \let\FV@Break@Next\FV@Break@AfterTokenNoBreak
+  \fi
+  \FV@Break@Next{#1}%
+}
+\def\FV@Break@AfterTokenNoBreak#1{%
+  \g@addto@macro{\FV@Tmp}{#1}%
+  \FV@Break@Scan}
+\def\FV@Break@AfterTokenBreak#1{%
+  \@ifnextchar\FV@Space%
+   {\g@addto@macro{\FV@Tmp}{#1}\FV@Break@Scan}%
+   {\ifthenelse{\boolean{FV@BreakAfterGroup}}%
+     {\ifx\@let@token#1\relax
+        \g@addto@macro{\FV@Tmp}{#1}%
+        \let\FV@Break@Next\FV@Break@Scan
+      \else
+        \ifx\@let@token\bgroup\relax
+          \g@addto@macro{\FV@Tmp}{#1}%
+          \let\FV@TmpToken#1%
+          \let\FV@Break@Next\FV@Break@AfterTokenBreak@Group
+        \else
+          \g@addto@macro{\FV@Tmp}{#1\FancyVerbBreakAfterBreak}%
+          \let\FV@Break@Next\FV@Break@Scan
+        \fi
+      \fi}%
+     {\g@addto@macro{\FV@Tmp}{#1\FancyVerbBreakAfterBreak}%
+      \let\FV@Break@Next\FV@Break@Scan}%
+    \FV@Break@Next}%
+}
+\def\FV@Break@AfterTokenBreak@Group#1{%
+  \g@addto@macro{\FV@Tmp}{{#1}}%
+  \ifstrempty{#1}%
+   {\let\FV@Break@Next\FV@Break@AfterTokenBreak@Group@i}%
+   {\let\FV@Break@Next\FV@Break@Scan}%
+  \FV@Break@Next}
+\def\FV@Break@AfterTokenBreak@Group@i{%
+  \@ifnextchar\FV@TmpToken%
+   {\FV@Break@Scan}%
+   {\g@addto@macro{\FV@Tmp}{\FancyVerbBreakAfterBreak}%
+    \FV@Break@Scan}}
+\def\FV@makeLineNumber{%
+  \hss
+  \FancyVerbFormatBreakSymbolLeft{\FancyVerbBreakSymbolLeft}%
+  \hbox to \FV@BreakSymbolSepLeft{\hfill}%
+  \rlap{\hskip\linewidth
+    \hbox to \FV@BreakSymbolSepRight{\hfill}%
+    \FancyVerbFormatBreakSymbolRight{\FancyVerbBreakSymbolRight}%
+    \FV@SetLineBreakLast
+  }%
+}
+\def\FV@SaveLineBox#1{%
+  \savebox{\FV@LineBox}{%
+    \advance\linewidth by -\FV@BreakIndent
+    \hbox to \FV@BreakIndent{\hfill}%
+    \ifthenelse{\boolean{FV@BreakAutoIndent}}%
+     {\let\FV@LineIndentChars\@empty
+      \FV@GetLineIndent#1\FV@Undefined
+      \savebox{\FV@LineIndentBox}{\FV@LineIndentChars}%
+      \hbox to \wd\FV@LineIndentBox{\hfill}%
+      \advance\linewidth by -\wd\FV@LineIndentBox}%
+     {}%
+    \ifdefempty{\FancyVerbBreakSymbolLeft}{}%
+     {\hbox to \FV@BreakSymbolIndentLeft{\hfill}%
+      \advance\linewidth by -\FV@BreakSymbolIndentLeft}%
+    \ifdefempty{\FancyVerbBreakSymbolRight}{}%
+     {\advance\linewidth by -\FV@BreakSymbolIndentRight}%
+    \parbox[t]{\linewidth}{%
+      \raggedright
+      \leftlinenumbers*
+      \begin{internallinenumbers*}%
+      \let\makeLineNumber\FV@makeLineNumber
+      \noindent\hspace*{-\FV@BreakIndent}%
+      \ifdefempty{\FancyVerbBreakSymbolLeft}{}{%
+        \hspace*{-\FV@BreakSymbolIndentLeft}}%
+      \ifthenelse{\boolean{FV@BreakAutoIndent}}%
+       {\hspace*{-\wd\FV@LineIndentBox}}%
+       {}%
+      \strut#1\nobreak\strut
+      \end{internallinenumbers*}
+    }%
+    \ifdefempty{\FancyVerbBreakSymbolRight}{}%
+     {\hbox to \FV@BreakSymbolIndentRight{\hfill}}%
+  }%
+}
+\def\FancyVerbFormatText#1{#1}
+\def\FV@ListProcessLine@Break#1{%
+  \hbox to \hsize{%
+  \kern\leftmargin
+  \hbox to \linewidth{%
+  \ifx\FV@RightListFrame\relax\else
+    \advance\linewidth by -\FV@FrameSep
+    \advance\linewidth by -\FV@FrameRule
+  \fi
+  \ifx\FV@LeftListFrame\relax\else
+    \advance\linewidth by -\FV@FrameSep
+    \advance\linewidth by -\FV@FrameRule
+  \fi
+  \sbox{\FV@LineBox}{\FancyVerbFormatLine{\FancyVerbFormatText{#1}}}%
+  \ifdim\wd\FV@LineBox>\linewidth
+    \setcounter{FancyVerbLineBreakLast}{0}%
+    \FV@SaveLineBox{\FancyVerbFormatText{%
+      \FancyVerbBreakStart#1\FancyVerbBreakStop}}%
+    \ifdefempty{\FancyVerbBreakSymbolRight}{}{%
+      \let\FV@SetLineBreakLast\relax
+      \FV@SaveLineBox{\FancyVerbFormatText{%
+        \FancyVerbBreakStart#1\FancyVerbBreakStop}}}%
+    \FV@LeftListNumber
+    \FV@LeftListFrame
+    \FancyVerbFormatLine{\usebox{\FV@LineBox}}%
+    \FV@RightListFrame
+    \FV@RightListNumber
+  \else
+    \FV@LeftListNumber
+    \FV@LeftListFrame
+    \FancyVerbFormatLine{%
+      \parbox[t]{\linewidth}{\noindent\strut\FancyVerbFormatText{#1}\strut}}%
+    \FV@RightListFrame
+    \FV@RightListNumber
+  \fi}%
+  \hss}\baselineskip\z@\lineskip\z@}
+\ifcsname KV@FV@linenos\endcsname\else
+\define@booleankey{FV}{linenos}%
+  {\@nameuse{FV@Numbers@left}}{\@nameuse{FV@Numbers@none}}
+\fi
+\fi
+\newsavebox{\minted@bgbox}
+\newenvironment{minted@colorbg}[1]{
+    %\setlength{\fboxsep}{-\fboxrule}
+    \def\minted@bgcol{#1}
+    \noindent
+    \begin{lrbox}{\minted@bgbox}
+    \begin{minipage}{\linewidth-2\fboxsep}}
+ {\end{minipage}
+    \end{lrbox}%
+    \colorbox{\minted@bgcol}{\usebox{\minted@bgbox}}}
+\newwrite\minted@code
+\newcommand{\minted@savecode}[1]{
+  \immediate\openout\minted@code\minted@jobname.pyg\relax
+  \immediate\write\minted@code{\expandafter\detokenize\expandafter{#1}}%
+  \immediate\closeout\minted@code}
+\newcounter{minted@FancyVerbLineTemp}
+\newcommand{\minted@write@detok}[1]{%
+  \immediate\write\FV@OutFile{\detokenize{#1}}}
+\newcommand{\minted@FVB@VerbatimOut}[1]{%
+  \setcounter{minted@FancyVerbLineTemp}{\value{FancyVerbLine}}%
+  \@bsphack
+  \begingroup
+    \FV@UseKeyValues
+    \FV@DefineWhiteSpace
+    \def\FV@Space{\space}%
+    \FV@DefineTabOut
+    \let\FV@ProcessLine\minted@write@detok
+    \immediate\openout\FV@OutFile #1\relax
+    \let\FV@FontScanPrep\relax
+    \let\@noligs\relax
+    \FV@Scan}
+\newcommand{\minted@FVE@VerbatimOut}{%
+  \immediate\closeout\FV@OutFile\endgroup\@esphack
+  \setcounter{FancyVerbLine}{\value{minted@FancyVerbLineTemp}}}%
+\ifcsname MintedPygmentize\endcsname\else
+  \newcommand{\MintedPygmentize}{pygmentize}
+\fi
+\newcommand{\minted@pygmentize}[2][\minted@outputdir\minted@jobname.pyg]{%
+  \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}%
+    {\def\minted@codefile{\minted@outputdir\minted@jobname.pyg}}%
+    {\def\minted@codefile{#1}}%
+  \ifthenelse{\boolean{minted@isinline}}%
+    {\def\minted@optlistcl@inlines{%
+      \minted@optlistcl@g@i
+      \csname minted@optlistcl@lang\minted@lang @i\endcsname}}%
+    {\let\minted@optlistcl@inlines\@empty}%
+  \def\minted@cmd{%
+    \ifminted@kpsewhich\ifwindows powershell\space\fi\fi
+    \MintedPygmentize\space -l #2
+    -f latex -P commandprefix=PYG -F tokenmerge
+    \minted@optlistcl@g \csname minted@optlistcl@lang\minted@lang\endcsname
+    \minted@optlistcl@inlines
+    \minted@optlistcl@cmd -o "\minted@outputdir\minted@infile"
+    \ifminted@kpsewhich
+      \ifwindows
+        \detokenize{$}(kpsewhich "\minted@codefile")%
+      \else
+        \detokenize{`}kpsewhich "\minted@codefile"
+          \detokenize{||} "\minted@codefile"\detokenize{`}%
+      \fi
+    \else
+      "\minted@codefile"
+    \fi}%
+  % For debugging, uncomment: %%%%
+  % \immediate\typeout{\minted@cmd}%
+  % %%%%
+  \ifthenelse{\boolean{minted@cache}}%
+    {%
+      \ifx\XeTeXinterchartoks\minted@undefined
+        \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}%
+          {\edef\minted@hash{\pdf@filemdfivesum{#1}%
+            \pdf@mdfivesum{\minted@cmd autogobble}}}%
+          {\edef\minted@hash{\pdf@filemdfivesum{#1}%
+            \pdf@mdfivesum{\minted@cmd}}}%
+      \else
+        \immediate\openout\minted@code\minted@jobname.mintedcmd\relax
+        \immediate\write\minted@code{\minted@cmd}%
+        \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}%
+          {\immediate\write\minted@code{autogobble}}{}%
+        \immediate\closeout\minted@code
+        %Cheating a little here by using ASCII codes to write `{` and `}`
+        %in the Python code
+        \def\minted@hashcmd{%
+          \detokenize{python -c "import hashlib;
+            hasher = hashlib.sha1();
+            f = open(\"}\minted@outputdir\minted@jobname.mintedcmd\detokenize{\", \"rb\");
+            hasher.update(f.read());
+            f.close();
+            f = open(\"}#1\detokenize{\", \"rb\");
+            hasher.update(f.read());
+            f.close();
+            f = open(\"}\minted@outputdir\minted@jobname.mintedmd5\detokenize{\", \"w\");
+            macro = \"\\edef\\minted@hash\" + chr(123) + hasher.hexdigest() + chr(125) + \"\";
+            f.write(\"\\makeatletter\" + macro + \"\\makeatother\\endinput\n\");
+            f.close();"}}%
+        \immediate\write18{\minted@hashcmd}%
+        \minted@input{\minted@outputdir\minted@jobname.mintedmd5}%
+      \fi
+      \edef\minted@infile{\minted@cachedir/\minted@hash.pygtex}%
+      \IfFileExists{\minted@infile}{}{%
+        \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}{%
+          %Need a version of open() that supports encoding under Python 2
+          \edef\minted@autogobblecmd{%
+            \detokenize{python -c "import sys;
+            import textwrap;
+            from io import open;
+            f = open(\"}#1\detokenize{\", \"r\", encoding=\"}\minted@encoding\detokenize{\");
+            t = f.read();
+            f.close();
+            f = open(\"}\minted@outputdir\minted@jobname.pyg\detokenize{\", \"w\", encoding=\"}\minted@encoding\detokenize{\");
+            f.write(textwrap.dedent(t));
+            f.close();"}%
+          }%
+          \immediate\write18{\minted@autogobblecmd}}{}%
+        \immediate\write18{\minted@cmd}}%
+      \expandafter\minted@addcachefile\expandafter{\minted@hash.pygtex}%
+      \minted@inputpyg}%
+    {%
+      \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}{%
+        %Need a version of open() that supports encoding under Python 2
+        \edef\minted@autogobblecmd{%
+          \detokenize{python -c "import sys;
+          import textwrap;
+          from io import open;
+          f = open(\"}#1\detokenize{\", \"r\", encoding=\"}\minted@encoding\detokenize{\");
+          t = f.read();
+          f.close();
+          f = open(\"}\minted@outputdir\minted@jobname.pyg\detokenize{\", \"w\", encoding=\"}\minted@encoding\detokenize{\");
+          f.write(textwrap.dedent(t));
+          f.close();"}%
+        }%
+        \immediate\write18{\minted@autogobblecmd}}{}%
+      \immediate\write18{\minted@cmd}%
+      \minted@inputpyg}%
+}
+\def\FV@SpaceMMode{ }
+\def\minted@BreakAfterPrep@extension{%
+  \ifcsname FV@BreakAfter@Token\@backslashchar\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZbs}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\FV@underscorechar\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZus}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\@charlb\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZob}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\@charrb\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZcb}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\detokenize{^}\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZca}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\FV@ampchar\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZam}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\detokenize{<}\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZlt}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\detokenize{>}\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZgt}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\FV@hashchar\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZsh}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\@percentchar\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZpc}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\FV@dollarchar\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZdl}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\detokenize{-}\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZhy}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\detokenize{'}\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZsq}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\detokenize{"}\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZdq}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\FV@tildechar\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZti}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\detokenize{@}\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZat}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\detokenize{[}\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZlb}}{}%
+  \fi
+  \ifcsname FV@BreakAfter@Token\detokenize{]}\endcsname
+    \@namedef{FV@BreakAfter@Token\detokenize{\PYGZrb}}{}%
+  \fi
+}
+\newcommand{\minted@inputpyg}{%
+  \let\FV@BreakAfterPrep@orig\FV@BreakAfterPrep
+  \def\FV@BreakAfterPrep{%
+    \FV@BreakAfterPrep@orig\minted@BreakAfterPrep@extension}%
+  \everymath\expandafter{\the\everymath\let\FV@Space\FV@SpaceMMode}%
+  \ifthenelse{\equal{\minted@get@opt{breakbytokenanywhere}{false}}{true}}%
+    {\setkeys{minted@opt@cmd}{breakbytoken=true}}{}%
+  \ifthenelse{\boolean{FV@BreakAnywhere}}%
+    {\expandafter\let\expandafter\minted@orig@PYG@breakanywhere%
+       \csname PYG\minted@get@opt{style}{default}\endcsname
+     \expandafter\def\csname PYG\minted@get@opt{style}{default}\endcsname##1##2{%
+       \minted@orig@PYG@breakanywhere{##1}%
+         {\FancyVerbBreakStart##2\FancyVerbBreakStop}}}{}%
+  \ifx\FV@BreakAfter\@empty
+  \else
+    \expandafter\let\expandafter\minted@orig@PYG@breakafter%
+      \csname PYG\minted@get@opt{style}{default}\endcsname
+    \expandafter\def\csname PYG\minted@get@opt{style}{default}\endcsname##1##2{%
+      \minted@orig@PYG@breakafter{##1}%
+       {\FancyVerbBreakStart##2\FancyVerbBreakStop}}%
+  \fi
+  \ifthenelse{\boolean{minted@isinline}}%
+   {\ifthenelse{\equal{\minted@get@opt{breaklines}{false}}{true}}%
+    {\let\FV@BeginVBox\relax
+     \let\FV@EndVBox\relax
+     \def\FV@BProcessLine##1{\FancyVerbFormatLine{##1}}%
+     \ifthenelse{\equal{\minted@get@opt{breakbytoken}{false}}{true}}%
+      {\minted@inputpyg@breakbytoken
+       \minted@inputpyg@inline}%
+      {\minted@inputpyg@inline}}%
+    {\minted@inputpyg@inline}}%
+   {\ifthenelse{\equal{\minted@get@opt{breaklines}{false}}{true}}%
+     {\ifthenelse{\equal{\minted@get@opt{breakbytoken}{false}}{true}}%
+       {\minted@inputpyg@breakbytoken
+        \minted@inputpyg@block}%
+       {\minted@inputpyg@block}}%
+     {\minted@inputpyg@block}}%
+}
+\def\minted@inputpyg@breakbytoken{%
+  \expandafter\let\expandafter\minted@orig@PYG@breakbytoken%
+    \csname PYG\minted@get@opt{style}{default}\endcsname
+  \ifthenelse{\equal{\minted@get@opt{breakbytokenanywhere}{false}}{true}}%
+   {\let\minted@orig@allowbreak\allowbreak
+    \def\allowbreak{\let\allowbreak\minted@orig@allowbreak}%
+    \expandafter\def\csname PYG\minted@get@opt{style}{default}\endcsname##1##2{%
+      \allowbreak{}\leavevmode\hbox{\minted@orig@PYG@breakbytoken{##1}{##2}}}}%
+   {\expandafter\def\csname PYG\minted@get@opt{style}{default}\endcsname##1##2{%
+      \leavevmode\hbox{\minted@orig@PYG@breakbytoken{##1}{##2}}}}%
+}
+\def\minted@inputpyg@inline{%
+  \expandafter\let\expandafter\PYG%
+    \csname PYG\minted@get@opt{style}{default}\endcsname
+  \ifthenelse{\equal{\minted@get@opt{bgcolor}{}}{}}%
+   {\minted@input{\minted@outputdir\minted@infile}}%
+   {\colorbox{\minted@get@opt{bgcolor}{}}{%
+      \minted@input{\minted@outputdir\minted@infile}}}%
+}
+\def\minted@inputpyg@block{%
+  \expandafter\let\expandafter\PYG%
+    \csname PYG\minted@get@opt{style}{default}\endcsname
+  \ifthenelse{\equal{\minted@get@opt{bgcolor}{}}{}}%
+   {\minted@input{\minted@outputdir\minted@infile}}%
+   {\begin{minted@colorbg}{\minted@get@opt{bgcolor}{}}%
+    \minted@input{\minted@outputdir\minted@infile}%
+    \end{minted@colorbg}}}
+\newcommand{\minted@langlinenoson}{%
+  \ifcsname c@minted@lang\minted@lang\endcsname\else
+    \newcounter{minted@lang\minted@lang}%
+  \fi
+  \setcounter{minted@FancyVerbLineTemp}{\value{FancyVerbLine}}%
+  \setcounter{FancyVerbLine}{\value{minted@lang\minted@lang}}%
+}
+\newcommand{\minted@langlinenosoff}{%
+  \setcounter{minted@lang\minted@lang}{\value{FancyVerbLine}}%
+  \setcounter{FancyVerbLine}{\value{minted@FancyVerbLineTemp}}%
+}
+\ifthenelse{\boolean{minted@langlinenos}}{}{%
+  \let\minted@langlinenoson\relax
+  \let\minted@langlinenosoff\relax
+}
+\newcommand{\setminted}[2][]{%
+  \ifthenelse{\equal{#1}{}}%
+    {\setkeys{minted@opt@g}{#2}}%
+    {\minted@configlang{#1}%
+      \setkeys{minted@opt@lang}{#2}}}
+\newcommand{\setmintedinline}[2][]{%
+  \ifthenelse{\equal{#1}{}}%
+    {\setkeys{minted@opt@g@i}{#2}}%
+    {\minted@configlang{#1}%
+      \setkeys{minted@opt@lang@i}{#2}}}
+\setmintedinline[php]{startinline=true}
+\newcommand{\usemintedstyle}[2][]{\setminted[#1]{style=#2}}
+\begingroup
+\catcode`\ =\active
+\catcode`\^^I=\active
+\gdef\minted@defwhitespace@retok{\def {\noexpand\FV@Space}\def^^I{\noexpand\FV@Tab}}%
+\endgroup
+\newcommand{\minted@writecmdcode}[1]{%
+  \immediate\openout\minted@code\minted@jobname.pyg\relax
+  \immediate\write\minted@code{\detokenize{#1}}%
+  \immediate\closeout\minted@code}
+\newrobustcmd{\mintinline}[2][]{%
+  \begingroup
+  \setboolean{minted@isinline}{true}%
+  \minted@configlang{#2}%
+  \setkeys{minted@opt@cmd}{#1}%
+  \minted@fvset
+  \begingroup
+  \let\do\@makeother\dospecials
+  \catcode`\{=1
+  \catcode`\}=2
+  \catcode`\^^I=\active
+  \@ifnextchar\bgroup
+    {\minted@inline@iii}%
+    {\catcode`\{=12\catcode`\}=12
+      \minted@inline@i}}
+\def\minted@inline@i#1{%
+  \endgroup
+  \def\minted@inline@ii##1#1{%
+    \minted@inline@iii{##1}}%
+  \begingroup
+  \let\do\@makeother\dospecials
+  \catcode`\^^I=\active
+  \minted@inline@ii}
+\ifthenelse{\boolean{minted@draft}}%
+  {\newcommand{\minted@inline@iii}[1]{%
+    \endgroup
+    \begingroup
+    \minted@defwhitespace@retok
+    \everyeof{\noexpand}%
+    \endlinechar-1\relax
+    \let\do\@makeother\dospecials
+    \catcode`\ =\active
+    \catcode`\^^I=\active
+    \xdef\minted@tmp{\scantokens{#1}}%
+    \endgroup
+    \let\FV@Line\minted@tmp
+    \def\FV@SV@minted@tmp{%
+      \FV@Gobble
+      \expandafter\FV@ProcessLine\expandafter{\FV@Line}}%
+    \ifthenelse{\equal{\minted@get@opt{breaklines}{false}}{true}}%
+     {\let\FV@BeginVBox\relax
+      \let\FV@EndVBox\relax
+      \def\FV@BProcessLine##1{\FancyVerbFormatLine{##1}}%
+      \BUseVerbatim{minted@tmp}}%
+     {\BUseVerbatim{minted@tmp}}%
+    \endgroup}}%
+  {\newcommand{\minted@inline@iii}[1]{%
+    \endgroup
+    \minted@writecmdcode{#1}%
+    \RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}%
+    \setcounter{minted@FancyVerbLineTemp}{\value{FancyVerbLine}}%
+    \minted@pygmentize{\minted@lang}%
+    \setcounter{FancyVerbLine}{\value{minted@FancyVerbLineTemp}}%
+    \endgroup}}
+\newrobustcmd{\mint}[2][]{%
+  \begingroup
+  \minted@configlang{#2}%
+  \setkeys{minted@opt@cmd}{#1}%
+  \minted@fvset
+  \begingroup
+  \let\do\@makeother\dospecials
+  \catcode`\{=1
+  \catcode`\}=2
+  \catcode`\^^I=\active
+  \@ifnextchar\bgroup
+    {\mint@iii}%
+    {\catcode`\{=12\catcode`\}=12
+      \mint@i}}
+\def\mint@i#1{%
+  \endgroup
+  \def\mint@ii##1#1{%
+    \mint@iii{##1}}%
+  \begingroup
+  \let\do\@makeother\dospecials
+  \catcode`\^^I=\active
+  \mint@ii}
+\ifthenelse{\boolean{minted@draft}}%
+  {\newcommand{\mint@iii}[1]{%
+    \endgroup
+    \begingroup
+    \minted@defwhitespace@retok
+    \everyeof{\noexpand}%
+    \endlinechar-1\relax
+    \let\do\@makeother\dospecials
+    \catcode`\ =\active
+    \catcode`\^^I=\active
+    \xdef\minted@tmp{\scantokens{#1}}%
+    \endgroup
+    \let\FV@Line\minted@tmp
+    \def\FV@SV@minted@tmp{%
+      \FV@CodeLineNo=1\FV@StepLineNo
+      \FV@Gobble
+      \expandafter\FV@ProcessLine\expandafter{\FV@Line}}%
+    \minted@langlinenoson
+    \UseVerbatim{minted@tmp}%
+    \minted@langlinenosoff
+    \endgroup}}%
+  {\newcommand{\mint@iii}[1]{%
+    \endgroup
+    \minted@writecmdcode{#1}%
+    \minted@langlinenoson
+    \minted@pygmentize{\minted@lang}%
+    \minted@langlinenosoff
+    \endgroup}}
+\ifthenelse{\boolean{minted@draft}}%
+  {\newenvironment{minted}[2][]
+    {\VerbatimEnvironment
+      \minted@configlang{#2}%
+      \setkeys{minted@opt@cmd}{#1}%
+      \minted@fvset
+      \minted@langlinenoson
+      \begin{Verbatim}}%
+    {\end{Verbatim}%
+      \minted@langlinenosoff}}%
+  {\newenvironment{minted}[2][]
+    {\VerbatimEnvironment
+      \let\FVB@VerbatimOut\minted@FVB@VerbatimOut
+      \let\FVE@VerbatimOut\minted@FVE@VerbatimOut
+      \minted@configlang{#2}%
+      \setkeys{minted@opt@cmd}{#1}%
+      \minted@fvset
+      \begin{VerbatimOut}[codes={\catcode`\^^I=12}]{\minted@jobname.pyg}}%
+    {\end{VerbatimOut}%
+        \minted@langlinenoson
+        \minted@pygmentize{\minted@lang}%
+        \minted@langlinenosoff}}
+\ifthenelse{\boolean{minted@draft}}%
+  {\newcommand{\inputminted}[3][]{%
+    \begingroup
+    \minted@configlang{#2}%
+    \setkeys{minted@opt@cmd}{#1}%
+    \minted@fvset
+    \VerbatimInput{#3}%
+    \endgroup}}%
+  {\newcommand{\inputminted}[3][]{%
+    \begingroup
+    \minted@configlang{#2}%
+    \setkeys{minted@opt@cmd}{#1}%
+    \minted@fvset
+    \minted@pygmentize[#3]{#2}%
+    \endgroup}}
+\newcommand{\newminted}[3][]{
+  \ifthenelse{\equal{#1}{}}
+    {\def\minted@envname{#2code}}
+    {\def\minted@envname{#1}}
+  \newenvironment{\minted@envname}
+    {\VerbatimEnvironment
+      \begin{minted}[#3]{#2}}
+    {\end{minted}}
+  \newenvironment{\minted@envname *}[1]
+    {\VerbatimEnvironment\begin{minted}[#3,##1]{#2}}
+    {\end{minted}}}
+\newcommand{\newmint}[3][]{
+  \ifthenelse{\equal{#1}{}}
+    {\def\minted@shortname{#2}}
+    {\def\minted@shortname{#1}}
+  \expandafter\newcommand\csname\minted@shortname\endcsname[2][]{
+    \mint[#3,##1]{#2}##2}}
+\newcommand{\newmintedfile}[3][]{
+  \ifthenelse{\equal{#1}{}}
+    {\def\minted@shortname{#2file}}
+    {\def\minted@shortname{#1}}
+  \expandafter\newcommand\csname\minted@shortname\endcsname[2][]{
+    \inputminted[#3,##1]{#2}{##2}}}
+\newcommand{\newmintinline}[3][]{%
+  \ifthenelse{\equal{#1}{}}%
+    {\def\minted@shortname{#2inline}}%
+    {\def\minted@shortname{#1}}%
+    \expandafter\newrobustcmd\csname\minted@shortname\endcsname{%
+      \begingroup
+      \let\do\@makeother\dospecials
+      \catcode`\{=1
+      \catcode`\}=2
+      \@ifnextchar[{\endgroup\minted@inliner[#3][#2]}%
+        {\endgroup\minted@inliner[#3][#2][]}}%
+    \def\minted@inliner[##1][##2][##3]{\mintinline[##1,##3]{##2}}%
+}
+\ifthenelse{\boolean{minted@newfloat}}%
+ {\@ifundefined{minted@float@within}%
+    {\DeclareFloatingEnvironment[fileext=lol,placement=h]{listing}}%
+    {\def\minted@tmp#1{%
+       \DeclareFloatingEnvironment[fileext=lol,placement=h, within=#1]{listing}}%
+     \expandafter\minted@tmp\expandafter{\minted@float@within}}}%
+ {\@ifundefined{minted@float@within}%
+    {\newfloat{listing}{h}{lol}}%
+    {\newfloat{listing}{h}{lol}[\minted@float@within]}}
+\ifminted@newfloat\else
+\newcommand{\listingscaption}{Listing}
+\floatname{listing}{\listingscaption}
+\newcommand{\listoflistingscaption}{List of Listings}
+\providecommand{\listoflistings}{\listof{listing}{\listoflistingscaption}}
+\fi
+\AtEndOfPackage{%
+  \ifthenelse{\boolean{minted@draft}}{}{%
+    \ifnum\pdf@shellescape=1\relax\else
+      \PackageError{minted}%
+       {You must invoke LaTeX with the
+        -shell-escape flag}%
+       {Pass the -shell-escape flag to LaTeX. Refer to the minted.sty
+        documentation for more information.}%
+    \fi
+    \setminted{style=default}%
+  }%
+}
+\AtEndPreamble{%
+  \ifthenelse{\boolean{minted@draft}}{}{%
+    \TestAppExists{pygmentize}%
+    \ifAppExists\else
+      \PackageError{minted}%
+       {You must have `pygmentize' installed
+        to use this package}%
+       {Refer to the installation instructions in the minted
+        documentation for more information.}%
+    \fi
+  }%
+}
+\AtEndDocument{
+  \ifx\XeTeXinterchartoks\minted@undefined
+  \else
+    \DeleteFile[\minted@outputdir]{\minted@jobname.mintedcmd}%
+    \DeleteFile[\minted@outputdir]{\minted@jobname.mintedmd5}%
+  \fi
+  \DeleteFile[\minted@outputdir]{\minted@jobname.pyg}%
+  \DeleteFile[\minted@outputdir]{\minted@jobname.out.pyg}%
+}
+\endinput
+%%
+%% End of file `minted.sty'.
diff --git a/doc/book/minted1.sty b/doc/book/minted1.sty
new file mode 100644
index 0000000000000000000000000000000000000000..a8aaf50ad98a0244a0945c6c712100fba8439dd3
--- /dev/null
+++ b/doc/book/minted1.sty
@@ -0,0 +1,261 @@
+%%
+%% This is file `minted1.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% minted.dtx  (with options: `packageone')
+%% Copyright 2013--2015 Geoffrey M. Poore
+%% Copyright 2010--2011 Konrad Rudolph
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%% 
+%% Additionally, the project may be distributed under the terms of the new BSD
+%% license.
+%% 
+%% This work has the LPPL maintenance status `maintained'.
+%% 
+%% The Current Maintainer of this work is Geoffrey Poore.
+%% 
+%% This work consists of the files minted.dtx and minted.ins
+%% and the derived file minted.sty.
+\NeedsTeXFormat{LaTeX2e}
+%%%% Begin minted1 modification
+%%\ProvidesPackage{minted}[2011/09/17 v1.7 Yet another Pygments shim for LaTeX]
+\ProvidesPackage{minted1}[2015/01/31 v1.0 minted 1.7 compatibility package]
+%%%% End minted1 modification
+\RequirePackage{keyval}
+\RequirePackage{fancyvrb}
+\RequirePackage{xcolor}
+\RequirePackage{float}
+\RequirePackage{ifthen}
+%%%% Begin minted1 modification
+\newboolean{mintedone@mintedloaded}
+\@ifpackageloaded{minted}%
+ {\setboolean{mintedone@mintedloaded}{true}%
+  \PackageError{minted1}{The package "minted1" may not be loaded after
+      ^^J"minted" has already been loaded--load "minted1" only for "minted"
+      ^^Jversion 1.7 compatibility}%
+   {Load "minted1" only when "minted" version 1.7 compatibility is required}}%
+ {}
+\ifmintedone@mintedloaded\else
+\@namedef{ver@minted.sty}{2011/09/17 v1.7 Yet another Pygments shim for LaTeX}
+\expandafter\let\expandafter\minted@tmp\csname opt@minted1.sty\endcsname
+\expandafter\let\csname opt@minted.sty\endcsname\minted@tmp
+\let\minted@tmp\relax
+%%%% End minted1 modification
+\RequirePackage{calc}
+\RequirePackage{ifplatform}
+\DeclareOption{chapter}{\def\minted@float@within{chapter}}
+\DeclareOption{section}{\def\minted@float@within{section}}
+\ProcessOptions\relax
+\ifwindows
+  \providecommand\DeleteFile[1]{\immediate\write18{del #1}}
+\else
+  \providecommand\DeleteFile[1]{\immediate\write18{rm #1}}
+\fi
+\newboolean{AppExists}
+\newcommand\TestAppExists[1]{
+  \ifwindows
+    \DeleteFile{\jobname.aex}
+    \immediate\write18{for \string^\@percentchar i in (#1.exe #1.bat #1.cmd)
+      do set >\jobname.aex <nul: /p x=\string^\@percentchar \string~$PATH:i>>\jobname.aex} %$
+    \newread\@appexistsfile
+    \immediate\openin\@appexistsfile\jobname.aex
+    \expandafter\def\expandafter\@tmp@cr\expandafter{\the\endlinechar}
+    \endlinechar=-1\relax
+    \readline\@appexistsfile to \@apppathifexists
+    \endlinechar=\@tmp@cr
+    \ifthenelse{\equal{\@apppathifexists}{}}
+     {\AppExistsfalse}
+     {\AppExiststrue}
+    \immediate\closein\@appexistsfile
+    \DeleteFile{\jobname.aex}
+\immediate\typeout{file deleted}
+  \else
+    \immediate\write18{which #1 && touch \jobname.aex}
+    \IfFileExists{\jobname.aex}
+     {\AppExiststrue
+      \DeleteFile{\jobname.aex}}
+     {\AppExistsfalse}
+  \fi}
+\newcommand\minted@resetoptions{}
+\newcommand\minted@defopt[1]{
+  \expandafter\def\expandafter\minted@resetoptions\expandafter{%
+    \minted@resetoptions
+    \@namedef{minted@opt@#1}{}}}
+\newcommand\minted@opt[1]{
+  \expandafter\detokenize%
+    \expandafter\expandafter\expandafter{\csname minted@opt@#1\endcsname}}
+\newcommand\minted@define@opt[3][]{
+  \minted@defopt{#2}
+  \ifthenelse{\equal{#1}{}}{
+    \define@key{minted@opt}{#2}{\@namedef{minted@opt@#2}{#3}}}
+   {\define@key{minted@opt}{#2}[#1]{\@namedef{minted@opt@#2}{#3}}}}
+\newcommand\minted@define@switch[3][]{
+  \minted@defopt{#2}
+  \define@booleankey{minted@opt}{#2}
+   {\@namedef{minted@opt@#2}{#3}}
+   {\@namedef{minted@opt@#2}{#1}}}
+\minted@defopt{extra}
+\newcommand\minted@define@extra[1]{
+  \define@key{minted@opt}{#1}{
+    \expandafter\def\expandafter\minted@opt@extra\expandafter{%
+      \minted@opt@extra,#1=##1}}}
+\newcommand\minted@define@extra@switch[1]{
+  \define@booleankey{minted@opt}{#1}
+   {\expandafter\def\expandafter\minted@opt@extra\expandafter{%
+      \minted@opt@extra,#1}}
+   {\expandafter\def\expandafter\minted@opt@extra\expandafter{%
+      \minted@opt@extra,#1=false}}}
+\minted@define@switch{texcl}{-P texcomments}
+\minted@define@switch{mathescape}{-P mathescape}
+\minted@define@switch{linenos}{-P linenos}
+\minted@define@switch{startinline}{-P startinline}
+\minted@define@switch[-P funcnamehighlighting=False]%
+  {funcnamehighlighting}{-P funcnamehighlighting}
+\minted@define@opt{gobble}{-F gobble:n=#1}
+\minted@define@opt{bgcolor}{#1}
+\minted@define@extra{frame}
+\minted@define@extra{framesep}
+\minted@define@extra{framerule}
+\minted@define@extra{rulecolor}
+\minted@define@extra{numbersep}
+\minted@define@extra{firstnumber}
+\minted@define@extra{stepnumber}
+\minted@define@extra{firstline}
+\minted@define@extra{lastline}
+\minted@define@extra{baselinestretch}
+\minted@define@extra{xleftmargin}
+\minted@define@extra{xrightmargin}
+\minted@define@extra{fillcolor}
+\minted@define@extra{tabsize}
+\minted@define@extra{fontfamily}
+\minted@define@extra{fontsize}
+\minted@define@extra{fontshape}
+\minted@define@extra{fontseries}
+\minted@define@extra{formatcom}
+\minted@define@extra{label}
+\minted@define@extra@switch{numberblanklines}
+\minted@define@extra@switch{showspaces}
+\minted@define@extra@switch{resetmargins}
+\minted@define@extra@switch{samepage}
+\minted@define@extra@switch{showtabs}
+\minted@define@extra@switch{obeytabs}
+\newsavebox{\minted@bgbox}
+\newenvironment{minted@colorbg}[1]{
+  \def\minted@bgcol{#1}
+  \noindent
+  \begin{lrbox}{\minted@bgbox}
+  \begin{minipage}{\linewidth-2\fboxsep}}
+ {\end{minipage}
+  \end{lrbox}%
+  \colorbox{\minted@bgcol}{\usebox{\minted@bgbox}}}
+\newwrite\minted@code
+\newcommand\minted@savecode[1]{
+  \immediate\openout\minted@code\jobname.pyg
+  \immediate\write\minted@code{#1}
+  \immediate\closeout\minted@code}
+\newcommand\minted@pygmentize[2][\jobname.pyg]{
+  \def\minted@cmd{pygmentize -l #2 -f latex -F tokenmerge
+    \minted@opt{gobble} \minted@opt{texcl} \minted@opt{mathescape}
+    \minted@opt{startinline} \minted@opt{funcnamehighlighting}
+    \minted@opt{linenos} -P "verboptions=\minted@opt{extra}"
+    -o \jobname.out.pyg #1}
+  \immediate\write18{\minted@cmd}
+  % For debugging, uncomment:
+  %\immediate\typeout{\minted@cmd}
+  \ifthenelse{\equal{\minted@opt@bgcolor}{}}
+   {}
+   {\begin{minted@colorbg}{\minted@opt@bgcolor}}
+  \input{\jobname.out.pyg}
+  \ifthenelse{\equal{\minted@opt@bgcolor}{}}
+   {}
+   {\end{minted@colorbg}}
+  \DeleteFile{\jobname.out.pyg}}
+\newcommand\minted@usedefaultstyle{\usemintedstyle{default}}
+\newcommand\usemintedstyle[1]{
+  \renewcommand\minted@usedefaultstyle{}
+  \immediate\write18{pygmentize -S #1 -f latex > \jobname.pyg}
+  \input{\jobname.pyg}}
+\newcommand\mint[3][]{
+  \DefineShortVerb{#3}
+  \minted@resetoptions
+  \setkeys{minted@opt}{#1}
+  \SaveVerb[aftersave={
+    \UndefineShortVerb{#3}
+    \minted@savecode{\FV@SV@minted@verb}
+    \minted@pygmentize{#2}
+    \DeleteFile{\jobname.pyg}}]{minted@verb}#3}
+\newcommand\minted@proglang[1]{}
+\newenvironment{minted}[2][]
+ {\VerbatimEnvironment
+  \renewcommand{\minted@proglang}[1]{#2}
+  \minted@resetoptions
+  \setkeys{minted@opt}{#1}
+  \begin{VerbatimOut}[codes={\catcode`\^^I=12}]{\jobname.pyg}}%
+ {\end{VerbatimOut}
+  \minted@pygmentize{\minted@proglang{}}
+  \DeleteFile{\jobname.pyg}}
+\newcommand\inputminted[3][]{
+  \minted@resetoptions
+  \setkeys{minted@opt}{#1}
+  \minted@pygmentize[#3]{#2}}
+\newcommand\newminted[3][]{
+  \ifthenelse{\equal{#1}{}}
+   {\def\minted@envname{#2code}}
+   {\def\minted@envname{#1}}
+  \newenvironment{\minted@envname}
+   {\VerbatimEnvironment\begin{minted}[#3]{#2}}
+   {\end{minted}}
+  \newenvironment{\minted@envname *}[1]
+   {\VerbatimEnvironment\begin{minted}[#3,##1]{#2}}
+   {\end{minted}}}
+\newcommand\newmint[3][]{
+  \ifthenelse{\equal{#1}{}}
+   {\def\minted@shortname{#2}}
+   {\def\minted@shortname{#1}}
+  \expandafter\newcommand\csname\minted@shortname\endcsname[2][]{
+    \mint[#3,##1]{#2}##2}}
+\newcommand\newmintedfile[3][]{
+  \ifthenelse{\equal{#1}{}}
+   {\def\minted@shortname{#2file}}
+   {\def\minted@shortname{#1}}
+  \expandafter\newcommand\csname\minted@shortname\endcsname[2][]{
+    \inputminted[#3,##1]{#2}{##2}}}
+\@ifundefined{minted@float@within}
+ {\newfloat{listing}{h}{lol}}
+ {\newfloat{listing}{h}{lol}[\minted@float@within]}
+\newcommand\listingscaption{Listing}
+\floatname{listing}{\listingscaption}
+\newcommand\listoflistingscaption{List of listings}
+\providecommand\listoflistings{\listof{listing}{\listoflistingscaption}}
+\AtBeginDocument{
+  \minted@usedefaultstyle}
+\AtEndOfPackage{
+  \ifnum\pdf@shellescape=1\relax\else
+    \PackageError{minted}
+     {You must invoke LaTeX with the
+      -shell-escape flag}
+     {Pass the -shell-escape flag to LaTeX. Refer to the minted.sty
+      documentation for more information.}\fi
+  \TestAppExists{pygmentize}
+  \ifAppExists\else
+    \PackageError{minted}
+     {You must have `pygmentize' installed
+      to use this package}
+     {Refer to the installation instructions in the minted
+      documentation for more information.}
+  \fi}
+%%%% Begin minted1 modification
+\fi
+%%%% End minted1 modification
+\endinput
+%%
+%% End of file `minted1.sty'.
diff --git a/doc/book/papers.tex b/doc/book/papers.tex
new file mode 100644
index 0000000000000000000000000000000000000000..6780c415224b7f90e0a74bf5c60b5f46220cf150
--- /dev/null
+++ b/doc/book/papers.tex
@@ -0,0 +1,29 @@
+\def\PraetoriusA{% Praetorius2011
+{\sc S.~Praetorius and A.~Voigt}, {\em {A Phase Field Crystal Approach for
+  Particles in a Flowing Solvent}}, Macromolecular Theory and Simulations, 20 (2011),
+  pp.~541--547.}
+  
+\def\PraetoriusB{% Praetorius2013
+{\sc S.~Praetorius, A.~Voigt, R.~Wittkowski, and H.~L\"owen}, {\em Structure
+  and dynamics of interfaces between two coexisting liquid-crystalline phases},
+  Physical Review E, 87 (2013), p.~052406.}
+  
+\def\PraetoriusC{% Praetorius2014
+{\sc S.~Praetorius and A.~Voigt}, {\em Development and
+  Analysis of a Block-Preconditioner for the Phase-Field Crystal Equation},
+  SIAM Journal on Scientific Computing, 37 (2015), pp.~B425--B451.}
+  
+\def\PraetoriusD{% Praetorius2015
+{\sc S.~Praetorius and A.~Voigt}, {\em A Navier-Stokes
+  phase-field crystal model for colloidal suspensions}, The Journal of chemical physics, 142
+  (2015).}
+  
+\def\TangA{% Tang2015
+{\sc S.~Tang, S.~Praetorius, R.~Backofen, A.~Voigt, Y.-M. Yu, and J.~Wang},
+  {\em Two-dimensional liquid crystalline growth within a phase-field-crystal
+  model}, Phys. Rev. E, 92 (2015), p.~012504.}
+  
+\def\BackofenA{% Backofen2011
+{\sc R.~Backofen, M.~Gr{\"a}f, D.~Potts, S.~Praetorius, A.~Voigt, and
+  T.~Witkowski}, {\em A continuous approach to discrete ordering on
+  $\mathbb{S}^2$}, Multiscale Modeling \& Simulation, 9 (2011), pp.~314--334.}
diff --git a/doc/book/preface.tex b/doc/book/preface.tex
new file mode 100644
index 0000000000000000000000000000000000000000..3b5f5ae7606cdd4f200d1ece4009ae97d5e02d63
--- /dev/null
+++ b/doc/book/preface.tex
@@ -0,0 +1 @@
+\chapter*{Preface}
diff --git a/doc/book/publishing.tex b/doc/book/publishing.tex
new file mode 100644
index 0000000000000000000000000000000000000000..e86a4b32af79fc840b0e23ee57b339fa7f7dd045
--- /dev/null
+++ b/doc/book/publishing.tex
@@ -0,0 +1,16 @@
+% You'll get these from the LOT office
+\isbn{000-11-22222-33-4}  
+\NUR{000}  
+
+% A description or credit for the cover illustration
+\imagecredit{Cover illustration: The Tower of Babel, by Pieter Bruegel}
+
+% If the current year is not the correct copyright year, override it here
+\copyrightyear{2016}
+
+% The copyright claim is automatically generated, but you can override it:
+\copyrightclaim{Copyright \copyright\ 2016 by Anonymous. All rights reserved.}
+
+% You can add a note in the space just above the publisher details (p. ii)
+%\abovepublisher{The research reported here was supported by a generous 
+%  grant from my grandparents etc. etc. etc.}
diff --git a/doc/book/siam.bst b/doc/book/siam.bst
new file mode 100644
index 0000000000000000000000000000000000000000..7710f125b497de31aaf0244142f32ef9cc9e8c4e
--- /dev/null
+++ b/doc/book/siam.bst
@@ -0,0 +1,1040 @@
+
+% ====================== SIAM.BST ================================ % 
+% SIAM bibliography style (24-Jan-88 version)
+%    numeric labels, alphabetic order, Mathematical Reviews abbreviations,
+%    names in \sc, titles in italics, book titles mixed upper-lower and
+%article
+%    titles lowercase, commas separate all fields except before "notes".
+%
+%   History
+%    1/30/86    (HWT)    Original version, by Howard Trickey.
+%    6/15/87    (HWT)    Fix format.editors---Martin Costabel.
+%    1/24/88    (OP&HWT) Updated for BibTeX version 0.99a, Oren Patashnik;
+%            THIS `siam' VERSION DOES NOT WORK WITH BIBTEX 0.98i.
+
+ENTRY
+  { address
+    author
+    booktitle
+    chapter
+    edition
+    editor
+    howpublished
+    institution
+    journal
+    key
+    month
+    note
+    number
+    organization
+    pages
+    publisher
+    school
+    series
+    title
+    type
+    volume
+    year
+  }
+  {}
+  { label }
+
+INTEGERS { output.state before.all mid.sentence after.block }
+
+FUNCTION {init.state.consts}
+{ #0 'before.all :=
+  #1 'mid.sentence :=
+  #2 'after.block :=
+}
+
+STRINGS { s t }
+
+FUNCTION {output.nonnull}
+{ 's :=
+  output.state mid.sentence =
+    { ", " * write$ }
+    { output.state after.block =
+    { add.period$ write$
+      newline$
+      "\newblock " write$
+    }
+    'write$
+      if$
+      mid.sentence 'output.state :=
+    }
+  if$
+  s
+}
+
+FUNCTION {output}
+{ duplicate$ empty$
+    'pop$
+    'output.nonnull
+  if$
+}
+
+FUNCTION {output.check}
+{ 't :=
+  duplicate$ empty$
+    { pop$ "empty " t * " in " * cite$ * warning$ }
+    'output.nonnull
+  if$
+}
+
+FUNCTION {output.bibitem}
+{ newline$
+  "\bibitem{" write$
+  cite$ write$
+  "}" write$
+  newline$
+  ""
+  before.all 'output.state :=
+}
+
+FUNCTION {fin.entry}
+{ add.period$
+  write$
+  newline$
+}
+
+FUNCTION {new.block}
+{ output.state before.all =
+    'skip$
+    { after.block 'output.state := }
+  if$
+}
+
+FUNCTION {not}
+{   { #0 }
+    { #1 }
+  if$
+}
+
+FUNCTION {and}
+{   'skip$
+    { pop$ #0 }
+  if$
+}
+
+FUNCTION {or}
+{   { pop$ #1 }
+    'skip$
+  if$
+}
+
+FUNCTION {new.block.checka}
+{ empty$
+    'skip$
+    'new.block
+  if$
+}
+
+FUNCTION {field.or.null}
+{ duplicate$ empty$
+    { pop$ "" }
+    'skip$
+  if$
+}
+
+FUNCTION {emphasize}
+{ duplicate$ empty$
+    { pop$ "" }
+    { "{\em " swap$ * "}" * }
+  if$
+}
+
+FUNCTION {scapify}
+{ duplicate$ empty$
+    { pop$ "" }
+    { "{\sc " swap$ * "}" * }
+  if$
+}
+
+INTEGERS { nameptr namesleft numnames }
+
+FUNCTION {format.names}
+{ 's :=
+  #1 'nameptr :=
+  s num.names$ 'numnames :=
+  numnames 'namesleft :=
+    { namesleft #0 > }
+%    { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
+    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
+      nameptr #1 >
+    { namesleft #1 >
+        { ", " * t * }
+        { numnames #2 >
+        { "," * }
+        'skip$
+          if$
+          t "others" =
+        { " et~al." * }
+        { " and " * t * }
+          if$
+        }
+      if$
+    }
+    't
+      if$
+      nameptr #1 + 'nameptr :=
+      namesleft #1 - 'namesleft :=
+    }
+  while$
+}
+
+STRINGS { last.authors }
+
+FUNCTION {init.last.authors}
+{ "" 'last.authors :=
+}
+
+FUNCTION {format.authors}
+{ author empty$
+    { "" 'last.authors :=
+      ""
+    }
+    { author last.authors =
+        { "\leavevmode\vrule height 2pt depth -1.6pt width 23pt" }
+        { author format.names scapify }
+      if$
+      author 'last.authors :=
+    }
+  if$
+}
+
+FUNCTION {format.organization}
+{ organization empty$
+    { "" 'last.authors :=
+      ""
+    }
+    { organization last.authors =
+        { "\leavevmode\vrule height 2pt depth -1.6pt width 23pt" }
+        { organization scapify }
+      if$
+      organization 'last.authors :=
+    }
+  if$
+}
+
+FUNCTION {format.editors}
+{ editor empty$
+    { "" 'last.authors :=
+      ""
+    }
+    { editor last.authors =
+        { "\leavevmode\vrule height 2pt depth -1.6pt width 23pt" }
+    { editor format.names scapify }
+      if$
+      editor num.names$ #1 >
+        { ", eds." * }
+    { ", ed." * }
+      if$
+      editor 'last.authors :=
+    }
+  if$
+}
+
+FUNCTION {format.ineditors}
+{ editor empty$
+    { "" }
+    { editor format.names
+      editor num.names$ #1 >
+    { ", eds." * }
+    { ", ed." * }
+      if$
+    }
+  if$
+}
+
+FUNCTION {format.title}
+{ title empty$
+    { "" }
+    { title "t" change.case$ emphasize }
+  if$
+}
+
+FUNCTION {n.dashify}
+{ 't :=
+  ""
+    { t empty$ not }
+    { t #1 #1 substring$ "-" =
+    { t #1 #2 substring$ "--" = not
+        { "--" *
+          t #2 global.max$ substring$ 't :=
+        }
+        {   { t #1 #1 substring$ "-" = }
+        { "-" *
+          t #2 global.max$ substring$ 't :=
+        }
+          while$
+        }
+      if$
+    }
+    { t #1 #1 substring$ *
+      t #2 global.max$ substring$ 't :=
+    }
+      if$
+    }
+  while$
+}
+
+FUNCTION {format.date}
+{ year empty$
+    { month empty$
+    { "" }
+    { "there's a month but no year in " cite$ * warning$
+      month
+    }
+      if$
+    }
+    { month empty$
+    'year
+    { month " " * year * }
+      if$
+    }
+  if$
+}
+
+FUNCTION {format.btitle}
+{ title emphasize
+}
+
+FUNCTION {tie.or.space.connect}
+{ duplicate$ text.length$ #3 <
+    { "~" }
+    { " " }
+  if$
+  swap$ * *
+}
+
+FUNCTION {either.or.check}
+{ empty$
+    'pop$
+    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
+  if$
+}
+
+FUNCTION {format.bvolume}
+{ volume empty$
+    { "" }
+    { "vol.~" volume *
+      series empty$
+    'skip$
+    { " of " * series * }
+      if$
+      "volume and number" number either.or.check
+    }
+  if$
+}
+
+FUNCTION {format.number.series}
+{ volume empty$
+    { number empty$
+    { series field.or.null }
+    { "no.~" number *
+      series empty$
+        { "there's a number but no series in " cite$ * warning$ }
+        { " in " * series * }
+      if$
+    }
+      if$
+    }
+    { "" }
+  if$
+}
+
+FUNCTION {format.edition}
+{ edition empty$
+    { "" }
+    { edition "l" change.case$ "~ed." * }
+  if$
+}
+
+INTEGERS { multiresult }
+
+FUNCTION {multi.page.check}
+{ 't :=
+  #0 'multiresult :=
+    { multiresult not
+      t empty$ not
+      and
+    }
+    { t #1 #1 substring$
+      duplicate$ "-" =
+      swap$ duplicate$ "," =
+      swap$ "+" =
+      or or
+    { #1 'multiresult := }
+    { t #2 global.max$ substring$ 't := }
+      if$
+    }
+  while$
+  multiresult
+}
+
+FUNCTION {format.pages}
+{ pages empty$
+    { "" }
+    { pages multi.page.check
+    { "pp.~" pages n.dashify * }
+    { "p.~" pages * }
+      if$
+    }
+  if$
+}
+
+FUNCTION {format.vol.year}
+{ volume field.or.null
+  year empty$
+    { "empty year in " cite$ * warning$ }
+    { " (" year * ")" * * }
+  if$
+}
+
+FUNCTION {format.chapter.pages}
+{ chapter empty$
+    'format.pages
+    { type empty$
+    { "ch.~" chapter * }
+    { type "l" change.case$ chapter tie.or.space.connect }
+      if$
+      pages empty$
+    'skip$
+    { ", " * format.pages * }
+      if$
+    }
+  if$
+}
+
+FUNCTION {format.in.ed.booktitle}
+{ booktitle empty$
+    { "" }
+    { editor empty$
+    { "in " booktitle * }
+    { "in " booktitle * ", " * format.ineditors * }
+      if$
+    }
+  if$
+}
+
+FUNCTION {empty.misc.check}
+{ author empty$ title empty$ howpublished empty$
+  month empty$ year empty$ note empty$
+  and and and and and
+  key empty$ not and
+    { "all relevant fields are empty in " cite$ * warning$ }
+    'skip$
+  if$
+}
+
+FUNCTION {format.thesis.type}
+{ type empty$
+    'skip$
+    { pop$
+      type "l" change.case$
+    }
+  if$
+}
+
+FUNCTION {format.tr.number}
+{ type empty$
+    { "Tech. Report" }
+    'type
+  if$
+  number empty$
+    { "l" change.case$ }
+    { number tie.or.space.connect }
+  if$
+}
+
+FUNCTION {format.article.crossref}
+{ key empty$
+    { journal empty$
+    { "need key or journal for " cite$ * " to crossref " * crossref *
+      warning$
+      ""
+    }
+    { "in " journal * }
+      if$
+    }
+    { "in " key * }
+  if$
+  " \cite{" * crossref * "}" *
+}
+
+FUNCTION {format.crossref.editor}
+{ editor #1 "{vv~}{ll}" format.name$
+  editor num.names$ duplicate$
+  #2 >
+    { pop$ " et~al." * }
+    { #2 <
+    'skip$
+    { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
+        { " et~al." * }
+        { " and " * editor #2 "{vv~}{ll}" format.name$ * }
+      if$
+    }
+      if$
+    }
+  if$
+}
+
+FUNCTION {format.book.crossref}
+{ volume empty$
+    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
+      "in "
+    }
+    { "vol.~" volume *
+      " of " *
+    }
+  if$
+  editor empty$
+  editor field.or.null author field.or.null =
+  or
+    { key empty$
+    { series empty$
+        { "need editor, key, or series for " cite$ * " to crossref " *
+          crossref * warning$
+          "" *
+        }
+        { series * }
+      if$
+    }
+    { key * }
+      if$
+    }
+    { format.crossref.editor * }
+  if$
+  " \cite{" * crossref * "}" *
+}
+
+FUNCTION {format.incoll.inproc.crossref}
+{ editor empty$
+  editor field.or.null author field.or.null =
+  or
+    { key empty$
+    { booktitle empty$
+        { "need editor, key, or booktitle for " cite$ * " to crossref " *
+          crossref * warning$
+          ""
+        }
+        { "in " booktitle * }
+      if$
+    }
+    { "in " key * }
+      if$
+    }
+    { "in " format.crossref.editor * }
+  if$
+  " \cite{" * crossref * "}" *
+}
+
+FUNCTION {article}
+{ output.bibitem
+  format.authors "author" output.check
+  format.title "title" output.check
+  crossref missing$
+    { journal "journal" output.check
+      format.vol.year output
+    }
+    { format.article.crossref output.nonnull }
+  if$
+  format.pages output
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {book}
+{ output.bibitem
+  author empty$
+    { format.editors "author and editor" output.check }
+    { format.authors output.nonnull
+      crossref missing$
+    { "author and editor" editor either.or.check }
+    'skip$
+      if$
+    }
+  if$
+  format.btitle "title" output.check
+  crossref missing$
+    { format.bvolume output
+      format.number.series output
+      publisher "publisher" output.check
+      address output
+    }
+    { format.book.crossref output.nonnull }
+  if$
+  format.edition output
+  format.date "year" output.check
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {booklet}
+{ output.bibitem
+  format.authors output
+  format.title "title" output.check
+  howpublished new.block.checka
+  howpublished output
+  address output
+  format.date output
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {inbook}
+{ output.bibitem
+  author empty$
+    { format.editors "author and editor" output.check }
+    { format.authors output.nonnull
+      crossref missing$
+    { "author and editor" editor either.or.check }
+    'skip$
+      if$
+    }
+  if$
+  format.btitle "title" output.check
+  crossref missing$
+    { format.bvolume output
+      format.number.series output
+      publisher "publisher" output.check
+      address output
+    }
+    { format.book.crossref output.nonnull }
+  if$
+  format.edition output
+  format.date "year" output.check
+  format.chapter.pages "chapter and pages" output.check
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {incollection}
+{ output.bibitem
+  format.authors "author" output.check
+  format.title "title" output.check
+  crossref missing$
+    { format.in.ed.booktitle "booktitle" output.check
+      format.bvolume output
+      format.number.series output
+      publisher "publisher" output.check
+      address output
+      format.edition output
+      format.date "year" output.check
+    }
+    { format.incoll.inproc.crossref output.nonnull }
+  if$
+  format.chapter.pages output
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {inproceedings}
+{ output.bibitem
+  format.authors "author" output.check
+  format.title "title" output.check
+  crossref missing$
+    { format.in.ed.booktitle "booktitle" output.check
+      format.bvolume output
+      format.number.series output
+      address empty$
+    { organization output
+      publisher output
+      format.date "year" output.check
+    }
+    { address output.nonnull
+      format.date "year" output.check
+      organization output
+      publisher output
+    }
+      if$
+    }
+    { format.incoll.inproc.crossref output.nonnull }
+  if$
+  format.pages output
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {conference} { inproceedings }
+
+FUNCTION {manual}
+{ output.bibitem
+  author empty$
+    { format.organization output }
+    { format.authors output.nonnull }
+  if$
+  format.btitle "title" output.check
+  author empty$
+    'skip$
+    { organization output }
+  if$
+  address output
+  format.edition output
+  format.date output
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {mastersthesis}
+{ output.bibitem
+  format.authors "author" output.check
+  format.title "title" output.check
+  "master's thesis" format.thesis.type output.nonnull
+  school "school" output.check
+  address output
+  format.date "year" output.check
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {misc}
+{ output.bibitem
+  format.authors output
+  format.title output
+  howpublished new.block.checka
+  howpublished output
+  format.date output
+  new.block
+  note output
+  fin.entry
+  empty.misc.check
+}
+
+FUNCTION {phdthesis}
+{ output.bibitem
+  format.authors "author" output.check
+  format.btitle "title" output.check
+  "PhD thesis" format.thesis.type output.nonnull
+  school "school" output.check
+  address output
+  format.date "year" output.check
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {proceedings}
+{ output.bibitem
+  editor empty$
+    { format.organization output }
+    { format.editors output.nonnull }
+  if$
+  format.btitle "title" output.check
+  format.bvolume output
+  format.number.series output
+  address empty$
+    { editor empty$
+    'skip$
+    { organization output }
+      if$
+      publisher output
+      format.date "year" output.check
+    }
+    { address output.nonnull
+      format.date "year" output.check
+      editor empty$
+    'skip$
+    { organization output }
+      if$
+      publisher output
+    }
+  if$
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {techreport}
+{ output.bibitem
+  format.authors "author" output.check
+  format.title "title" output.check
+  format.tr.number output.nonnull
+  institution "institution" output.check
+  address output
+  format.date "year" output.check
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {unpublished}
+{ output.bibitem
+  format.authors "author" output.check
+  format.title "title" output.check
+  new.block
+  note "note" output.check
+  format.date output
+  fin.entry
+}
+
+FUNCTION {default.type} { misc }
+
+MACRO {jan} {"Jan."}
+
+MACRO {feb} {"Feb."}
+
+MACRO {mar} {"Mar."}
+
+MACRO {apr} {"Apr."}
+
+MACRO {may} {"May"}
+
+MACRO {jun} {"June"}
+
+MACRO {jul} {"July"}
+
+MACRO {aug} {"Aug."}
+
+MACRO {sep} {"Sept."}
+
+MACRO {oct} {"Oct."}
+
+MACRO {nov} {"Nov."}
+
+MACRO {dec} {"Dec."}
+
+MACRO {acmcs} {"ACM Comput. Surveys"}
+
+MACRO {acta} {"Acta Inf."}
+
+MACRO {cacm} {"Comm. ACM"}
+
+MACRO {ibmjrd} {"IBM J. Res. Dev."}
+
+MACRO {ibmsj} {"IBM Syst.~J."}
+
+MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
+
+MACRO {ieeetc} {"IEEE Trans. Comput."}
+
+MACRO {ieeetcad}
+ {"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
+
+MACRO {ipl} {"Inf. Process. Lett."}
+
+MACRO {jacm} {"J.~Assoc. Comput. Mach."}
+
+MACRO {jcss} {"J.~Comput. System Sci."}
+
+MACRO {scp} {"Sci. Comput. Programming"}
+
+MACRO {sicomp} {"SIAM J. Comput."}
+
+MACRO {tocs} {"ACM Trans. Comput. Syst."}
+
+MACRO {tods} {"ACM Trans. Database Syst."}
+
+MACRO {tog} {"ACM Trans. Gr."}
+
+MACRO {toms} {"ACM Trans. Math. Softw."}
+
+MACRO {toois} {"ACM Trans. Office Inf. Syst."}
+
+MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
+
+MACRO {tcs} {"Theoretical Comput. Sci."}
+
+READ
+
+FUNCTION {sortify}
+{ purify$
+  "l" change.case$
+}
+
+INTEGERS { len }
+
+FUNCTION {chop.word}
+{ 's :=
+  'len :=
+  s #1 len substring$ =
+    { s len #1 + global.max$ substring$ }
+    's
+  if$
+}
+
+FUNCTION {sort.format.names}
+{ 's :=
+  #1 'nameptr :=
+  ""
+  s num.names$ 'numnames :=
+  numnames 'namesleft :=
+    { namesleft #0 > }
+    { nameptr #1 >
+    { "   " * }
+    'skip$
+      if$
+      s nameptr "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}" format.name$ 't :=
+      nameptr numnames = t "others" = and
+    { "et al" * }
+    { t sortify * }
+      if$
+      nameptr #1 + 'nameptr :=
+      namesleft #1 - 'namesleft :=
+    }
+  while$
+}
+
+FUNCTION {sort.format.title}
+{ 't :=
+  "A " #2
+    "An " #3
+      "The " #4 t chop.word
+    chop.word
+  chop.word
+  sortify
+  #1 global.max$ substring$
+}
+
+FUNCTION {author.sort}
+{ author empty$
+    { key empty$
+    { "to sort, need author or key in " cite$ * warning$
+      ""
+    }
+    { key sortify }
+      if$
+    }
+    { author sort.format.names }
+  if$
+}
+
+FUNCTION {author.editor.sort}
+{ author empty$
+    { editor empty$
+    { key empty$
+        { "to sort, need author, editor, or key in " cite$ * warning$
+          ""
+        }
+        { key sortify }
+      if$
+    }
+    { editor sort.format.names }
+      if$
+    }
+    { author sort.format.names }
+  if$
+}
+
+FUNCTION {author.organization.sort}
+{ author empty$
+    { organization empty$
+    { key empty$
+        { "to sort, need author, organization, or key in " cite$ * warning$
+          ""
+        }
+        { key sortify }
+      if$
+    }
+    { "The " #4 organization chop.word sortify }
+      if$
+    }
+    { author sort.format.names }
+  if$
+}
+
+FUNCTION {editor.organization.sort}
+{ editor empty$
+    { organization empty$
+    { key empty$
+        { "to sort, need editor, organization, or key in " cite$ * warning$
+          ""
+        }
+        { key sortify }
+      if$
+    }
+    { "The " #4 organization chop.word sortify }
+      if$
+    }
+    { editor sort.format.names }
+  if$
+}
+
+FUNCTION {presort}
+{ type$ "book" =
+  type$ "inbook" =
+  or
+    'author.editor.sort
+    { type$ "proceedings" =
+    'editor.organization.sort
+    { type$ "manual" =
+        'author.organization.sort
+        'author.sort
+      if$
+    }
+      if$
+    }
+  if$
+  "    "
+  *
+  year field.or.null sortify
+  *
+  "    "
+  *
+  title field.or.null
+  sort.format.title
+  *
+  #1 entry.max$ substring$
+  'sort.key$ :=
+}
+
+ITERATE {presort}
+
+SORT
+
+STRINGS { longest.label }
+
+INTEGERS { number.label longest.label.width }
+
+FUNCTION {initialize.longest.label}
+{ "" 'longest.label :=
+  #1 'number.label :=
+  #0 'longest.label.width :=
+}
+
+FUNCTION {longest.label.pass}
+{ number.label int.to.str$ 'label :=
+  number.label #1 + 'number.label :=
+  label width$ longest.label.width >
+    { label 'longest.label :=
+      label width$ 'longest.label.width :=
+    }
+    'skip$
+  if$
+}
+
+EXECUTE {initialize.longest.label}
+
+ITERATE {longest.label.pass}
+
+FUNCTION {begin.bib}
+{ preamble$ empty$
+    'skip$
+    { preamble$ write$ newline$ }
+  if$
+  "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
+}
+
+EXECUTE {begin.bib}
+
+EXECUTE {init.state.consts}
+
+EXECUTE {init.last.authors}
+
+ITERATE {call.type$}
+
+FUNCTION {end.bib}
+{ newline$
+  "\end{thebibliography}" write$ newline$
+}
+
+EXECUTE {end.bib}
+ 
diff --git a/doc/book/siam10.clo b/doc/book/siam10.clo
new file mode 100644
index 0000000000000000000000000000000000000000..8df47a0f5e0e4ca22d7a4f1c5ca85ee86b0acb3c
--- /dev/null
+++ b/doc/book/siam10.clo
@@ -0,0 +1,208 @@
+%% 
+%% This is file `siam10.clo', based on size10.clo
+%% Revision of siam macros for use with LaTeX 2e
+%% for the Society for Industrial and Applied
+%% Mathematics (SIAM). 
+%% 
+%% February 4, 1997
+%%
+%% Version 1.1
+%% 
+%% You are not allowed to change this file. 
+%% 
+%% You are allowed to distribute this file under the condition that 
+%% it is distributed together with all of the files in the siam macro 
+%% distribution. These are:
+%%
+%%  siamltex.cls (main LaTeX macro for SIAM)
+%%  siamltex.sty (includes siamltex.cls for compatibility mode)
+%%  siam10.clo   (this file)
+%%  subeqn.clo   (allows equation numbners with lettered subelements)
+%%  siam.bst     (bibliographic style file for use with BibTeX)
+%%  docultex.tex (documentation file)
+%%  lexample.tex (example file for latex macro) 
+%% 
+%% If you receive only some of these files from someone, complain! 
+%% 
+%% You are NOT ALLOWED to distribute this file alone. You are NOT 
+%% ALLOWED to take money for the distribution or use of either this 
+%% file or a changed version, except for a nominal charge for copying 
+%% etc. 
+%% \CharacterTable
+%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%%   Digits        \0\1\2\3\4\5\6\7\8\9
+%%   Exclamation   \!     Double quote  \"     Hash (number) \#
+%%   Dollar        \$     Percent       \%     Ampersand     \&
+%%   Acute accent  \'     Left paren    \(     Right paren   \)
+%%   Asterisk      \*     Plus          \+     Comma         \,
+%%   Minus         \-     Point         \.     Solidus       \/
+%%   Colon         \:     Semicolon     \;     Less than     \<
+%%   Equals        \=     Greater than  \>     Question mark \?
+%%   Commercial at \@     Left bracket  \[     Backslash     \\
+%%   Right bracket \]     Circumflex    \^     Underscore    \_
+%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
+%%   Right brace   \}     Tilde         \~}
+\ProvidesFile{siam10.clo}
+              [1994/10/01 v1.0
+      SIAM LaTeX file (size option)]
+\renewcommand{\normalsize}{%
+   \@setfontsize\normalsize\@xpt\@xiipt
+   \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
+   \abovedisplayshortskip \abovedisplayskip
+   \belowdisplayshortskip \belowdisplayskip
+   \belowdisplayskip \abovedisplayskip
+   \let\@listi\@listI}
+\normalsize
+\newcommand{\small}{%
+   \@setfontsize\small\@ixpt{11}%
+   \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
+   \abovedisplayshortskip \z@ \@plus2\p@
+   \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
+   \def\@listi{\leftmargin\leftmargini
+               \topsep 4\p@ \@plus2\p@ \@minus2\p@
+               \parsep 2\p@ \@plus\p@ \@minus\p@
+               \itemsep \parsep}%
+   \belowdisplayskip \abovedisplayskip
+}
+\newcommand{\footnotesize}{%
+   \@setfontsize\footnotesize\@viiipt{9.5}%
+   \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
+   \abovedisplayshortskip \abovedisplayskip
+   \belowdisplayshortskip \belowdisplayskip
+   \def\@listi{\leftmargin\leftmargini
+               \topsep \z@
+               \parsep \z@
+               \itemsep \parsep}%
+   \belowdisplayskip \abovedisplayskip
+}
+\newcommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt}
+\newcommand{\tiny}{\@setfontsize\tiny\@vpt\@vipt}
+\newcommand{\large}{\@setfontsize\large\@xiipt{14}}
+\newcommand{\Large}{\@setfontsize\Large\@xivpt{18}}
+\newcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{22}}
+\newcommand{\huge}{\@setfontsize\huge\@xxpt{25}}
+\newcommand{\Huge}{\@setfontsize\Huge\@xxvpt{30}}
+\if@twocolumn
+  \setlength\parindent{1em}
+\else
+  \setlength\parindent{.25in}
+\fi
+\setlength\headheight{10\p@}
+\setlength\headsep   {.2in}
+%\setlength\topskip   {10\p@}
+\setlength\footskip{.2in}
+\if@compatibility 
+ \setlength\maxdepth{4\p@}
+\else
+ \setlength\maxdepth{.5\topskip} 
+\fi
+\setlength\@maxdepth\maxdepth
+\if@compatibility
+  \if@twocolumn
+    \setlength\textwidth{410\p@}
+  \else
+    \setlength\textwidth{5.125in}
+  \fi
+\else
+  \if@twocolumn
+    \setlength\textwidth{410\p@}
+  \else
+    \setlength\textwidth{5.125in}
+  \fi
+\fi
+%\if@compatibility\else
+%  \@settopoint\textwidth
+%\fi
+\if@compatibility
+  \setlength\textheight{8.25in}
+\else
+  \setlength\textheight{8.25in}
+\fi
+%\addtolength\textheight{\topskip}
+\if@compatibility
+  \if@twoside
+%     \setlength\oddsidemargin   {.5in}
+%     \setlength\evensidemargin  {.5in}
+     \setlength\marginparwidth {1.25in}
+  \else
+%     \setlength\oddsidemargin   {.5in}
+%     \setlength\evensidemargin  {.5in}
+     \setlength\marginparwidth  {1.25in}
+  \fi
+  \if@twocolumn
+     \setlength\oddsidemargin  {30\p@}
+     \setlength\evensidemargin {30\p@}
+     \setlength\marginparwidth {48\p@}
+  \fi
+\else
+  \if@twoside
+%     \setlength\oddsidemargin   {.5in}
+%     \setlength\evensidemargin  {.5in}
+     \setlength\marginparwidth {1.25in}
+  \else
+%     \setlength\oddsidemargin   {.5in}
+%     \setlength\evensidemargin  {.5in}
+     \setlength\marginparwidth {1.25in}
+  \fi
+  \@settopoint\oddsidemargin
+  \@settopoint\marginparwidth
+\fi
+\if@twocolumn
+  \setlength\marginparsep {10\p@}
+\else
+  \setlength\marginparsep{11\p@}
+\fi
+\setlength\marginparpush{5\p@}
+\if@compatibility
+  \setlength\topmargin{\z@}
+\else
+\setlength\topmargin {\z@}
+%  \@settopoint\topmargin
+\fi
+
+\setlength\footnotesep{6.65\p@}
+\skip\footins 13\p@ \@plus 4\p@ \@minus 2\p@
+\setlength\floatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
+\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
+\setlength\intextsep   {12\p@ \@plus 2\p@ \@minus 2\p@}
+\setlength\dblfloatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
+\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
+\setlength\@fptop{0\p@ \@plus 1fil}
+\setlength\@fpsep{8\p@ \@plus 2fil}
+\setlength\@fpbot{0\p@ \@plus 1fil}
+\setlength\@dblfptop{0\p@ \@plus 1fil}
+\setlength\@dblfpsep{8\p@ \@plus 2fil}
+\setlength\@dblfpbot{0\p@ \@plus 1fil}
+\setlength\partopsep{\z@}
+\def\@listI{\leftmargin\leftmargini
+            \parsep \z@
+            \topsep \z@
+            \itemsep \parsep}
+\let\@listi\@listI
+\@listi
+\def\@listii {\leftmargin\leftmarginii
+              \labelwidth\leftmarginii
+              \advance\labelwidth-\labelsep
+              \topsep    \z@
+              \parsep    \z@
+              \itemsep   \parsep}
+\def\@listiii{\leftmargin\leftmarginiii
+              \labelwidth\leftmarginiii
+              \advance\labelwidth-\labelsep
+              \topsep    \z@
+              \parsep    \z@
+              \partopsep \z@
+              \itemsep   \topsep}
+\def\@listiv {\leftmargin\leftmarginiv
+              \labelwidth\leftmarginiv
+              \advance\labelwidth-\labelsep}
+\def\@listv  {\leftmargin\leftmarginv
+              \labelwidth\leftmarginv
+              \advance\labelwidth-\labelsep}
+\def\@listvi {\leftmargin\leftmarginvi
+              \labelwidth\leftmarginvi
+              \advance\labelwidth-\labelsep}
+\endinput
+%% 
+%% End of file `siam10.clo'.
diff --git a/doc/workshop/images/12-fold_7.png b/doc/workshop/images/12-fold_7.png
new file mode 100644
index 0000000000000000000000000000000000000000..0ac04f198f5524f37009f5d7d52f43d5942c1ca6
Binary files /dev/null and b/doc/workshop/images/12-fold_7.png differ
diff --git a/doc/workshop/images/120particle_f3.png b/doc/workshop/images/120particle_f3.png
new file mode 100644
index 0000000000000000000000000000000000000000..e8f8d947cd87e2293b6497cbc83326071ad95af9
Binary files /dev/null and b/doc/workshop/images/120particle_f3.png differ
diff --git a/doc/workshop/images/Ball42_implicit.png b/doc/workshop/images/Ball42_implicit.png
new file mode 100644
index 0000000000000000000000000000000000000000..60703b084e3deabb6bfdf018c2f3c6efe4d6f658
Binary files /dev/null and b/doc/workshop/images/Ball42_implicit.png differ
diff --git a/doc/workshop/images/Earth_flow.png b/doc/workshop/images/Earth_flow.png
new file mode 100644
index 0000000000000000000000000000000000000000..9f7c2db3c56a041d719389f7294849aec633c21a
Binary files /dev/null and b/doc/workshop/images/Earth_flow.png differ
diff --git a/doc/workshop/images/Fsi.png b/doc/workshop/images/Fsi.png
new file mode 100644
index 0000000000000000000000000000000000000000..7aafe1e4df99eeea581dd392bf545c9c3f687ec9
Binary files /dev/null and b/doc/workshop/images/Fsi.png differ
diff --git a/doc/workshop/images/R9_energy.png b/doc/workshop/images/R9_energy.png
new file mode 100644
index 0000000000000000000000000000000000000000..d990ca41aca79c60238dfa015d6b62de4fba4cd2
Binary files /dev/null and b/doc/workshop/images/R9_energy.png differ
diff --git a/doc/workshop/images/Sphere_decomposition2.png b/doc/workshop/images/Sphere_decomposition2.png
new file mode 100644
index 0000000000000000000000000000000000000000..7bd695b9977b0fcfeacf8a31c1c67c07f39e8225
Binary files /dev/null and b/doc/workshop/images/Sphere_decomposition2.png differ
diff --git a/doc/workshop/images/Three_layers2b_end.png b/doc/workshop/images/Three_layers2b_end.png
new file mode 100644
index 0000000000000000000000000000000000000000..92b37f0088f2af87f1c3d4c9a6429e85de00531d
Binary files /dev/null and b/doc/workshop/images/Three_layers2b_end.png differ
diff --git a/doc/workshop/images/adaption-loop.png b/doc/workshop/images/adaption-loop.png
new file mode 100644
index 0000000000000000000000000000000000000000..9e2915297dee0e5f4a80a4130195453b3187573b
Binary files /dev/null and b/doc/workshop/images/adaption-loop.png differ
diff --git a/doc/workshop/images/ball500.png b/doc/workshop/images/ball500.png
new file mode 100644
index 0000000000000000000000000000000000000000..dda5e88d1ab05292b4d3dcf9b7621bf183271b72
Binary files /dev/null and b/doc/workshop/images/ball500.png differ
diff --git a/doc/workshop/images/biharmonic.png b/doc/workshop/images/biharmonic.png
new file mode 100644
index 0000000000000000000000000000000000000000..583897d974b727216b8c1eb48903dcb597f32c47
Binary files /dev/null and b/doc/workshop/images/biharmonic.png differ
diff --git a/doc/workshop/images/bisection.png b/doc/workshop/images/bisection.png
new file mode 100644
index 0000000000000000000000000000000000000000..3363960dc6bcc8947934e36465253ac6f7de9119
Binary files /dev/null and b/doc/workshop/images/bisection.png differ
diff --git a/doc/workshop/images/bone.png b/doc/workshop/images/bone.png
new file mode 100644
index 0000000000000000000000000000000000000000..1d4e6b1733c99f7f1bc614e208bcad4f1abbf1cb
Binary files /dev/null and b/doc/workshop/images/bone.png differ
diff --git a/doc/workshop/images/cahn_hilliard.png b/doc/workshop/images/cahn_hilliard.png
new file mode 100644
index 0000000000000000000000000000000000000000..6816d136a056f459db771eb744bbe0d25ae72936
Binary files /dev/null and b/doc/workshop/images/cahn_hilliard.png differ
diff --git a/doc/workshop/images/capillary_ellipse.png b/doc/workshop/images/capillary_ellipse.png
new file mode 100644
index 0000000000000000000000000000000000000000..b064519f790ce9219b05971fcfc238e48427032b
Binary files /dev/null and b/doc/workshop/images/capillary_ellipse.png differ
diff --git a/doc/workshop/images/capillary_ellipse2.png b/doc/workshop/images/capillary_ellipse2.png
new file mode 100644
index 0000000000000000000000000000000000000000..95805a5466e6b2acdc493c520f1e3520c9852aa5
Binary files /dev/null and b/doc/workshop/images/capillary_ellipse2.png differ
diff --git a/doc/workshop/images/capillary_schaum.png b/doc/workshop/images/capillary_schaum.png
new file mode 100644
index 0000000000000000000000000000000000000000..7f964bd9baa0166baf3b5f5f2674e20caaeb11a5
Binary files /dev/null and b/doc/workshop/images/capillary_schaum.png differ
diff --git a/doc/workshop/images/cavity2.png b/doc/workshop/images/cavity2.png
new file mode 100644
index 0000000000000000000000000000000000000000..d6f20c05ead9478ff65c8eb495bc905513a9ea1b
Binary files /dev/null and b/doc/workshop/images/cavity2.png differ
diff --git a/doc/workshop/images/cell.png b/doc/workshop/images/cell.png
new file mode 100644
index 0000000000000000000000000000000000000000..7ea70cdc9a785e52b7d11c5ea23ef1b2d5a1754f
Binary files /dev/null and b/doc/workshop/images/cell.png differ
diff --git a/doc/workshop/images/cell_in_flow.png b/doc/workshop/images/cell_in_flow.png
new file mode 100644
index 0000000000000000000000000000000000000000..276694c9e59c32ab218331773953a35dee7a53e5
Binary files /dev/null and b/doc/workshop/images/cell_in_flow.png differ
diff --git a/doc/workshop/images/coexistence2.png b/doc/workshop/images/coexistence2.png
new file mode 100644
index 0000000000000000000000000000000000000000..0484912dce9faac16abe76412b68bd996dc1a656
Binary files /dev/null and b/doc/workshop/images/coexistence2.png differ
diff --git a/doc/workshop/images/dend3d_04.png b/doc/workshop/images/dend3d_04.png
new file mode 100644
index 0000000000000000000000000000000000000000..2dc00b9c4d295752e9387ae9fde462bd501f8184
Binary files /dev/null and b/doc/workshop/images/dend3d_04.png differ
diff --git a/doc/workshop/images/ellipt_macro.pdf b/doc/workshop/images/ellipt_macro.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f8ede754910fef0d5aa92b34972b689346b87112
Binary files /dev/null and b/doc/workshop/images/ellipt_macro.pdf differ
diff --git a/doc/workshop/images/energy.png b/doc/workshop/images/energy.png
new file mode 100644
index 0000000000000000000000000000000000000000..51c15dc83ea43c2361f049774a86694204a9f060
Binary files /dev/null and b/doc/workshop/images/energy.png differ
diff --git a/doc/workshop/images/global.pdf b/doc/workshop/images/global.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..bacd9fcb782520547f5ae8eeb70f339c96227bef
Binary files /dev/null and b/doc/workshop/images/global.pdf differ
diff --git a/doc/workshop/images/indian_0050.png b/doc/workshop/images/indian_0050.png
new file mode 100644
index 0000000000000000000000000000000000000000..38bd54bb50d1ed470464c3b018f4c3c30f90ef16
Binary files /dev/null and b/doc/workshop/images/indian_0050.png differ
diff --git a/doc/workshop/images/kanal.pdf b/doc/workshop/images/kanal.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..0cd9a0efe068e6cb534478011de9ed99e0e95d38
Binary files /dev/null and b/doc/workshop/images/kanal.pdf differ
diff --git a/doc/workshop/images/kanal.png b/doc/workshop/images/kanal.png
new file mode 100644
index 0000000000000000000000000000000000000000..157860ea8e1f6c2038e4953ea841264397580585
Binary files /dev/null and b/doc/workshop/images/kanal.png differ
diff --git a/doc/workshop/images/local_refinement.png b/doc/workshop/images/local_refinement.png
new file mode 100644
index 0000000000000000000000000000000000000000..467a4f073976a912b44b0baaa885741662d301cc
Binary files /dev/null and b/doc/workshop/images/local_refinement.png differ
diff --git a/doc/workshop/images/local_refinement_0.png b/doc/workshop/images/local_refinement_0.png
new file mode 100644
index 0000000000000000000000000000000000000000..a6fb09563244db922f3726c8c42dceaa72e9e7bb
Binary files /dev/null and b/doc/workshop/images/local_refinement_0.png differ
diff --git a/doc/workshop/images/local_refinement_1.png b/doc/workshop/images/local_refinement_1.png
new file mode 100644
index 0000000000000000000000000000000000000000..98c658346b29616180000a42362335392ab97625
Binary files /dev/null and b/doc/workshop/images/local_refinement_1.png differ
diff --git a/doc/workshop/images/local_refinement_10.png b/doc/workshop/images/local_refinement_10.png
new file mode 100644
index 0000000000000000000000000000000000000000..045c61c0b8a5dcb2e77d6fad4c0152dcf3221fd6
Binary files /dev/null and b/doc/workshop/images/local_refinement_10.png differ
diff --git a/doc/workshop/images/local_refinement_2.png b/doc/workshop/images/local_refinement_2.png
new file mode 100644
index 0000000000000000000000000000000000000000..b682a55776d943fc0dd7bd3c2cfb352c759067e2
Binary files /dev/null and b/doc/workshop/images/local_refinement_2.png differ
diff --git a/doc/workshop/images/local_refinement_3.png b/doc/workshop/images/local_refinement_3.png
new file mode 100644
index 0000000000000000000000000000000000000000..20d03482c1db7919fed5284da766a6c24d61b50b
Binary files /dev/null and b/doc/workshop/images/local_refinement_3.png differ
diff --git a/doc/workshop/images/local_refinement_4.png b/doc/workshop/images/local_refinement_4.png
new file mode 100644
index 0000000000000000000000000000000000000000..eba92d71c1bd0a7f1215e7e08549765ef5e4590f
Binary files /dev/null and b/doc/workshop/images/local_refinement_4.png differ
diff --git a/doc/workshop/images/local_refinement_5.png b/doc/workshop/images/local_refinement_5.png
new file mode 100644
index 0000000000000000000000000000000000000000..5c27ba2cb18ba5e19b40a1b953948bc0ffe66c01
Binary files /dev/null and b/doc/workshop/images/local_refinement_5.png differ
diff --git a/doc/workshop/images/local_refinement_6.png b/doc/workshop/images/local_refinement_6.png
new file mode 100644
index 0000000000000000000000000000000000000000..39fd9eb4044b4c94592498e099f9363eb1d635f1
Binary files /dev/null and b/doc/workshop/images/local_refinement_6.png differ
diff --git a/doc/workshop/images/local_refinement_8.png b/doc/workshop/images/local_refinement_8.png
new file mode 100644
index 0000000000000000000000000000000000000000..be994b166f916abd838c319969676ee48bfe01fe
Binary files /dev/null and b/doc/workshop/images/local_refinement_8.png differ
diff --git a/doc/workshop/images/mesh.png b/doc/workshop/images/mesh.png
new file mode 100644
index 0000000000000000000000000000000000000000..52ef014ef48a9d5a446a6e5aa8243ddb68231d41
Binary files /dev/null and b/doc/workshop/images/mesh.png differ
diff --git a/doc/workshop/images/orientation.png b/doc/workshop/images/orientation.png
new file mode 100644
index 0000000000000000000000000000000000000000..4696c70222b551471363d5af6a7c7c2298270304
Binary files /dev/null and b/doc/workshop/images/orientation.png differ
diff --git a/doc/workshop/images/paraview.png b/doc/workshop/images/paraview.png
new file mode 100644
index 0000000000000000000000000000000000000000..29d6e6bc44c13ab1219954edadbc3fbb2921c28b
Binary files /dev/null and b/doc/workshop/images/paraview.png differ
diff --git a/doc/workshop/images/pfc_sphere.png b/doc/workshop/images/pfc_sphere.png
new file mode 100644
index 0000000000000000000000000000000000000000..47233ec2806a58620df0b76a41c246eef49b50cd
Binary files /dev/null and b/doc/workshop/images/pfc_sphere.png differ
diff --git a/doc/workshop/images/poisson1.png b/doc/workshop/images/poisson1.png
new file mode 100644
index 0000000000000000000000000000000000000000..5c014bdb42e4d4d565586a17c711bea532ee9b8c
Binary files /dev/null and b/doc/workshop/images/poisson1.png differ
diff --git a/doc/workshop/images/procedure.png b/doc/workshop/images/procedure.png
new file mode 100644
index 0000000000000000000000000000000000000000..9922bb9926d02cfcd27fcf079c9cb9c84726746c
Binary files /dev/null and b/doc/workshop/images/procedure.png differ
diff --git a/doc/workshop/images/rho_big.png b/doc/workshop/images/rho_big.png
new file mode 100644
index 0000000000000000000000000000000000000000..e129971f9d7d79f08c7205f3a9ae815ff3df905a
Binary files /dev/null and b/doc/workshop/images/rho_big.png differ
diff --git a/doc/workshop/images/slide_3d1.png b/doc/workshop/images/slide_3d1.png
new file mode 100644
index 0000000000000000000000000000000000000000..771b2091b25cc9c36098b21a4c7e6e115ea543ab
Binary files /dev/null and b/doc/workshop/images/slide_3d1.png differ
diff --git a/doc/workshop/images/sphere.png b/doc/workshop/images/sphere.png
new file mode 100644
index 0000000000000000000000000000000000000000..009e66a819841802141b80b9a9221148154bacd3
Binary files /dev/null and b/doc/workshop/images/sphere.png differ
diff --git a/doc/workshop/images/surface_pfc.png b/doc/workshop/images/surface_pfc.png
new file mode 100644
index 0000000000000000000000000000000000000000..9faa95d04a3d5127216ae7a785c9263adb0f1975
Binary files /dev/null and b/doc/workshop/images/surface_pfc.png differ
diff --git a/doc/workshop/images/taylor.png b/doc/workshop/images/taylor.png
new file mode 100644
index 0000000000000000000000000000000000000000..710b3dd281055b5cc4deaa4e93dafc4e49aa8c60
Binary files /dev/null and b/doc/workshop/images/taylor.png differ
diff --git a/doc/workshop/images/torus_macro.jpg b/doc/workshop/images/torus_macro.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..f76d8803e7f789be3fc368e84ac6a0a5c47924b0
Binary files /dev/null and b/doc/workshop/images/torus_macro.jpg differ
diff --git a/doc/workshop/images/visualization_schwarz.png b/doc/workshop/images/visualization_schwarz.png
new file mode 100644
index 0000000000000000000000000000000000000000..0245d95a5d4797bcdb870bed9c1f6aed88f423b8
Binary files /dev/null and b/doc/workshop/images/visualization_schwarz.png differ
diff --git a/doc/workshop/logo.png b/doc/workshop/logo.png
new file mode 100644
index 0000000000000000000000000000000000000000..56b5417cfe7477d3d8cb50579bf9a293efcb01e1
Binary files /dev/null and b/doc/workshop/logo.png differ
diff --git a/doc/workshop/seminar1.tex b/doc/workshop/seminar1.tex
new file mode 100644
index 0000000000000000000000000000000000000000..ee61f2b5092139f0a5f60420a4c16edfd6a57d05
--- /dev/null
+++ b/doc/workshop/seminar1.tex
@@ -0,0 +1,479 @@
+\section{AMDiS Overview}
+\begin{frame}\frametitle{AMDiS \textbf{A}daptive \textbf{M}ulti-\textbf{Di}mensional \textbf{S}imulations}
+AMDiS developed around 2005. Basis: C-library \textbf{ALBERTA}. Now: an object-oriented C++-Framework.
+Basic concepts
+\begin{itemize}
+\item \textbf{High abstraction level}: (Physical) Problems can be formulated with little knowledge about numerical details
+\item \textbf{Generality}: Solve a broad class of PDE problems. Linear and nonlinear problems, stationary and instationary. Multiple dimensions and coupling of different dimensions
+\item \textbf{Extensibility}: Interface to extend AMDiS in several aspects, e.g. own error estimators, linear solvers, preconditioners, time-stepping schemes
+\item \textbf{Efficiency}: Several tools for highly efficient simulations, e.g. adaptive meshes, parallelization, multi-mesh, fast linear solver libraries
+\end{itemize}
+\end{frame}
+
+
+% ..............................................................................
+\begin{frame}\frametitle{AMDiS \textbf{A}daptive \textbf{M}ulti-\textbf{Di}mensional \textbf{S}imulations}
+Short history:
+\begin{itemize}
+\item 2002: Beginning of development (based on C-library ALBERT(A))
+\item 2005: First release
+\item 2007: PhD Thesis of Simon Vey: ``\emph{Adaptive Finite Elements for Systems of PDEs}''
+\item 2007: Development in the IWR at TU-Dresden
+\item 2008: First parallel version
+\item 2011: Release of stable version 0.9
+\item 2013: PhD Thesis of Thomas Witkowski: ``\emph{Software concepts and algorithms for an efficient and scalable parallel finite element method}''
+\item 2014: Generic expression terms introduced
+\item 2016(?): AMDiS 2.0
+\end{itemize}
+\begin{block}{Developers}
+Axel Voigt, Simon Vey, Christina Stöcker, Thomas Wittkowski, Andreas Naumann, Simon Praetorius, ...
+\end{block}
+\end{frame}
+
+
+% ..............................................................................
+\begin{frame}\frametitle{AMDiS \textbf{A}daptive \textbf{M}ulti-\textbf{Di}mensional \textbf{S}imulations}
+Some features
+\begin{itemize}
+\item Solve (sequence of) Systems of \textbf{stationary linear PDEs} of \textbf{2nd order}
+\item \textbf{Time integrators}: e.g. Rosenbrock method
+\item \textbf{Nonlinear solvers}: e.g. Newton method
+\item \textbf{Adaptivity} in space and time
+\item Lagrange \textbf{basis functions} (deg. 1--4), and center-bubble function
+\item \textbf{Mixed finite-elements}, e.g. $P^2/P^1$, Mini-Element
+\item \textbf{Multi-Mesh} method (i.e. different components with different mesh)
+\item Sequential and \textbf{parallel} (tested with up to 16K cores, and $10^9$ DOFs)
+\item \textbf{Multi-Grid}: geometric (in AMDiS), algebraic (external library)
+\item Interface to \textbf{linear solvers}: (P)MTL4, PETSc, Hypre
+\item \textbf{FETI-DP} / Schur-complement solvers in parallel
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\begin{center}
+{\Huge Session 1}
+\end{center}
+\end{frame}
+
+\subsection{Second order PDEs}
+\begin{frame}\frametitle{\only<3>{System of s}\only<1-2>{S}econd order PDE\only<3>{s}}
+General problem formulation:
+\only<1-2>{\[
+\left[\partial_t u\right] + cu \only<1>{- \nabla\cdot(\underline{b}u)}\only<2->{+\alert<2>{ \underline{b}\cdot\nabla u}} - \nabla\cdot(\mathbb{A}\nabla u) = f,\quad\text{ in }\Omega
+\times(0,T]\]}
+\only<3->{\[
+\alert{\sum_j}\left[\alert{M^{i,j}}\partial_t u^{\alert{j}}\right] + c^{\alert{i,j}}u^{\alert{j}} + \underline{b}^{\alert{i,j}}\cdot\nabla u^{\alert{j}} - \nabla\cdot(\mathbb{A}^{\alert{i,j}}\nabla u^{\alert{j}}) = f^{\alert{i}},\quad\text{ in }\Omega\times(0,T]
+\]}
+with $u\only<3->{^{\alert<3>{j}}}=u\only<3->{^{\alert<3>{j}}}(x)$ the unknown function\only<3->{s} and coefficients $c, \underline{b}, \mathbb{A}$ that can depend on space, time, and other quantities $v$ living in $\Omega$:
+\[\begin{split}
+c\only<3->{^{i,j}} &= c\only<3->{^{i,j}}(t,x,\only<1-2>{v,\nabla v}\only<3->{\{v_k\},\{\nabla v_k\}}),\\
+\underline{b}\only<3->{^{i,j}} &= \underline{b}\only<3->{^{i,j}}(t,x,\only<1-2>{v,\nabla v}\only<3->{\{v_k\},\{\nabla v_k\}}),\\
+\mathbb{A}\only<3->{^{i,j}} &= \mathbb{A}\only<3->{^{i,j}}(t,x,\only<1-2>{v,\nabla v}\only<3->{\{v_k\},\{\nabla v_k\}}),\\
+f\only<3->{^{i}} &= f\only<3->{^{i}}(t,x,\only<1-2>{v,\nabla v}\only<3->{\{v_k\},\{\nabla v_k\}}),
+\end{split}\]
+equipped with (initial- and ) boundary conditions on $\partial\Omega$.
+\end{frame}
+
+% ..............................................................................
+\begin{frame}\frametitle{Second order PDEs}
+AMDiS is an FEM framework and FEM is based on the \textbf{weak formulation} of the equations, thus the basic formulation for problems is:\\Find $u\in L_2(0,T; V^{(1)})$, s.t.
+\only<1-2>{\[
+\left[\langle\partial_t u, \theta\rangle_\Omega\right] + \langle cu, \theta\rangle_\Omega \only<1>{+ \langle \underline{b}u,\nabla\theta\rangle_\Omega}\only<2->{+\alert<2>{\langle\underline{b}\cdot\nabla u, \theta\rangle_\Omega}} + \langle \mathbb{A}\nabla u, \nabla\theta\rangle_\Omega \only<3>{+\alert{\langle \alpha u, \theta\rangle_{\partial\Omega}}} = \langle f,\theta\rangle_\Omega\only<3>{+\alert{\langle g, \theta\rangle_{\partial\Omega}}},\quad\forall \theta\in V^{(0)}
+\]}
+\only<3>{\begin{multline*}
+\left[\langle\partial_t u, \theta\rangle_\Omega\right] + \langle cu, \theta\rangle_\Omega + \langle\underline{b}\cdot\nabla u, \theta\rangle_\Omega + \langle \mathbb{A}\nabla u, \nabla\theta\rangle_\Omega +\alert{\langle \alpha u, \theta\rangle_{\partial\Omega}}\\
+= \langle f,\theta\rangle_\Omega+\alert{\langle g, \theta\rangle_{\partial\Omega}},\quad\forall \theta\in V^{(0)}
+\end{multline*}}
+with $\langle a,b \rangle_\Omega:=\int_\Omega a\cdot b\,\text{d}x$ and $V^{(0)},V^{(1)}$ compatible spaces, e.g.
+\begin{itemize}
+\item $V^{(0)}=V^{(1)} = H^1(\Omega)$, or 
+\item $V^{(1)}=V_G:=\{u\in H^1(\Omega)\,:\,u|_{\partial\Omega}=G\}, V^{(0)} = V_0$.
+\end{itemize}
+\end{frame}
+
+
+\subsection{Data the user needs to provide}
+\begin{frame}\frametitle{Basic ingredients for an AMDiS program}
+What data/information do you need to formulate your problem?
+\begin{enumerate}
+\item<2-> Description of your \textbf{domain} $\Omega$ + a \textbf{triangulation} $\mathcal{T}_h$ of the domain $\rightarrow$ \texttt{Mesh}
+
+\item<3-> Function-space $V$, or its \textbf{basis-functions} respectively. \begin{itemize}
+  \item \texttt{P1} := Lagrange elements with polynomial degree $p=1$:
+  \[ V = \{ v\in H^1(\Omega)\,:\, v|_T\in\mathbb{P}_p(T),\,\forall T\in\mathcal{T}_h(\Omega)\} \]
+  \item \texttt{P1+bubble} := \texttt{P1} + center bubble-function
+\end{itemize}
+$V^{(0)}$ is called \texttt{RowFeSpace} and $V^{(1)}$ is called \texttt{ColumnFeSpace}.
+
+\item<4-> \textbf{Solution} vector $u$, based on a numbering of all DOFs $\rightarrow$ \texttt{DOFVector}
+\[u(x) = \sum_i u_i\phi_i(x),\]
+with $\{\phi_i\}$ a basis of $V^{(1)}$.
+\end{enumerate}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}\frametitle{Basic ingredients for an AMDiS program}
+\begin{enumerate}
+\setcounter{enumi}{3}
+\item<1-> \textbf{Coefficient functions} $c, \underline{b}, \mathbb{A}\;\rightarrow$ \texttt{OperatorTerm}\\
+Categorized by degree of derivative:
+\[{\color{blue}c}u - \nabla\cdot({\color{blue}\underline{b}}u) - \nabla\cdot({\color{blue}\mathbb{A}}\nabla u) = {\color{blue}f}\]
+  \begin{itemize}
+  \item $c, f$: \texttt{ZeroOrderTerm} (ZOT)
+  \item $\underline{b}$: \texttt{FirstOrderTerm} (FOT)\begin{itemize}
+    \item Derivative is on trial function: \texttt{GRD\_PHI}: $\langle\underline{b}\cdot\nabla \phi, \psi\rangle$
+    \item Derivative is on test function: \texttt{GRD\_PSI}: $\langle\underline{b} \phi,\nabla\psi\rangle$
+  \end{itemize}
+  \item $\mathbb{A}$: \texttt{SecondOrderTerm} (SOT)
+\end{itemize}
+
+\item<2-> \textbf{Boundary terms}, i.e. coefficient functions $\alpha, g$ and properties of the pair of function spaces $V^{(0)},V^{(1)}$.
+\end{enumerate}
+\end{frame}
+
+
+% ..............................................................................
+\begin{frame}\frametitle{General procedure}
+\begin{center}
+\includegraphics[width=\linewidth]{images/procedure}
+\end{center}
+\end{frame}
+
+% ..............................................................................
+% \begin{frame}\frametitle{The Problem Class}
+% \begin{enumerate}
+% \item<1-> All problem data is collected in AMDiS class \texttt{ProblemStat}
+% \item<2-> Basis-Functions, Mesh and a DOFAdmin build the \texttt{FiniteElemSpace}
+% \item<3-> A pair of Row/Column FeSpace + OperatorTerms define an \texttt{Operator}
+% \item<4-> Solution-vectors of multiple components are combined in \texttt{SystemVector}
+% \item<5-> PDE is always formulated as system of equations. In case of 1 equation and 
+% 1 solution vector, we have to fill the system-matrix component (0,0) and the SystemVector
+% component (0).
+% \end{enumerate}
+% \end{frame}
+
+% ==============================================================================
+\section{Example: Poisson equation}
+\begin{frame}\frametitle{Basic structure of AMDiS program (C++ code)}
+\begin{itemize}
+\item Header file: 
+\begin{codebox}
+\#include "AMDiS.h"
+\end{codebox}
+
+\item AMDiS initialization:
+\begin{codebox}
+using namespace AMDiS;\\
+int main(int argc, char** argv) \{\\
+$~~~~$AMDiS::init(argc, argv);\\
+$~~~~$...\\
+$~~~~$AMDiS::finalize();\\
+\}
+\end{codebox}
+init(...):
+\begin{itemize}
+  \item initializes \textit{PMTL4}, \textit{PETSc}, \textit{MPI}, \textit{Zoltan}
+  \item parses command line arguments (run program with \texttt{--help} to see available options)
+  \item reads a parameter-file
+\end{itemize}
+
+finalize():
+\begin{itemize}
+  \item finalizes \textit{PMTL4}, \textit{PETSc}, \textit{MPI}
+\end{itemize}
+
+\end{itemize}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}\frametitle{Stationary equation}
+\only<1-3>{We start with the most simple equation: Poisson equation
+\[
+-\Delta u = f(x)\quad\text{ in }\Omega,\quad u|_{\partial\Omega} = 0,\; f(x)\equiv 1
+\]
+$\Rightarrow$ coefficient functions are: $c=0,\,\underline{b}=0,\,\mathbb{A}={\tiny\begin{pmatrix}1 & 0\\0 & 1\end{pmatrix}}\equiv 1$.
+
+Weak formulation:} Find $u\in V_0$ , s.t. \only<2->{$\langle \nabla u, \nabla\theta\rangle_\Omega = \langle f, \theta\rangle_\Omega,\;\forall \theta\in V_0$.}
+\only<1>{\[\langle \nabla u, \nabla\theta\rangle_\Omega = \langle f, \theta\rangle_\Omega,\;\forall \theta\in V_0.\]}
+\begin{itemize}
+\item<2-> \alert<2>{Problem definition}
+\begin{codebox}
+ProblemStat prob("poisson");\\
+prob.initialize(INIT\_ALL); {\color{gray}// init FeSpace, Mesh, ...}
+\end{codebox}
+
+\item<3-> \alert<3>{Operator definition}
+\begin{codebox}
+Operator opL( prob.getFeSpace(), prob.getFeSpace() );\\
+addSOT( opL, 1.0 );  {\color{gray}// $\langle \nabla u, \nabla\theta\rangle_\Omega,\;\mathbb{A}=1.0$}\\
+Operator opF( prob.getFeSpace() ); \\
+addZOT( opF, 1.0 );  {\color{gray}// $\langle f, \theta\rangle_\Omega,\;f = 1.0$}
+\end{codebox}
+
+\item<4-> \alert<4>{Add Operators to Problem}
+\begin{codebox}
+prob.addMatrixOperator( opL, 0, 0 );
+prob.addVectorOperator( opF, 0 );
+\end{codebox}
+
+\item<5-> \alert<5>{Define boundary conditions}
+\begin{codebox}
+prob.addDirichletBC( nr, 0, 0, new Constant(0.0) );
+\end{codebox}
+where \texttt{nr} is a boundary number and \texttt{Constant} a predefined functor, that returns always 0.
+\end{itemize}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}\frametitle{Assemble and solve equation}
+In order to solve the PDE system: assemble matrix, solve linear system:
+\begin{itemize}
+\item Store Informations about solution process:
+\begin{codebox}
+AdaptInfo adaptInfo("adapt");
+\end{codebox}
+
+\item Assemble and solve system:
+\begin{codebox}
+prob.assemble(\&adaptInfo);\\
+prob.solve(\&adaptInfo);
+\end{codebox}
+
+\item Write solution to file:
+\begin{codebox}
+prob.writeFiles(\&adaptInfo, true);
+\end{codebox}
+\end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]
+\begin{lstlisting}
+  // create and init the scalar problem
+  ProblemStat prob("poisson");
+  prob.initialize(INIT_ALL);
+
+  // define operators
+  Operator opLaplace(prob.getFeSpace(), prob.getFeSpace());
+    addSOT(opLaplace, 1.0); // <grad(u), grad(theta)>
+  Operator opF(prob.getFeSpace());
+    addZOT(opF, 1.0); // <f(x), theta>
+  
+  // add operators to problem
+  prob.addMatrixOperator(opLaplace, 0, 0);
+  prob.addVectorOperator(opF, 0);
+
+  // add boundary conditions
+  BoundaryType nr = 1;
+  prob.addDirichletBC(nr, 0, 0, new Constant(0.0));
+
+  AdaptInfo adaptInfo("adapt");
+  
+  // assemble and solve linear system
+  prob.assemble(&adaptInfo);
+  prob.solve(&adaptInfo);
+  
+  prob.writeFiles(&adaptInfo, true);
+\end{lstlisting}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}\frametitle{Compile and run AMDiS programs}
+\begin{itemize}
+\item CMake configuration:
+\begin{codebox}
+project("workshop")\\
+find\_package(AMDIS REQUIRED)\\
+if (AMDIS\_FOUND)\\
+$~~~~$include(\${AMDIS\_USE\_FILE})\\
+endif (AMDIS\_FOUND)\\
+\\
+add\_executable("poisson1" src/poisson1.cc)\\
+target\_link\_libraries("poisson1" \${AMDIS\_LIBRARIES})
+\end{codebox}
+\begin{itemize}
+  \item CMake requires variable \texttt{AMDIS\_DIR} to point to directory, that
+contains the file \texttt{AMDISConfig.cmake}
+
+  \item See \href{http://www.cmake.org/cmake/help/v3.0}{\texttt{http://goo.gl/kVe0Z2}} for documentation of cmake commands.
+\end{itemize}
+\item Run an AMDiS program by
+\begin{codebox}
+./executable INIT-FILE
+\end{codebox}
+\end{itemize}
+\end{frame}
+
+% ------------------------------------------------------------------------------
+\subsection{The Parameter file}
+\begin{frame}\frametitle{The Parameter file}
+A parameter file (init-file) controls various parameters of the solution process,
+defines the FiniteElemSpace and sets the mesh and is mandatory.
+\begin{itemize}
+\item<1-> Init-files have the suffix \texttt{.dat.Xd}, where \texttt{X} is in $\{1,2,3\}$. 
+
+\item<2-> Parameter definition:
+\begin{codebox}
+parameter\_name: parameter\_value\quad\kommentar{a comment}
+\end{codebox}\begin{itemize}
+  \item The '\texttt{:}' sign is the delimiter between parameter name and value
+  \item The '\texttt{\%}' sign indicates a starting comment
+  \end{itemize}
+
+\item<3-> Read a parameter from init-file:
+\begin{codebox}
+value\_type value = value0;\\
+Parameters::get("parameter\_name", value);
+\end{codebox}\begin{itemize}
+  \item value0 is default, if parameter not found
+  \item value\_type can be number, vector, string
+  \item arithmetic expressions are parsed, interpreted and cast to value\_type
+  \end{itemize}
+\end{itemize}
+{\tiny The Initfile manual: \url{https://goo.gl/Dhm9Bx}}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}\frametitle{The Parameter file}
+\begin{codebox}\small
+dimension of world: 2\\
+\\
+mesh->macro file name:    ./macro/macro1.2d\\
+mesh->global refinements: 10\\
+\\
+poisson->mesh:       mesh\\
+poisson->dim:        2\\
+poisson->components: 1\\
+poisson->feSpace[0]: P1\\
+poisson->name[0]:    u\\
+\\
+poisson->solver:                 cg\\
+poisson->solver->max iteration:  1000\\
+poisson->solver->tolerance:      1.e-8\\
+poisson->solver->left precon:    diag\\
+\\
+poisson->output->filename:        ./output/poisson1.2d\\
+poisson->output->ParaView format: 1\\
+\end{codebox}
+\end{frame}
+
+% ------------------------------------------------------------------------------
+\subsection{The Macro-Mesh}
+\begin{frame}\frametitle{The Macro-Mesh}
+In AMDiS the geometry and coarse triangulation is called \texttt{Macro-Mesh}
+\begin{columns}\begin{column}{.55\textwidth}
+\only<1>{\begin{block}{Header}
+\texttt{DIM: 2}\\
+\texttt{DIM\_OF\_WORLD: 2}\\
+\texttt{number of elements: 4}\\
+\texttt{number of vertices: 5}
+\end{block}}
+\only<2>{\begin{block}{Mesh description}
+\texttt{element vertices:}\\
+\texttt{0 1 4}\\
+\texttt{1 2 4...}\\
+\texttt{element boundaries:}\\
+\texttt{0 0 1}\\
+\texttt{0 0 1...}\\
+\texttt{vertex coordinates:}\\
+\texttt{0.0 0.0}\\
+\texttt{1.0 0.0...}
+\end{block}}
+\end{column}\begin{column}{.45\textwidth}
+\includegraphics[width=\textwidth]{images/ellipt_macro}
+\end{column}\end{columns}
+ASCII-File, that describes dimension of the elements (\texttt{DIM}), dimension of the world (\texttt{DIM\_OF\_WORLD}), the vertex coordinates, element connectivity, element boundary numbers and a neighborship relation.
+\end{frame}
+
+
+% ..............................................................................
+\begin{frame}\frametitle{Visualization}
+Plot Solution (.vtu file), using ParaView
+\begin{center}
+\includegraphics[width=.9\linewidth]{images/paraview}
+\end{center}
+\end{frame}
+
+
+% ==============================================================================
+\section{Exercises}
+\subsection{Exercise1: Poisson equation}
+\begin{frame}\frametitle{Exercise1: Poisson equation}
+We want to solve the Poisson equation
+\[
+-\Delta u = f(x)\quad\text{ in }\Omega,
+\]
+and (in)homogeneous Dirichlet boundary conditions on $\partial\Omega$.
+
+\begin{enumerate}
+\item Setup the CMake configuration:
+\begin{codebox}
+> mkdir build\\
+> cd build\\
+> cmake .. 
+\end{codebox}
+
+\item Compile and run the example code \texttt{exercise1.cc}
+\begin{codebox}
+> make exercise1\\
+> cd ..\\
+> build/exercise1 init/exercise1.dat.2d
+\end{codebox}
+
+\item Visualize the file \texttt{exercise1.2d.vtu} created in directory \texttt{output}
+with the program \texttt{ParaView}.
+
+\item What is the concrete expression for $f$ and dirichlet value $g$?
+\end{enumerate}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}\frametitle{Advanced Exercise1: modify the Poisson equation}
+\begin{enumerate}
+\item Change the expression for $f$ and $g$.
+
+\item Modify the parameters in the init-file \texttt{exercise1.dat.2d}, e.g.\begin{itemize}
+  \item Change the nr. of global refinements
+  \item Set a different Finite-Element space
+  \item Use another linear solver
+\end{itemize}
+See also AMDiS-Wiki/Initfile: \url{https://goo.gl/Dhm9Bx}
+
+What parameters can be changed, and where do you get an error, or a crash of the program?
+
+\item Solve the same equation in 1d or 3d, by changing the mesh, dimension of world 
+and problem dimension in the init-file.
+
+\item Modify the macro-mesh, e.g. \begin{itemize}
+  \item change the boundary nr for the right edge
+  \item change the coordinates of the vertices
+  \end{itemize}
+\end{enumerate}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}[fragile]\frametitle{Some hints}
+\begin{enumerate}
+\item Used functions/classes:
+\begin{lstlisting}
+addSOT(Operator, EXPRESSION);
+addZOT(Operator, EXPRESSION);
+// Functor class with return-type double and 
+// argument-type WorldVector<double>:
+AbstractFunction<double, WorldVector<double>>; 
+\end{lstlisting}
+
+\item Parameters to modify:
+\begin{codebox}
+mesh->global refinements: INTEGER\\
+poisson->feSpace[0]: \{P1, P2, P3, P4, P1+bubble\}\\
+poisson->solver: \{cg, gmres, direct, ...\}
+\end{codebox}
+
+\item Sources for help:\begin{itemize}
+  \item AMDiS-Wiki: \url{https://goo.gl/Jy3u1u}
+  \item Init-file manual: \url{https://goo.gl/Dhm9Bx}
+  \item Expressions manual: \url{https://goo.gl/JK8EUI}
+  \item List of init-file parameters: \url{https://goo.gl/LWJzq9}
+  \end{itemize}
+\end{enumerate}
+\end{frame}
diff --git a/doc/workshop/seminar2.tex b/doc/workshop/seminar2.tex
new file mode 100644
index 0000000000000000000000000000000000000000..635141ba3287b7bbfa977398066d712d1a8ac4a5
--- /dev/null
+++ b/doc/workshop/seminar2.tex
@@ -0,0 +1,262 @@
+\begin{frame}
+\begin{center}
+{\Huge Session 2}
+\end{center}
+\end{frame}
+
+% ==============================================================================
+\section{Processing the data}
+\begin{frame}[plain]\frametitle{Processing the data}
+\begin{center}
+Extract maxima of solution\\
+\includegraphics[width=.3\linewidth]{images/ball500}
+\includegraphics[width=.3\linewidth]{images/pfc_sphere}\\
+Calculate integrals\\
+\includegraphics[width=.4\linewidth]{images/energy}
+\end{center}
+\end{frame}
+
+
+\subsection{Working with the discrete solution}
+\begin{frame}\frametitle{Working with the discrete solution}
+Finite-Element function $u_h$ expressed as linear combination of basis-functions $\phi_i$:
+\[
+u_h(x) = \sum_i u_i \phi_i(x),
+\]
+with $u_i:=$ Degrees of Freedom, stored in \texttt{DOFVector$<$value\_type$>$ U}:
+\begin{itemize}
+\item Evaluate at DOF index: \texttt{U[idx]}
+\item Iterate over all DOFs:
+\begin{codebox}
+DOFIterator<value\_type> it(\&U [, USED\_DOFS]);\\
+for (it.reset(); !it.end(); ++it)\\
+$~~~~$*it = value; {\color{grau}// idx = it.getDOFIndex()}
+\end{codebox}
+
+\item<2> Evaluate DOFVector at coordinate $x$:
+\begin{codebox}
+WorldVector<double> x; \\
+x[0] = 0.2; x[1] = 0.3;\\
+value\_type value = U(x);
+\end{codebox}
+\end{itemize}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}\frametitle{Fill a DOFVector}
+\begin{codebox}
+U << EXPRESSION;
+\end{codebox}
+where \texttt{EXPRESSION} can contain e.g.\begin{itemize}
+  \item The coordinates: \texttt{X()}, \texttt{X(i)}
+  \item Scalar values: \texttt{1.0}, \texttt{constant(1.0)}
+  \item Matrix and vector expressions: \texttt{two\_norm(...)}, \texttt{vec * vec}
+  \item Other DOFVectors: \texttt{valueOf(V)}, \texttt{gradientOf(V)}
+  \end{itemize}
+{\tiny Expressions manual: \url{https://goo.gl/JK8EUI}}
+  
+\textbf{Example:} Let $C$ and $U$ be of type DOFVector$<$double$>$:
+\[
+U\only<2>{\alert{(x)}} := \frac{1}{2}\left(C\only<2>{\alert{(x)}}^2\,(1-C\only<2>{\alert{(x)}})^2 + \frac{1}{\epsilon}\|\nabla C\only<2>{\alert{(x)}}\|^2\right)
+\]
+Assign expression on rhs to DOFVector $U$:
+\begin{codebox}
+U << 0.5*( pow<2>(valueOf(C) * (1.0 - valueOf(C))\\
+$~~~~~~~~~~$+ (1.0/eps) * unary\_dot(gradientOf(C)) );
+\end{codebox}
+\end{frame}
+% ..............................................................................
+\begin{frame}\frametitle{Working with the discrete solution}
+\begin{itemize}
+\item Reduce the DOFVector, i.e. calc integrals, norms:
+\begin{codebox}
+integrate( EXPRESSION [, Mesh*] )
+\end{codebox}
+\begin{codebox}
+integrate( valueOf(U) ); $\Rightarrow\int_\Omega u\,\text{d}x$ \\
+integrate( two\_norm(gradientOf(U)) ); $\Rightarrow\int_\Omega \|\nabla u\|_2\,\text{d}x$ \\
+integrate(pow<2>(valueOf(U)) + unary\_dot(gradientOf(U))); $\Rightarrow\|u\|^2_{H^1(\Omega)}$ \\
+\end{codebox}
+
+\item Other reduction operations (over DOFs):\begin{itemize}
+  \item \texttt{max( EXPRESSION )} $\Rightarrow\max\{ expr(x_i)\,:\, x_i\in\Omega \}$
+  \item \texttt{min( EXPRESSION )} $\Rightarrow\min\{ expr(x_i)\,:\, x_i\in\Omega \}$
+  \item \texttt{abs\_max( EXPRESSION )} $\Rightarrow\max\{ |expr(x_i)|\,:\, x_i\in\Omega \}$
+  \item \texttt{abs\_min( EXPRESSION )} $\Rightarrow\min\{ |expr(x_i)|\,:\, x_i\in\Omega \}$
+  \end{itemize}
+\end{itemize}
+\end{frame}
+
+% ------------------------------------------------------------------------------
+\subsection{Working with the mesh}
+\begin{frame}[plain]\frametitle{Working with the mesh}
+\begin{center}
+\includegraphics[width=.3\linewidth]{images/ellipt_macro}
+\includegraphics[width=.3\linewidth]{images/torus_macro}\\
+Change position of mesh vertices:\\
+\includegraphics[width=.7\linewidth]{images/Fsi}
+\end{center}
+\end{frame}
+
+\begin{frame}\frametitle{Working with the mesh}
+A Mesh holds all information about a triangulation. Get the mesh from \texttt{ProblemStat}:
+\begin{codebox}
+Mesh\& mesh = *prob.getMesh();
+\end{codebox}
+\begin{itemize}
+\item Number of vertices: \texttt{mesh.getNumberOfVertices()}
+\item Number of triangles (elements): \texttt{mesh.getNumberOfElements()}
+\item World coordinates are stored in \texttt{WorldVector$<$double$>$}.
+\item Get the coordinates of all DOFs:
+\begin{codebox}
+DOFVector<WorldVector<double> >\\$~~~~$Coords(prob.getFeSpace(), "coords");
+mesh.getDofCoords(Coords);
+\end{codebox}
+\item Change coordinates of the mesh:
+\begin{codebox}
+ParametricSimple parametric(Coords);
+mesh.setParametric(\&parametric);
+\end{codebox}
+\end{itemize}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}[fragile]\frametitle{Working with the mesh: }
+\begin{itemize}
+\item (Advanced) Traverse the mesh element-wise:
+\begin{lstlisting}
+Flag traverseFlag = Mesh::CALL_LEAF_EL | (FILL_FLAGS);
+TraverseStack stack;
+ElInfo *elInfo = stack.traverseFirst(&mesh, -1, traverseFlag);
+while (elInfo) {
+  // do something with elInfo
+  elInfo = stack.traverseNext(elInfo);
+}
+\end{lstlisting}
+
+\item (Advanced) Global Refinement of the mesh: Use \texttt{RefinementManager}
+\begin{lstlisting}
+RefinementManager* refManager = prob.getRefinementManager();
+
+Flag f = refManager->globalRefine(&mesh, 5);
+if (f == MESH_REFINED) {
+  MSG("Mesh globally refined by 5 levels!\n");
+}
+\end{lstlisting}
+\end{itemize}
+\end{frame}
+
+
+% ..............................................................................
+\begin{frame}[fragile]\frametitle{Example: Print solution with coordinates}
+Writing out the solution to the screen:
+\begin{lstlisting}
+DOFVector<WorldVector<double>> C(U.getFeSpace(), "c");
+mesh.getDofCoords(C);
+
+DOFIterator<double> it(U);
+DOFIterator<WorldVector<double>> c_it(C);
+for (it.reset(),c_it.reset();  !it.end();  ++it,++c_it)
+  std::cout << "U(" << *c_it << ") = " << *it << "\n";
+\end{lstlisting}
+This will print out:
+{\scriptsize\begin{codebox}
+U(0 0) = 0\\
+U(1 0) = 0\\
+U(1 1) = 0\\
+U(0 1) = 0\\
+U(0.5 0.5) = 0.0833333
+\end{codebox}}
+\end{frame}
+
+
+% ------------------------------------------------------------------------------
+\subsection{Input/Output}
+\begin{frame}\frametitle{Input/Output}
+Write DOFVectors to file, for visualization, serialization, ...
+\begin{itemize}
+\item File writer with automatic file-type detection:
+\begin{codebox}
+io::writeFile(DOFVECTOR, FILENAME);
+\end{codebox}
+Detection by filename extension: ".vtu", ".arh", ".dat", ".2d", ".gnu",...
+\item Use \textbf{ParaView} for visualization
+\item Tool \textbf{MeshConv} can convert beween mesh formats
+
+\item File reader with automatic file-type detection:
+\begin{codebox}
+io::readFile(FILENAME, DOFVECTOR);
+\end{codebox}
+\item Use ARH format to exchange data (can be converted to VTU by MeshConv.)
+\end{itemize}
+\end{frame}
+
+
+
+
+% ==============================================================================
+\section{Exercises}
+\subsection{Exercise2: Poisson equation}
+\begin{frame}\frametitle{Exercise2: Poisson equation}
+We want to solve the Poisson equation
+\[
+-\Delta u = f(x)\quad\text{ in }\Omega,\quad u|_{\partial\Omega} = g
+\]
+in a rectangular domain $\Omega$, with 
+\[\begin{split}
+f(x) &= 40(1 - 10\|x\|^2)e^{-10.0\|x\|^2}\\
+g(x) &:= e^{-10.0\|x\|^2} \\
+\end{split}\]
+and with exact solution $u^\ast=g$.
+\begin{enumerate}
+\item Assemble and solve the equation.
+\item Interpolate error $ERR := |u_h - g|$ to DOFVector and write it to a file.
+\item Calculate the error-norms $\|u_h - g\|_{L_2(\Omega)}$ and $\|u_h - g\|_{H_1(\Omega)}$
+\item Evaluate the error at the grid-point $x=(0.5, 0.5)$.
+\item Refine the mesh globally and compare error-norms to old error-norms.
+\end{enumerate}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}[fragile]\frametitle{Advanced Exercise2: Mesh adaption}
+The datastructure \texttt{AdaptInfo} provides parameters for tolerance and nr. of iterations for an adaption process:
+\begin{lstlisting}
+AdaptInfo adaptInfo("adapt");
+adaptInfo.getMaxSpaceIteration(); // => adapt->max iteration
+adaptInfo.getSpaceTolerance(0);   // => adapt[0]->tolerance
+\end{lstlisting}
+\begin{enumerate}
+\item Use AdaptInfo to write an adaption loop that refines the mesh globally to reduce the error until a tolerance is reached.
+\item Write the error DOFVector in every adaption iteration to a file.
+\item Calculate the exponent in the error estimate $\|u_h - I_h u^\ast\|_\#\leq C h^k$
+\item (optional) Transform the mesh, by $x\mapsto 2x$ and solve again.
+\end{enumerate}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}[fragile]\frametitle{Some hints}
+\begin{enumerate}
+\item Used functions/classes:
+\begin{lstlisting}
+DOFVector << EXPRESSION;
+integrate( EXPRESSION );
+
+// EXPRESSION: {valueOf(U), gradientOf(U), X(), X(i), +,-,*,/,
+//              unary_dot(EXPR.), pow<2>(EXPR.), absolute(EXPR.)}
+
+RefinementManager* refManager = prob.getRefinementManager();
+refManager->globalRefine(prob.getMesh(), NR_OF_REFINEMENTS);
+
+adaptInfo.getSpaceTolerance(0);
+adaptInfo.getMaxSpaceIteration();
+
+io::writeFile( DOFVECTOR, FILENAME );
+\end{lstlisting}
+
+\item Parameters to modify:
+\begin{codebox}
+adapt[0]->tolerance: DOUBLE\\
+adapt->max iteration: INTEGER
+\end{codebox}
+\end{enumerate}
+\end{frame}
\ No newline at end of file
diff --git a/doc/workshop/seminar3.tex b/doc/workshop/seminar3.tex
new file mode 100644
index 0000000000000000000000000000000000000000..de488ab8f13283db5b5409a4fc3cdca10b444a72
--- /dev/null
+++ b/doc/workshop/seminar3.tex
@@ -0,0 +1,299 @@
+\begin{frame}
+\begin{center}
+{\Huge Session 3}
+\end{center}
+\end{frame}
+
+% ==============================================================================
+\section{Adaptivity and systems of equations}
+\subsection{Adaptivity and error estimators}
+\begin{frame}\frametitle{Mesh adaptivity}
+Motivation: \begin{itemize}
+\item Two-phase flow problem
+\item Steep transition between two phases
+\end{itemize}
+\begin{center}
+\begin{tabular}{cc}
+\includegraphics[width=.4\linewidth]{images/capillary_ellipse} &
+\includegraphics[width=.5\linewidth]{images/capillary_ellipse2}
+\end{tabular}
+\end{center}
+\end{frame}
+
+\begin{frame}\frametitle{Adaptivity and error estimators: poisson3.cc}
+\only<1>{\begin{columns}\begin{column}{.6\linewidth}
+Adative solution strategy:
+\begin{itemize}
+\item Refine elements to reduce global error
+\item Local refinement instead of global refinement
+\item Repeated solution with adapted mesh:
+\end{itemize}\end{column}\begin{column}{.4\linewidth}
+\begin{center}
+\includegraphics[width=\textwidth]{images/bisection}
+\end{center}
+\end{column}\end{columns}}
+\begin{center}
+\includegraphics[width=.75\linewidth]{images/adaption-loop}
+\end{center}
+
+\only<2-3>{\begin{codebox}\only<2>{\scriptsize}\only<3>{\tiny}
+prob.assemble(\&adaptInfo);\\
+prob.solve(\&adaptInfo);\\
+prob.estimate(\&adaptInfo); {\color{gray}// local error indicator}\\
+\\
+Flag adapted;\\
+for (int i = 0; i < MAX\_ITER; ++i) \\
+\{\\
+$~~~~$if (adaptInfo.getEstSum(0) < TOL)\\
+$~~~~~~~~$break;\\
+$~~~~$Flag markFlag = prob.markElements(\&adaptInfo); {\color{gray}// mesh adaption}\\
+$~~~~$adapted = prob.refineMesh(\&adaptInfo);\\
+$~~~~$adapted|= prob.coarsenMesh(\&adaptInfo);\\
+\\
+$~~~~$prob.buildAfterCoarsen(\&adaptInfo, markFlag); {\color{gray}// assemble}\\
+$~~~~$prob.solve(\&adaptInfo);\\
+$~~~~$prob.estimate(\&adaptInfo);\\
+\}\\
+\end{codebox}}
+\only<4>{Encapsulation into class:
+\begin{codebox}
+AdaptStationary adaptStat("adapt", prob, adaptInfo);\\
+adaptStat.adapt(); {\color{gray}// start adaptive solution process}
+\end{codebox}}
+\only<3>{\alert<3>{\begin{center}\only<3>{\huge} Better: \texttt{AdaptStationary}\end{center}}}
+\end{frame}
+
+
+
+% ..............................................................................
+\begin{frame}\frametitle{Adaptivity and error estimators: poisson3.cc}
+Solution strategy:
+$\text{assemble}\rightarrow\text{solve}\rightarrow\alert<2>{\text{estimate}}\rightarrow\alert<3>{\text{mark}}\rightarrow\text{refine/coarsen}$
+\begin{itemize}
+\item<1-> Estimator type can be set in init-file
+\item<2-> e.g. Residual-Estimator: Element error-indicator $\eta_T$:
+\[
+\eta_T := C_0 h_T^2 \|f + \nabla\cdot\mathbb{A}\nabla u_h\|_{L_2(T)} + C_1 \left(\sum_{e\subset T} h_e \left[\left[\mathbb{A}\nabla u_h\cdot\underline{\nu_e}\right]\right]^2\right)^{1/2}
+\]
+\item<2-> e.g. Recovery Estimator:
+\[
+\eta_T := \|\nabla u_h^\ast - \nabla u_h\|_{L_2(T)}
+\]
+\item<3-> Various \textbf{marking strategies}: global refinement, maximum strategy, equidistribution strategy, guaranteed error reduction strategy
+\end{itemize}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}[fragile]\frametitle{Stationary equation with adaptivity}
+Source-code: see "poisson4.cc"
+\begin{lstlisting}
+ProblemStat prob("poisson5");
+prob.initialize(INIT_ALL);
+
+Operator opL( prob.getFeSpace(), prob.getFeSpace() );
+  addSOT( opL, A ); // e.g. A = 1.0
+Operator opF( prob.getFeSpace() );
+  addZOT( opF, f ); // e.g. f = X()*X() + 1
+
+prob.addMatrixOperator( opL, 0, 0 );
+prob.addVectorOperator( opF, 0 );
+
+prob.addDirichletBC( nr, 0, 0, new G );
+
+AdaptInfo adaptInfo("adapt");
+AdaptStationary("adapt", prob, adaptInfo).adapt();
+
+prob.writeFiles(&adaptInfo, true);
+\end{lstlisting}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}[fragile]\frametitle{Stationary equation with adaptivity}
+Init-file: see "poisson4.dat.2d"
+\begin{lstlisting}
+poisson->estimator[0]: residual % or recovery
+poisson->estimator[0]->C0: 0.1 % weight of element residual
+poisson->estimator[0]->C1: 0.1 % weight of jump residual
+
+poisson->marker[0]->strategy: 2 
+% 1... global refinement
+% 2... maximum strategy
+% 3... equidistribution strategy
+% 4... guaranteed error reduction strategy
+
+adapt[0]->tolerance: 1e-4
+adapt->max iteration: 5
+\end{lstlisting}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}\frametitle{Stationary equation with adaptivity}
+Visualization of the locally refined grid:
+\begin{center}
+\begin{tabular}{ccc}
+\includegraphics[width=.30\linewidth]{images/local_refinement_0} &
+\includegraphics[width=.30\linewidth]{images/local_refinement_3} &
+\includegraphics[width=.30\linewidth]{images/local_refinement_4} \\
+\includegraphics[width=.30\linewidth]{images/local_refinement_5} &
+\includegraphics[width=.30\linewidth]{images/local_refinement_6} &
+\includegraphics[width=.30\linewidth]{images/local_refinement_10}
+\end{tabular}
+\end{center}
+\end{frame}
+
+% ------------------------------------------------------------------------------
+\subsection{System of equations}
+
+\begin{frame}
+\begin{center}
+{\Huge Lesson 3b}
+\end{center}
+\end{frame}
+
+\begin{frame}[plain]\frametitle{System of equations}
+Motivation:\begin{itemize}
+\item Navier-Stokes equations
+\item Phase-Field (Crystal) equation
+\item Willmore flow
+\end{itemize}
+\begin{center}
+\includegraphics[height=.3\textheight]{images/120particle_f3}\hspace{0.1cm}
+\includegraphics[height=.3\textheight]{images/rho_big}\hspace{0.1cm}
+\includegraphics[height=.3\textheight]{images/cell}
+\end{center}
+\end{frame}
+
+\begin{frame}\frametitle{Example: Biharmonic equation}
+We consider the stream-function formulation for the Stokes equation (2D):
+\[
+-\nu\Delta^2\psi = f,\quad\text{ in }\Omega,\qquad\big(\mathbf{v} = -\nabla\times\mathbf{e}_z \psi\big)
+\]
+with \alert<3>{$\psi|_{\partial\Omega}=\Delta\psi|_{\partial\Omega} = 0$} and $f=(\nabla\times\mathbf{f})_z$. 
+\only<2->{Reformulated as system of second order equation, we obtain:
+\[\begin{split}
+-\nu\Delta\phi &= f,\quad\text{ in }\Omega \\
+-\Delta\psi + \phi &= 0,\only<3->{\quad\alert<3>{\text{ with }\psi|_{\partial\Omega}=0\text{ and }\phi|_{\partial\Omega} = 0}}
+\end{split}\]
+or in weak form:
+\only<2-3>{\[\begin{split}
+\langle\nu\nabla\phi,\nabla\theta\rangle -\only<2>{\langle\nu\partial_n\phi,\theta\rangle_{\partial\Omega}} \only<3>{\cancel{\langle\nu\partial_n\phi,\theta\rangle_{\partial\Omega}}} &= \langle f, \theta\rangle,\quad\forall\theta\in \only<2>{V}\only<3>{V_{\color{blue}{0}}} \\
+\langle\nabla\psi,\nabla\theta'\rangle -\only<2>{\langle\partial_n\psi,\theta'\rangle_{\partial\Omega}} \only<3>{\cancel{\langle\partial_n\psi,\theta'\rangle_{\partial\Omega}}} + \langle\phi,\theta'\rangle &= 0,\qquad\forall\theta'\in \only<2>{V'}\only<3>{V'_{\alert{0}}}
+\end{split}\]}
+\only<4->{\[\begin{split}
+\overbrace{\langle\nu\nabla\phi,\nabla\theta\rangle}^{\text{\alert<4>{SOT}}\only<5->{\alert<5>{(0,1)}}} &= \overbrace{\langle f, \theta\rangle}^{\text{\alert<4>{ZOT}}\only<5->{\alert<5>{(0)}}},\quad\forall\theta\in V_0 \\
+\underbrace{\langle\nabla\psi,\nabla\theta'\rangle}_{\text{\alert<4>{SOT}}\only<5->{\alert<5>{(1,0)}}} + \underbrace{\langle\phi,\theta'\rangle}_{\text{\alert<4>{ZOT}}\only<5->{\alert<5>{(1,1)}}} &= 0,\qquad\forall\theta'\in V'_0
+\end{split}\]
+}
+with solution components $(\psi\in \only<2>{V}\only<3->{V_{\alert<3>{0}}}, \phi\in \only<2>{V'}\only<3->{V'_{\color<3>{blue}{0}}})$.}
+\end{frame}
+
+
+% ..............................................................................
+\begin{frame}[fragile]\frametitle{The biharmonic equation}
+Source-code: see "biharmonic1.cc"
+\[\begin{split}
+\overbrace{\langle\nu\nabla\phi,\nabla\theta\rangle}^{\text{\texttt{opL\_phi}}} &= \overbrace{\langle f, \theta\rangle}^{\text{\texttt{opF}}}, \\
+\underbrace{\langle\nabla\psi,\nabla\theta'\rangle}_{\text{\texttt{opL\_psi}}} + \underbrace{\langle\phi,\theta'\rangle}_{\text{\texttt{opM\_phi}}} &= 0
+\end{split}\]
+\begin{lstlisting}
+Operator opL_phi(prob.getFeSpace(0), prob.getFeSpace(1));
+  addSOT(opL_phi, nu);
+Operator opF(prob.getFeSpace(0));
+  addZOT(opF, f);
+Operator opL_psi(prob.getFeSpace(1), prob.getFeSpace(0));
+  addSOT(opL_psi, 1.0); 
+Operator opM_phi(prob.getFeSpace(1), prob.getFeSpace(1));
+  addZOT(opM_phi, 1.0);
+
+// ===== add operators to problem =====
+prob.addMatrixOperator(opL_phi, 0, 1);   // -nu*laplace(phi)
+prob.addMatrixOperator(opL_psi, 1, 0);   // -laplace(psi)
+prob.addMatrixOperator(opM_phi, 1, 1);   // phi
+prob.addVectorOperator(opF,     0);      // f(x)
+/// ...
+\end{lstlisting}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}[fragile]\frametitle{The biharmonic equation}
+Source-code: see "biharmonic1.cc"
+\begin{lstlisting}
+/// ...
+BoundaryType nr = 1;
+prob.addDirichletBC(nr, 1, 0, new Constant(0.0));
+prob.addDirichletBC(nr, 0, 1, new Constant(0.0));
+
+AdaptInfo adaptInfo("adapt");
+AdaptStationary("adapt", prob, adaptInfo).adapt();
+
+prob.writeFiles(&adaptInfo, true);
+\end{lstlisting}
+Init-file: see "biharmonic1.dat.2d"
+\begin{lstlisting}
+biharmonic->mesh:       mesh
+biharmonic->components: 2
+biharmonic->feSpace[0]: P1
+biharmonic->feSpace[1]: P1
+biharmonic->dim:        2
+biharmonic->name:       [psi,phi]
+\end{lstlisting}
+\end{frame}
+
+
+% ..............................................................................
+\begin{frame}[fragile]\frametitle{The biharmonic equation}
+Velocity field $\mathbf{v}$ and stream function $\psi$ for $\mathbf{f}=(y, -x)^\top$
+\begin{center}
+\includegraphics[width=.8\linewidth]{images/biharmonic}
+\end{center}
+\end{frame}
+
+% ==============================================================================
+\section{Exercises}
+\subsection{Exercise3: Biharmonic equation}
+\begin{frame}\frametitle{Exercise3: System of equations}
+Implement the 4th order PDE
+\[\begin{split}
+u &- \Delta(u -\epsilon\Delta u) = f(x)\quad\text{ in }\Omega, \\
+\partial_n u|_{\partial\Omega} &= \partial_n(u - \epsilon\Delta u)|_{\partial\Omega} = 0
+\end{split}\]
+in a rectangular domain $\Omega$, with $\epsilon<1$ and $f(x)\in[-1,1]$ (random values).
+\begin{enumerate}
+\item Formulate Splitting of equation in system of equations.
+\item Assemble and solve the system.
+\item Vary the value $\epsilon$ from 1 to $10^{-3}$. Introduce a parameter and read it from init-file. Change the mesh resolution accordingly.
+\end{enumerate}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}\frametitle{Advanced Exercise3: Error estimators}
+\begin{enumerate}
+\item Modify exercise 1 to allow local mesh adaption by an error estimator.
+\item Change the init-file correspondingly, i.e. add an entry for estimator and marker.
+\item Choose a residual estimator/ recovery estimator and vary the estimator parameters
+\item Vary the marking strategies and visualize the effect.
+\end{enumerate}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}[fragile]\frametitle{Some hints}
+\begin{enumerate}
+\item Used functions/classes:
+\begin{lstlisting}
+// functor that returns random values in mean +- amplitude/2
+Random(mean, amplitude); 
+
+EXPRESSION: eval(&functor)
+\end{lstlisting}
+
+\item Parameters to modify:
+\begin{codebox}
+poisson->estimator[0]: residual / recovery
+poisson->marker[0]->strategy: 1/2/3/4
+\end{codebox}
+
+\item References:\begin{itemize}
+  \item ALBERT manual, Section 1.5.2 (marker strategies)
+\end{itemize}
+\end{enumerate}
+\end{frame}
\ No newline at end of file
diff --git a/doc/workshop/seminar4.tex b/doc/workshop/seminar4.tex
new file mode 100644
index 0000000000000000000000000000000000000000..a6033a513022d77638566d39b38dcaf89d46c32f
--- /dev/null
+++ b/doc/workshop/seminar4.tex
@@ -0,0 +1,394 @@
+\begin{frame}
+\begin{center}
+{\Huge Session 4}
+\end{center}
+\end{frame}
+
+% ==============================================================================
+\section{Sequence of stationary problems}
+\subsection{Time-dependent problems}
+
+\begin{frame}\frametitle{Time-dependent problems}
+\begin{center}
+\begin{tabular}{cc}
+\includegraphics[width=.4\linewidth]{images/cell_in_flow} &
+\includegraphics[width=.33\linewidth]{images/slide_3d1} \\
+\includegraphics[width=.33\linewidth]{images/dend3d_04} &
+\includegraphics[width=.33\linewidth]{images/indian_0050}
+\end{tabular}
+\end{center}
+\end{frame}
+
+\begin{frame}\frametitle{Time-dependent problems}
+Consider the instationary heat equation
+\[\begin{split}
+\partial_t u - \alpha\Delta u &= f,\quad\text{ in }\Omega\times(0,T],\\
+\alpha\partial_n u|_{\partial\Omega} &= g
+\end{split}\]
+with $u$: temperature, $\alpha>0$: thermal diffusivity and $f$: heat source.
+\begin{itemize}
+\item<2-> Transform equation in a sequence of stationary equations: Let $0=t_0<t_1<\ldots<t_N=T$ and $\tau_k=t_{k+1}-t_k$, $u_k\equiv u(t_k)$:
+
+For $k=0,1,\ldots,N-1$ find $u_{k+1}\in V$, s.t.
+\only<2>{\[
+\frac{1}{\tau_k} u_{k+1} - \alpha\Delta u_{k+1} = \frac{1}{\tau_k} u_{k} + f(t_{k+1}),\quad\text{ in }\Omega
+\]}
+\only<3>{\begin{multline*}
+\langle\frac{1}{\tau_k} u_{k+1},\theta\rangle + \langle\alpha\nabla u_{k+1},\nabla\theta\rangle \\
+= \langle\frac{1}{\tau_k} u_{k} + f(t_{k+1}), \theta\rangle + \langle g(t_{k+1}),\theta\rangle_{\partial\Omega},\quad\forall \theta\in V
+\end{multline*}}
+\only<4>{\begin{multline*}
+\overbrace{\langle\frac{1}{\tau_k} u_{k+1},\theta\rangle}^{\text{\alert<4>{ZOT}}} + \overbrace{\langle\alpha\nabla u_{k+1},\nabla\theta\rangle}^{\text{\alert<4>{SOT}}} \\
+= \underbrace{\langle\frac{1}{\tau_k} u_{k} + f(t_{k+1}), \theta\rangle}_{\text{\alert<4>{ZOT}}} + \underbrace{\langle g(t_{k+1}),\theta\rangle_{\partial\Omega}}_{\alert<4>{\text{ZOT}_{\partial\Omega}}},\quad\forall \theta\in V
+\end{multline*}}
+\item<4> Coefficients, like $\tau_k, \alpha, f, g$ may change over time.
+\end{itemize}
+\end{frame}
+
+
+\begin{frame}[fragile]\frametitle{Time-dependent problems: heat1.cc}
+Formulate the stationary equation, that is solved in each timestep:
+\begin{lstlisting}
+FiniteElemSpace const* V = prob.getFeSpace(0);
+DOFVector<double>* u =     prob.getSolution(0);
+
+Operator opL(V, V);    
+  addZOT(opL, 1.0/var(tau) );
+  addSOT(opL, A ); // e.g. A = 1.0
+  
+Operator opF(V);       
+  addZOT(opF, valueOf(u)/var(tau) );
+  addZOT(opF, f ); // e.g. f = X()*X() + 1
+  
+Operator opG(V);
+  addZOT(opG, g ); // e.g. g = X(0)+X(1)
+
+prob.addMatrixOperator( opL, 0, 0 );
+prob.addVectorOperator( opF, 0 );
+
+prob.addBoundaryVectorOperator( nr, opG, 0 );  // <g, theta>_B
+\end{lstlisting}
+\only<2>{
+Get timestep width \texttt{tau} from \texttt{AdaptInfo}:
+\begin{codebox}
+{\color{blue}double}* tau = adaptInfo.getTimestepPtr();
+\end{codebox}
+}
+\end{frame}
+
+
+
+\begin{frame}[fragile]\frametitle{Time-dependent problems: heat1.cc}
+Sequence of timesteps:
+\begin{lstlisting}
+// ===== set initial solution =====
+u << constant(0.0); // u(x,t=0) := 0
+
+while (adaptInfo.getTime() < adaptInfo.getEndTime()) {
+  adaptInfo.setTime(adaptInfo.getTime() 
+		    + adaptInfo.getTimestep()); // t += tau
+  
+  // ===== assemble and solve linear system =====
+  prob.assemble(&adaptInfo);
+  prob.solve(&adaptInfo);
+  
+  // ===== write solution to file =======
+  prob.writeFiles(&adaptInfo, false);
+}
+\end{lstlisting}
+\only<2>{\alert<2>{\begin{center}\only<2>{\huge} Better: \texttt{AdaptInstationary}\end{center}}}
+\end{frame}
+
+
+\begin{frame}[fragile]\frametitle{Time-dependent problems: heat2.cc}
+Sequence of timesteps: encapsulation into class:
+\begin{lstlisting}
+ProblemInstat instat("heat", prob);
+instat.initialize(INIT_NOTHING); // init (vector of) old solutions
+
+// start adaptive solution process
+AdaptInstationary("adapt", prob, adaptInfo, instat, adaptInfo)
+  .adapt(); 
+\end{lstlisting}
+\end{frame}
+
+
+
+\begin{frame}\frametitle{Nonlinear problems}
+\begin{itemize}
+\item<1-> Consider the nonlinear Poisson equation
+\[\begin{split}
+L(u,x) := -\Delta u + u^4 - f(x) &= 0,\quad\text{ in }\Omega,\\
+u|_{\partial\Omega} &= 0
+\end{split}\]
+
+\item<2-> Newton-Method: provide Jacobian $J_u L$
+\[
+J_uL(u,x)[\delta u] = -\Delta \delta u + 4u^3\delta u,\quad \delta u|_{\partial\Omega} = 0
+\]
+
+\item<3-> Then we can write the iterative process as
+\[\begin{split}
+J_uL(u_k,x)[\delta u] &= - L(u_k,x),\\
+u_{k+1} &= u_k + \delta u
+\end{split}\]
+for initial solution $u_0$. Inserting Jacobian $J$ and objective fct. $L$:
+\[\begin{split}
+-\Delta \delta u + 4u_k^3\delta u &= \Delta u_k - u_k^4 + f(x) \\
+\delta u|_{\partial\Omega} &= - u_k|_{\partial\Omega}
+\end{split}\]
+\end{itemize}
+\end{frame}
+
+
+\begin{frame}\frametitle{Nonlinear problems}
+In weak form this can be written as
+\[
+\langle \nabla\delta u, \nabla \theta\rangle + \langle 4u_k^3\delta u, \theta\rangle = -\langle\nabla u_k, \nabla \theta\rangle + \langle-u_k^4 + f(x), \theta \rangle
+\]
+Insering $\delta u = u_{k+1} - u_k$ we obtain:
+\begin{codebox}
+Let $u_0 := u0$\\
+FOR $k=0,1,2,\ldots,M-1$\\
+$~~~~$solve: 
+\[
+\langle \nabla u_{k+1}, \nabla \theta\rangle + \langle 4u_k^3 u_{k+1}, \theta\rangle = \langle 3u_k^4 + f(x), \theta \rangle\quad\forall \theta\in V_0,\quad u_{k+1}|_{\partial\Omega} = 0
+\]
+END-FOR\\
+set $u := u_M$
+\end{codebox}
+\end{frame}
+
+
+\begin{frame}[fragile]\frametitle{Nonlinear problems: nonlin1.cc}
+Formulate the stationary equation, that is solved in each iteration:
+\[\langle \nabla u_{k+1}, \nabla \theta\rangle + \langle 4u_k^3 u_{k+1}, \theta\rangle = \langle 3u_k^4 + f(x), \theta \rangle\]
+\begin{lstlisting}
+FiniteElemSpace const* V = prob.getFeSpace(0);
+DOFVector<double>& u_k =  *prob.getSolution(0);
+
+Operator opL(V, V);
+  addSOT(opL, 1.0);
+  addZOT(opL, 4.0 * pow<3>(valueOf(u_k)); 
+prob.addMatrixOperator(opL, 0, 0);
+
+Operator opF(V);
+  addZOT(opF, 3.0 * pow<4>(valueOf(u_k)) + f );
+prob.addVectorOperator(opF, 0);
+
+prob.addDirichletBC(nr, 0, 0, new Constant(0.0));
+...
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]\frametitle{Nonlinear problems: nonlin1.cc}
+Formulate the stationary equation, that is solved in each iteration:
+\begin{lstlisting}
+...
+// ===== start adaption loop =====
+AdaptInfo adaptInfo("adapt");
+AdaptStationary adapt("adapt", prob, adaptInfo);
+
+u_k << INITIAL_SOLUTION;
+for (int k = 0; k < MAX_ITER; k++) {
+  adaptInfo.reset();
+  adapt.adapt();
+}
+\end{lstlisting}
+\only<2>{\alert<2>{\begin{center}\only<2>{\huge} Better: \texttt{ProblemNonlin}\end{center}}}
+\end{frame}
+
+\begin{frame}[fragile]\frametitle{Nonlinear problems: nonlin2.cc}
+\begin{itemize}
+\item Implement Newton-formulation directly:
+\[
+J_uL(u_k,x)[\delta u] = - L(u_k,x)
+\]
+\item Iterative process implemented/ controlled by \texttt{ProblemNonlin}:
+\end{itemize}
+\begin{lstlisting}
+ProblemNonLin prob("nonlin");
+prob.initialize(INIT_ALL);
+
+FiniteElemSpace const* V = prob.getFeSpace(0);
+DOFVector<double>& u_k =  *prob.getSolution(0);
+...
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]\frametitle{Nonlinear problems: nonlin2.cc}
+\[
+-\Delta \delta u + 4u_k^3\delta u = \Delta u_k - u_k^4 + f(x)
+\]
+\begin{lstlisting}
+...
+// J_u L(u_k)[du]
+Operator opJL(V, V);
+  addSOT(opJL, 1.0);
+  addZOT(opJL, 4.0 * pow<3>(valueOf(u_k)) ); 
+prob.addMatrixOperator(opJL, 0, 0);
+
+// -L(u_k)
+Operator opL(V);
+  addSOT(opL, -1.0);
+opL.setUhOld(&u_k); // apply operator to DOFVector u_k
+prob.addVectorOperator(opL, 0);
+
+Operator opF(V);
+  addZOT(opF, -pow<4>(valueOf(u_k)) + f );
+prob.addVectorOperator(opF, 0);
+
+prob.addDirichletBC(nr, 0, 0, new Constant(0.0));
+...
+\end{lstlisting}
+\end{frame}
+
+
+\begin{frame}[fragile]\frametitle{Nonlinear problems: nonlin2.cc}
+\[
+-\Delta \delta u + 4u_k^3\delta u = \Delta u_k - u_k^4 + f(x)
+\]
+\begin{lstlisting}
+...
+// ===== start adaption loop =====
+AdaptInfo adaptInfo("adapt");
+
+u_k << INITIAL_SOLUTION;
+prob.solve();
+\end{lstlisting}
+
+Initfile:
+\begin{codebox}
+nonlin->nonlin solver: newton {\color{gray}\% newtonArmijo}\\
+nonlin->nonlin solver->build cycle: 1\\
+nonlin->nonlin solver->tolerance: 1e-3\\
+nonlin->nonlin solver->max iteration: 100\\
+...
+\end{codebox}
+\end{frame}
+
+
+\begin{frame}[fragile]\frametitle{(Experimental) Nonlinear problems: nonlin3.cc}
+\[
+L(u,x) := -\Delta u + u^4 - f(x)
+\]
+Use symbolic differentiation in Jacobian:
+\begin{lstlisting}
+// class acts as name for the unknown:
+struct _U_;
+...
+auto coeff = pow<4>(valueOf<_U_>(u_k)) - f;
+  
+// J_u L(u_k)[du]
+Operator opJL(V, V);
+  addSOT(opJL, 1.0);
+  addZOT(opJL, diff<_U_>(coeff) ); 
+prob.addMatrixOperator(opJL, 0, 0);
+
+// -L(u_k)
+Operator opL(V); opL.setUhOld(&u_k);
+  addSOT(opL, -1.0);
+prob.addVectorOperator(opL, 0);
+
+Operator opF(V);
+  addZOT(opF, -coeff );
+prob.addVectorOperator(opF, 0);
+...
+\end{lstlisting}
+\end{frame}
+
+
+\begin{frame}[fragile]\frametitle{(Experimental) Nonlinear problems: nonlin3.cc}
+\[
+L(u,x) := -\Delta u + u^4 - f(x)
+\]
+Use symbolic differentiation in Jacobian:
+\begin{lstlisting}
+// class acts as name for the unknown:
+struct _U_;
+...
+auto coeff = pow<4>(valueOf<_U_>(u_k)) - f;
+
+std::cout << coeff << "\n"; 
+std::cout << diff<_U_>(coeff) << "\n"; 
+std::cout << diff<2, _U_>(coeff) << " --> " 
+	  << simplify(diff<2, _U_>(coeff)) << "\n"; 
+\end{lstlisting}
+
+This prints:
+\begin{codebox}
+(pow<4>(value(u)) - F(X))\\
+([4] * pow<3>(value(u)))\\
+([0] + ([12] * pow<2>(value(u)))) --> \\
+$~~~~$([12] * pow<2>(value(u)))
+\end{codebox}
+\end{frame}
+
+% ==============================================================================
+\section{Exercises}
+\subsection{Exercise4: Navier-Stokes equations}
+\begin{frame}\frametitle{Exercise4: Navier-Stokes equations}
+Implement the 2d Navier-Stokes equations
+\[\begin{split}
+\partial_t u_i + (\mathbf{u}\cdot\nabla)u_i &= \nu\Delta u_i - \partial_i p,\quad i=1,2 \\
+\nabla\cdot\mathbf{u} &= 0
+\end{split}\]
+in a rectangular domain $\Omega=[0,10]\times[0,1]$ with boundary conditions
+\[\begin{split}
+\mathbf{u}|_{\Gamma_3} &= \mathbf{u}|_{\Gamma_4} = \mathbf{u}|_{\Gamma_5} = 0, \\
+\mathbf{u}(x_0,x_1)|_{\Gamma_1} &= \big(4 u^\infty x_1(1-x_1), 0\big)^\top\\
+\nu\partial_n\mathbf{u} &= \mathbf{n}p,\quad\text{ at }\Gamma_2
+\end{split}\]
+with $\mathbf{n}$ the outer domain normal.
+\begin{center}
+% \setlength{\unitlength}{5cm}
+\setlength{\unitlength}{.8\linewidth}
+\input{images/kanal.tex}
+\end{center}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}\frametitle{Exercise4: Navier-Stokes equations}
+\begin{enumerate}
+\item Implement a simple semi-implicit backward Euler time-discretization
+\item Linearize the non-linear term: $(\mathbf{u}\cdot\nabla)u_i\;\rightarrow\;(\mathbf{u}^\text{old}\cdot\nabla)u_i$
+\item Take the macro-mesh \texttt{kanal.2d} from the macro directory.
+\item Choose $\nu=1, u^\infty=1$ and solve for time $t\in[0,10]$ with timestep $\tau=0.1$.
+\end{enumerate}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}\frametitle{Advanced Exercise4: Navier-Stokes equations}
+\begin{enumerate}
+\item Vary the parameters $\nu, u^\infty$ and timestep $\tau$, gridwidth $h$ to see the karman vortex structures.
+\item Change the mesh to \texttt{kanal2.2d} and modify the boundary condition accordingly.
+\item Instead of a simple linearization, use a Newton-method to solve the non-linearity.
+\item Implement a higher-order time-discretization. Remark: Use the \texttt{old\_solution} from \texttt{ProblemInstat}
+\end{enumerate}
+\end{frame}
+
+% ..............................................................................
+\begin{frame}[fragile]\frametitle{Some hints}
+\begin{enumerate}
+\item Used functions/classes:
+\begin{lstlisting}
+int dow = Global::getGeo(WORLD); // dimension of world
+
+// AdaptInfo needs to know the nr. of components
+AdaptInfo adaptInfo("adapt", prob.getNumComponents());
+
+// partial derivative: 
+addFOT(OPERATOR, EXPR, i, GRD_PHI); // < EXPR d_i(u), theta >
+addFOT(OPERATOR, EXPR, i, GRD_PSI); // < EXPR*u, d_i(theta) >
+\end{lstlisting}
+
+\item Parameters for Taylor-Hood element:
+\begin{codebox}
+ns->components: 3\\
+ns->feSpace[0]: P2\\
+ns->feSpace[1]: P2\\
+ns->feSpace[2]: P1\\
+ns->name: [u0, u1, p]
+\end{codebox}
+\end{enumerate}
+\end{frame}
\ No newline at end of file
diff --git a/doc/workshop/workshop.pdf b/doc/workshop/workshop.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f46f0011f31fb231aa0d680e3bf1b1f2a4c09d25
Binary files /dev/null and b/doc/workshop/workshop.pdf differ
diff --git a/doc/workshop/workshop.tex b/doc/workshop/workshop.tex
new file mode 100644
index 0000000000000000000000000000000000000000..8765c696735b1b2891e4ff05068e9554f05fbfe9
--- /dev/null
+++ b/doc/workshop/workshop.tex
@@ -0,0 +1,150 @@
+\documentclass[utf8]{beamer}
+\usepackage{ucs}
+\usepackage{amsmath}
+\usepackage{amssymb}
+%\usepackage[dvips,final]{graphicx}
+\usepackage{array}
+\usepackage{ucs}
+\usepackage{amsthm}
+\usepackage{amsfonts}
+\usepackage{calc}
+\usepackage{cancel}
+\usepackage{relsize}
+\usepackage{multirow}
+\usepackage{soul}
+\usepackage{cancel}
+\usepackage{listings}
+
+\usepackage{xparse}
+\usepackage{tikz}
+\usetikzlibrary{calc}
+
+% Fuer Handout
+% \usepackage{pgfpages}
+% \pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm,landscape]
+% \usecolortheme{dove}
+
+% Fuer Beamerpraesentation
+\usetheme{Boadilla}
+\usepackage{multimedia} 
+\usepackage[absolute,overlay]{textpos}
+  \setlength{\TPHorizModule}{1mm}
+  \setlength{\TPVertModule}{1mm}
+
+% \usecolortheme{seahorse}
+
+\setbeamercovered{transparent}
+\newtheorem*{bemerkung}{Bemerkung}
+%\theoremstyle{definition}
+%\newtheorem*{definition}{Definition}
+
+\definecolor{DarkGreen}{rgb}{0,0.5,0}
+\definecolor{LightGray}{gray}{.80}
+\newcommand{\begriff}[1]{\textit{#1}\index{#1}}
+\renewcommand{\thefootnote}{}
+
+\newcommand{\haekchen}{{\Large\color{DarkGreen}$\;\checkmark$}}
+
+\tikzstyle{nosep}=[inner sep=0pt, outer sep=0pt]
+\newcommand{\hcancel}[1]{%
+    \tikz[baseline=(tocancel.base)]{
+        \node[nosep] (tocancel) {#1};
+        \node[nosep, yshift=.5ex]  (from) at (tocancel.south west) {};
+        \node[nosep, yshift=-.5ex] (to)   at (tocancel.north east) {};
+        \draw[red] (from) -- (to);
+    }%
+}%
+
+% colors
+\definecolor{light-gray}{gray}{0.9}
+\definecolor{dark-gray}{gray}{0.3}
+\definecolor{hellgrau}{rgb}{0.9, 0.9, 0.9} 
+\definecolor{dunkelgruen}{rgb}{0, 0.5, 0.0} 
+\definecolor{grau}{rgb}{0.4, 0.4, 0.4} 
+\definecolor{dunkelblau}{rgb}{0.3, 0.3, 0.5} 
+
+\lstset{language=C++,
+        basicstyle=\scriptsize\ttfamily,
+        backgroundcolor=\color{light-gray},
+        keywordstyle=\color{blue}\ttfamily,
+        directivestyle=\color{dunkelgruen}\bfseries\ttfamily,
+        stringstyle=\color{red}\ttfamily,
+        commentstyle=\color{grau}\ttfamily,
+        morecomment=[l][\color{dunkelblau}]{///},
+        morecomment=[l][\color{dunkelblau}]{\%},
+        morecomment=[s][\color{dunkelblau}]{/**}{*/},
+        morecomment=[s][\color{dunkelblau}]{/*!}{*/},
+        frame=none,
+        numbers=none,
+        showspaces=false,
+        showstringspaces=false,
+}
+
+\newsavebox{\mybox}
+\newenvironment{codebox}
+{\newcommand\colboxcolor{light-gray}%
+	\vspace{-0.5cm}\begin{lrbox}{\mybox}%
+	\begin{minipage}{\linewidth}
+\ttfamily }
+{\end{minipage}\end{lrbox}%
+\begin{center}
+  	\colorbox{\colboxcolor}{\usebox{\mybox}}
+\end{center}}
+
+
+\newcommand{\kommentar}[1]{\textit{\textcolor{dark-gray}{\% #1}}}
+
+
+% ==============================================================================
+
+\title[AMDiS]{AMDiS -- Adaptive Multi-Dimensional Simulations}
+\subtitle{\small Eine Einführung in das FEM-Framework}
+\author[Simon Praetorius]{Simon Praetorius$^{\ast}$\\{\tiny \texttt{simon.praetorius@tu-dresden.de}}}
+\institute[TU Dresden IWR]{$^{\ast}$Institut für Wissenschaftliches Rechnen, Technische Universität Dresden}
+\date[2015/09/22]{September 22, 2015}
+\titlegraphic{\includegraphics[width=\textwidth]{logo}}
+
+\begin{document}
+\begin{frame}[plain]
+	\maketitle
+\end{frame}
+
+% \input{examples}
+
+\section{About this Course}
+\begin{frame}\frametitle{About this Course}
+\begin{itemize}
+\item Goals: Introductory course\begin{itemize}
+  \item You know how to use the software AMDiS
+  \item You can solve a scalar equation, or a system of elliptic equations
+  \item You can handle instationary problems, nonlinearities and complex boundary conditions
+  \item (You can run your simulation in parallel)
+  \end{itemize}
+\item References: \begin{itemize}
+  \item Some theoretical background and basic design ideas of AMDiS software: \href{http://www.alberta-fem.de/download.html}{\underline{ALBERTA-FEM}} especially the ALBERT 1.0 documentation.\\
+  {\tiny \url{http://goo.gl/ZMI2kA}}
+  \item The \href{https://fusionforge.zih.tu-dresden.de/plugins/mediawiki/wiki/amdis/index.php/Hauptseite}{\underline{AMDiS-Wiki}}\\
+  {\tiny \url{https://goo.gl/Jy3u1u}}
+  \item Some (old) PDF Documentation on \href{https://fusionforge.zih.tu-dresden.de/docman/?group_id=11&view=listfile&dirid=907}{\underline{Fusionforge}}\\
+  {\tiny \url{https://goo.gl/5ngfYd}}
+  \end{itemize}
+\item Workshop material can be found on \href{https://github.com/spraetor/amdis_workshop}{\underline{GitHub}}\\
+{\tiny \url{https://goo.gl/3IxKYx}}
+\end{itemize}
+\end{frame}
+
+\begin{frame}\frametitle{Outline}
+\begin{enumerate}
+\item Scalar linear second order PDEs
+\item Handling data on unstructured grids
+\item Adaptivity and systems of equations
+\item Time-dependent and nonlinear problems
+\end{enumerate}
+\end{frame}
+
+\input{seminar1}
+\input{seminar2}
+\input{seminar3}
+\input{seminar4}
+
+\end{document}