\documentclass[a4paper]{article}
%\usepackage{fixltx2e} % LaTeX patches, \textsubscript
%\usepackage{cmap} % fix search and cut-and-paste in Acrobat
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{mathptmx} % Times
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
\usepackage[margin=0.5in]{geometry}
\usepackage{xcolor}
\usepackage{longtable}
%%% User specified packages and stylesheets
\DeclareGraphicsExtensions{ %
    .pdf,.PDF,%
    .png,.PNG,%
    .jpg,.mps,.jpeg,.jbig2,.jb2,.JPG,.JPEG,.JBIG2,.JB2}
\title{@{{ program }}@ --- RETIS analysis}
\author{}
\date{}

\begin{document}
\maketitle
\noindent PPRETIS analysis report generated by @{{ program }}@ version @{{ version }}@
on @{{ date }}@.
\\
\noindent The main results are:
\begin{itemize}
\item The crossing probability:
$P_{\text{cross}} =$ \colorbox{blue!30}{ @{{ numbers['pcross'] }}@ }  $\pm$ @{{ numbers['perr'] }}@ $\%$

\item The upper estimate of the initial flux (unit: 1/@{{ text['flux-unit'] }}@):
$f_A =$ \colorbox{blue!30}{ @{{ numbers['flux'] }}@ }  $\pm$ @{{ numbers['flux-err'] }}@ $\%$

\item The rate constant (unit: 1/@{{ text['flux-unit'] }}@):
$k_{AB} = $ \colorbox{blue!30}{ @{{ numbers['rate'] }}@ }  $\pm$ @{{ numbers['rate-err'] }}@ $\%$

@{% if (numbers['permeability'] is defined) and numbers['permeability'] %}@

\item Matching factor between the two [0] ensembles:
$\xi =$ \colorbox{blue!30}{ @{{ numbers['xi'] }}@ } $\pm$  @{{numbers['xi-err'] }}@ $\%$

\item The time spent in the reference bin (unit: @{{ text['flux-unit'] }}@/
	OP-unit):
$\frac{\tau_{{\mathrm{ref}},[{0^-}{'}]}}{dz} =$ \colorbox{blue!30}{ @{{ numbers['tau'] }}@ }
$\pm$ @{{ numbers['tau-err'] }}@  $\%$

\item The permeability (unit: OP-unit/ @{{ text['flux-unit']  }}@):
$P =$ \colorbox{blue!30}{ @{{ numbers['perm'] }}@ } $\pm$ @{{ numbers['perm-err'] }}@  $\%$

@{% endif %}@

\end{itemize}
\noindent Detailed results are given below for the different path
ensembles and the overall results are summarized
in the last section.

\begin{center}

@{% if (numbers['permeability'] is defined) and numbers['permeability'] %}@

\includegraphics[width=0.33\linewidth]{@{{ figures['xi'] }}@}
\includegraphics[width=0.33\linewidth]{@{{ figures['xierror'] }}@}
\includegraphics[width=0.33\linewidth]{@{{ figures['tau'] }}@}
\includegraphics[width=0.33\linewidth]{@{{ figures['tauerror'] }}@}
\includegraphics[width=0.33\linewidth]{@{{ figures['tauref'] }}@}
\clearpage
@{% endif %}@

\end{center}


\section{Combined results}
\label{sec:combined}

The overall matched probability distributions are shown in the left figure
while the matched probability distribution is shown in the right figure below.
The overall crossing rate as a function of cycles
and its relative error block analysis are reported in the two following
plots, respectively.

\begin{center}
\includegraphics[width=0.45\linewidth]{@{{ figures['matched'] }}@}%
\end{center}
\begin{center}
\includegraphics[width=0.45\linewidth]{@{{ figures['progress'] }}@}%
\includegraphics[width=0.45\linewidth]{@{{ figures['error'] }}@}%
\end{center}

\clearpage

\section{Results for path ensembles}
The following interfaces were used in the simulation and in
the analysis:
@{{ tables['interfaces'] }}@
@{{ tables['probability'] }}@
@{{ tables['efficiency'] }}@
\clearpage


\subsection{Crossing probabilities}
@{% for figure in figures['tis'] %}@
\begin{center}
\includegraphics[width=0.33\linewidth]{@{{ figure['pcross'] }}@}%
\includegraphics[width=0.33\linewidth]{@{{ figure['prun_sl'] }}@}%
\includegraphics[width=0.33\linewidth]{@{{ figure['perror_sl'] }}@}%
\end{center}
\begin{center}
\includegraphics[width=0.33\linewidth]{@{{ figure['pcross'] }}@}%
\includegraphics[width=0.33\linewidth]{@{{ figure['prun_sr'] }}@}%
\includegraphics[width=0.33\linewidth]{@{{ figure['perror_sr'] }}@}%
\end{center}
@{% endfor %}@
\clearpage

\subsection{Distributions for path lengths and shooting moves}
The average path lengths in the different ensembles are given in
the table below and some distributions for the path lengths and
shooting moves can also be found here:

\begin{center}
\includegraphics[width=0.45\linewidth]{@{{ figures['path0']['lpath'] }}@}%
\includegraphics[width=0.45\linewidth]{@{{ figures['path0']['shoots'] }}@}%
\end{center}

@{% for figure in figures['tis'] %}@
\begin{center}
\includegraphics[width=0.45\linewidth]{@{{ figure['lpath'] }}@}%
\includegraphics[width=0.45\linewidth]{@{{ figure['shoots'] }}@}%
\end{center}
@{% endfor %}@
\clearpage

\end{document}
