diff --git a/Doc/FFCatalog/FFCatalog.tex b/Doc/FFCatalog/FFCatalog.tex
new file mode 100644
index 0000000000000000000000000000000000000000..526f409c9e14594c16ff98c9b2b6335631fe1fe0
--- /dev/null
+++ b/Doc/FFCatalog/FFCatalog.tex
@@ -0,0 +1,53 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%%   BornAgain  User Manual  Form Factor Catalog
+%%
+%%   homepage:   http://www.bornagainproject.org
+%%
+%%   copyright:  Forschungszentrum Jülich GmbH 2015-2020
+%%
+%%   license:    Creative Commons CC-BY-SA
+%%
+%%   authors:    Scientific Computing Group at MLZ Garching
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% To compile this report, run
+%   xelatex   FFCatalog
+%   bibtex    FFCatalog
+%   xelatex   FFCatalog
+%   makeindex FFCatalog
+%   xelatex   FFCatalog
+
+\documentclass[a4paper,11pt,fleqn]{report}\usepackage[final]{graphicx}
+%\documentclass[a4paper,11pt,fleqn,draft]{report}\usepackage[final]{graphicx}
+%\documentclass[a4paper,11pt,fleqn,draft]{report}\usepackage[draft]{graphicx}
+
+\def\authors{Céline Durniak, Marina Ganeva, Gennady Pospelov, Walter Van Herck, Joachim Wuttke}
+\def\version{1.16}
+
+\input{Setup}
+
+\begin{document}
+\ifdraft{\pagenumbering{roman}}{}
+\flushbottom
+
+\input{Macros}
+\input{Title}
+
+\tableofcontents\cleardoublepage
+
+\include{Preface}
+\pagemode{\thechapter}
+
+\include{FormFactors}
+
+\otherchapter{References}{X}
+\bibliographystyle{switch}
+\bibliography{jw7}
+
+\otherchapter{Index}{Z}
+\small
+\printindex
+
+\end{document}
diff --git a/Doc/FFCatalog/FFCatalogue.pdf b/Doc/FFCatalog/FFCatalogue.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..4c7ebc817c2b7c2c65e928aaafd485ba40d17e4a
Binary files /dev/null and b/Doc/FFCatalog/FFCatalogue.pdf differ
diff --git a/Doc/FFCatalog/FixMdframed.tex b/Doc/FFCatalog/FixMdframed.tex
new file mode 100644
index 0000000000000000000000000000000000000000..9db59a5a9af273b167987c137b3adfd14015898d
--- /dev/null
+++ b/Doc/FFCatalog/FixMdframed.tex
@@ -0,0 +1,171 @@
+% Prevents erroneous page breaks,
+% as proposed by David Carlisle,
+% http://tex.stackexchange.com/questions/241543.
+
+\makeatletter
+
+\def\mdf@put@frame@ii{%
+  \setlength{\mdf@freevspace@length}{\vsize}%
+    \ifbool{mdf@repeatframetitle}%
+      {%repeating title -- more robust using hooks.
+       \toggletrue{mdf@notfirstframetitle}%
+       \splitmaxdepth\z@ \splittopskip\z@%
+       \setbox\mdf@splitbox@one=\vbox{\break\unvbox\mdf@splitbox@one}%
+       \mdf@ignorevbadness%
+       \setbox0=\vsplit\mdf@splitbox@one to \z@\relax%
+       \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}%
+       \setbox\mdf@splitbox@one\vbox%
+          {%
+           \parskip\z@\relax%
+           \parindent\z@\relax%
+           \vskip\mdf@frametitleaboveskip@length%
+           \unvcopy\mdf@frametitlebox\relax%
+           \mdf@@frametitlerule\relax%
+           \unvbox\mdf@splitbox@one\relax%
+          }%
+       \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}%
+      }{}%
+  \setlength{\dimen@}{\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}%
+  \mdf@dolist{\mdf@advancelength@add{\dimen@}}%
+        {innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth}%
+  \ifboolexpr { bool {mdf@everyline} and bool {mdf@topline} }%
+    {%
+     \mdf@dolist{\mdf@advancelength@add{\dimen@}}%
+        {innerlinewidth,middlelinewidth,outerlinewidth}%
+    }{}%
+   \notbool{mdf@bottomline}%remove bottom if neccessary
+     {%
+       \mdf@dolist{\mdf@advancelength@sub{\dimen@}}%
+         {innerlinewidth,middlelinewidth,outerlinewidth}%
+     }{}%
+   \ifdimgreater{\dimen@}{\mdf@freevspace@length}%
+    {%have a middle box
+     \advance\mdf@freevspace@length by -\mdf@splitbottomskip@length\relax%
+     \ifbool{mdf@everyline}%regard top and bottom if everyline is used
+       {%
+        \ifbool{mdf@topline}%
+          {%
+           \mdf@dolist{\mdf@advancelength@sub{\mdf@freevspace@length}}%
+             {innerlinewidth,middlelinewidth,outerlinewidth}%
+          }{}%
+        \ifbool{mdf@bottomline}%
+          {%
+           \mdf@dolist{\mdf@advancelength@sub{\mdf@freevspace@length}}%
+             {innerlinewidth,middlelinewidth,outerlinewidth}%
+          }{}%
+       }{}%
+     \setbox\mdf@splitbox@save=\vbox{\unvcopy\mdf@splitbox@one}%
+     \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
+     \mdf@ignorevbadness%
+     \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \mdf@freevspace@length%
+     \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}%
+     \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}%
+     \ifdimgreater{\ht\mdf@splitbox@two+\dp\mdf@splitbox@two}%
+                  {\mdf@freevspace@length}%
+       {%splitted wrong
+        \mdf@PackageInfo{Box was splittet wrong^^J
+                         starting loop to iterate
+                         the splitting point\MessageBreak}%
+        \dimen@i=\mdf@freevspace@length%\relax
+        \@tempcnta=\z@\relax
+        \loop
+        \ifdim\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax>%
+              \mdf@freevspace@length\relax
+          \advance\dimen@i by -\p@\relax%
+          \advance\@tempcnta by \@ne\relax%
+          \ifnum\@tempcnta>100
+            \let\iterate\relax%
+            \mdf@PackageWarning{correct box splittet fails^^J
+                                It seems you are using a non splittable
+                                contents\MessageBreak}%
+          \fi
+          \mdf@ignorevbadness%
+          \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
+          \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
+          \mdf@ignorevbadness%
+          \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@i\relax%
+          \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}%
+          \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}%
+        \repeat%
+       }{}%
+     \ifvoid\mdf@splitbox@one\relax%
+        \mdf@PackageWarning{You got a bad break because the splittet box is
+                            empty^^J
+                            You have to change the page settings^^J
+                            like enlargethispage or something else^^J
+                            the package increases do
+                            \enlargethispage{\baselineskip}\MessageBreak}%
+        \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
+        \enlargethispage{\baselineskip}%
+        \def\mdf@reserved@a{\mdf@put@frame@ii}%
+     \else
+      \setbox\mdf@splitbox@two=\vbox%
+                   {%
+                    \hrule \@height\z@ \@width\mdfboundingboxwidth\relax%
+                    \unvcopy\mdf@splitbox@two%
+                   }%
+        \begingroup%
+          \mdf@@setzref%
+          \booltrue{mdfmiddleframe}%
+          \mdf@beforebreak%
+          \mdf@putbox@middle%
+          \mdf@afterbreak%
+        \endgroup%
+          \hrule \@height\z@ \@width\hsize%
+          \vfill\eject%
+          \def\mdf@reserved@a{\mdf@put@frame@ii}%
+        \fi
+     }%End middle box case
+     {%start last box case
+      \ifvoid\mdf@splitbox@one
+           \mdf@PackageWarning{You got a bad break\MessageBreak
+                               because the last split box is empty\MessageBreak
+                               You have to change the settings1}%%
+%CHANGE:  leave final box as void
+\iffalse
+ \setbox\mdf@splitbox@one=\vbox%
+                  {%
+                   \unvbox\mdf@splitbox@one%
+                   \hrule \@height\z@ \@width\mdfboundingboxwidth
+                  }%
+\fi
+%end CHANGE
+      \fi%
+      \ifdimless{\ht\mdf@splitbox@one}{1sp}%
+         {%
+          \mdf@PackageWarning{You got a bad break\MessageBreak
+                              because the last split box is empty\MessageBreak
+                              You have to change the settings2}%
+
+          \let\mdf@reserved@a\relax%
+%CHANGE: add discard final box
+\iffalse
+ \setbox\mdf@splitbox@one=\vbox%
+                 {%
+                  \unvbox\mdf@splitbox@one%
+                  \hrule \@height\z@ \@width\mdfboundingboxwidth
+                 }%
+\fi
+%END CHANGE
+\setbox\mdf@splitbox@one\box\voidb@x
+         }{}%
+      \begingroup%
+      \toggletrue{mdflastframe}%
+      \mdf@beforebreak%
+%Debug{\color{red}\rule{\textwidth}{1pt}}
+      \begingroup%
+        \mdf@@setzref%
+        \booltrue{mdflastframe}%
+        \mdf@beforelastframe%
+        \mdf@putbox@second%
+        \mdf@afterlastframe%
+      \endgroup%
+      \hrule \@height\z@ \@width\hsize%
+      \mdf@afterbreak%
+      \endgroup%
+      \let\mdf@reserved@a\relax%
+     }%
+  \mdf@reserved@a%
+}
+
+\makeatother
diff --git a/Doc/UserManual/FormFactors.tex b/Doc/FFCatalog/FormFactors.tex
similarity index 90%
rename from Doc/UserManual/FormFactors.tex
rename to Doc/FFCatalog/FormFactors.tex
index 8b50759a68eb6e7a11bd0ce924b156f7c2467676..9f7334949111e87046c0ee5156bd028040d1d35a 100644
--- a/Doc/UserManual/FormFactors.tex
+++ b/Doc/FFCatalog/FormFactors.tex
@@ -13,104 +13,27 @@
 %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-\chapter{Particle form factors}\label{SPFF}
-
-\iffalse
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\section{Usage}\label{SintroPFF}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\index{Form factor!tutorial}%
-\index{Form factor!examples}%
-\index{Form factor!custom implementation}%
-The online tutorial contains an entire section on
-  \tuto{47}{embedded particles}, including several usage examples
-  and a \tutoNomar{72}{list of all available form factors}.
-  If a particle shape is missing, try to implement a \tutoNomar{107}{custom form factor},
-  or/and contact us.
-
-The particles can be rotated in a different direction by using one of
-the following transformations: \Code{CreateRotateX($\theta$),
-  CreateRotateY($\theta$), CreateRotateZ($\theta$)}, where capital X, Y, Z mark rotations
-around the associated axis and $\theta$ is the
-angle of rotation from this axis. For example, the following \Code{Python}\ script shows how to rotate a pyramid by $45^{\circ}$ around
-the $z$-axis:\\
-
-\setPy
-\begin{lstlisting}
-    pyramid_ff = ba.FormFactorPyramid(10*nm, 5*nm, 54.73*deg )
-    pyramid = ba.Particle(m_particle, pyramid_ff)
-    transform = ba.Transform3D.createRotateZ(45*deg)
-    particle_layout = ba.ParticleLayout().addParticle(pyramid, transform)
-\end{lstlisting}
-
-Particle rotation is demonstrated in the example~\tuto{61}{rotated pyramids}.
-
-For particles that are made of different materials,
-the definition % TODO RESTORE ~\cref{EFFdef}
-of the form factor~$F(\q)$
-must be generalized in obvious ways.
-In practice, the most important case is the \E{core-shell particle}.
-\index{Inhomogeneous particles}%
-\index{Core-shell particles}%
-\index{Particle!Core-shell}%
-This is supported in \BornAgain\ through the function
-\index{ParticleCoreShell@\Code{ParticleCoreShell}}
-\setCpp
-\begin{lstlisting}
-    ParticleCoreShell(const Particle& shell, const Particle& core,
-            kvector_t relative_core_position={0., 0., 0.});
-\end{lstlisting}
-where \Code{shell\_particle} is assumed to be inscribed
-in \Code{core\_particle}.
-\Code{rel\_\discretionary{}{}{}position}
-specifies the position of the
-center of the base of the core particle relative
-to center of the base of the shell particle.
-
-See the online tutorial for an example with \tuto{59}{core-shell nanoparticles}.
-
-%===============================================================================
-\index{Polydispersity!embedded particles}%
-\index{Particle!polydispersity}%
-\index{Distribution!of particle parameters}%
-\index{Form factor!parameter distributions}%
-Embedded particles may be \E{polydisperse}, i.~e.\ have statistical distributions
-for some or all their numeric parameters.
-This is supported in \BornAgain\ through the same mechanism
-as for other numeric parameters.
-
-See the online tutorial for the example \tuto{66}{cylinders with size distribution}.
-  The example also shows how two parameters can be tied to each other
-(size distribution with constant ratio radius/height).
-
-\fi
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\section{Hard particles}\label{SHPFF}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\index{Form factor!hard particles|(}
+\def\ffsection#1{%
+\FloatBarrier\clearpage
+\section{#1}}
 
 % Don't number subfigures in this chapter.
 \makeatletter
 \renewcommand{\@thesubfigure}{\relax}
 \makeatother
 
-% \lstset{language=python,style=eclipseboxed,numbers=none,nolol}
-
-\def\ffsection#1{%
-%\FloatBarrier\clearpage\ifodd\value{page}\E{Page intentionally left blank}\clearpage\else\fi
-\subsection{#1}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{Introduction}\label{SPFF}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 
-\BornAgain\ comes with a comprehensive collection of hard-coded
+BornAgain comes with a comprehensive collection of hard-coded
 shape transforms for standard particle geometries like
 spheres, cylinders, prisms, pyramids or ripples.
 This collection is documented in the following.
 For each shape,
 the real-space geometry is shown in orthogonal projections,
-the parameters of the \BornAgain\ method are defined,
+the parameters of the BornAgain method are defined,
 an analytical expression for the form factor is given,
 and exemplary results for $\left|F(\q)\right|^2$ versus
 $\alpha_\sf,\phi_\sf$ are shown for small-angle scattering conditions
@@ -124,86 +47,30 @@ along a symmetry axis of the particle.
 The origin is always at the center of the bottom side of the particle.
 Different parametrization or a different choice of the origin
 cause our analytic form factors to trivially deviate
-from expressions given in the \IsGISAXS\ manual \cite[Sec.~2.3]{Laz08}
+from expressions given in the \IsGISAXS\ manual \cite[Sec.~2.3]{Laz06}
 or in the literature \cite[Appendix]{ReLL09}.
 
-We recomputed all expressions to make sure
-that they also hold for complex scattering vectors,
+We made sure that all expressions also hold for complex scattering vectors,
 used to describe in order to take any material absorption into account.
-The implementation in \BornAgain\ allows all three components
-of~$\q$ to be complex.\footnote
-{Per~\cref{Ekconst},
+In standard reflectometry geometry, with reference surface normal to $\v{\hat z}$,
 only the vertical components of $\k_\si$ and $\k_\sf$ can have imaginary parts.
 However,
 for tilted particles
 $F(\v{\tilde{q}})$ needs to be computed with
 a rotated scattering vector~$\v{\tilde q}$
-that may be complex in all three components.}
-
-The following tables summarize the implemented particle geometries,
- roughly ordered by decreasing symmetry.
-Afterwards, the detailed documentation is in alphabetical order.
-
-%\clearpage\thispagestyle{empty}
-\def\entry#1#2#3#4#5#6{%
-\raisebox{-3.8ex}{\includefinal{5em}{fig/blue/#2.png}} &
- \texttt{#1}& %\newline\textsl{#1} &
-#5 & % symmetry
-#4 & % parameters
-Page~\pageref{S#3}\\} % , \cref{S#3}
-\begin{center}
-  \def\h{\text{h}}
-  \def\v{\text{v}}
-\small
-\begin{longtable}
-  {@{}p{.14\textwidth}
-   @{}p{.32\textwidth}
-   @{}p{.17\textwidth}
-   @{}p{.19\textwidth}
-   @{}p{.15\textwidth}@{}}
-% Shape&{Name\newline \textsl{Legacy Name}}&Symmetry&Parameters&Reference\\\hline
-Shape&Name&Symmetry&Parameters&Reference\\\hline
-\entry{FullSphere}{FullSphere3d}{FullSphere}{$R$}{R$_3$}{Sphere}
-\entry{FullSpheroid}{FullSpheroid3d}{FullSpheroid}{$R$, $H$}{D$_{\infty\h}$}{Spheroid}
-\entry{Cylinder}{Cylinder3d}{Cylinder}{$R$, $H$}{D$_{\infty\h}$}{Cylinder}
-\entry{TruncatedSphere}{Sphere3d}{TruncatedSphere}{$R$, $H$}{C$_{\infty\v}$}{SphericalCap}
-\entry{TruncatedSpheroid}{Spheroid3d}{TruncatedSpheroid}{$R$, $H$, $f_p$}{C$_{\infty\v}$}{SpheroidalCap}
-\entry{Cone}{Cone3d}{Cone}{$R$, $H$, $\alpha$}{C$_{\infty\v}$}{ConicalFrustum}
-\entry{Icosahedron}{Icosahedron3d}{Icosahedron}{$L$}{I$_\h$}{Icosahedron}
-\entry{Dodecahedron}{Dodecahedron3d}{Dodecahedron}{$L$}{I$_\h$}{Dodecahedron}
-\entry{TruncatedCube}{TruncatedCube3d}{TruncatedCube}{$L$, $t$}{O$_\h$}{TruncatedCube}
-\entry{Prism6}{Prism63d}{Prism6}{$R$, $H$}{D$_{6\h}$}{Prism6}
-\entry{Cone6}{Cone63d}{Cone6}{$R$, $H$, $\alpha$}{C$_{6\v}$}{Frustum6}
-\entry{Pyramid}{Pyramid3d}{Pyramid}{$L$, $H$, $\alpha$}{C$_{4\v}$}{Frustum4}
-\entry{Cuboctahedron}{Cuboctahedron3d}{Cuboctahedron}{$L$, $H$, $r_H$, $\alpha$}{C$_{4\v}$}{BiFrustum4}
-\entry{Prism3}{Prism33d}{Prism3}{$L$, $H$}{D$_{3\h}$}{Prism3}
-\entry{Tetrahedron}{Tetrahedron3d}{Tetrahedron}{$L$, $H$, $\alpha$}{C$_{3\v}$}{Frustum3}
-\entry{EllipsoidalCylinder}{EllipsoidalCylinder3d}{EllipsoidalCylinder}{$R_a$, $R_b$, $H$}{D$_{2\h}$}{EllipsoidalCylinder}
-\entry{Box}{Box3d}{Box}{$L$, $W$, $H$}{D$_{2\h}$}{Prism2}
-\entry{HemiEllipsoid}{HemiEllipsoid3d}{HemiEllipsoid}{$R_a$, $R_b$, $H$}{C$_{2\v}$}{HemiEllipsoid}
-\entry{AnisoPyramid}{AnistropicPyramid3d}{AnisoPyramid}{$L$, $W$, $H$, $\alpha$}{C$_{2\v}$}{Frustum2}
-\hline
-\end{longtable}
-\end{center}
-%\thispagestyle{empty}\clearpage
-
-\index{Rotation of particles}
-\index{Orientation of particles}
-\index{CreateRotateX@\Code{CreateRotateX}}
-\index{Transform3D@\Code{Transform3D}}
+that may be complex in all three components.
+Therefore BornAgain allows all three components of~$\q$ to be complex.
 
-In the following subsections,
+In the following,
 information about the implemented geometries is given in standardized form.
 Analytical expressions are given for the form factor $F(\q)$,
 for the volume $V=F(0)$,
 and for the maximum horizontal section $S$
 (the area of the particle as seen from above).
-\nomenclature[2s130 0]{$S$}{Maximum horizontal section of embedded particle}%
 Mathematical notation in the form factor expressions includes
 the cardinal sine functions $\sinc(z)\coloneqq\sin(z)/z$
 and the Bessel function of first kind and first order $J_1(z)$
 \cite[Ch.~9]{AbSt64}.
-\nomenclature[2j132 01]{$J_1$}{Bessel function of first kind and first order}%
 If results contain an integral,
 then no analytical form was found,
 and the integral is evaluated by numeric quadrature.
@@ -214,7 +81,7 @@ For polyhedral figures,
 except a few simple ones like the rectangular box,
 we use a generic form factor computation,
 parametrized by the vertices of the figure,
-that is described in full detail in a mathematical paper~\cite{ba:ffp}.
+that is described in full detail in a mathematical paper~\cite{Wut17}.
 
 Almost all analytical expressions for $F(\q)$ contain
 removable singularities for certain values of $\q$.
@@ -224,7 +91,7 @@ Our implementation uses proper analytic continuations at these singularities,
 though this is not explicitly denoted in the following formula collection.
 Furthermore, series expansions are used to ensure numeric accuracies
 in the neighborhood of the singularities.
-For polyhedra, see Ref.~\cite{ba:ffp} for a meticulous discussion.
+For polyhedra, see Ref.~\cite{Wut17} for a meticulous discussion.
 
 \begin{figure}[t]
 \begin{center}
@@ -241,7 +108,7 @@ data are only shown for first quadrant $0^\circ\le\phi_\sf,\alpha_\sf\le 5^\circ
 Geometrical objects can be parametrized in different ways.
 Concerns about user experience and about code readability
 sometimes lead to different choices.
-For the \BornAgain\ user interfaces (GUI and API)
+For the BornAgain user interfaces (GUI and API)
 we have chosen the most standard parameters,
 as used in elementary geometry, like length, height, radius,
 even if this is at variance from the \IsGISAXS\ precedent.
@@ -296,20 +163,78 @@ than in the preceding one-quadrant representation.}
 \end{figure}
 
 \index{Large particles!numeric difficulty}%
-\index{Numeric difficulty!form factor oscillations}%
-\index{Oscillations!from large particle form factor}%
+\index{Numeric difficulty!form factor oscillation}%
+\index{Oscillation!from large particle form factor}%
 \index{Monte-Carlo integration!for large particle form factor}%
-\index{Particle!rapid form factor oscillations}%
-\index{Form factor!rapid oscillations}%
-\index{Form factor!large particles}%
-\Warn{For large particles (typically of order 1000nm),
+\index{Particle!rapid form factor oscillation}%
+\index{Form factor!rapid oscillation}%
+\index{Form factor!large particle}%
+Finally, one warning: For large particles (typically of order 1000nm),
   the form factor oscillates rapidly within one detector bin
   so that analytical calculations (performed for the bin center)
-  may give a completely wrong intensity pattern.}
+  may give a completely wrong intensity pattern.
+Several ways to work around this problem are proposed in Sect.~5.3
+of our reference paper~\cite{PoVB20}.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{Hard particles}\label{SHPFF}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\index{Form factor!hard particles|(}
+
+The following tables summarize the implemented particle geometries,
+ roughly ordered by decreasing symmetry.
+Afterwards, the detailed documentation is in alphabetical order.
+
+%\clearpage\thispagestyle{empty}
+\def\entry#1#2#3#4#5#6{%
+\raisebox{-3.8ex}{\includefinal{5em}{fig/blue/#2.png}} &
+ \texttt{#1}& %\newline\textsl{#1} &
+#5 & % symmetry
+#4 & % parameters
+Page~\pageref{S#3}\\} % , \cref{S#3}
+\begin{center}
+  \def\h{\text{h}}
+  \def\v{\text{v}}
+\small
+\begin{longtable}
+  {@{}p{.14\textwidth}
+   @{}p{.32\textwidth}
+   @{}p{.17\textwidth}
+   @{}p{.19\textwidth}
+   @{}p{.15\textwidth}@{}}
+% Shape&{Name\newline \textsl{Legacy Name}}&Symmetry&Parameters&Reference\\\hline
+Shape&Name&Symmetry&Parameters&Reference\\\hline
+\entry{FullSphere}{FullSphere3d}{FullSphere}{$R$}{R$_3$}{Sphere}
+\entry{FullSpheroid}{FullSpheroid3d}{FullSpheroid}{$R$, $H$}{D$_{\infty\h}$}{Spheroid}
+\entry{Cylinder}{Cylinder3d}{Cylinder}{$R$, $H$}{D$_{\infty\h}$}{Cylinder}
+\entry{TruncatedSphere}{Sphere3d}{TruncatedSphere}{$R$, $H$}{C$_{\infty\v}$}{SphericalCap}
+\entry{TruncatedSpheroid}{Spheroid3d}{TruncatedSpheroid}{$R$, $H$, $f_p$}{C$_{\infty\v}$}{SpheroidalCap}
+\entry{Cone}{Cone3d}{Cone}{$R$, $H$, $\alpha$}{C$_{\infty\v}$}{ConicalFrustum}
+\entry{Icosahedron}{Icosahedron3d}{Icosahedron}{$L$}{I$_\h$}{Icosahedron}
+\entry{Dodecahedron}{Dodecahedron3d}{Dodecahedron}{$L$}{I$_\h$}{Dodecahedron}
+\entry{TruncatedCube}{TruncatedCube3d}{TruncatedCube}{$L$, $t$}{O$_\h$}{TruncatedCube}
+\entry{Prism6}{Prism63d}{Prism6}{$R$, $H$}{D$_{6\h}$}{Prism6}
+\entry{Cone6}{Cone63d}{Cone6}{$R$, $H$, $\alpha$}{C$_{6\v}$}{Frustum6}
+\entry{Pyramid}{Pyramid3d}{Pyramid}{$L$, $H$, $\alpha$}{C$_{4\v}$}{Frustum4}
+\entry{Cuboctahedron}{Cuboctahedron3d}{Cuboctahedron}{$L$, $H$, $r_H$, $\alpha$}{C$_{4\v}$}{BiFrustum4}
+\entry{Prism3}{Prism33d}{Prism3}{$L$, $H$}{D$_{3\h}$}{Prism3}
+\entry{Tetrahedron}{Tetrahedron3d}{Tetrahedron}{$L$, $H$, $\alpha$}{C$_{3\v}$}{Frustum3}
+\entry{EllipsoidalCylinder}{EllipsoidalCylinder3d}{EllipsoidalCylinder}{$R_a$, $R_b$, $H$}{D$_{2\h}$}{EllipsoidalCylinder}
+\entry{Box}{Box3d}{Box}{$L$, $W$, $H$}{D$_{2\h}$}{Prism2}
+\entry{HemiEllipsoid}{HemiEllipsoid3d}{HemiEllipsoid}{$R_a$, $R_b$, $H$}{C$_{2\v}$}{HemiEllipsoid}
+\entry{AnisoPyramid}{AnistropicPyramid3d}{AnisoPyramid}{$L$, $W$, $H$, $\alpha$}{C$_{2\v}$}{Frustum2}
+\hline
+\end{longtable}
+\end{center}
+%\thispagestyle{empty}\clearpage
+
+\index{Rotation of particles}
+\index{Orientation of particles}
+\index{CreateRotateX@\Code{CreateRotateX}}
+\index{Transform3D@\Code{Transform3D}}
+
 
-In this case, the best solution we can currently provide
-  is a Monte-Carlo integration, as shown in the example
-  \tuto{TODO}{large particle form factor}.
 
 \index{Shape transform!catalogue|(}
 \index{Form factor!catalogue|(}
@@ -355,7 +280,7 @@ They must fulfill
 
 \paragraph{Form factor, volume, horizontal section}\strut\\
 \begin{equation*}
-  F \text{~: computed using the generic polyhedron form factor~\cite{ba:ffp},}
+  F \text{~: computed using the generic polyhedron form factor~\cite{Wut17},}
 \end{equation*}
 \begin{equation*}
   V= H \Big[LW - \dfrac{(L + W)H}{\tan\alpha} + \dfrac{4}{3} \dfrac{H^2}{\tan^2\alpha}\Big].
@@ -377,7 +302,7 @@ for four different angles~$\omega$ of rotation around the $z$ axis.}
 
 \paragraph{History}\strut\\
 Agrees with the \E{In-plane anisotropic pyramid} form factor of \IsGISAXS\
-\cite[Eq.~2.40]{Laz08} \cite[Eq.~217]{ReLL09},
+\cite[Eq.~2.40]{Laz06} \cite[Eq.~217]{ReLL09},
 except for different parametrization.
 This is \E{not} the \E{anisotropic pyramid} of \FitGISAXS,
 which is a true pyramid with an off-center apex \cite{Bab13}.
@@ -391,7 +316,7 @@ and were found to fully agree.
   \index{Box (form factor)}
   \index{Cuboid (form factor)}
   \index{Prism (form factor)!reactangular (Box)}
-  \index{Platonic solids!cube}
+  \index{Platonic solid!cube}
   \index{FormFactorBox@\Code{FormFactorBox}}
 
 \paragraph{Real-space geometry}\strut\\
@@ -446,7 +371,7 @@ for four different angles~$\omega$ of rotation around the $z$ axis.}
 
 \paragraph{History}\strut\\
 Agrees with \E{Box} form factor of \IsGISAXS\
-\cite[Eq.~2.38]{Laz08} \cite[Eq.~214]{ReLL09},
+\cite[Eq.~2.38]{Laz06} \cite[Eq.~214]{ReLL09},
 except for factors $1/2$ in the definitions of parameters $L$, $W$, $H$.
 
 
@@ -518,7 +443,7 @@ for four different tilt angles~$\vartheta$ (rotation around the $y$ axis).}
 
 \paragraph{History}\strut\\
 Agrees with \E{Cone} form factor of \IsGISAXS\
-\cite[Eq.~2.28]{Laz08} \cite[Eq.~225]{ReLL09},
+\cite[Eq.~2.28]{Laz06} \cite[Eq.~225]{ReLL09},
 except for a substitution $z\to\rho$ in our expression for~$F$.
 
 
@@ -565,7 +490,7 @@ The parameters must fulfill
 
 \paragraph{Form factor, volume, horizontal section}\strut\\
 \begin{equation*}
-  F \text{~: computed using the generic polyhedron form factor~\cite{ba:ffp},}
+  F \text{~: computed using the generic polyhedron form factor~\cite{Wut17},}
 \end{equation*}
 \begin{equation*}
   V = \tan\beta  \left( R^3- \left(R-\frac{H}{\tan\beta}\right)^3 \right),
@@ -587,18 +512,18 @@ for four different angles~$\omega$ of rotation around the $z$ axis.}
 
 \paragraph{History}\strut\\
 Our parametrization deviates from the form factor \E{Cone6} of \IsGISAXS
-\cite[Eq.~2.32]{Laz08} \cite[Eq.~222]{ReLL09}.
+\cite[Eq.~2.32]{Laz06} \cite[Eq.~222]{ReLL09}.
 
 Up to \BornAgain-1.5 computed by numeric integration, as in \IsGISAXS.
 Since \BornAgain-1.6 higher speed and better accuracy are achieved
-by using the generic polyhedron form factor \cite{ba:ffp},
+by using the generic polyhedron form factor \cite{Wut17},
 with series expansions near singularities.
 
 %===============================================================================
 \ffsection{Cuboctahedron} \label{SCuboctahedron}
 %===============================================================================
   \index{Cuboctahedron (form factor)}
-  \index{Platonic solids!octahedron}
+  \index{Platonic solid!octahedron}
   \index{FormFactorCuboctahedron@\Code{FormFactorCuboctahedron}}
 
 \paragraph{Real-space geometry}\strut\\
@@ -637,7 +562,7 @@ They must fulfill
 
 \paragraph{Form factor, volume, horizontal section}\strut\\
 \begin{equation*}
-  F \text{~: computed using the generic polyhedron form factor~\cite{ba:ffp},}
+  F \text{~: computed using the generic polyhedron form factor~\cite{Wut17},}
 \end{equation*}
 \begin{equation*}
   V= \dfrac{1}{6} \tan(\alpha)L^3 \Big[ 2
@@ -662,10 +587,10 @@ for four different angles~$\omega$ of rotation around the $z$ axis.}
 
 \paragraph{History}\strut\\
 Agrees with \E{Cuboctahedron} form factor of \IsGISAXS\
-\cite[Eq.~2.34]{Laz08} \cite[Eq.~218]{ReLL09},
+\cite[Eq.~2.34]{Laz06} \cite[Eq.~218]{ReLL09},
 except for different parametrization $L=2R_{\rm{\Code{IsGISAXS}}}$.
 Since \BornAgain-1.6 implemented
-using the generic polyhedron form factor \cite{ba:ffp}.
+using the generic polyhedron form factor \cite{Wut17}.
 
 
 %===============================================================================
@@ -730,10 +655,10 @@ for four different tilt angles~$\vartheta$ (rotation around the $y$ axis).}
 \end{figure}
 
 \paragraph{History and Derivation}\strut\\
-For real wave vectors, this form factor is well known;
+For real wavevectors, this form factor is well known;
 it goes back to Lord Rayleigh.
 In \IsGISAXS, it has been implemented as form factor \E{Cylinder}
-\cite[Eq.~2.27]{Laz08} \cite[Eq.~223]{ReLL09},
+\cite[Eq.~2.27]{Laz06} \cite[Eq.~223]{ReLL09},
 allowing for complex wavevectors.
 
 Since it is not obvious that the standard formula also holds for complex~$\q$,
@@ -764,7 +689,7 @@ Integration over~$r$ then yields the in-plane contribution to the form factor~$F
 \ffsection{Dodecahedron} \label{SDodecahedron}
 %===============================================================================
   \index{Dodecahedron (form factor)}
-  \index{Platonic solids!dodecahedron}
+  \index{Platonic solid!dodecahedron}
   \index{FormFactorDodecahedron@\Code{FormFactorDodecahedron}}
 
 \paragraph{Real-space geometry}\strut\\
@@ -795,7 +720,7 @@ with the parameter
 \paragraph{Form factor, volume, horizontal section}\strut\\
 \begin{equation*}
   F \text{~: computed using the generic form factor of a polyhedron
-             with inversion symmetry~\cite{ba:ffp},}
+             with inversion symmetry~\cite{Wut17},}
 \end{equation*}
 \begin{equation*}
   V= \frac{1}{4} (15+7\sqrt{5}) a^3 \approx 7.663\,a^3,
@@ -832,7 +757,7 @@ ditto, and tilted by $9^\circ$ around the $x$ axis.}
 
 \paragraph{History}\strut\\
 New in \BornAgain-1.6,
-based on the generic form factor of the polyhedron~\cite{ba:ffp}.
+based on the generic form factor of the polyhedron~\cite{Wut17}.
 
 
 %===============================================================================
@@ -896,7 +821,7 @@ for four different angles~$\omega$ of rotation around the $z$ axis.}
 
 \paragraph{History}\strut\\
 Agrees with the \IsGISAXS\ form factor
-\E{Ellipsoid} \cite[Eq.~2.41, wrongly labeled in Fig.~2.4]{Laz08}
+\E{Ellipsoid} \cite[Eq.~2.41, wrongly labeled in Fig.~2.4]{Laz06}
 or \E{Ellipsoidal Cylinder} \cite[Eq.~224]{ReLL09}.
 
 
@@ -960,10 +885,10 @@ computed with $R=3.9$~nm.}
 \end{figure}
 
 \paragraph{History and Derivation}\strut\\
-For real wave vectors, this form factor is well known;
+For real wavevectors, this form factor is well known;
 it goes back at least to Lord Rayleigh.
 In \IsGISAXS, it has been implemented as form factor \E{Full sphere}
-\cite[Eq.~2.36]{Laz08} \cite[Eq.~226]{ReLL09},
+\cite[Eq.~2.36]{Laz06} \cite[Eq.~226]{ReLL09},
 allowing for complex wavevectors.
 Since it is not obvious that Rayleigh's formula also holds for complex~$\q$,
 let us outline a derivation
@@ -1094,7 +1019,7 @@ computed with $R=3.5$~nm and $H=9.8$~nm.}
 
 \paragraph{History}\strut\\
 Agrees with the \E{Full spheroid} form factor of \IsGISAXS\
-\cite[Eq.~2.37]{Laz08} \cite[Eq.~227]{ReLL09},
+\cite[Eq.~2.37]{Laz06} \cite[Eq.~227]{ReLL09},
 with corrected volume formula.
 We also discovered a wrong factor of~2 in the \IsGISAXS\ code.
 
@@ -1164,7 +1089,7 @@ for four different angles~$\omega$ of rotation around the $z$ axis.}
 \paragraph{History}\strut\\
 Agrees with the \IsGISAXS\ form factor
 \E{Anisotropic hemi-ellipsoid}
-\cite[Eq.~2.42, with wrong sign in the $z$-dependent phase factor]{Laz08}
+\cite[Eq.~2.42, with wrong sign in the $z$-dependent phase factor]{Laz06}
 or \E{Hemi-spheroid} \cite[Eq.~229]{ReLL09}.
 
 
@@ -1172,7 +1097,7 @@ or \E{Hemi-spheroid} \cite[Eq.~229]{ReLL09}.
 \ffsection{Icosahedron} \label{SIcosahedron}
 %===============================================================================
   \index{Icosahedron (form factor)}
-  \index{Platonic solids!icosahedron}
+  \index{Platonic solid!icosahedron}
   \index{FormFactorIcosahedron@\Code{FormFactorIcosahedron}}
 
 \paragraph{Real-space geometry}\strut\\
@@ -1203,7 +1128,7 @@ with the parameter
 \paragraph{Form factor, volume, horizontal section}\strut\\
 \begin{equation*}
   F \text{~: computed using the generic form factor of a polyhedron
-             with inversion symmetry~\cite{ba:ffp},}
+             with inversion symmetry~\cite{Wut17},}
 \end{equation*}
 \begin{equation*}
   V= \frac{5}{12} (3+\sqrt5)a^3 \approx 2.182\,a^3
@@ -1240,7 +1165,7 @@ ditto, and tilted by $9^\circ$ around the $x$ axis.}
 
 \paragraph{History}\strut\\
 New in \BornAgain-1.6,
-based on the generic form factor of the polyhedron~\cite{ba:ffp}.
+based on the generic form factor of the polyhedron~\cite{Wut17}.
 
 
 %===============================================================================
@@ -1279,7 +1204,7 @@ with the parameters
 F = H \sinc\left(q_z\frac{H}{2}\right) \exp\left(-i q_z\frac{ H}{2}\right) F_\parallel(\q_\parallel)
 \end{equation*}
 with the form factor $F_\parallel$ of the base triangle
-computed using the generic form factor of a planar polygon \cite{ba:ffp},
+computed using the generic form factor of a planar polygon \cite{Wut17},
 \begin{equation*}
   V= \dfrac{\sqrt{3}}{4} H L^2,
 \end{equation*}
@@ -1301,7 +1226,7 @@ for four different angles~$\omega$ of rotation around the $z$ axis.}
 
 \paragraph{History}\strut\\
 Has been validated against the \E{Prism3} form factor of \IsGISAXS\
-\cite[Eq.~2.29]{Laz08} \cite[Eq.~219]{ReLL09}.
+\cite[Eq.~2.29]{Laz06} \cite[Eq.~219]{ReLL09}.
 Note the different parameterization $L= 2 R_{\rm{\Code{IsGISAXS}}}$.
 In \FitGISAXS\ just called \E{Prism} \cite{Bab13}.
 In \BornAgain-1.6,
@@ -1309,7 +1234,7 @@ redefined to let the $x$ axis point along a symmetry axis
 (rotated by $30^\circ$ with respect to the previous version).
 
 Reimplemented in \BornAgain-1.6 using the generic form factor
-of a polygonal prism \cite{ba:ffp},
+of a polygonal prism \cite{Wut17},
 to achieve numerical stability near the removable singularity at $q\to0$.
 
 %===============================================================================
@@ -1349,7 +1274,7 @@ F = H \sinc\left(q_z\frac{H}{2}\right) \exp\left(-i q_z\frac{ H}{2}\right) F_\pa
 \end{equation*}
 with the form factor $F_\parallel$ of the base hexagon
 computed using the generic form factor of a planar polygon
-with two-fold symmetry~($S_2$) \cite{ba:ffp},
+with two-fold symmetry~($S_2$) \cite{Wut17},
 \begin{equation*}
   V = \dfrac{3\sqrt{3}}{2}H R^2,
 \end{equation*}
@@ -1371,12 +1296,12 @@ for four different angles~$\omega$ of rotation around the $z$ axis.}
 
 \paragraph{History}\strut\\
 Has been validated against the \E{Prism6} form factor of \IsGISAXS\
-\cite[Eq.~2.31]{Laz08} \cite[Eq.~221]{ReLL09},
+\cite[Eq.~2.31]{Laz06} \cite[Eq.~221]{ReLL09},
 which has different parametrization
 and lacks a factor $H$ in $F(\q)$.
 
 Reimplemented in \BornAgain-1.5 using the generic form factor
-of a polygonal prism with symmetry~$S_2$ \cite{ba:ffp},
+of a polygonal prism with symmetry~$S_2$ \cite{Wut17},
 to achieve numerical stability near the removable singularity at $q\to0$.
 
 
@@ -1419,7 +1344,7 @@ They must fulfill
 
 \paragraph{Form factor, volume, horizontal section}\strut\\
 \begin{equation*}
-  F \text{~: computed using the generic polyhedron form factor~\cite{ba:ffp},}
+  F \text{~: computed using the generic polyhedron form factor~\cite{Wut17},}
 \end{equation*}
 \begin{equation*}
   V = \dfrac{1}{6}  L^3 \tan\alpha\left[ 1
@@ -1442,12 +1367,12 @@ for four different angles~$\omega$ of rotation around the $z$ axis.}
 
 \paragraph{History}\strut\\
 Corresponds to \E{Pyramid} form factor of \IsGISAXS\
-\cite[Eq.~2.31]{Laz08} \cite[Eq.~221]{ReLL09},
+\cite[Eq.~2.31]{Laz06} \cite[Eq.~221]{ReLL09},
 except for different parametrization $L=2R_{\rm{\Code{IsGISXAXS}}}$
 and a corrected sign.
 
 Reimplemented in \BornAgain-1.6 using the generic form factor
-of a polygonal prism \cite{ba:ffp},
+of a polygonal prism \cite{Wut17},
 to achieve numerical stability near the removable singularity at $q\to0$.
 
 
@@ -1456,7 +1381,7 @@ to achieve numerical stability near the removable singularity at $q\to0$.
 %===============================================================================
   \index{Tetrahedron (form factor)}
   \index{Truncated tetrahedron (form factor)}
-  \index{Platonic solids!tetrahedron}
+  \index{Platonic solid!tetrahedron}
   \index{FormFactorTetrahedron@\Code{FormFactorTetrahedron}}
 
 \paragraph{Real-space geometry}\strut\\
@@ -1496,7 +1421,7 @@ It is related to the dihedral angle through $\tan \alpha = 2 \tan \beta$.
 
 \paragraph{Form factor, volume, horizontal section}\strut\\
 \begin{equation*}
-  F\text{~: computed using the generic polyhedron form factor~\cite{ba:ffp},}
+  F\text{~: computed using the generic polyhedron form factor~\cite{Wut17},}
 \end{equation*}
 \begin{equation*}
   V= \dfrac{\tan(\alpha) L^3}{24} \left[1- \left(1 -
@@ -1520,7 +1445,7 @@ The low symmetry requires other angular ranges than used in most other figures.}
 
 \paragraph{History}\strut\\
 Previous implementations as \E{Tetrahedron} in \IsGISAXS\
-\cite[Eq.~2.30]{Laz08} \cite[Eq.~220]{ReLL09},
+\cite[Eq.~2.30]{Laz06} \cite[Eq.~220]{ReLL09},
 and as  \E{Truncated tetrahedron} in \FitGISAXS\ \cite{Bab13}.
 In \BornAgain-1.6,
 redefined to let the $x$ axis lie in a mirror plane
@@ -1528,7 +1453,7 @@ redefined to let the $x$ axis lie in a mirror plane
 
 Up to \BornAgain-1.5, we computed the form factor by numeric integration, as in \IsGISAXS.
 Since \BornAgain-1.6 higher speed and accuracy are achieved
-by using the generic polyhedron form factor \cite{ba:ffp},
+by using the generic polyhedron form factor \cite{Wut17},
 with series expansions near singularities.
 
 %===============================================================================
@@ -1571,7 +1496,7 @@ They must fulfill
 \paragraph{Form factor, volume, horizontal section}\strut\\
 \begin{equation*}
   F \text{~: computed using the generic form factor of a polyhedron
-             with inversion symmetry~\cite{ba:ffp},}
+             with inversion symmetry~\cite{Wut17},}
 \end{equation*}
 \begin{equation*}
   V = L^3 - \dfrac{4}{3}t^3,
@@ -1594,7 +1519,7 @@ for four different angles~$\omega$ of rotation around the $z$ axis.}
 \paragraph{History}\strut\\
 Motivated by \cite{HeSS74}.
 Reimplemented in \BornAgain-1.6 using the generic form factor
-of a polygonal prism \cite{ba:ffp}.
+of a polygonal prism \cite{Wut17}.
 
 
 %===============================================================================
@@ -1670,7 +1595,7 @@ for four different tilt angles~$\vartheta$ (rotation around the $y$ axis).}
 
 \paragraph{History}\strut\\
 Agrees with the \IsGISAXS\ form factor
-\E{Sphere} \cite[Eq.~2.33]{Laz08} or
+\E{Sphere} \cite[Eq.~2.33]{Laz06} or
 \E{Truncated sphere} \cite[Eq.~228]{ReLL09}.
 
 
@@ -1747,7 +1672,7 @@ for four different tilt angles~$\vartheta$ (rotation around the $y$ axis).}
 
 \paragraph{History}\strut\\
 Agrees with the \IsGISAXS\ form factor
-\E{Sphere} \cite[Eq.~2.33]{Laz08} or
+\E{Sphere} \cite[Eq.~2.33]{Laz06} or
 \E{TruncatedSpheroid} \cite[Eq.~228]{ReLL09}.
 % Note an erroneous factor~2 in the expression of the volume
 % in the \Code{IsGISAXS} manual.
@@ -1756,7 +1681,7 @@ Agrees with the \IsGISAXS\ form factor
 \index{Form factor!catalogue|)}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\section{Ripples}\label{SRipple}
+\chapter{Ripples}\label{SRipple}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 
diff --git a/Doc/FFCatalog/Macros.tex b/Doc/FFCatalog/Macros.tex
new file mode 100644
index 0000000000000000000000000000000000000000..0c8d1299fe0d09f476a43f6d24945a6bc1a75a6a
--- /dev/null
+++ b/Doc/FFCatalog/Macros.tex
@@ -0,0 +1,96 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%%   BornAgain User Manual
+%%
+%%   homepage:   http://www.bornagainproject.org
+%%
+%%   copyright:  Forschungszentrum Jülich GmbH 2015
+%%
+%%   license:    Creative Commons CC-BY-SA
+%%
+%%   authors:    Scientific Computing Group at MLZ Garching
+%%               C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% TeX/LaTeX macros we will overwrite
+\let\ringaccent\r
+
+% Vectors
+\def\v#1{\ensuremath{\mathbf{#1}}}
+% unused \newcommand{\unitvec}[1]{\ensuremath{\widehat{\vect{#1}}}}
+
+% Tensors
+\def\TENS#1{\ensuremath{\mathsf{#1}}}
+\def\ONE{\TENS{1}}
+
+% Math operators
+\newcommand{\ggll}{\mathrel{\substack{\ll\\[-.05em]\gg}}}
+\newcommand{\llgg}{\mathrel{\substack{\gg\\[-.05em]\ll}}}
+\newcommand{\Nabla}{\v{\nabla}}
+
+% Curly letters
+\newcommand{\curlf}{\ensuremath{\mathcal{F}}}
+\newcommand{\curlp}{\ensuremath{\mathcal{P}}}
+\def\Sample{\ensuremath{\mathcal{M}}}
+\def\Sphere{\ensuremath{\mathcal{S}}}
+
+% Pair correlation functions
+\newcommand{\ppcf}[3]{\ensuremath{\mathcal{G}_{#1 ,#2}\left( \v{#3}_{#1} , \v{#3}_{#2} \right)}}
+\newcommand{\ppcfb}[3]{\ensuremath{\mathcal{G}_{#1 #2}\left( \v{#3}_{#1 #2} \right)}}
+
+% Fixed-font words
+\newcommand{\Code}[1]{\texttt{#1}}
+\newcommand{\BornAgain}{{Born\discretionary{}{}{}Again}}%
+\newcommand{\IsGISAXS}{\Code{IsGISAXS}}%
+\newcommand{\FitGISAXS}{\Code{FitGISAXS}}%
+
+\def\DS{\displaystyle}
+
+\def\d{\mathrm d}
+\def\e{\mathrm e}
+\def\eps{\epsilon}
+\def\E#1{\textsl{#1}}
+\def\etal{\E{et al.}}
+\def\FD{\mathcal{F}}
+\def\GD{\mathcal{G}}
+\def\idest{\E{i.e.\ }}
+\def\k{\v{k}}
+\def\kD{\k_\text{D}}
+\def\mv{\overline{v}}
+\def\nz{\overline{n^2}}
+\def\plll{\parallel}
+\def\PD{\mathcal{P}}
+\def\q{\v{q}}
+\def\hx{\v{\hat x}}
+\def\hy{\v{\hat y}}
+\def\AA{\ringaccent A}
+\def\r{\v{r}}
+\def\R{\v{R}}
+\def\rD{\r_\text{D}}
+\def\rS{\r_\text{S}}
+\def\se{\text{e}}
+\def\si{\text{i}}
+\def\sf{\text{f}}
+\def\SD{\mathcal{S}}
+\def\SRC#1#2{\href{https://github.com/scgmlz/BornAgain/blob/master/#1/#2}{#2}}
+\def\T#1{\texttt{#1}}
+\def\xElas{\frac{\d\sigma}{\d\Omega}}
+
+\renewcommand{\u}[1]{\underline{#1}}
+\newcommand{\uu}[1]{\underline{\underline{#1}}}
+\newcommand{\UP}{\uparrow}
+\newcommand{\DN}{\downarrow}
+
+%-------------------------------------------------------------------------------
+%	HYPHENATION
+%-------------------------------------------------------------------------------
+
+\hyphenation{
+Born-Again
+equi-dis-tant
+MacOS
+nano-par-ti-cle nano-par-ti-cles
+para-crys-tal
+Schrö-ding-er
+wave-num-ber}
diff --git a/Doc/FFCatalog/Preface.tex b/Doc/FFCatalog/Preface.tex
new file mode 100644
index 0000000000000000000000000000000000000000..925d77ff562bc9bfec2a8a4959e691ba3832b2a0
--- /dev/null
+++ b/Doc/FFCatalog/Preface.tex
@@ -0,0 +1,68 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%%   BornAgain User Manual
+%%
+%%   homepage:   http://www.bornagainproject.org
+%%
+%%   copyright:  Forschungszentrum Jülich GmbH 2015
+%%
+%%   license:    Creative Commons CC-BY-SA
+%%
+%%   authors:    Scientific Computing Group at MLZ Garching
+%%               C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\cleardoublepage
+\ichapter{Preface}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\isection{About BornAgain}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+BornAgain is a software package
+to simulate and fit
+reflectometry, off-specular scattering,
+and grazing-incidence small-angle scattering (GISAS)
+of X-rays and neutrons.
+It provides a generic framework
+for modeling multilayer samples with smooth or
+rough interfaces and with various types of embedded nanoparticles.
+The name, \BornAgain,
+alludes to the central role of the distorted-wave Born
+approximation (DWBA) in the physical description of the
+scattering process.
+\index{Distorted-wave Born approximation}
+
+BornAgain is maintained
+by the Scientific Computing Group
+of the J\"ulich Centre for Neutron Science (JCNS)
+at Heinz Maier-Leibnitz Zentrum (MLZ) Garching, Germany.
+It free and open source software.
+The source code is released under the GNU General Public License (GPL, version 3 or higher),
+the documentation under the Creative Commons license CC-BY-SA.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\isection{Citation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The canonical reference for BornAgain is the journal article
+\begin{quote}
+Gennady Pospelov, Walter Van Herck, Jan Burle, Juan M. Carmona Loaiza,
+Céline Durniak, Jonathan M. Fisher, Marina Ganeva, Dmitry Yurov and
+Joachim Wuttke:\\
+BornAgain : software for simulating and fitting
+grazing-incidence small-angle scattering\\
+\href{https://doi.org/10.1107/S1600576719016789}{J. Appl. Cryst. 53, 262–276 (2020)}
+\end{quote}
+Use of the software version should additionally be documented by citing a specific version
+\index{Citation}%
+\begin{quote}
+BornAgain --- Software for simulating and fitting
+X-ray and neutron small-angle scattering at grazing incidence,
+version $\langle$\texttt{version}$\rangle$ ($\langle$\texttt{release date}$\rangle$),\\
+\url{http://www.bornagainproject.org}
+\end{quote}
+Citation of the present document is only necessary
+when referring to specific information about form factors.
diff --git a/Doc/FFCatalog/Setup.tex b/Doc/FFCatalog/Setup.tex
new file mode 100644
index 0000000000000000000000000000000000000000..15762b59dd8cbeaa5f044a270b2ec3738c18e942
--- /dev/null
+++ b/Doc/FFCatalog/Setup.tex
@@ -0,0 +1,425 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%%   BornAgain User Manual
+%%
+%%   homepage:   http://www.bornagainproject.org
+%%
+%%   copyright:  Forschungszentrum Jülich GmbH 2015
+%%
+%%   license:    Creative Commons CC-BY-SA
+%%
+%%   authors:    Scientific Computing Group at MLZ Garching
+%%               C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\usepackage{ifdraft}
+
+\let\angstrom=\AA
+
+%-------------------------------------------------------------------------------
+%  Page layout
+%-------------------------------------------------------------------------------
+
+% Horizontal setup
+\textwidth=410pt
+\hoffset=210mm % width of A4
+\advance\hoffset by -1\textwidth
+\ifdraft{\hoffset=0.\hoffset}{\hoffset=0.5\hoffset}
+\advance\hoffset by -1in
+% Now a slight assymmetry to leave more blank on the side of the fold
+\ifdraft{}{
+  \evensidemargin=0pt
+  \oddsidemargin=5pt
+  \advance\evensidemargin by -1\oddsidemargin}
+
+\def\myparindent{5ex}
+\setlength{\parindent}{\myparindent} % workaround, for colorboxes
+
+% Vertical setup
+\setlength{\headheight}{0pt}
+\setlength{\headsep}{10pt}
+\setlength{\textheight}{630pt} % default=592pt
+\setlength{\footskip}{45pt}
+\setlength{\marginparwidth}{7em}
+\renewcommand{\baselinestretch}{1.02}
+
+\renewcommand{\arraystretch}{1.3}
+
+%-------------------------------------------------------------------------------
+%  Symbols, fonts
+%-------------------------------------------------------------------------------
+
+\usepackage{amsmath}
+\usepackage{mathtools} % has \coloneqq for :=
+% \usepackage{manfnt} % for \dbend
+\usepackage{dingbat}
+\usepackage{amssymb}
+\usepackage{braket}
+
+% prevent unicode-math from overwriting
+
+\AtBeginDocument{\renewcommand{\Re}{\operatorname{Re}}}
+\AtBeginDocument{\renewcommand{\Im}{\operatorname{Im}}}
+
+% Math operators
+\DeclareMathOperator{\sinc}{sinc}
+\DeclareMathOperator{\expmone}{expm1}
+\DeclareMathOperator{\expmtwo}{expm2}
+\DeclareMathOperator{\Tr}{Tr}
+
+%-------------------------------------------------------------------------------
+%  Footer
+%-------------------------------------------------------------------------------
+
+\makeatletter
+\def\@oddfoot{{v \version}\phantom{\thepage}\hfill BornAgain Form Factor Catalog\hfill
+\phantom{v \version}\thepage}
+\def\@evenfoot{\@oddfoot}
+\makeatother
+\def\pagereset{}
+
+%-------------------------------------------------------------------------------
+%  Sectioning
+%-------------------------------------------------------------------------------
+
+\makeatletter
+
+\newif\ifnumberedchapter
+\def\@makechapterhead#1{\numberedchaptertrue\mychapterhead{#1}}
+\def\@makeschapterhead#1{\numberedchapterfalse\mychapterhead{#1}}
+
+\newif\iffirstchapterinpart
+\firstchapterinpartfalse
+\renewcommand\part{%
+  \clearpage\firstchapterinparttrue
+  %\thispagestyle{plain}%
+  \if@twocolumn
+    \onecolumn
+    \@tempswatrue
+  \else
+    \@tempswafalse
+  \fi
+  \vspace*{50\p@ plus 10\p@ minus 10\p@}%
+  \secdef\@part\@spart}
+
+
+\def\@part[#1]#2{%
+    \refstepcounter{part}%
+    \addcontentsline{toc}{part}{Part~\thepart\hspace{1em}#1}%
+    \markboth{}{}%
+    {\interlinepenalty \@M
+     \normalfont
+     \ifnum \c@secnumdepth >-2\relax
+       \parindent \z@ \Large\bfseries \partname\nobreakspace\thepart
+       \par
+       \vskip 20\p@
+     \fi
+     \parindent \z@ \huge \bfseries #2\par}
+    }
+
+\newif\iffirstsectioninchapter
+\def\sectionclear{\iffirstsectioninchapter\else\ifdraft{\clearpage}{}\fi}
+
+\renewcommand\chapter{
+  \firstsectioninchaptertrue
+  \pagereset
+  \iffirstchapterinpart\else\clearpage\fi
+  \firstchapterinpartfalse
+  %\thispagestyle{myheadings}
+  %                  \thispagestyle{plain}%
+  \global\@topnum\z@
+  \@afterindentfalse
+  \secdef\@chapter\@schapter}
+
+\def\mychapterhead#1{%
+  \vspace*{50\p@ plus 10\p@ minus 10\p@}%
+  {\parindent \z@ \normalfont
+    \raggedright
+    \LARGE \bfseries \ifnumberedchapter\thechapter~~\fi #1\par\nobreak
+    \interlinepenalty\@M
+    \vskip 10\p@ plus 2\p@ minus 2\p@
+%    \hrule
+    \interlinepenalty\@M
+    \vskip 40\p@ plus 8\p@ minus 8\p@
+  }}
+
+\def\pagemode#1{%
+\ifdraft{
+\def\thepage{#1:\arabic{page}} % compositor character must agree with page_compositor in *.ist files
+\def\pagereset{\setcounter{page}{1}}}{}}
+
+% Index, Bibliography, ...
+\def\otherchapter#1#2{
+  \clearpage
+  \pagemode{#2}
+  \phantomsection
+  \addcontentsline{toc}{chapter}{#1}
+  \markboth{#1}{#1}}
+
+\def\ichapter#1{\chapter*{#1}\addcontentsline{toc}{chapter}{#1}}
+\def\isection#1{\section*{#1}\addcontentsline{toc}{section}{#1}}
+
+\renewcommand\section{\@startsection{section}{1}{\z@}
+  {-3.5ex \@plus -1.5ex \@minus -.5ex}
+  {2.3ex \@plus .8ex \@minus .5ex}
+  {\sectionclear\global\firstsectioninchapterfalse\normalfont\Large\bfseries}}
+\renewcommand\subsection{\@startsection{subsection}{2}{\z@}
+  {-3.25ex\@plus -1.3ex \@minus -.4ex}
+  {1.5ex \@plus .5ex \@minus .3ex}
+  {\normalfont\large\bfseries}}
+
+% from size11.clo
+\renewcommand\normalsize{
+   \@setfontsize\normalsize\@xipt{13.6}%
+   \abovedisplayskip 11\p@ \@plus7\p@ \@minus6\p@
+   \abovedisplayshortskip \z@ \@plus3\p@
+   \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
+   \belowdisplayskip \abovedisplayskip
+   \let\@listi\@listI}
+\makeatother
+
+\setcounter{secnumdepth}{3}
+\setcounter{tocdepth}{2}
+%\usepackage[toc,page]{appendix}
+\usepackage{titlesec}
+
+\def\TTI#1{#1@\Code{#1}}
+\def\ttIdx#1{\texttt{#1}\index{\TTI{#1}}}
+\def\ttIdx#1{\texttt{#1}\index{\TTI{#1}}}
+\def\clFctHide#1#2{\index{\TTI{#1}!\TTI{#2}}\index{#2 #1@\Code{#2} (\Code{#1})}}
+\def\clFct#1#2{\texttt{#2}\clFctHide{#1}{#2}}
+\def\constrHide#1{\index{\TTI{#1}!constructor}}
+\def\constr#1{\texttt{#1}\constrHide{#1}}
+
+%-------------------------------------------------------------------------------
+%  Table of Contents
+%-------------------------------------------------------------------------------
+
+% from latex.ltx, worked incorrectly for non-standard page label
+\makeatletter
+\def\@dottedtocline#1#2#3#4#5{%
+  \ifnum #1>\c@tocdepth \else
+    \vskip \z@ \@plus.2\p@
+    {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
+     \parindent #2\relax\@afterindenttrue
+     \interlinepenalty\@M
+     \leavevmode
+     \@tempdima #3\relax
+     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
+     {#4}\nobreak
+     \leaders\hbox{$\m@th
+        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
+        mu$}\hfill
+     \nobreak
+     \hbox{\hfil\normalfont \normalcolor #5}% % patched here
+     \par}%
+  \fi}
+\makeatother
+
+%-------------------------------------------------------------------------------
+%  Index, List of Symbols
+%-------------------------------------------------------------------------------
+
+\ifdraft{\usepackage{showidx}}{}
+\usepackage[noautomatic]{imakeidx}
+\makeindex
+
+\makeatletter
+% patch showidx
+\def\@showidx#1{%
+  \insert\indexbox{\tiny
+    \hsize2\marginparwidth
+    \hangindent\marginparsep \parindent\z@
+    \everypar{}\let\par\@@par \parfillskip\@flushglue
+    \lineskip\normallineskip
+    \baselineskip .8\normalbaselineskip\sloppy
+    \raggedright \leavevmode
+    \vrule \@height .7\normalbaselineskip \@width \z@\relax
+        #1\relax
+    \vrule \@height \z@ \@depth .3\normalbaselineskip \@width \z@}}
+\def\@mkidx{\smash{\hbox{\raise3cm\vbox to \z@{\hbox{\@rightidx\box\indexbox}\vss}}}}
+\def\@rightidx{\hskip\columnwidth \hskip\marginparsep}
+  \renewenvironment{theindex}
+    {\imki@maybeaddtotoc
+     \imki@indexlevel{\indexname}\imki@indexheaders
+     % patched here \thispagestyle{\imki@firstpagestyle}%
+     \ifnum\imki@columns>\@ne
+       \columnsep \imki@columnsep
+       \ifx\imki@idxprologue\relax
+         \begin{multicols}{\imki@columns}
+       \else
+         \begin{multicols}{\imki@columns}[\imki@idxprologue]
+       \fi
+     \else
+       \imki@idxprologue
+     \fi
+     \global\let\imki@idxprologue\relax
+     \parindent\z@
+     \parskip\z@ \@plus .3\p@\relax
+     \columnseprule \ifKV@imki@columnseprule.4\p@\else\z@\fi
+     \raggedright
+     \let\item\@idxitem
+     \imki@othercode}
+    {\ifnum\imki@columns>\@ne\end{multicols}\fi}
+\makeatother
+
+
+\usepackage[refpage]{nomencl}
+\makenomenclature
+\renewcommand{\nomname}{List of Symbols}
+  % see nomencl.txt for how to force the ordering of symbols
+\def\nompageref#1{,~\hyperpage{#1}\nomentryend\endgroup}
+\makeatletter
+\def\thenomenclature{%
+  \nompreamble
+  \list{}{%
+    \labelwidth\nom@tempdim
+    \leftmargin\labelwidth
+    \advance\leftmargin\labelsep
+    \itemsep\nomitemsep
+    \let\makelabel\nomlabel}}
+\makeatother
+
+%-------------------------------------------------------------------------------
+%  Improve LaTeX basics
+%-------------------------------------------------------------------------------
+
+\usepackage{enumitem}
+\usepackage{subfigure}
+
+\usepackage{placeins} % defines \FloatBarrier
+\usepackage{float}
+\usepackage[font={small}]{caption}
+
+%-------------------------------------------------------------------------------
+%  Tables, code listings, ...
+%-------------------------------------------------------------------------------
+
+\usepackage{longtable}
+%\usepackage{booktabs} % defines \toprule &c for use in tabular
+% see http://tex.stackexchange.com/questions/78075/multi-page-with-tabulary
+\usepackage{tabulary}
+
+\usepackage[final]{listings}
+\usepackage[x11names]{xcolor}
+\usepackage{lstcustom} % under our control
+\renewcommand{\lstfontfamily}{\ttfamily}
+
+\def\setPy{\lstset{language=python,style=eclipseboxed,numbers=none,nolol,
+   backgroundcolor=\color{SlateGray1}}}
+\def\setPyNum{\lstset{language=python,style=eclipseboxed,nolol,
+   backgroundcolor=\color{SlateGray1}}}
+\def\setCpp{\lstset{language=python,style=eclipseboxed,numbers=none,nolol,
+   backgroundcolor=\color{Wheat1}}}
+\setPy
+
+%-------------------------------------------------------------------------------
+%  Tikz pictures
+%-------------------------------------------------------------------------------
+
+\usepackage{tikz}
+%\usepackage{tikz-uml}
+\usetikzlibrary{trees,matrix,positioning,decorations.pathreplacing,calc}
+
+\newcommand{\ntikzmark}[2]
+           {#2\thinspace\tikz[overlay,remember picture,baseline=(#1.base)]
+             {\node[inner sep=0pt] (#1) {};}}
+
+\newcommand{\makebrace}[3]{%
+    \begin{tikzpicture}[overlay, remember picture]
+        \draw [decoration={brace,amplitude=0.6em},decorate]
+        let \p1=(#1), \p2=(#2) in
+        ({max(\x1,\x2)}, {\y1+1.5em}) -- node[right=0.6em] {#3} ({max(\x1,\x2)}, {\y2});
+    \end{tikzpicture}
+}
+
+%-------------------------------------------------------------------------------
+%  Conditional pictures
+%-------------------------------------------------------------------------------
+
+\def\TW{\textwidth}
+\ifdraft{\def\skipresult{true}}{\def\skipresult{false}}
+\def\includefinal#1#2{\includegraphics[width=#1,draft=\skipresult]{#2}}
+
+%-------------------------------------------------------------------------------
+%  Highlighting
+%-------------------------------------------------------------------------------
+
+\usepackage{mdframed}
+\input FixMdframed % bug fix to prevent erroneous page breaks
+% doesnt work:
+%\newcommand\widow{%
+%  \widowpenalty=10000
+%
+%  \widowpenalty=150}
+
+\def\defineBox#1#2#3#4#5{
+  \newmdenv[
+    usetwoside=false,
+    skipabove=3pt minus 1pt plus 3pt,
+    skipbelow=3pt minus 1pt plus 3pt,
+    leftmargin=-4pt,
+    rightmargin=-4pt,
+    innerleftmargin=2pt,
+    innerrightmargin=2pt,
+    innertopmargin=4pt,
+    innerbottommargin=4pt,
+    backgroundcolor=#3,
+    topline=false,
+    bottomline=false,
+    linecolor=#4,
+    linewidth=2pt,
+    ]{#2*}
+  \newenvironment{#1}
+    {\begin{#2*}\makebox[0pt][r]{\smash{#5}}\ignorespaces}
+    {\end{#2*}\mdbreakon}
+}
+
+\def\mdbreakoff{\makeatletter\booltrue{mdf@nobreak}\makeatother}
+\def\mdbreakon{\makeatletter\boolfalse{mdf@nobreak}\makeatother}
+
+\def\marginSymbolLarge#1#2{\raisebox{-4ex}{\includegraphics[width=3em]{#1}\hspace{10pt}}}
+\def\marginSymbolMedium#1#2{\raisebox{-2ex}{\includegraphics[width=2em]{#1}\hspace{15pt}}}
+
+\def\MissingSection{\begin{boxWork}\ldots\ to be written \ldots\end{boxWork}}
+
+%-------------------------------------------------------------------------------
+%  Hyper ref and clever ref
+%-------------------------------------------------------------------------------
+
+\usepackage[final,pagebackref=true]{hyperref} % wants to be included last
+\hypersetup{
+    colorlinks,
+    linkcolor={red!50!black},
+    citecolor={blue!50!black},
+    urlcolor={blue!80!black},
+    pdftitle={BornAgain Form Factor Catalog} % seems to be ignored
+}
+\ifdraft{\usepackage[right]{showlabels}}{}
+
+\usepackage{cleveref}
+
+\crefformat{equation}{(#2#1#3)}
+\Crefformat{equation}{Equation~(#2#1#3)}
+\crefmultiformat{equation}{(#2#1#3)}{ and~(#2#1#3)}{, (#2#1#3)}{ and~(#2#1#3)}
+\crefrangeformat{equation}{(#3#1#4) to~(#5#2#6)}
+
+\crefformat{part}{Part~#2#1#3}
+\Crefformat{part}{Part~#2#1#3}
+
+\crefformat{chapter}{Chapter~#2#1#3}
+\Crefformat{chapter}{Chapter~#2#1#3}
+
+\crefformat{section}{Sec.~#2#1#3}
+\Crefformat{section}{Section~#2#1#3}
+\crefmultiformat{section}{Secs.\ #2#1#3}{ and~#2#1#3}{, #2#1#3}{ and~#2#1#3}
+
+\crefformat{subsection}{Sec.~#2#1#3}
+\Crefformat{subsection}{Section~#2#1#3}
+
+\crefformat{subsubsection}{Sec.~#2#1#3}
+\Crefformat{subsubsection}{Section~#2#1#3}
+
+\crefformat{figure}{Fig.~#2#1#3}
+\Crefformat{figure}{Figure~#2#1#3}
diff --git a/Doc/FFCatalog/Title.tex b/Doc/FFCatalog/Title.tex
new file mode 100644
index 0000000000000000000000000000000000000000..5df84f92d9493a19ab2fe346b7911819a6075624
--- /dev/null
+++ b/Doc/FFCatalog/Title.tex
@@ -0,0 +1,61 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%%   BornAgain  User Manual  Form Factor Catalog
+%%
+%%   homepage:   http://www.bornagainproject.org
+%%
+%%   copyright:  Forschungszentrum Jülich GmbH 2015-2020
+%%
+%%   license:    Creative Commons CC-BY-SA
+%%
+%%   authors:    Scientific Computing Group at MLZ Garching
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%-------------------------------------------------------------------------------
+%  Title page
+%-------------------------------------------------------------------------------
+
+\thispagestyle{empty}
+\strut\vspace{10mm}
+\begin{center}
+\Huge
+{\bf BornAgain}\\[10mm]
+{\bf  Form Factor Catalog}\\[20mm]
+\large
+Software version \version\\[5mm]
+This document last updated \today\\\vfill
+\large
+\authors\\[10mm]
+\large
+Scientific Computing Group\\[.2ex]
+J\"ulich Centre for Neutron Science\\[.2ex]
+at Heinz Maier-Leibnitz Zentrum Garching\\[.2ex]
+Forschungszentrum J\"ulich GmbH
+\end{center}
+\newpage
+
+%------------------------------------------------------------------------------
+%	DOCUMENT
+%------------------------------------------------------------------------------
+
+
+% Back of title page.
+\thispagestyle{empty}
+~\vfill
+\noindent
+\begin{tabular}{@{}p{.25\textwidth}@{}p{.75\textwidth}@{}}
+Homepage:  &\url{http://www.bornagainproject.org}\\[2ex]
+Copyright:  &Forschungszentrum Jülich GmbH 2013--\the\year\\[2ex]
+Licenses:   &Software: GNU General Public License version 3 or higher\\
+            &Documentation: Creative Commons CC-BY-SA\\[2ex]
+Authors:    &\authors\\
+            &Scientific Computing Group\\
+            &at Heinz Maier-Leibnitz Zentrum (MLZ) Garching\\[2ex]
+Disclaimer: &Software and documentation are work in progress.\\
+            &We cannot guarantee correctness and accuracy.\\
+            &If in doubt, contact us for assistance or scientific collaboration.\\[2ex]
+Funding:    &This project has received funding from the European Union’s
+             Horizon 2020 research and innovation programme under grant agreement No 654000.
+\end{tabular}
+\newpage
diff --git a/Doc/UserManual/fig/blue/AnistropicPyramid3d.png b/Doc/FFCatalog/fig/blue/AnistropicPyramid3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/AnistropicPyramid3d.png
rename to Doc/FFCatalog/fig/blue/AnistropicPyramid3d.png
diff --git a/Doc/UserManual/fig/blue/Box3d.png b/Doc/FFCatalog/fig/blue/Box3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Box3d.png
rename to Doc/FFCatalog/fig/blue/Box3d.png
diff --git a/Doc/UserManual/fig/blue/Cone3d.png b/Doc/FFCatalog/fig/blue/Cone3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Cone3d.png
rename to Doc/FFCatalog/fig/blue/Cone3d.png
diff --git a/Doc/UserManual/fig/blue/Cone63d.png b/Doc/FFCatalog/fig/blue/Cone63d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Cone63d.png
rename to Doc/FFCatalog/fig/blue/Cone63d.png
diff --git a/Doc/UserManual/fig/blue/Cuboctahedron3d.png b/Doc/FFCatalog/fig/blue/Cuboctahedron3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Cuboctahedron3d.png
rename to Doc/FFCatalog/fig/blue/Cuboctahedron3d.png
diff --git a/Doc/UserManual/fig/blue/Cylinder3d.png b/Doc/FFCatalog/fig/blue/Cylinder3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Cylinder3d.png
rename to Doc/FFCatalog/fig/blue/Cylinder3d.png
diff --git a/Doc/UserManual/fig/blue/Dodecahedron3d.png b/Doc/FFCatalog/fig/blue/Dodecahedron3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Dodecahedron3d.png
rename to Doc/FFCatalog/fig/blue/Dodecahedron3d.png
diff --git a/Doc/UserManual/fig/blue/EllipsoidalCylinder3d.png b/Doc/FFCatalog/fig/blue/EllipsoidalCylinder3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/EllipsoidalCylinder3d.png
rename to Doc/FFCatalog/fig/blue/EllipsoidalCylinder3d.png
diff --git a/Doc/UserManual/fig/blue/FullSphere3d.png b/Doc/FFCatalog/fig/blue/FullSphere3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/FullSphere3d.png
rename to Doc/FFCatalog/fig/blue/FullSphere3d.png
diff --git a/Doc/UserManual/fig/blue/FullSpheroid3d.png b/Doc/FFCatalog/fig/blue/FullSpheroid3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/FullSpheroid3d.png
rename to Doc/FFCatalog/fig/blue/FullSpheroid3d.png
diff --git a/Doc/UserManual/fig/blue/HemiEllipsoid3d.png b/Doc/FFCatalog/fig/blue/HemiEllipsoid3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/HemiEllipsoid3d.png
rename to Doc/FFCatalog/fig/blue/HemiEllipsoid3d.png
diff --git a/Doc/UserManual/fig/blue/Icosahedron3d.png b/Doc/FFCatalog/fig/blue/Icosahedron3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Icosahedron3d.png
rename to Doc/FFCatalog/fig/blue/Icosahedron3d.png
diff --git a/Doc/UserManual/fig/blue/Prism33d.png b/Doc/FFCatalog/fig/blue/Prism33d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Prism33d.png
rename to Doc/FFCatalog/fig/blue/Prism33d.png
diff --git a/Doc/UserManual/fig/blue/Prism63d.png b/Doc/FFCatalog/fig/blue/Prism63d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Prism63d.png
rename to Doc/FFCatalog/fig/blue/Prism63d.png
diff --git a/Doc/UserManual/fig/blue/Pyramid3d.png b/Doc/FFCatalog/fig/blue/Pyramid3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Pyramid3d.png
rename to Doc/FFCatalog/fig/blue/Pyramid3d.png
diff --git a/Doc/UserManual/fig/blue/Ripple13d.png b/Doc/FFCatalog/fig/blue/Ripple13d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Ripple13d.png
rename to Doc/FFCatalog/fig/blue/Ripple13d.png
diff --git a/Doc/UserManual/fig/blue/Ripple23d.png b/Doc/FFCatalog/fig/blue/Ripple23d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Ripple23d.png
rename to Doc/FFCatalog/fig/blue/Ripple23d.png
diff --git a/Doc/UserManual/fig/blue/Sphere3d.png b/Doc/FFCatalog/fig/blue/Sphere3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Sphere3d.png
rename to Doc/FFCatalog/fig/blue/Sphere3d.png
diff --git a/Doc/UserManual/fig/blue/Spheroid3d.png b/Doc/FFCatalog/fig/blue/Spheroid3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Spheroid3d.png
rename to Doc/FFCatalog/fig/blue/Spheroid3d.png
diff --git a/Doc/UserManual/fig/blue/Tetrahedron3d.png b/Doc/FFCatalog/fig/blue/Tetrahedron3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/Tetrahedron3d.png
rename to Doc/FFCatalog/fig/blue/Tetrahedron3d.png
diff --git a/Doc/UserManual/fig/blue/TruncatedCube3d.png b/Doc/FFCatalog/fig/blue/TruncatedCube3d.png
similarity index 100%
rename from Doc/UserManual/fig/blue/TruncatedCube3d.png
rename to Doc/FFCatalog/fig/blue/TruncatedCube3d.png
diff --git a/Doc/UserManual/fig/cuts/AnisoPyramid2dxy.pdf b/Doc/FFCatalog/fig/cuts/AnisoPyramid2dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/AnisoPyramid2dxy.pdf
rename to Doc/FFCatalog/fig/cuts/AnisoPyramid2dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/AnisoPyramid2dxy.svg b/Doc/FFCatalog/fig/cuts/AnisoPyramid2dxy.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/AnisoPyramid2dxy.svg
rename to Doc/FFCatalog/fig/cuts/AnisoPyramid2dxy.svg
diff --git a/Doc/UserManual/fig/cuts/AnisoPyramid2dxz.pdf b/Doc/FFCatalog/fig/cuts/AnisoPyramid2dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/AnisoPyramid2dxz.pdf
rename to Doc/FFCatalog/fig/cuts/AnisoPyramid2dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/AnisoPyramid2dxz.svg b/Doc/FFCatalog/fig/cuts/AnisoPyramid2dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/AnisoPyramid2dxz.svg
rename to Doc/FFCatalog/fig/cuts/AnisoPyramid2dxz.svg
diff --git a/Doc/UserManual/fig/cuts/Box2dxy.pdf b/Doc/FFCatalog/fig/cuts/Box2dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Box2dxy.pdf
rename to Doc/FFCatalog/fig/cuts/Box2dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/Box2dxy.svg b/Doc/FFCatalog/fig/cuts/Box2dxy.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Box2dxy.svg
rename to Doc/FFCatalog/fig/cuts/Box2dxy.svg
diff --git a/Doc/UserManual/fig/cuts/Box2dxz.pdf b/Doc/FFCatalog/fig/cuts/Box2dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Box2dxz.pdf
rename to Doc/FFCatalog/fig/cuts/Box2dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/Box2dxz.svg b/Doc/FFCatalog/fig/cuts/Box2dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Box2dxz.svg
rename to Doc/FFCatalog/fig/cuts/Box2dxz.svg
diff --git a/Doc/UserManual/fig/cuts/CONVERT b/Doc/FFCatalog/fig/cuts/CONVERT
similarity index 100%
rename from Doc/UserManual/fig/cuts/CONVERT
rename to Doc/FFCatalog/fig/cuts/CONVERT
diff --git a/Doc/UserManual/fig/cuts/Cone2dxy.pdf b/Doc/FFCatalog/fig/cuts/Cone2dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cone2dxy.pdf
rename to Doc/FFCatalog/fig/cuts/Cone2dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/Cone2dxy.svg b/Doc/FFCatalog/fig/cuts/Cone2dxy.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cone2dxy.svg
rename to Doc/FFCatalog/fig/cuts/Cone2dxy.svg
diff --git a/Doc/UserManual/fig/cuts/Cone2dxz.pdf b/Doc/FFCatalog/fig/cuts/Cone2dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cone2dxz.pdf
rename to Doc/FFCatalog/fig/cuts/Cone2dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/Cone2dxz.svg b/Doc/FFCatalog/fig/cuts/Cone2dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cone2dxz.svg
rename to Doc/FFCatalog/fig/cuts/Cone2dxz.svg
diff --git a/Doc/UserManual/fig/cuts/Cone62dxy.pdf b/Doc/FFCatalog/fig/cuts/Cone62dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cone62dxy.pdf
rename to Doc/FFCatalog/fig/cuts/Cone62dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/Cone62dxy.svg b/Doc/FFCatalog/fig/cuts/Cone62dxy.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cone62dxy.svg
rename to Doc/FFCatalog/fig/cuts/Cone62dxy.svg
diff --git a/Doc/UserManual/fig/cuts/Cone62dxz.pdf b/Doc/FFCatalog/fig/cuts/Cone62dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cone62dxz.pdf
rename to Doc/FFCatalog/fig/cuts/Cone62dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/Cone62dxz.svg b/Doc/FFCatalog/fig/cuts/Cone62dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cone62dxz.svg
rename to Doc/FFCatalog/fig/cuts/Cone62dxz.svg
diff --git a/Doc/UserManual/fig/cuts/CoreShellParallPyrxy.pdf b/Doc/FFCatalog/fig/cuts/CoreShellParallPyrxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/CoreShellParallPyrxy.pdf
rename to Doc/FFCatalog/fig/cuts/CoreShellParallPyrxy.pdf
diff --git a/Doc/UserManual/fig/cuts/CoreShellParallPyrxy.svg b/Doc/FFCatalog/fig/cuts/CoreShellParallPyrxy.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/CoreShellParallPyrxy.svg
rename to Doc/FFCatalog/fig/cuts/CoreShellParallPyrxy.svg
diff --git a/Doc/UserManual/fig/cuts/CoreShellParallPyrxz.pdf b/Doc/FFCatalog/fig/cuts/CoreShellParallPyrxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/CoreShellParallPyrxz.pdf
rename to Doc/FFCatalog/fig/cuts/CoreShellParallPyrxz.pdf
diff --git a/Doc/UserManual/fig/cuts/CoreShellParallPyrxz.svg b/Doc/FFCatalog/fig/cuts/CoreShellParallPyrxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/CoreShellParallPyrxz.svg
rename to Doc/FFCatalog/fig/cuts/CoreShellParallPyrxz.svg
diff --git a/Doc/UserManual/fig/cuts/Cuboctahedron2dxy.pdf b/Doc/FFCatalog/fig/cuts/Cuboctahedron2dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cuboctahedron2dxy.pdf
rename to Doc/FFCatalog/fig/cuts/Cuboctahedron2dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/Cuboctahedron2dxz.pdf b/Doc/FFCatalog/fig/cuts/Cuboctahedron2dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cuboctahedron2dxz.pdf
rename to Doc/FFCatalog/fig/cuts/Cuboctahedron2dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/Cuboctahedron2dxz.svg b/Doc/FFCatalog/fig/cuts/Cuboctahedron2dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cuboctahedron2dxz.svg
rename to Doc/FFCatalog/fig/cuts/Cuboctahedron2dxz.svg
diff --git a/Doc/UserManual/fig/cuts/Cylinder2dxy.pdf b/Doc/FFCatalog/fig/cuts/Cylinder2dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cylinder2dxy.pdf
rename to Doc/FFCatalog/fig/cuts/Cylinder2dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/Cylinder2dxy.svg b/Doc/FFCatalog/fig/cuts/Cylinder2dxy.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cylinder2dxy.svg
rename to Doc/FFCatalog/fig/cuts/Cylinder2dxy.svg
diff --git a/Doc/UserManual/fig/cuts/Cylinder2dxz.pdf b/Doc/FFCatalog/fig/cuts/Cylinder2dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cylinder2dxz.pdf
rename to Doc/FFCatalog/fig/cuts/Cylinder2dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/Cylinder2dxz.svg b/Doc/FFCatalog/fig/cuts/Cylinder2dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Cylinder2dxz.svg
rename to Doc/FFCatalog/fig/cuts/Cylinder2dxz.svg
diff --git a/Doc/UserManual/fig/cuts/EllipsoidalCylinder2dxy.pdf b/Doc/FFCatalog/fig/cuts/EllipsoidalCylinder2dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/EllipsoidalCylinder2dxy.pdf
rename to Doc/FFCatalog/fig/cuts/EllipsoidalCylinder2dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/EllipsoidalCylinder2dxy.svg b/Doc/FFCatalog/fig/cuts/EllipsoidalCylinder2dxy.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/EllipsoidalCylinder2dxy.svg
rename to Doc/FFCatalog/fig/cuts/EllipsoidalCylinder2dxy.svg
diff --git a/Doc/UserManual/fig/cuts/EllipsoidalCylinder2dxz.pdf b/Doc/FFCatalog/fig/cuts/EllipsoidalCylinder2dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/EllipsoidalCylinder2dxz.pdf
rename to Doc/FFCatalog/fig/cuts/EllipsoidalCylinder2dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/FullSphere2dxy.pdf b/Doc/FFCatalog/fig/cuts/FullSphere2dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/FullSphere2dxy.pdf
rename to Doc/FFCatalog/fig/cuts/FullSphere2dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/FullSphere2dxz.pdf b/Doc/FFCatalog/fig/cuts/FullSphere2dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/FullSphere2dxz.pdf
rename to Doc/FFCatalog/fig/cuts/FullSphere2dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/FullSphere2dxz.svg b/Doc/FFCatalog/fig/cuts/FullSphere2dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/FullSphere2dxz.svg
rename to Doc/FFCatalog/fig/cuts/FullSphere2dxz.svg
diff --git a/Doc/UserManual/fig/cuts/FullSpheroid2dxy.pdf b/Doc/FFCatalog/fig/cuts/FullSpheroid2dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/FullSpheroid2dxy.pdf
rename to Doc/FFCatalog/fig/cuts/FullSpheroid2dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/FullSpheroid2dxz.pdf b/Doc/FFCatalog/fig/cuts/FullSpheroid2dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/FullSpheroid2dxz.pdf
rename to Doc/FFCatalog/fig/cuts/FullSpheroid2dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/FullSpheroid2dxz.svg b/Doc/FFCatalog/fig/cuts/FullSpheroid2dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/FullSpheroid2dxz.svg
rename to Doc/FFCatalog/fig/cuts/FullSpheroid2dxz.svg
diff --git a/Doc/UserManual/fig/cuts/HemiEllipsoid2dxy.pdf b/Doc/FFCatalog/fig/cuts/HemiEllipsoid2dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/HemiEllipsoid2dxy.pdf
rename to Doc/FFCatalog/fig/cuts/HemiEllipsoid2dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/HemiEllipsoid2dxz.pdf b/Doc/FFCatalog/fig/cuts/HemiEllipsoid2dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/HemiEllipsoid2dxz.pdf
rename to Doc/FFCatalog/fig/cuts/HemiEllipsoid2dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/HemiEllipsoid2dxz.svg b/Doc/FFCatalog/fig/cuts/HemiEllipsoid2dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/HemiEllipsoid2dxz.svg
rename to Doc/FFCatalog/fig/cuts/HemiEllipsoid2dxz.svg
diff --git a/Doc/UserManual/fig/cuts/Prism32dxy.ps b/Doc/FFCatalog/fig/cuts/Prism32dxy.ps
similarity index 100%
rename from Doc/UserManual/fig/cuts/Prism32dxy.ps
rename to Doc/FFCatalog/fig/cuts/Prism32dxy.ps
diff --git a/Doc/UserManual/fig/cuts/Prism32dxz.ps b/Doc/FFCatalog/fig/cuts/Prism32dxz.ps
similarity index 100%
rename from Doc/UserManual/fig/cuts/Prism32dxz.ps
rename to Doc/FFCatalog/fig/cuts/Prism32dxz.ps
diff --git a/Doc/UserManual/fig/cuts/Prism62dxy.pdf b/Doc/FFCatalog/fig/cuts/Prism62dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Prism62dxy.pdf
rename to Doc/FFCatalog/fig/cuts/Prism62dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/Prism62dxy.svg b/Doc/FFCatalog/fig/cuts/Prism62dxy.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Prism62dxy.svg
rename to Doc/FFCatalog/fig/cuts/Prism62dxy.svg
diff --git a/Doc/UserManual/fig/cuts/Prism62dxz.pdf b/Doc/FFCatalog/fig/cuts/Prism62dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Prism62dxz.pdf
rename to Doc/FFCatalog/fig/cuts/Prism62dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/Prism62dxz.svg b/Doc/FFCatalog/fig/cuts/Prism62dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Prism62dxz.svg
rename to Doc/FFCatalog/fig/cuts/Prism62dxz.svg
diff --git a/Doc/UserManual/fig/cuts/Pyramid2dxy.pdf b/Doc/FFCatalog/fig/cuts/Pyramid2dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Pyramid2dxy.pdf
rename to Doc/FFCatalog/fig/cuts/Pyramid2dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/Pyramid2dxy.svg b/Doc/FFCatalog/fig/cuts/Pyramid2dxy.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Pyramid2dxy.svg
rename to Doc/FFCatalog/fig/cuts/Pyramid2dxy.svg
diff --git a/Doc/UserManual/fig/cuts/Pyramid2dxz.pdf b/Doc/FFCatalog/fig/cuts/Pyramid2dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Pyramid2dxz.pdf
rename to Doc/FFCatalog/fig/cuts/Pyramid2dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/Pyramid2dxz.svg b/Doc/FFCatalog/fig/cuts/Pyramid2dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Pyramid2dxz.svg
rename to Doc/FFCatalog/fig/cuts/Pyramid2dxz.svg
diff --git a/Doc/UserManual/fig/cuts/Ripple12dxy.pdf b/Doc/FFCatalog/fig/cuts/Ripple12dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Ripple12dxy.pdf
rename to Doc/FFCatalog/fig/cuts/Ripple12dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/Ripple12dxy.svg b/Doc/FFCatalog/fig/cuts/Ripple12dxy.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Ripple12dxy.svg
rename to Doc/FFCatalog/fig/cuts/Ripple12dxy.svg
diff --git a/Doc/UserManual/fig/cuts/Ripple12dyz.pdf b/Doc/FFCatalog/fig/cuts/Ripple12dyz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Ripple12dyz.pdf
rename to Doc/FFCatalog/fig/cuts/Ripple12dyz.pdf
diff --git a/Doc/UserManual/fig/cuts/Ripple12dyz.svg b/Doc/FFCatalog/fig/cuts/Ripple12dyz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Ripple12dyz.svg
rename to Doc/FFCatalog/fig/cuts/Ripple12dyz.svg
diff --git a/Doc/UserManual/fig/cuts/Ripple22dxy.pdf b/Doc/FFCatalog/fig/cuts/Ripple22dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Ripple22dxy.pdf
rename to Doc/FFCatalog/fig/cuts/Ripple22dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/Ripple22dxy.svg b/Doc/FFCatalog/fig/cuts/Ripple22dxy.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Ripple22dxy.svg
rename to Doc/FFCatalog/fig/cuts/Ripple22dxy.svg
diff --git a/Doc/UserManual/fig/cuts/Ripple22dyz.pdf b/Doc/FFCatalog/fig/cuts/Ripple22dyz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Ripple22dyz.pdf
rename to Doc/FFCatalog/fig/cuts/Ripple22dyz.pdf
diff --git a/Doc/UserManual/fig/cuts/Ripple22dyz.svg b/Doc/FFCatalog/fig/cuts/Ripple22dyz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Ripple22dyz.svg
rename to Doc/FFCatalog/fig/cuts/Ripple22dyz.svg
diff --git a/Doc/UserManual/fig/cuts/Sphere2dxy.pdf b/Doc/FFCatalog/fig/cuts/Sphere2dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Sphere2dxy.pdf
rename to Doc/FFCatalog/fig/cuts/Sphere2dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/Sphere2dxz.pdf b/Doc/FFCatalog/fig/cuts/Sphere2dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Sphere2dxz.pdf
rename to Doc/FFCatalog/fig/cuts/Sphere2dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/Sphere2dxz.svg b/Doc/FFCatalog/fig/cuts/Sphere2dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Sphere2dxz.svg
rename to Doc/FFCatalog/fig/cuts/Sphere2dxz.svg
diff --git a/Doc/UserManual/fig/cuts/Spheroid2dxy.pdf b/Doc/FFCatalog/fig/cuts/Spheroid2dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Spheroid2dxy.pdf
rename to Doc/FFCatalog/fig/cuts/Spheroid2dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/Spheroid2dxz.pdf b/Doc/FFCatalog/fig/cuts/Spheroid2dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Spheroid2dxz.pdf
rename to Doc/FFCatalog/fig/cuts/Spheroid2dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/Spheroid2dxz.svg b/Doc/FFCatalog/fig/cuts/Spheroid2dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Spheroid2dxz.svg
rename to Doc/FFCatalog/fig/cuts/Spheroid2dxz.svg
diff --git a/Doc/UserManual/fig/cuts/Tetrahedron2dxy.ps b/Doc/FFCatalog/fig/cuts/Tetrahedron2dxy.ps
similarity index 100%
rename from Doc/UserManual/fig/cuts/Tetrahedron2dxy.ps
rename to Doc/FFCatalog/fig/cuts/Tetrahedron2dxy.ps
diff --git a/Doc/UserManual/fig/cuts/Tetrahedron2dxz.ps b/Doc/FFCatalog/fig/cuts/Tetrahedron2dxz.ps
similarity index 100%
rename from Doc/UserManual/fig/cuts/Tetrahedron2dxz.ps
rename to Doc/FFCatalog/fig/cuts/Tetrahedron2dxz.ps
diff --git a/Doc/UserManual/fig/cuts/Truncatedcube2dxy.pdf b/Doc/FFCatalog/fig/cuts/Truncatedcube2dxy.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Truncatedcube2dxy.pdf
rename to Doc/FFCatalog/fig/cuts/Truncatedcube2dxy.pdf
diff --git a/Doc/UserManual/fig/cuts/Truncatedcube2dxy.svg b/Doc/FFCatalog/fig/cuts/Truncatedcube2dxy.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Truncatedcube2dxy.svg
rename to Doc/FFCatalog/fig/cuts/Truncatedcube2dxy.svg
diff --git a/Doc/UserManual/fig/cuts/Truncatedcube2dxz.pdf b/Doc/FFCatalog/fig/cuts/Truncatedcube2dxz.pdf
similarity index 100%
rename from Doc/UserManual/fig/cuts/Truncatedcube2dxz.pdf
rename to Doc/FFCatalog/fig/cuts/Truncatedcube2dxz.pdf
diff --git a/Doc/UserManual/fig/cuts/Truncatedcube2dxz.svg b/Doc/FFCatalog/fig/cuts/Truncatedcube2dxz.svg
similarity index 100%
rename from Doc/UserManual/fig/cuts/Truncatedcube2dxz.svg
rename to Doc/FFCatalog/fig/cuts/Truncatedcube2dxz.svg
diff --git a/Doc/UserManual/fig/ff2/bornplot.py b/Doc/FFCatalog/fig/ff2/bornplot.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/bornplot.py
rename to Doc/FFCatalog/fig/ff2/bornplot.py
diff --git a/Doc/UserManual/fig/ff2/ff_AnisoPyramid.pdf b/Doc/FFCatalog/fig/ff2/ff_AnisoPyramid.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_AnisoPyramid.pdf
rename to Doc/FFCatalog/fig/ff2/ff_AnisoPyramid.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Box.pdf b/Doc/FFCatalog/fig/ff2/ff_Box.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Box.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Box.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Cone.pdf b/Doc/FFCatalog/fig/ff2/ff_Cone.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Cone.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Cone.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Cone6.pdf b/Doc/FFCatalog/fig/ff2/ff_Cone6.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Cone6.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Cone6.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Cuboctahedron.pdf b/Doc/FFCatalog/fig/ff2/ff_Cuboctahedron.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Cuboctahedron.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Cuboctahedron.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Cylinder.pdf b/Doc/FFCatalog/fig/ff2/ff_Cylinder.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Cylinder.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Cylinder.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Dodecahedron_asy.pdf b/Doc/FFCatalog/fig/ff2/ff_Dodecahedron_asy.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Dodecahedron_asy.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Dodecahedron_asy.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Dodecahedron_sym.pdf b/Doc/FFCatalog/fig/ff2/ff_Dodecahedron_sym.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Dodecahedron_sym.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Dodecahedron_sym.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_EllipsoidalCylinder.pdf b/Doc/FFCatalog/fig/ff2/ff_EllipsoidalCylinder.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_EllipsoidalCylinder.pdf
rename to Doc/FFCatalog/fig/ff2/ff_EllipsoidalCylinder.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_FullSphere.pdf b/Doc/FFCatalog/fig/ff2/ff_FullSphere.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_FullSphere.pdf
rename to Doc/FFCatalog/fig/ff2/ff_FullSphere.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_FullSpheroid.pdf b/Doc/FFCatalog/fig/ff2/ff_FullSpheroid.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_FullSpheroid.pdf
rename to Doc/FFCatalog/fig/ff2/ff_FullSpheroid.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_FullSpheroid_tilt.pdf b/Doc/FFCatalog/fig/ff2/ff_FullSpheroid_tilt.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_FullSpheroid_tilt.pdf
rename to Doc/FFCatalog/fig/ff2/ff_FullSpheroid_tilt.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_HemiEllipsoid.pdf b/Doc/FFCatalog/fig/ff2/ff_HemiEllipsoid.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_HemiEllipsoid.pdf
rename to Doc/FFCatalog/fig/ff2/ff_HemiEllipsoid.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Icosahedron_asy.pdf b/Doc/FFCatalog/fig/ff2/ff_Icosahedron_asy.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Icosahedron_asy.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Icosahedron_asy.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Icosahedron_sym.pdf b/Doc/FFCatalog/fig/ff2/ff_Icosahedron_sym.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Icosahedron_sym.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Icosahedron_sym.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Prism3.pdf b/Doc/FFCatalog/fig/ff2/ff_Prism3.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Prism3.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Prism3.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Prism6.pdf b/Doc/FFCatalog/fig/ff2/ff_Prism6.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Prism6.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Prism6.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Pyramid.pdf b/Doc/FFCatalog/fig/ff2/ff_Pyramid.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Pyramid.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Pyramid.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Ripple1.pdf b/Doc/FFCatalog/fig/ff2/ff_Ripple1.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Ripple1.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Ripple1.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Ripple2.pdf b/Doc/FFCatalog/fig/ff2/ff_Ripple2.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Ripple2.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Ripple2.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_Tetrahedron.pdf b/Doc/FFCatalog/fig/ff2/ff_Tetrahedron.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_Tetrahedron.pdf
rename to Doc/FFCatalog/fig/ff2/ff_Tetrahedron.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_TruncatedCube.pdf b/Doc/FFCatalog/fig/ff2/ff_TruncatedCube.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_TruncatedCube.pdf
rename to Doc/FFCatalog/fig/ff2/ff_TruncatedCube.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_TruncatedSphere.pdf b/Doc/FFCatalog/fig/ff2/ff_TruncatedSphere.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_TruncatedSphere.pdf
rename to Doc/FFCatalog/fig/ff2/ff_TruncatedSphere.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_TruncatedSpheroid.pdf b/Doc/FFCatalog/fig/ff2/ff_TruncatedSpheroid.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_TruncatedSpheroid.pdf
rename to Doc/FFCatalog/fig/ff2/ff_TruncatedSpheroid.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_demo_1quadrants.pdf b/Doc/FFCatalog/fig/ff2/ff_demo_1quadrants.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_demo_1quadrants.pdf
rename to Doc/FFCatalog/fig/ff2/ff_demo_1quadrants.pdf
diff --git a/Doc/UserManual/fig/ff2/ff_demo_4quadrants.pdf b/Doc/FFCatalog/fig/ff2/ff_demo_4quadrants.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_demo_4quadrants.pdf
rename to Doc/FFCatalog/fig/ff2/ff_demo_4quadrants.pdf
diff --git a/Doc/UserManual/fig/ff2/sim_AnisoPyramid.py b/Doc/FFCatalog/fig/ff2/sim_AnisoPyramid.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_AnisoPyramid.py
rename to Doc/FFCatalog/fig/ff2/sim_AnisoPyramid.py
diff --git a/Doc/UserManual/fig/ff2/sim_Box.py b/Doc/FFCatalog/fig/ff2/sim_Box.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Box.py
rename to Doc/FFCatalog/fig/ff2/sim_Box.py
diff --git a/Doc/UserManual/fig/ff2/sim_Cone.py b/Doc/FFCatalog/fig/ff2/sim_Cone.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Cone.py
rename to Doc/FFCatalog/fig/ff2/sim_Cone.py
diff --git a/Doc/UserManual/fig/ff2/sim_Cone6.py b/Doc/FFCatalog/fig/ff2/sim_Cone6.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Cone6.py
rename to Doc/FFCatalog/fig/ff2/sim_Cone6.py
diff --git a/Doc/UserManual/fig/ff2/sim_Cuboctahedron.py b/Doc/FFCatalog/fig/ff2/sim_Cuboctahedron.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Cuboctahedron.py
rename to Doc/FFCatalog/fig/ff2/sim_Cuboctahedron.py
diff --git a/Doc/UserManual/fig/ff2/sim_Cylinder.py b/Doc/FFCatalog/fig/ff2/sim_Cylinder.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Cylinder.py
rename to Doc/FFCatalog/fig/ff2/sim_Cylinder.py
diff --git a/Doc/UserManual/fig/ff2/sim_Dodecahedron_asy.py b/Doc/FFCatalog/fig/ff2/sim_Dodecahedron_asy.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Dodecahedron_asy.py
rename to Doc/FFCatalog/fig/ff2/sim_Dodecahedron_asy.py
diff --git a/Doc/UserManual/fig/ff2/sim_Dodecahedron_sym.py b/Doc/FFCatalog/fig/ff2/sim_Dodecahedron_sym.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Dodecahedron_sym.py
rename to Doc/FFCatalog/fig/ff2/sim_Dodecahedron_sym.py
diff --git a/Doc/UserManual/fig/ff2/sim_EllipsoidalCylinder.py b/Doc/FFCatalog/fig/ff2/sim_EllipsoidalCylinder.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_EllipsoidalCylinder.py
rename to Doc/FFCatalog/fig/ff2/sim_EllipsoidalCylinder.py
diff --git a/Doc/UserManual/fig/ff2/sim_FullSphere.py b/Doc/FFCatalog/fig/ff2/sim_FullSphere.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_FullSphere.py
rename to Doc/FFCatalog/fig/ff2/sim_FullSphere.py
diff --git a/Doc/UserManual/fig/ff2/sim_FullSpheroid.py b/Doc/FFCatalog/fig/ff2/sim_FullSpheroid.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_FullSpheroid.py
rename to Doc/FFCatalog/fig/ff2/sim_FullSpheroid.py
diff --git a/Doc/UserManual/fig/ff2/sim_FullSpheroid_tilt.py b/Doc/FFCatalog/fig/ff2/sim_FullSpheroid_tilt.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_FullSpheroid_tilt.py
rename to Doc/FFCatalog/fig/ff2/sim_FullSpheroid_tilt.py
diff --git a/Doc/UserManual/fig/ff2/sim_HemiEllipsoid.py b/Doc/FFCatalog/fig/ff2/sim_HemiEllipsoid.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_HemiEllipsoid.py
rename to Doc/FFCatalog/fig/ff2/sim_HemiEllipsoid.py
diff --git a/Doc/UserManual/fig/ff2/sim_Icosahedron_asy.py b/Doc/FFCatalog/fig/ff2/sim_Icosahedron_asy.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Icosahedron_asy.py
rename to Doc/FFCatalog/fig/ff2/sim_Icosahedron_asy.py
diff --git a/Doc/UserManual/fig/ff2/sim_Icosahedron_sym.py b/Doc/FFCatalog/fig/ff2/sim_Icosahedron_sym.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Icosahedron_sym.py
rename to Doc/FFCatalog/fig/ff2/sim_Icosahedron_sym.py
diff --git a/Doc/UserManual/fig/ff2/sim_Prism3.py b/Doc/FFCatalog/fig/ff2/sim_Prism3.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Prism3.py
rename to Doc/FFCatalog/fig/ff2/sim_Prism3.py
diff --git a/Doc/UserManual/fig/ff2/sim_Prism6.py b/Doc/FFCatalog/fig/ff2/sim_Prism6.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Prism6.py
rename to Doc/FFCatalog/fig/ff2/sim_Prism6.py
diff --git a/Doc/UserManual/fig/ff2/sim_Pyramid.py b/Doc/FFCatalog/fig/ff2/sim_Pyramid.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Pyramid.py
rename to Doc/FFCatalog/fig/ff2/sim_Pyramid.py
diff --git a/Doc/UserManual/fig/ff2/sim_Ripple1.py b/Doc/FFCatalog/fig/ff2/sim_Ripple1.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Ripple1.py
rename to Doc/FFCatalog/fig/ff2/sim_Ripple1.py
diff --git a/Doc/UserManual/fig/ff2/sim_Ripple2.py b/Doc/FFCatalog/fig/ff2/sim_Ripple2.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Ripple2.py
rename to Doc/FFCatalog/fig/ff2/sim_Ripple2.py
diff --git a/Doc/UserManual/fig/ff2/sim_Tetrahedron.py b/Doc/FFCatalog/fig/ff2/sim_Tetrahedron.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_Tetrahedron.py
rename to Doc/FFCatalog/fig/ff2/sim_Tetrahedron.py
diff --git a/Doc/UserManual/fig/ff2/sim_TruncatedCube.py b/Doc/FFCatalog/fig/ff2/sim_TruncatedCube.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_TruncatedCube.py
rename to Doc/FFCatalog/fig/ff2/sim_TruncatedCube.py
diff --git a/Doc/UserManual/fig/ff2/sim_TruncatedSphere.py b/Doc/FFCatalog/fig/ff2/sim_TruncatedSphere.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_TruncatedSphere.py
rename to Doc/FFCatalog/fig/ff2/sim_TruncatedSphere.py
diff --git a/Doc/UserManual/fig/ff2/sim_TruncatedSpheroid.py b/Doc/FFCatalog/fig/ff2/sim_TruncatedSpheroid.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_TruncatedSpheroid.py
rename to Doc/FFCatalog/fig/ff2/sim_TruncatedSpheroid.py
diff --git a/Doc/UserManual/fig/ff2/sim_demo_1quadrants.py b/Doc/FFCatalog/fig/ff2/sim_demo_1quadrants.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_demo_1quadrants.py
rename to Doc/FFCatalog/fig/ff2/sim_demo_1quadrants.py
diff --git a/Doc/UserManual/fig/ff2/sim_demo_4quadrants.py b/Doc/FFCatalog/fig/ff2/sim_demo_4quadrants.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_demo_4quadrants.py
rename to Doc/FFCatalog/fig/ff2/sim_demo_4quadrants.py
diff --git a/Doc/UserManual/fig/ff2/sim_det_box.py b/Doc/FFCatalog/fig/ff2/sim_det_box.py
similarity index 100%
rename from Doc/UserManual/fig/ff2/sim_det_box.py
rename to Doc/FFCatalog/fig/ff2/sim_det_box.py
diff --git a/Doc/FFCatalog/fig/icons/Achtung.png b/Doc/FFCatalog/fig/icons/Achtung.png
new file mode 100644
index 0000000000000000000000000000000000000000..9b7fb096ec76bb3e4fc7e621952ae235e6e4df32
Binary files /dev/null and b/Doc/FFCatalog/fig/icons/Achtung.png differ
diff --git a/Doc/FFCatalog/fig/icons/Arbeiten.png b/Doc/FFCatalog/fig/icons/Arbeiten.png
new file mode 100644
index 0000000000000000000000000000000000000000..0272e27fd17c0fffb75528c59902b23e45a200bc
Binary files /dev/null and b/Doc/FFCatalog/fig/icons/Arbeiten.png differ
diff --git a/Doc/FFCatalog/fig/icons/Weblink.png b/Doc/FFCatalog/fig/icons/Weblink.png
new file mode 100644
index 0000000000000000000000000000000000000000..cfc7b6e33c068b3a288adf44ff9aa4ae836c473c
Binary files /dev/null and b/Doc/FFCatalog/fig/icons/Weblink.png differ
diff --git a/Doc/FFCatalog/lstcustom.sty b/Doc/FFCatalog/lstcustom.sty
new file mode 100644
index 0000000000000000000000000000000000000000..b640ffb5393856b3dae693e625cab78a44a55b1e
--- /dev/null
+++ b/Doc/FFCatalog/lstcustom.sty
@@ -0,0 +1,273 @@
+% this is customisation of 'listings' packag
+% TODO: cleanup
+
+% xcolor must be included before (not done here, because different options may be desired).
+
+\definecolor{darkviolet}{rgb}{0.5,0,0.4} %
+\definecolor{darkgreen}{rgb}{0,0.4,0.2} %
+\definecolor{darkblue}{rgb}{0.1,0.1,0.9}%
+\definecolor{darkgrey}{rgb}{0.5,0.5,0.5} %
+\definecolor{lightblue}{rgb}{0.4,0.4,1} %
+\definecolor{lightblue1}{rgb}{0 0.25 1}
+\definecolor{darkpink}{rgb}{1 0 0.75}
+\definecolor{dred}{rgb}{0.8,0,0}
+\definecolor{lightlightgrey}{rgb}{0.95 0.95 0.95} %
+
+
+%\definecolor{oneblue}{rgb}{0,0,0.75}
+\definecolor{dockerblue}{rgb}{0.11,0.56,0.98} %
+%\definecolor{MyDarkBlue1}{rgb}{0.1,0,0.55}
+%\definecolor{lightgrey}{rgb}{0.9,0.9,0.9}
+
+\lstdefinelanguage{pseudo}{
+  keywords={procedure,end,return,integer,real,foreach,for,each,
+  do,if,then,else,while,until,true,false,algorithm},
+  comment=[l]{//}
+}
+
+\lstdefinelanguage{oaw}{
+  morekeywords={import, this, create, let, then, Void, extension, JAVA,
+  IMPORT, DEFINE, ENDDEFINE, LET, ENDLET, FOR, FILE, ENDFILE, ITERATOR, FOREACH,
+  AS, IF, ENDFOREACH, ENDIF, EXPAND, INSTANCEOF, USING, SEPARATOR, CSTART, CEND,
+  PROTECT, ENDPROTECT, ID, EXTENSION,
+  context, ERROR, WARNING, INFO, enum},
+  morecomment=[l]{//},
+  morecomment=[s]{/*}{*/},
+  % FIXME: listings does not see guillemets, so any regions with them wont work
+  morecomment=[s]{«REM»}{«ENDREM»},
+  morecomment=[s]{«REM}{»},
+  morestring=[s]{'}{'},
+  morestring=[s]{"}{"},
+  escapechar={@},
+  % required for use with UTF-8
+  literate={«}{\guillemotleft}{1}
+           {»}{\guillemotright}{1}
+}
+
+% extension, if, then, else, switch, Void, Boolean, Integer, Real, String, let
+
+\lstdefinelanguage{shell}
+{alsodigit={>},
+  morekeywords={linux>},
+  backgroundcolor=\color{lstbackgroundshellcolor}
+}
+
+\lstdefinelanguage{csimul}
+{alsodigit={>},
+  alsodigit={\%},
+  morekeywords={CONDITIONER>, COUNTER>, \%},
+  backgroundcolor=\color{lstbackgroundshellcolor},
+  morecomment=[l]{\#}
+}
+
+\newcommand{\lstfontfamily}{\ttfamily}
+%\newcommand{\lstfontfamily}{\sffamily} % Adapt to schneider
+\newcommand{\textlst}[1]{\texttt{#1}}
+\newcommand{\mathlst}[1]{\mathtt{#1}}
+\lstdefinestyle{tiny}{basicstyle=\tiny\lstfontfamily}
+\lstdefinestyle{scriptsize}{basicstyle=\scriptsize\lstfontfamily}
+\lstdefinestyle{footnotesize}{basicstyle=\footnotesize\lstfontfamily}
+\lstdefinestyle{small}{basicstyle=\small\lstfontfamily}
+\lstdefinestyle{normalsize}{basicstyle=\normalsize\lstfontfamily}
+\lstdefinestyle{large}{basicstyle=\lstfontfamily}
+
+\lstdefinestyle{monitor}{morekeywords={monitor, export}}
+\lstdefinestyle{ConcPascal}{language=Pascal,style=monitor}
+
+% To make this accessible to Emacs/AUCTeX (C-c C-f C-o),
+% add something like this to TeX-mode-hook:
+%  (setq LaTeX-font-list
+%       (append '((?{\^O} "\\codefont{" "}"))
+%               LaTeX-font-list))
+%\newcommand{\codefont}[1]{{\renewcommand{\textnormal}[1]{\textlst{#1}}\lstfontfamily #1}}
+\newcommand{\mathcodefont}[1]{\mathtt{#1}}
+\newcommand{\codefont}[1]{{\lstfontfamily #1}}
+\newlength{\lstframexleftmargin}
+\setlength{\lstframexleftmargin}{1mm}
+
+% rulesepcolor and backgroundcolor are set in beamercustom{presentation|handout}.sty
+\lstdefinestyle{mydefault}{
+  style=scriptsize,
+  emphstyle=\color{red},
+  framexleftmargin=\lstframexleftmargin,
+  frame=shadowbox,
+  keywordstyle=\structure,
+  commentstyle=\itshape,
+  columns=flexible,            % Columns not rigid - gives nicer spacing
+  gobble=4,                    % Gobble first 4 characters of each line
+  escapeinside=`',
+  escapechar=@,
+  lineskip=+0.2ex,
+  rulesepcolor=\color{lstrulesepcolor},
+  % WARNING: For some reason, the settin of backgroundcolor must take
+  % place at the very end!!!
+  backgroundcolor=\color{lstbackgroundprogcolor}
+}
+
+\lstdefinestyle{eclipse}{
+    basicstyle=\small\lstfontfamily,
+    emphstyle=\color{red}\bfseries,
+    keywordstyle=\color{darkviolet}\bfseries,
+    commentstyle=\color{darkgreen},
+    stringstyle=\color{darkblue},
+    numberstyle=\color{darkgrey}\lstfontfamily,
+    emph={Simulation,MaterialManager,MultiLayer,Layer,Particle,ParticleDecoration},
+    emphstyle=\color{dockerblue},
+    % get also javadoc style comments
+    morecomment=[s][\color{lightblue}]{/**}{*/},
+   %columns=fullflexible, %spaceflexible, %flexible, fullflexible
+%  escapeinside=`',
+%  escapechar=@,
+  showstringspaces=false,
+  numbers=left,
+escapeinside={@}{@}, %reference to line number in text
+breaklines = true
+}
+
+\lstdefinestyle{black}{
+  basicstyle=\small\lstfontfamily,
+  numbers=left,
+  columns=fullflexible,
+  breaklines=true,
+  mathescape=true,
+  escapechar=\#,
+  tabsize=4,
+  frame=lines,
+  showstringspaces=false
+}
+
+
+
+
+\lstdefinestyle{eclipseboxed}{
+moredelim=[is][\color{red}\itshape]{|}{|},
+   escapeinside={@}{@},
+    basicstyle=\small\lstfontfamily,
+    emphstyle=\color{red}\bfseries,
+    keywordstyle=\color{darkviolet}\bfseries,
+    commentstyle=\color{darkgreen},
+    stringstyle=\color{darkblue},
+    numberstyle=\color{darkgrey}\lstfontfamily,
+    emph={Simulation,MaterialManager,MultiLayer,Layer,Particle,ParticleDecoration},
+    emphstyle=\color{dockerblue},
+    backgroundcolor=\color{lightlightgrey},
+    morecomment=[s][\color{lightblue}]{/**}{*/},
+  showstringspaces=false,
+  numbers=left,
+ emphstyle={[2]\color{blue}},
+ frame=single,
+firstnumber=auto,
+ rulesepcolor=\color{darkgrey},
+rulecolor=\color{darkgrey},
+breaklines = true
+%showspaces=true,
+%showtabs=true,
+%tabsize=1
+}
+
+% use proper tt font that supports bold printing, e.g. by
+% \usepackage{courier}
+\lstdefinestyle{seminar}{
+  basicstyle=\small\ttfamily,
+  numbers=left,
+  breaklines=true,
+  mathescape=true,
+  escapechar=\#,
+  tabsize=4,
+  showstringspaces=false
+}
+
+
+\lstdefinestyle{commandline}{
+   escapeinside={@}{@},
+    basicstyle=\small\lstfontfamily,
+    emphstyle=\color{red}\bfseries,
+    keywordstyle=\color{darkviolet}\bfseries,
+    commentstyle=\color{darkgreen},
+    stringstyle=\color{darkblue},
+    numberstyle=\color{darkgrey}\lstfontfamily,
+    emphstyle=\color{red},
+    backgroundcolor=\color{lightlightgrey},
+    morecomment=[s][\color{lightblue}]{/**}{*/},
+  showstringspaces=false,
+ emphstyle={[2]\color{blue}},
+ frame=single,
+firstnumber=auto,
+ rulesepcolor=\color{darkgrey},
+rulecolor=\color{darkgrey},
+breaklines = true,
+numbers=none,
+%showspaces=true,
+%showtabs=true,
+%tabsize=1
+}
+
+
+% Another example of customisation (to Study)
+
+% \documentclass[a4paper,12pt]{article}
+% \usepackage[utf8]{inputenc}
+%
+% % Default fixed font does not support bold face
+% \DeclareFixedFont{\ttb}{T1}{txtt}{bx}{n}{12} % for bold
+% \DeclareFixedFont{\ttm}{T1}{txtt}{m}{n}{12}  % for normal
+%
+% % Custom colors
+% \usepackage{color}
+% \definecolor{deepblue}{rgb}{0,0,0.5}
+% \definecolor{deepred}{rgb}{0.6,0,0}
+% \definecolor{deepgreen}{rgb}{0,0.5,0}
+%
+% \usepackage{listings}
+%
+% % Python style for highlighting
+% \newcommand\pythonstyle{\lstset{
+% language=Python,
+% basicstyle=\ttm,
+% otherkeywords={self},             % Add keywords here
+% keywordstyle=\ttb\color{deepblue},
+% emph={MyClass,__init__},          % Custom highlighting
+% emphstyle=\ttb\color{deepred},    % Custom highlighting style
+% stringstyle=\color{deepgreen},
+% frame=tb,                         % Any extra options here
+% showstringspaces=false            %
+% }}
+%
+%
+% % Python environment
+% \lstnewenvironment{python}[1][]
+% {
+% \pythonstyle
+% \lstset{#1}
+% }
+% {}
+%
+% % Python for external files
+% \newcommand\pythonexternal[1]{{
+% \pythonstyle
+% \lstinputlisting{#1}}}
+%
+% % Python for inline
+% \newcommand\pythoninline[1]{{\pythonstyle\lstinline!#1!}}
+%
+% \begin{document}
+%
+% \section{``In-text'' listing highlighting}
+%
+% \begin{python}
+% class MyClass(Yourclass):
+%     def __init__(self, my, yours):
+%         bla = '5 1 2 3 4'
+%         print bla
+% \end{python}
+%
+% \section{External listing highlighting}
+%
+% \pythonexternal{demo.py}
+%
+% \section{Inline highlighting}
+%
+% Definition \pythoninline{class MyClass} means \dots
+%
+% \end{document}
+%
diff --git a/Doc/UserManual/Assemblies.tex b/Doc/UserManual/Assemblies.tex
index 2f68dca018b8d518a976539958f2c2fb7bcaa1ba..c281f1916dc4c6abe59b7fd56d15bcbeebf04317 100644
--- a/Doc/UserManual/Assemblies.tex
+++ b/Doc/UserManual/Assemblies.tex
@@ -62,7 +62,7 @@ with the indicator function
   1&\text{~if $\r$ in p,}\\[.2ex]
   0&\text{~otherwise.} \end{array}\right.
 \end{equation}
-\nomenclature[1χ032 2p000]{$\chi_\sp(\r)$}{indicates whether $\r$ is in particle of type~$\sp$}%
+\nomenclature[1χ032 2p000]{$\chi_\sp(\r)$}{Indicates whether $\r$ is in particle of type~$\sp$}%
 \index{Indicator function}%
 The following formalism, however, shall not rely on \cref{EDvpHomo},
 but also allow for soft particles for which $\Delta v_\sp(\r)$ is a continuous function of~$\r$.
@@ -81,7 +81,7 @@ $\delta v_l(\r)=0$.
 With the factorization~\cref{Ekpar},
 the scattering matrix element~\cref{Etrama} becomes
 \begin{equation}\label{Escamatrix2}
-  \bra\psi_\si|\delta v|\psi_\sf\ket
+  \braket{\psi_\si|\delta v|\psi_\sf}
   = \int\!\d^2 r_\plll\, \e^{i\q_\plll \r_\plll}
     \int\!\d z\, \phi^*_\si(z) \delta v(\r) \phi_\sf(z).
 \end{equation}
@@ -111,7 +111,7 @@ With the \E{DWBA form factor}
 \end{equation}
 the scattering matrix element~\cref{Escamatrix2} becomes
 \begin{equation}\label{EsumRF}
-  \bra\psi_\si|\delta v|\psi_\sf\ket
+  \braket{\psi_\si|\delta v|\psi_\sf}
   = \sum_j \e^{i\q_\plll \R_{j\plll}}  \FD_{\si\sf}(\q_\plll,\v{T}_j).
 \end{equation}
 The elastic scattering cross section~\cref{Exsection} can be written as
@@ -300,7 +300,7 @@ are independent and identically distributed (\E{i.i.d.}) random variables.
 They all have the same distribution~$p(\v\tau)$.
 Averages under this distribution shall be denoted as
 \begin{equation}\label{Epavg}
-  \bra f\ket \coloneqq  \int\!\d\v\tau\,p(\v\tau)f(\tau).
+  \braket{f} \coloneqq  \int\!\d\v\tau\,p(\v\tau)f(\tau).
 \end{equation}
 Pairs of particles have the distribution~$p(\v\tau)p(\v\tau')$,
 except if the two particles are identical.
@@ -325,7 +325,7 @@ with the \E{diffuse} and \E{coherent} scattering intensities
 \Emph
 {\begin{eqnarray}
   I_\text{d}\label{EIddef}
-  &\coloneqq& \bra\left|\FD\right|^2\ket-\left|\bra\FD\ket\right|^2,
+  &\coloneqq& \braket{\left|\FD\right|^2}-\left|\braket{\FD}\right|^2,
 \\[2ex]
   I_\text{c}\label{EIcdef}
   &\coloneqq&
@@ -336,7 +336,7 @@ with the \E{diffuse} and \E{coherent} scattering intensities
 The diffuse intensity can be rewritten as
 \begin{equation}\label{EIdDiff}
   I_\text{d}
-  = \bra\left|\FD-\bra\FD\ket\right|^2\ket,
+  = \braket{\left|\FD-\braket{\FD}\right|^2},
 \end{equation}
 which shows that it is due to fluctuations of the single-particle form factor.
 
@@ -369,7 +369,7 @@ the atomic \E{static structure factor}
 The coherent scattering intensity then takes the simple form
 \Emph
 {\begin{equation}\label{EIcFac}
-  I_\text{c} = \SD(\q) \left|\bra\FD\ket\right|^2.
+  I_\text{c} = \SD(\q) \left|\braket{\FD}\right|^2.
 \end{equation}\vskip -5pt}
 Together, the T-T and R-T decoupling
 make up the \E{decoupling approximation}
@@ -414,7 +414,7 @@ $I_\text{c}$ then cancels the second term in~\cref{EIddef},
 so that the cross section~\cref{EIdIc} reduces to the incoherent sum
 \begin{equation}\label{EIdInc}
   \frac{1}{N_p}\xElas
-  = \bra\left|\FD\right|^2\ket
+  = \braket{\left|\FD\right|^2}
 \end{equation}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -814,7 +814,7 @@ layer which corresponds to \texttt{depth}=0.}
 
 Since in most experimental conditions only the statistical properties of the particles are known, one can consider the probabilistic value of this cross-section \idest its expectation value. Assuming that the particles' shapes are determined by their class $\alpha$, with the abundance ratio $p_\alpha \equiv N_\alpha / N$, and defining the particle density as $\rho_V \equiv N/V$, the expectation value becomes:
 \begin{align*}
-  \bra \xElas(\q) \ket  & = \sum_\alpha p_\alpha \left\lvert F_\alpha(\q)\right\rvert ^2 + \frac{\rho_V}{V}\sum_{\alpha,\beta} p_\alpha p_\beta F_\alpha (\q)F_\beta^*(\q)  \\
+  \braket{\xElas(\q)}  & = \sum_\alpha p_\alpha \left\lvert F_\alpha(\q)\right\rvert ^2 + \frac{\rho_V}{V}\sum_{\alpha,\beta} p_\alpha p_\beta F_\alpha (\q)F_\beta^*(\q)  \\
   & \times \iint_V d^3\v{R}_\alpha d^3\v{R}_\beta \ppcf{\alpha}{\beta}{R} \exp \left[ i\q\cdot (\v{R}_\alpha - \v{R}_\beta ) \right],
 \end{align*}
 
@@ -824,7 +824,7 @@ where $\ppcf{\alpha}{\beta}{R}$ is called the \emph{partial pair correlation fun
 TO MERGE IN:
 
 \begin{align*}
-  & \bra \xElas(\k_\si,\k_\sf) \ket_{\text{Off-specular}}  \\
+  & \braket{\xElas(\k_\si,\k_\sf)}_{\text{Off-specular}}  \\
   & = \sum_\alpha p_\alpha \left\lvert \curlf_\alpha(\k_{j,i},\k_{j,f}, R_{\alpha,z})\right\rvert ^2 + \frac{\rho_S}{S}\sum_{\alpha,\beta} p_\alpha p_\beta \curlf_\alpha (\k_{j,i},\k_{j,f}, R_{\alpha,z})\curlf_\beta^*(\k_{j,i},\k_{j,f}, R_{\beta,z}) \\
   & \times \iint_S d^2r_\alpha^\plll d^2r_\beta^\plll \ppcf{\alpha}{\beta}{R^\plll} \exp \left[ i\v{q}_{j\plll}\cdot (\r_\alpha^\plll - \r_\beta^\plll ) \right].
 \end{align*}
@@ -833,20 +833,19 @@ TO MERGE IN:
 TO MERGE IN:
 This expression can be split into a diffuse part, which by definition should be zero for the case of only one particle type, and a coherent part, resulting from the coherent superposition of scattering amplitudes for particles at different positions:
 \begin{equation*}
-  \bra \xElas(\q) \ket
-  = I_d(\q) + {\bra F_\alpha (\q ) S_{\alpha\beta} (\q) F_\beta^* (\q)
-               \ket}_{\alpha\beta},
+  \braket{\xElas(\q)}
+  = I_d(\q) + \braket{F_\alpha (\q ) S_{\alpha\beta} (\q) F_\beta^* (\q)}_{\alpha\beta},
 \end{equation*}
 where
 \begin{align*}
   I_d(\q) &
-  \equiv {\bra\left\rvert F_\alpha (\q) \right\rvert^2\ket}_{\alpha}
-       - \left\lvert {\bra F_\alpha (\q)\ket}_{\alpha} \right\rvert^2, \\
+  \equiv \braket\left\rvert F_\alpha (\q) \right\rvert^2}_{\alpha}
+       - \left\lvert \braket{F_\alpha (\q)}_{\alpha} \right\rvert^2, \\
   S_{\alpha\beta} (\q) &\equiv 1 + \rho_V \int_V \d^3\r\mathcal{G}_{\alpha\beta}(\r)
                        \exp \left[ i\q\cdot \r \right].
 \end{align*}
 $S_{\alpha\beta} (\q)$ is called the \emph{interference function},
-and $\bra\dotso\ket_\alpha$ is the expectation value over the classes $\lbrace \alpha\rbrace$.
+and $\braket{\dotso}_\alpha$ is the expectation value over the classes $\lbrace \alpha\rbrace$.
 
 
 TO MERGE IN:
@@ -955,13 +954,13 @@ The scattered intensity can also be calculated as the Fourier transform of the P
 \end{equation*}
 For a sample where only the statistical properties of particle positions and shape/size are known, the scattered intensity per scattering particle becomes average over an ensemble of the Fourier transform of the Patterson function:
 \begin{equation*}
-  I(\q ) = \frac{1}{N}\bra\curlf (\curlp (\r ))\ket,
+  I(\q ) = \frac{1}{N}\braket{\curlf (\curlp (\r ))},
 \end{equation*}
 where $\curlf$ denotes the Fourier transform.
 
 The ensemble averaged Patterson function will be denoted as:
 \begin{equation*}
-  Z(r) \equiv \frac{1}{N}\bra\curlp (\r )\ket.
+  Z(r) \equiv \frac{1}{N}\braket{\curlp (\r )}.
 \end{equation*}
 In the case of systems where the particles are aligned in one dimension, this autocorrelation function can be further split into nearest neighbor probabilities. First, it is split into terms for negative, zero or positive distance:
 \begin{equation*}
@@ -994,7 +993,7 @@ where $D(\alpha_0,\alpha_1) = D_0 + \kappa \left[ \Delta R(\alpha_0) + \Delta R(
 In momentum space, the sum of convolutions can be written as a geometric series, which can be exactly calculated to be:
 \begin{equation}
 \label{Esscainf}
-I(\q ) = {\bra\left| F_\alpha(\q ) \right| ^2\ket}_{\alpha}
+I(\q ) = \braket{\left| F_\alpha(\q ) \right| ^2}_{\alpha}
 + 2 \Re \left\lbrace \widetilde{\curlf_\kappa}(\q )
  \widetilde{\curlf_\kappa^*}(\q ) \cdot
  \frac{\Omega_\kappa(\q )}{\tilde{p}_{2\kappa}(\q )\left
@@ -1019,14 +1018,14 @@ The intensity in \cref{Esscainf} will contain a Dirac delta function contributio
 Another way of dealing with this infinity at $\q =0$ consists of taking only a finite number of terms, in which case the geometric series still has an analytic solution, but becomes a bit more cumbersome:
 \begin{equation*}
 \begin{split}
-  I(\q ) &= {\bra\left| F_\alpha(\q ) \right| ^2\ket}_\alpha
+  I(\q ) &= \bra{\left| F_\alpha(\q ) \right| ^2}_\alpha
    + 2 \Re \Biggl\lbrace \frac{1}{\tilde{p}_{2\kappa}(\q )}\widetilde{\curlf_\kappa}(\q )\widetilde{\curlf_\kappa^*}(\q ) \\
   & \times \left[ \left( 1 - \frac{1}{N}\right) \frac{\Omega_\kappa(\q )}{1 - \Omega_\kappa(\q ) } - \frac{1}{N}\frac{\Omega_\kappa^2(\q )\left( 1- \Omega_\kappa^{N-1}(\q )\right) }{\left( 1 - \Omega_\kappa(\q ) \right) ^2 } \right] \Biggr\rbrace.
 \end{split}
 \end{equation*}
 This expression has a well-defined limit for $\Omega_\kappa(\q ) \rightarrow 1$ (when $\q \rightarrow 0$), namely:
 \begin{equation*}
-  \lim_{\q \rightarrow 0} I(\q ) = {\bra\left| F_\alpha(0 ) \right| ^2\ket}_{\alpha} + \left( N-1 \right) \left| {\bra F_\alpha(0 )\ket}_{\alpha} \right|^2.
+  \lim_{\q \rightarrow 0} I(\q ) = \bra{\left| F_\alpha(0)\right| ^2}_{\alpha} + \left( N-1 \right) \left| \bra{F_\alpha(0)}_{\alpha} \right|^2.
 \end{equation*}
 
 
diff --git a/Doc/UserManual/BornAgainManual.tex b/Doc/UserManual/BornAgainManual.tex
index 4f72a09e04e8bc641fbcb3b595375881095fd22d..43e5cc9c47a5f31756dc427d36607248965aab59 100644
--- a/Doc/UserManual/BornAgainManual.tex
+++ b/Doc/UserManual/BornAgainManual.tex
@@ -61,7 +61,6 @@ Walter Van Herck, Joachim Wuttke}
 \include{BasicRef}
 \include{Sample}
 \include{Particles}
-\include{FormFactors}
 
 %\appendix %\addtocontents{toc}{\protect\setcounter{tocdepth}{1}}
 %\include{..}
diff --git a/Doc/UserManual/Instrument.tex b/Doc/UserManual/Instrument.tex
index ae777244b587f4529a6e8de3090292042563d5b3..da61016463250425ab59c7fd9c7946005ee9dc1c 100644
--- a/Doc/UserManual/Instrument.tex
+++ b/Doc/UserManual/Instrument.tex
@@ -52,7 +52,7 @@ that generates histograms on a rectangular grid,
 consisting of $n\cdot m$ pixels of constant width and height,
 as sketched in \cref{FexpGeom}.
 This figure also shows the coordinate system
-\index{Conventions|see {Coordinate system}}%
+\index{Convention!coordinate system}%
 \index{Coordinate system}%
 according to unanimous GISAS convention,
 with $z$ normal to the sample plane,
@@ -80,9 +80,9 @@ and the vertical glancing angle $\alpha_\sf$.
 The projection of $(\alpha_\sf,\phi_\sf)$ into
 the detector plane~$(y,z)$ is known as the \E{gnomonic projection}.
 \index{Gnomonic projection}%
-\index{Projection!wave vector to pixel coordinate}%
-\index{Mapping!wave vector to pixel coordinate}%
-\index{Transformation!wave vector to pixel coordinate}%
+\index{Projection!wavevector to pixel coordinate}%
+\index{Mapping!wavevector to pixel coordinate}%
+\index{Transformation!wavevector to pixel coordinate}%
 From elementary trigonometry one finds
 \begin{equation}\label{Eyzdet}
   \begin{array}{lcl}
@@ -161,7 +161,7 @@ For $y,z\ll L$, however, nonlinear terms loose importance.
 %-------------------------------------------------------------------------------
 \begin{figure}[t]
 \begin{center}
-\includegraphics[width=1\textwidth]{fig/ff2/ff_det_box.pdf}
+\includegraphics[width=1\textwidth]{fig/gisasmap/ff_det_box.pdf}
 \end{center}
 \caption{Simulated detector image for small-angle scattering from
 uncorrelated cuboids (right rectangular prisms).
diff --git a/Doc/UserManual/Macros.tex b/Doc/UserManual/Macros.tex
index 096c8dfc9717a6f36b4c702e12a7017b73bd16e7..0c8d1299fe0d09f476a43f6d24945a6bc1a75a6a 100644
--- a/Doc/UserManual/Macros.tex
+++ b/Doc/UserManual/Macros.tex
@@ -28,8 +28,6 @@
 \newcommand{\ggll}{\mathrel{\substack{\ll\\[-.05em]\gg}}}
 \newcommand{\llgg}{\mathrel{\substack{\gg\\[-.05em]\ll}}}
 \newcommand{\Nabla}{\v{\nabla}}
-\newcommand{\bra}{\ensuremath{\left\langle}}
-\newcommand{\ket}{\ensuremath{\right\rangle}}
 
 % Curly letters
 \newcommand{\curlf}{\ensuremath{\mathcal{F}}}
@@ -75,6 +73,8 @@
 \def\si{\text{i}}
 \def\sf{\text{f}}
 \def\SD{\mathcal{S}}
+\def\SRC#1#2{\href{https://github.com/scgmlz/BornAgain/blob/master/#1/#2}{#2}}
+\def\T#1{\texttt{#1}}
 \def\xElas{\frac{\d\sigma}{\d\Omega}}
 
 \renewcommand{\u}[1]{\underline{#1}}
diff --git a/Doc/UserManual/Multilayers.tex b/Doc/UserManual/Multilayers.tex
index 8f9d7b24d3a0e2a2e92c0804caca08a14424d21d..034b8e533fbed80fde1cf763de69036e6b0b9148 100644
--- a/Doc/UserManual/Multilayers.tex
+++ b/Doc/UserManual/Multilayers.tex
@@ -17,17 +17,22 @@
 \chapter{Multilayer systems}  \label{sec:Multilayers}
 
 \index{Multilayer|(}%
-\index{Layer structures|see {Multilayer}}
+\index{Layered structure|see {Multilayer}}
+
+The distorted-wave ansatz of \Cref{SSca} started from the decomposition~\cref{Edecompose_v}
+of the scattering-length density~$v(\r)$.
+It was assumed that propagation of distorted waves can be computed analytically for
+a function~$\overline{v}(\r)$,
+so that only the remaining fluctuations $\delta v(\r)$ cause scattering.
+In this chapter, we consider wave propagation in a multilayer system for which
+$\overline{v}(\r)=\overline{v}(z)$.
+In \Cref{Swave21} we introduce notation,
+factorize the wavefunction into an in-plane and a perpendicular function,
+and derive the notorious four-term DWBA cross section~\cref{Edwba4}.
+In \Cref{SLayHomo} we specialize to a stack of homogeneous layers,
+and describe how the vertical wavefunction is computed in BornAgain.
 
-Wave propagation through thin layers requires
-a special formalism that accounts for
-refraction and reflection (\cref{Swave21}).
-The so obtained distorted plane waves are the base
-for the reformulation of Born's scattering theory
-in the distorted wave Born approximation (\cref{SDWBA}).
-% TODO RESTORE XREF We also discuss the limits of coherent superposition (\cref{Scoherlen}),
 
-\index{GISAS|see{Grazing-incidence small angle scattering}}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{DWBA for layered samples}\label{Swave21}
@@ -39,7 +44,7 @@ in the distorted wave Born approximation (\cref{SDWBA}).
     \includegraphics[clip=, width=120mm]{fig/drawing/setup_multilayer.jpg}
   \caption[Conventional GISAS scattering geometry.]{Geometric conventions
 \index{Convention!GISAS geometry}%
-\index{Grazing-incidence small angle scattering!geometric conventions}%
+\index{Grazing-incidence small-angle scattering!geometric conventions}%
 \index{Coordinate system!GISAS geometry}%
 \index{Glancing angle}%
 \index{Scattering!angle}%
@@ -86,7 +91,8 @@ and its normal point out of the sample in positive $z$~direction.
 \nomenclature[2z020]{$z$}{Vertical coordinate, along the sample normal}%
 \index{Horizontal plane}%
 \index{Vertical direction}%
-\index{Convention|see {Horizontal and Vertical}}%
+\index{Convention!horizontal plane}%
+\index{Convention!vertical direction}%
 In our visualizations, we will always represent the $xy$~plane as \E{horizontal},
 and the $z$~axis as upward \E{vertical},
 altough there are ``horizontal'' reflectometers
@@ -94,7 +100,7 @@ where the sample normal is horizontal in laboratory space.
 \index{Reflectometer!vertical vs horizontal}%
 
 Scattering from such systems will be studied in distorted-wave Born approximation.
-To determine the cross section~\cref{Exsection},
+To determine the neutron scattering cross section~\cref{Exsection},
 we need to determine the incident and final wavefunctions
 $\psi_\si$ and~$\psi_\sf$.
 Vertical variations of the refractive index $n(z)$
@@ -133,7 +139,7 @@ The exciting wavefunction is
 \nomenclature[2k021\perp]{$k_\perp$}{Component of $\k$ along the sample normal}%
 \nomenclature[2k041\plll]{$\k_\plll$}{Projection of $\k$ onto the sample plane}%
 The subscripts $\plll$ and~$\perp$ refer to the sample $xy$ plane.
-The wave vector components $\k_\plll$ and $k_{\perp}$ must fulfill
+The wavevector components $\k_\plll$ and $k_{\perp}$ must fulfill
 \begin{equation}
   k(z)^2=\k_\plll^2+k_{\perp}^2.
 \end{equation}
@@ -208,32 +214,32 @@ All this holds not only for the incident wavefunction~$\psi_\si$,
 but also for the wavefunction~$\psi_\sf$
 that is tracked back from a detector pixel towards the sample.
 \index{Backtracking}%
-\index{Scattered wave!backtracking}%
+\index{Scattered radiation!backtracking}%
 \index{Detector!backtracking}%
 Therefore the scattering matrix element
 involves two incident and two final partial wavefunctions.
 The resulting sum
 \index{Wave propagation!in multilayer|)}
 \begin{equation}\label{Edwba4}
-  \bra \psi_\si|\delta v|\psi_\sf\ket
-  = \bra \psi^-_\si|\delta v|\psi^-_\sf\ket
-  + \bra \psi^-_\si|\delta v|\psi^+_\sf\ket
-  + \bra \psi^+_\si|\delta v|\psi^-_\sf\ket
-  + \bra \psi^+_\si|\delta v|\psi^+_\sf\ket
+  \braket{\psi_\si|\delta v|\psi_\sf}
+  = \braket{\psi^-_\si|\delta v|\psi^-_\sf}
+  + \braket{\psi^-_\si|\delta v|\psi^+_\sf}
+  + \braket{\psi^+_\si|\delta v|\psi^-_\sf}
+  + \braket{\psi^+_\si|\delta v|\psi^+_\sf}
 \end{equation}
 is depicted in \Cref{Fdwba4terms}.
 It can be written in an obvious shorthand notation
 \Emph{%
 \begin{equation}\label{Edwba}
-  \bra \psi_\si|\delta v|\psi_\sf\ket
+  \braket{\psi_\si|\delta v|\psi_\sf}
   = \sum_{\pm_\si} \sum_{\pm_\sf}
-    \bra \psi^\pm_\si|\delta v|\psi^\pm_\sf\ket.
+    \bra{\psi^\pm_\si|\delta v|\psi^\pm_\sf}.
 \end{equation}%
 \vspace*{-5pt}}
 This equation contains the essence of
 the DWBA for GISAS,
 and is the base for all scattering models implemented in \BornAgain.
-Since $\bra \psi_\si|\delta v|\psi_\sf\ket$
+Since $\braket{\psi_\si|\delta v|\psi_\sf}$
 appears as a squared modulus
 in the differential cross section~\cref{Exsection},
 the four terms of \cref{Edwba} can interfere with each other,
@@ -241,15 +247,25 @@ which adds to the complexity of GISAS patterns.
 
 BornAgain supports multilayer samples
 with refractive index discontinuities at layer interfaces.
-Conventions for layer numbers and interface coordinates are
-introduced in~\Cref{Fdefz}.
-A multilayer sample consists of a finite sequence of discrete layers
-$l=0,\ldots,N$
+Conventions for layer numbers and interface coordinates are introduced in~\Cref{Fdefz}.
+\index{Convention!layer numbering}%
+\index{Convention!interface coordinate}%
+\index{Coordinate!interface}%
+\index{Interface!coordinate}%
+\index{Multilayer!numbering}%
+\index{Multilayer!coordinates}%
+\index{Layer!index}%
+\index{Numbering!layers}%
+A sample has $N$ layers,
+including the semi-infinite bottom and top layers.
+Numbering is from top to bottom,
+and from 0 to $N-1$ as imposed by the programming languages C$++$ and Python.
+Each layer~$l$
 \nomenclature[2l010]{$l$}{Layer index}%
-with constant refractive indices $n_l$
+has a constant refractive index $n_l$
 \nomenclature[2k022 2l010]{$k_l$}{Wavenumber in layer~$l$}%
 \nomenclature[2n020 2l010]{$n_l$}{Refractive index of layer~$l$}%
-and wavenumber $k_l\coloneqq K_\text{vac} n_l$.
+and a constant wavenumber $k_l\coloneqq K_\text{vac} n_l$.
 Any up- or downward travelling solution of the wave equation shall be written
 as a sum over partial wavefunctions,
 \begin{equation}\label{Epsipmsuml}
@@ -262,9 +278,9 @@ with the requirement
 The DWBA matrix element~\cref{Edwba} then takes the form
 \Emph{%
 \begin{equation}\label{Edwbal}
-  \bra \psi_\si|\delta v|\psi_\sf\ket
+  \braket{\psi_\si|\delta v|\psi_\sf}
   = \sum_l \sum_{\pm_\si} \sum_{\pm_\sf}
-    \bra \psi^\pm_{\si l}|\delta v|\psi^\pm_{\sf l}\ket.
+    \braket{\psi^\pm_{\si l}|\delta v|\psi^\pm_{\sf l}}.
 \end{equation}%
 \vspace*{-5pt}}
 
@@ -273,28 +289,45 @@ The DWBA matrix element~\cref{Edwba} then takes the form
 \begin{center}
 \includegraphics[width=0.4\textwidth]{fig/drawing/multilayer_z_conventions.ps}
 \end{center}
-\caption{Conventions for layer numbers and interface coordinates:
-Layers are numbered from top to bottom.
-The top vacuum (or air) layer (which extends to $z\to+\infty$) has number~0,
-the substrate (extending to $z\to-\infty$) is layer~$N$.
-\nomenclature[2n120]{$N$}{A multilayer sample has $N+1$ layers, including the
-  semi-infinite bottom and top layers}
+\caption{Conventions for layer numbers and interface coordinates.
+\index{Convention!layer numbering}%
+\index{Convention!interface coordinate}%
+\index{Coordinate!interface}%
+\index{Interface!coordinate}%
 \index{Multilayer!numbering}%
+\index{Multilayer!coordinates}%
 \index{Layer!index}%
-\index{Convention!layer number}%
+\index{Numbering!layers}%
+A sample has $N$ layers,
+including the semi-infinite bottom and top layers.
+\nomenclature[2n120]{$N$}{A multilayer sample has $N$ layers, including the
+  semi-infinite bottom and top layers}
+Layers are numbered from top to bottom.
+The top vacuum (or air) layer (which extends to $z\to+\infty$) has number~0,
+the substrate (extending to $z\to-\infty$) is layer~$N-1$.
 The parameter $z_l$
 \nomenclature[2z020 2l010]{$z_l$}{Vertical
   coordinate at the top of layer~$l$ (at the bottom for $l=0$)}%
 is the $z$ coordinate of the \E{top} interface of layer~$l$,
-\index{Multilayer!coordinates}%
-\index{Layer!coordinate}%
-\index{Convention!interface coordinate}%
 except for $z_0$ which is the coordinate of the \E{bottom} interface
 of the air or vacuum layer~0.}
 \label{Fdefz}
 \end{figure}
 %--------------------------------------------------------------------------------
 
+All the above can be easily transcribed to electromagnetic waves.
+The scattering matrix element~\cref{EtramaE}
+becomes a four-term some over field components $\v{E}^{\pm}_{\text i,f}$.
+In full analogy with~\cref{Edwbal},
+the sum over layers is
+\Emph{%
+\begin{equation}\label{EdwbalE}
+  \braket{\v{E}_\si|\delta v|\v{E}_\sf}
+  = \sum_l \sum_{\pm_\si} \sum_{\pm_\sf}
+    \braket{\v{E}^\pm_{\si l}|\delta v|\v{E}^\pm_{\sf l}}.
+\end{equation}%
+\vspace*{-5pt}}
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{Homogeneous layers}\label{SLayHomo}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -307,8 +340,8 @@ BornAgain currently only supports layers with a homogenous matrix.
 In terms of~\cref{Edecompose_vz} this means that
 $\mv(z)\eqqcolon v_l$ must be constant within a layer.
 
-Within the layer, $\psi^\pm_l$ is a plane wave
-that factorizes as in~\cref{Ekpar}.
+Within the layer, the directional neutron wavefunction~$\psi^\pm_l$
+is a plane wave and factorizes as in~\cref{Ekpar}.
 Its amplitude~$A_l^\pm$ is determined recursively
 by Fresnel's transmission and reflection coefficients
 \index{Fresnel coefficients}%
@@ -347,7 +380,7 @@ and the geometric interpretation of~$\psi_l(\r)$ less obvious.
 so that one has to fully rely on the algebraic formalism.
 
 With the indicator function
-\nomenclature[1χ032 2l010]{$\chi_l(z)$}{indicates whether $z$ is in layer~$l$}%
+\nomenclature[1χ032 2l010]{$\chi_l(z)$}{Indicates whether $z$ is in layer~$l$}%
 \index{Indicator function}%
 \begin{equation}\label{Echildef}
   \chi_l(\r)\coloneqq\left\{\begin{array}{ll}
@@ -365,7 +398,7 @@ The offset~$z_l$ has been included in the phase factor for later convenience.
 The DWBA transition matrix element~\cref{Edwba} is
 \index{Distorted-wave Born approximation!multilayer}%
 \begin{equation}\label{Edwba_ml0}
-  \bra \psi_\si|\delta v|\psi_\sf\ket
+  \braket{\psi_\si|\delta v|\psi_\sf}
   = \sum_l \sum_{\pm_\si} \sum_{\pm_\sf}
     A^{\pm *}_{\si l} A^\pm_{\sf l}
      \delta v_l(\k^\pm_{\sf l}-\k^\pm_{\si l})
@@ -393,7 +426,7 @@ and define the corresponding wavenumbers and amplitude factors and as
 Accordingly, we can write \cref{Edwba_ml0} as
 \Emph{
 \begin{equation}\label{Edwba_ml}
-  \bra \psi_\si|\delta v|\psi_\sf\ket
+  \braket{\psi_\si|\delta v|\psi_\sf}
   = \sum_l \sum_{u} C^u_l \delta v_l(\q_l^u).
 \end{equation}
 \vspace*{-5pt}}
@@ -420,7 +453,7 @@ such that the wavefunction $\phi(\r)$ and its first derivative
 $\Nabla\phi(\r)$ evolve continuously.
 
 % TODO REPLACE BY TEXT BELOW
-\Note{Support for rough interfaces is already implemented in \BornAgain,
+\Work{Support for rough interfaces is already implemented in \BornAgain,
 but documentation is adjourned to a later edition of this manual.}
 %Unless layer interfaces are smooth,
 %their roughness causes extra contribution to the total scattering.
@@ -435,7 +468,7 @@ which is the thickness of layer~$l$,
 except for $l=0$,
 where the special definition of $z_0$ (\cref{Fdefz}) implies $d_0=0$.
 We consider the interface between layers $l$ and $l-1$,
-with~$l=1,\ldots,N$, as shown in \cref{Fboundary}.
+with~$l=1,\ldots,N-1$, as shown in \cref{Fboundary}.
 This interface has the vertical coordinate $z_l=z_{l-1}-d_{l-1}$.
 Accordingly, the continuity conditions at the interface are
 \begin{equation}\label{Econtcond}
@@ -471,7 +504,14 @@ we can rewrite this equation system as
   \left( \begin{array}{c}A^-_{l-1}\\ A^+_{l-1}\end{array} \right)
   = M_l \left( \begin{array}{c}A^-_l\\A^+_l\end{array} \right)
 \end{equation}
-with the transfer matrix
+with the transfer matrix\footnote
+{This approach is generally attributed to Abelès,
+\index{Abelès matrix}%
+who elaborated it in his thesis from 1949, published 1950.
+The usually cited paper \cite{Abe50a} is no more than a short advertisement.
+Parratt \cite{Par54}, unaware of Abelès, expressed the same relation as a recursion formula.%
+\index{Parratt recursion}%
+}
 \begin{equation}\label{EMil}
   M_l
    \coloneqq
@@ -505,26 +545,26 @@ plane-wave amplitudes are subject to two boundary conditions.
 Let us assume that the source or the sink is located at $z>0$.
 Then in the top layer, $A^-_{0}=1$ is given by the
 incident or back-traced final plane wave.
-In the substrate, $A^+_{N}=0$ because there is no radiation
+In the substrate, $A^+_{N-1}=0$ because there is no radiation
 coming from $z\to-\infty$.
 This leaves us with two unkown amplitudes,
-the overall coefficients of transmission~$A^-_N$ and reflection~$A^+_0$.
+the overall coefficients of transmission~$A^-_{N-1}$ and reflection~$A^+_0$.
 These two unknowns are connected by a system of two linear equations,
 \begin{equation}\label{E1Ap}
   \left( \begin{array}{c}1\\ A^+_0\end{array} \right)
-  = M_1 \cdots M_{N} \left( \begin{array}{c}A^-_N\\0\end{array} \right).
+  = M_1 \cdots M_{N-1} \left( \begin{array}{c}A^-_{N-1}\\0\end{array} \right).
 \end{equation}
 While it is possible in principle
 to solve this as a matrix equation,
-the actual implementation in \BornAgain\
-%\footnote{SpectralMatrix.cpp: SpectralMatrix::execute()}
+the actual implementation in \BornAgain\footnote
+{In file \SRC{Core/Multilayer}{SpecularMatrix.cpp}, function \T{SpecularMatrix::execute}.}
 starts with a unit vector in the substrate,
 and then carries out the propagation step \cref{EcMc}
 interface by interface,
 yielding unnormalized amplitudes
 \begin{equation}\label{EAtildel}
   \left( \begin{array}{c}\tilde A^-_l\\ \tilde A^+_l\end{array} \right)
-  \coloneqq M_{l+1}\cdots M_{N} \left( \begin{array}{c}1\\0\end{array} \right).
+  \coloneqq M_{l+1}\cdots M_{N-1} \left( \begin{array}{c}1\\0\end{array} \right).
 \end{equation}
 When the top layer is reached,
 the obtained values are normalized
@@ -537,36 +577,11 @@ For GISAS detection in transmission geometry
 \index{Detector!transmission geometry}%
 (sink location $z<0$) all the development
 following \cref{EMil} holds with exchanged order of layers:
-$(0,\ldots, N) \mapsto (N,\ldots,0)$.
+$(0,\ldots, N-1) \mapsto (N-1,\ldots,0)$.
 
 \Work{GISAS in transmission geometry is not yet implemented in \BornAgain,
   but high on our agenda.}
 
-At this point,
-it may be an interesting exercise to make
- a connection with a well known textbook result.
-Consider a system
-with a single interface between two semi-infinite,
-non-absorbing media. The incoming wave is assumed to be above the
-critical angle, ensuring all $f_l$ are real.
-The reflected flux,
-normalized to the incident vertical flux $J_{0\perp}^-=-Kf_0$, is
-\index{Reflected flux}%
-\begin{equation}\label{EJrefl}
-  \frac{J_{0\perp}^+}{J_{0\perp}^-}
-  = - \left(\frac{f_0-f_1}{f_0+f_1}\right)^2,
-\end{equation}
-and the transmitted flux
-\index{Transmitted flux}%
-\begin{equation}\label{EJtran}
-  \frac{J_{1\perp}^-}{J_{0\perp}^-}
-  = \frac{4f_0 f_1}{(f_0+f_1)^2}.
-\end{equation}
-This satisfies particle number conservation, $J_{0\perp}^-+J_{0\perp}^+=J_{1\perp}^-$,
-and agrees with Fresnel's result for $s$-polarized light.\footnote
-{See any optics textbook, e.g.\ Born~\&~Wolf \cite[ch.~1.5.2]{BoWo99}
-  or Hecht \cite[ch.~4.6.2]{Hec02}.}
-
 The above algorithm fails if $f_l\to0$
 because $M_{l+1}$ becomes singular.
 The general solution of \cref{Ewavez} will be a linear function of $z$:
@@ -624,7 +639,6 @@ The first two terms describe the exponential intensity decrease
 due to absorption, while
 the oscillatory term in square brackets
 is responsible for waveguide effects in layers with finite thickness.
-
 The flux can also be written in terms of the one-dimensional wavefunctions $\phi^{\pm}(z)$:
 \begin{equation}\label{EJ2}
   \begin{array}{@{}l@{\;}l}
@@ -655,6 +669,126 @@ In the case of a semi-infinite layer, the vertical component becomes zero and
  all incoming radiation at the top of the layer undergoes \E{total reflection}.
 \index{Total reflection}%
 
+%===============================================================================
+\subsection{Modifications for X-rays}\label{SmulayX}
+%===============================================================================
+
+\def\Ep{\v{\Phi}}
+\def\hn{\v{n}}
+
+We shall now translate the above results from unpolarized neutrons to X-rays.
+The vectorial amplitude of the electromagnetic field will require
+nontrivial modifications.
+In place of the factorization~\cref{Ekpar}, we write
+\begin{equation}
+  \v{E}(\r)=\e^{i\k_\plll\r}\Ep(z).
+\end{equation}
+In place of~\cref{Ephizwj},
+the vertical wavefunction is
+\begin{equation}
+  \Ep^\pm_l(z) = \v{A}^\pm_l \e^{\pm ik_\perp(z-z_l)}\chi_l(z).
+\end{equation}
+
+%--------------------------------------------------------------------------------
+\begin{figure}[tb]
+\begin{center}
+\includegraphics[width=0.8\textwidth]{fig/drawing/s-vs-p-polarization.ps}
+\end{center}
+\caption{Conventions for polarization directions relative to a refracting interface:
+\index{Convention!p- and s-polarization}%
+\index{Polarization!p and s@$p$ and $s$}%
+\index{p Polarization@$p$-Polarization}%
+\index{s Polarization@$s$-Polarization}%
+For $p$ polarization, the electric field vector~$\v{E}$ is parallel to the interface normal~$\hn$;
+for $s$ polarization, it is perpendicular (\E{senkrecht} in German).
+In either case, $\v{E}$ is perpendicular to the wavevector~$\k$.}
+\label{Fsppol}
+\end{figure}
+%--------------------------------------------------------------------------------
+
+The vectorial character of $\v{A}^\pm_{wl}$ will require changes in~\cref{Sacrolay}.
+For electromagnetic radiation in nonmagnetic media,
+the boundary conditions at an interface with normal $\hn$ are \cite[eq. 7.37]{Jac75}
+% , Born \& Wolf \cite[ch.~1.1.3]{BoWo99}, or Hecht \cite[ch.~4.6.1]{Hec02}.}
+\nomenclature[2n04]{$\hn$}{Normal vector of an interface}
+\begin{align}
+  &\sum_\pm\,\overline{\epsilon}\,\v{E}^\pm\,\hn = \text{const}, \label{EbcE1}\\[1.4ex]
+  &\sum_\pm\,\v{E}^\pm\times\hn = \text{const}, \label{EbcE2}\\[1.4ex]
+  &\sum_\pm\,\k^\pm_l\times\v{E}^\pm = \text{const}. \label{EbcE3}
+\end{align}
+We will only consider the two polarization directions,
+\index{Convention!p- and s-polarization}%
+\index{Polarization!p and s@$p$ and $s$}%
+\index{p Polarization@$p$-Polarization}%
+\index{s Polarization@$s$-Polarization}%
+conventionally designated as $p$ and~$s$, defined in \Cref{Fsppol}.
+As some algebra on \cref{EbcE1,EbcE2,EbcE3} would show,
+these are \E{principal axes},
+meaning that if both incoming fields $\v{E}^-_{l-1}$ and~$\v{E}^+_l$ are strictly
+polarized in either $p$ or $s$ direction,
+then the outgoing fields $\v{E}^+_{l-1}$ and~$\v{E}^-_l$
+are polarized in the same direction.
+Conversely, if the incoming fields are mixtures of $p$ and $s$ polarization,
+then the outgoing fields will be, in general, mixed differently.
+Therefore if polarization factors are quantitatively important in an experiment,
+one should strive to accurately polarize the incident beam in $p$ or $s$ direction
+in order to avoid the extra complication of variably mixed polarizations.
+
+Further algebra on \cref{EbcE1,EbcE2,EbcE3} replicates the
+reflection law that relates $\k^-$ and $k^+$
+and Snell's law~\cref{ESnell}.
+Taking these for granted,
+we only retain equations that are needed to determine the field amplitudes~$E^\pm$.
+For $p$~polarization they yield
+\begin{equation}
+  \left(\begin{array}{cc}k&k\\
+       -k_\perp/k&k_\perp/k\end{array}\right)
+  \left(\begin{array}{c}E^-\\
+       E^+\end{array}\right) = \text{const},
+\end{equation}
+and for $s$~polarization
+\begin{equation}
+  \left(\begin{array}{cc}1&1\\
+       -k_\perp&k_\perp\end{array}\right)
+  \left(\begin{array}{c}E^-\\
+       E^+\end{array}\right) = \text{const}.
+\end{equation}
+The latter equation can be brought into the form~\cref{Econt2}.
+In consequence,
+$s$-polarized X-rays are refracted and reflected in
+exactly the same ways as unpolarized neutrons.
+For $p$ polarization, the transfer matrix~\cref{EMil}
+must be replaced by
+\begin{equation}
+  M_l^{\text(p)} = TODO,
+\end{equation}
+\Work{In BornAgain, this modified transfer matrix is not yet implemented;
+only $s$ polarized X-rays are currently supported.}
+
+\Work{The following paragraph on polarization factors shall be worked out next:}
+In $s$~geometry the coefficients $C^u_l$ of \Cref{Edwba_mlE}
+are given by simple products of scalar amplitudes as in~\cref{Eudef}.
+
+The DWBA matrix element is
+\begin{equation}\label{Edwba_mlE}
+  \braket{\v{E}_\si|\delta v|\v{E}_\sf}
+  = \sum_l \sum_{u} C^u_l \delta v_l(\q_l^u).
+\end{equation}
+in full analogy with~\cref{Edwba_ml},
+but the coefficients are now scalar products
+$C^1=\v{A}^{-*}_\si\v{A}^{+}_\sf$ etc.\ instead of the products of scalar factors in~\cref{Eudef}.
+
+and the coefficients of \Cref{Edwba_mlE} are
+\begin{equation}
+  \begin{array}{@{}lcl}
+    C^1 &=& A^{-*}_\si A^+_\sf,\\
+    C^2 &=& A^{-*}_\si A^-_\sf\cos(\alpha_-+\alpha_+),\\
+    C^3 &=& A^{+*}_\si A^+_\sf\cos(\alpha_-+\alpha_+),\\
+    C^4 &=& A^{+*}_\si A^-_\sf.
+  \end{array}
+\end{equation}
+\Work{In BornAgain, polarization factors are not yet implemented.}
+
 
 %===============================================================================
 \iffalse
diff --git a/Doc/UserManual/Scattering.tex b/Doc/UserManual/Scattering.tex
index 46c1f603892272bd38ea2014d2ec3df503edce95..b5f01cdaaee8e21bd65afcea7e933e4e4d13f7ef 100644
--- a/Doc/UserManual/Scattering.tex
+++ b/Doc/UserManual/Scattering.tex
@@ -13,41 +13,61 @@
 %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+\def\Do{\overset{o}{D}}
+\def\Go{\overset{o}{G}}
+\def\TD{\TENS{D}}
+\def\Td{\TENS{\delta}}
+\def\TG{\TENS{G}}
+\def\TU{\TENS{U}}
+\def\TV{\TENS{V}}
+\def\TL{\TENS{\Lambda}}
+\def\TDo{\TENS{\overset{o}{D}}}
+\def\TGo{\TENS{\overset{o}{G}}}
+\def\vGo{\v{\overset{o}{G}}\vphantom{\v{G}}}
+\def\Psio{\v{\overset{o}{\Psi}}\vphantom{\Psi}}
+\def\ue{\v{\hat u}}
+
+\def\pfo{\overset{o}{\psi}_\sf}
+\def\pfoc{\overset{o}{\psi}\vphantom{\psi}^*_\sf}
+
+\index{Elastic scattering|seealso{Cross section}}%
+
 \part{Physics}\label{PPHYS}
 
 \chapter{Scattering}  \label{SSca}
 \chaptermark{Scattering}
 
+This chapter provides a self-contained introduction
+into the theory of neutron and X-ray scattering,
+as needed for the analysis of grazing-incidence small-angle scattering (GISAS) experiments.
+\index{Grazing-incidence small-angle scattering}%
+\index{Scattering!grazing incidence|see{Grazing-incidence small-angle scattering}}%
+\index{GISAS|see{Grazing-incidence small-angle scattering}}%
+In \Cref{Swave},
+a generic wave equation is derived.
+In \Cref{SDWBA},
+it is solved in first-order distorted-wave Born approximation (DWBA).
+\index{DWBA|see {Distorted-wave Born approximation}}%
+\index{Distorted-wave Born approximation}%
+The chapter finishes with a qualitative discussion
+of coherence lengths in \Cref{Scoherlen}.
 
-This chapter introduces the basic theory of small-angle scattering (SAS).
-\index{Small-angle scattering}%
-\index{SAS|see{Small-angle scattering}}%
-We specifically consider scalar neutron and X-ray propagation,
-adjourning the notationally more involved
-theory of polarized neutrons to \Cref{SPol}.
-Our exposition is self-contained,
-except for the initial passage from the microscopic
-to the macroscopic Schrödinger equation,
-which we outline only briefly (\Cref{Swave}).
-For X-rays, we obtain the same perturbed Schrödinger equation from Maxwell's equations
-(\Cref{SXray}).
-The standard description of scattering in first-order Born approximation
-(\Cref{SBornApprox})
-is introduced in a way that facilitates the following generalization
-into the distorted-wave Born approximation (DWBA)
-needed for grazing-incidence scattering (\Cref{SDWBA}).
-This chapter finishes with a qualitative discussion
-of coherence lengths (\Cref{Scoherlen}).
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\section{Neutron propagation}\label{Swave}
+\section{Wave propagation}\label{Swave}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\index{Wave propagation!neutron|(}%
-\index{Neutron!wave propagation|(}%
+\index{Wave propagation|(}%
+
+In this section, we review the wave equations that describe the propagation
+of neutrons (\cref{SnScalar,SnSpinor}) and X-rays (\cref{SXwave}) in matter,
+and combine them into a unified wave equation (\cref{SuniWave})
+that is the base for the all following analysis.
 
 %===============================================================================
-\subsection{Coherent wave equation}\label{ScohWave}
+\subsection{Neutrons}\label{SnScalar}
 %===============================================================================
+\index{Wave propagation!neutron|(}%
+\index{Neutron!wave propagation|(}%
 
 \def\Vmac{\tilde{V}}
 
@@ -57,819 +77,281 @@ The scalar wavefunction $\psi(\r,t)$
 \nomenclature[2r040]{$\r$}{Position}%
 \nomenclature[1ψ030 2r040 2t02]{$\psi(\r,t)$}{Microscopic neutron wavefunction}%
 of a free neutron
-is governed by the microscopic Schrödinger equation
-\begin{equation}\label{ESchrodi}
+in absence of a magnetic field
+is governed by the Schrödinger equation
+\begin{equation}\label{ESchrodi1}
   i\hbar\partial_t \psi(\r,t)
   = \left\{-\frac{\hbar^2}{2m}\Nabla^2+V(\r)\right\} \psi(\r,t).
 \end{equation}
-Since BornAgain only supports elastic scattering,
-\index{Elastic scattering}%
+Since BornAgain only aims at modelling elastic scattering,
 \index{Scattering!elastic}%
-the potential $V(\r)$ must be time independent.
-\index{Time}%
+any time dependence of the potential is averaged out in the definition
+\index{Potential!neutron}%
+\index{Neutron!potential}%
+$V(\r)\coloneqq \langle V(\r,t)\rangle$.
+\nomenclature[2v130 2r040]{$V(\r)$}{Neutron potential}%
+\index{Time dependence!neutron potential}%
+Inelastic scattering,
+\index{Inelastic scattering}%
+\index{Scattering!inelastic}%
+\index{Damping!inelastic scattering}%
+\index{Loss terms|see {Damping}}%
+in principle, can be accounted for by an extra contribution
+damping.\footnote
+{This is not explicitly supported in the software,
+but users are free to increase the imaginary part of the refractive index
+\index{Refractive index!losses from inelastic scattering}%
+to emulate damping by inelastic losses.\label{Flosses}}
 Therefore we only need to consider monochromatic waves
 \index{Wave!monochromatic}%
 \index{Monochromatic wave}%
 with given frequency~$\omega$.
 \nomenclature[1ω 020]{$\omega$}{Frequency of incident radiation}%
-In consequence, the wave function
+In consequence, the wavefunction
 \begin{equation}\label{Estationarywave}
   \psi(\r,t) = \psi(\r)\e^{-i\omega t}
 \end{equation}
-\nomenclature[1ψ030 2r040 0]{$\psi(\r)$}{Stationary wavefunction}%
-factorizes into a stationary wave and a time-dependent phase factor.%
-\index{Stationary wave function}%
-\index{Phase factor}%
-\footnote
-{The minus sign in the exponent of the phase factor
-is an inevitable consequence of the standard form of the Schrödinger equation,
-and is therefore called the \E{quantum-mechanical sign convention}.
-\index{Wave propagation|seealso {Sign convention}}%
-\index{Convention|see {Sign convention}}%
-\index{Sign convention!wave propagation|(}%
-For electromagnetic radiation
-usage is less uniform.
-While most optics textbooks
-have adopted the quantum-mechanical convention~\cref{Estationarywave},
-\index{Quantum-mechanical convention}%
-in X-ray crystallography
-the conjugate phase factor $\e^{+i\omega t}$ is prefered.
-This \E{crystallographic sign convention}
-\index{Crystallographic sign convention}%
-has also been chosen
-in influential texts on GISAXS (e.g.\ \cite{ReLL09}).
-Here, however, we are concerned not only with X-rays,
-but also with neutrons,
-and therefore need to leave the Schrödinger equation~\cref{ESchrodi} intact.
-Consequently, in this manual, and in the program code of BornAgain,
-the quantum-mechanical sign convention~\cref{Estationarywave}
-\index{Sign convention!wave propagation|)}%
-is chosen.}
-Inserting \cref{Estationarywave} in \cref{ESchrodi},
-we obtain the stationary Schrödinger equation
-\begin{equation}\label{EstatSchrodi}
-  \left\{-\frac{\hbar^2}{2m}\Nabla^2+V(\r)-\hbar\omega\right\} \psi(\r) = 0.
-\end{equation}
-\nomenclature[2m020]{$m$}{Neutron mass}%
-\nomenclature[2v130 2r040]{$V(\r)$}{Microscopic optical potential}%
-\index{Potential|see {Optical potential}}%
-\index{Optical potential!nuclear (microscopic)}%
-The \E{nuclear} (or \E{microscopic})
-\E{optical potential} $V(\r)$,
-in a somewhat ``naive conception'' \cite[p.~7]{Sea89},
-consists of a sum of delta functions,
-representing Fermi's ``pseudopotential''.
-\index{Fermi's pseudopotential}%
-The superposition of the incident wave with the scattered waves
-originating from each illuminated nucleus
-results in \E{coherent forward scattering},
-\index{Coherent forward scattering}%
-in line with Huygens' principle.
-\index{Huygens' principle}%
-
-Coherent superposition also leads to \E{Bragg scattering}.
-\index{Bragg scattering!by atomic lattices}%
-However, Bragg scattering by atomic lattices only occurs at angles
-far above the small-angle range covered in GISAS experiments.
-Accordingly, it can be neglected in the analysis of GISAS data,
-or at most, is taken into account as a loss channel.
-
-Therefore,
-we can neglect the atomic structure of $V(\r)$,
-and perform some coarse graining to
-arrive at a \E{continuum approximation}.
-\index{Continuum approximation!neutron propagation}%
-This is
-similar to the passage from
-the microscopic to the macroscopic Maxwell equations.
-The details are intricate \cite{Sea89,Lax51},
-but the result \cite[eq.~2.8.32]{Sea89} is very simple:
-The macroscopic field equation
-has still the form of a stationary Schrödinger equation,
-\index{Schrodinger@Schrödinger equation!macroscopic}%
-\begin{equation}\label{EmacrSchrodi}
-  \left\{-\frac{\hbar^2}{2m}\Nabla^2+\Vmac(\r)-\hbar\omega\right\} \psi(\r) = 0,
-\end{equation}
-\nomenclature[1ψ030 2r040 2t020]{$\psi(\r,t)$}{Coherent wavefunction}%
-\nomenclature[2v131 2r040]{$\Vmac(\r)$}{Macroscopic optical potential}%
-where $\psi$ now stands for the \E{coherent wavefunction}
-\index{Coherent wavefunction}%
-\index{Wave propagation!coherent}%
-obtained by superposition of
-incident and forward scattered states,
-and $\Vmac(\r)$ is the \E{macroscopic optical potential}.
-\index{Optical potential!macroscopic}%
-This potential is weak, and slowly varying compared to atomic length scales.
-In the following it shall be expressed through the
-\E{bound scattering length density} (SLD)
-\index{Bound scattering length|see{Scattering length}}%
-\index{Scattering!length density}%
-\index{SLD|see{Scattering length density}}%
-\cite[eq.\ 2.8.37]{Sea89},
-\nomenclature[2v020 2r040]{$v(\r)$}{Scattering length density (SLD)}%
-\begin{equation}
-  v(\r)\coloneqq\frac{m}{2\pi \hbar^2}\Vmac(\r).
-\end{equation}
-
-%===============================================================================
-\subsection{SLD fluctuations}\label{Sfluct}
-%===============================================================================
-
-In the following, we will use~\cref{EmacrSchrodi}
-as a starting point to study scattering by condensed-matter samples
-(we will prefer the brief term \E{sample} over \E{scattering target}).
-\index{Scattering!target|see{Sample}}%
-\index{Sample}%
-To compute scattering cross sections from a perturbation expansion,
-\index{Perturbation expansion}%
-we will need to decompose the SLD as
-\begin{equation}\label{Edecompose_v}
-  v(\r) \coloneqq \mv(\r) + \delta v(\r).
-\end{equation}
-\nomenclature[1d030 2v230 2r040]{$\delta v(\r)$}{Fluctuating part of the scattering length density}%
-\nomenclature[2v021]{$\mv$}{Average scattering length density}%
-For $\r$ outside the finite sample volume, we require $\delta v(\r)=0$.
-Inside the sample, the decomposition~\cref{Edecompose_v} is somewhat arbitrary,
-and can be chosen for analytical convenience.
-The macroscopic Schrödinger equation~\cref{EmacrSchrodi} becomes
-\begin{equation}\label{ESchrodi3}
-  \left\{ \Nabla^2 + \frac{2m\omega}{\hbar} - 4\pi\mv(\r) \right\}\psi(\r)
-  = 4\pi\delta v(\r)\psi(\r).
-\end{equation}
-The left-hand side describes optical wave propagation,
-the right-hand side is a perturbation that causes scattering.
-\index{Scattering potential!neutron}%
-\index{Perturbation potential|see{Scattering potential}}%
-\index{Potential|see{Scattering potential}}%
-Accordingly, $\mv(\r)$ should only contain SLD variations
-that are simple enough to allow an analytical solution.
-The SLD fluctuation~$\delta v(\r)$ then stands for the more irregular
-features of a sample one ultimately wants to study in a scattering experiment.
-
-For brevity, we rewrite~\cref{ESchrodi3} as
-\Emph{
-\begin{equation}\label{ESchrodiK}
-  \left\{ \Nabla^2 + k(\r)^2 \right\}\psi(\r)
-  = 4\pi\delta v(\r)\psi(\r).
-\end{equation}
-\vspace*{-5pt}}
-\index{Perturbed Schrödinger equation}%
-\index{Schrödinger equation!perturbed}%
-This \E{perturbed Schrödinger equation} will be the starting point for all further analyses.
-It contains the material-dependent wavenumber~$k(\r)$, defined by the dispersion relation
-\nomenclature[2k030 2r040]{$k(\r)$}{Wavenumber}%
-\index{Dispersion!neutron in homogeneous medium}%
-\index{Wavenumber!material dependent}%
-\begin{equation}\label{Edispersion}
-  k(\r)^2 \coloneqq \frac{2m\omega}{\hbar} - 4\pi\mv(\r).
-\end{equation}
-Alternatively, we may write
-\begin{equation}\label{Ekkn}
-  k(\r)=K n(\r),
-\end{equation}
-using the vacuum wavenumber~$K\coloneqq \sqrt{2m\omega/\hbar}$
-\nomenclature[2k120]{$K$}{Wavenumber in vacuum}%
-and the neutron optical \E{refractive index}
-\nomenclature[2n020]{$n$}{Refractive index}%
-\index{Refractive index}%
-\index{Index of refraction|see {Refractive index}}%
-\begin{equation}\label{EnRefrIndx}
-  n(\r)\coloneqq \sqrt{1-\frac{4\pi}{K^2}\mv(\r)}.
-\end{equation}
-It is customary to express the complex refractive index of a material
-by two real parameters:
-\begin{equation}\label{Endb1}
-  n =  1-\delta +i\beta.
-\end{equation}
-\nomenclature[1δ020]{$\delta$}{Small parameter in the refractive index
-   $n=1-\delta +i\beta$}%
-\nomenclature[1β020]{$\beta$}{Imaginary part of the refractive index}%
-For X-rays and thermal neutrons,
-$\delta$ and $\beta$ are almost always nonnegative,\footnote
-{The plus sign in front of~$i\beta$ is a consequence of
-the quantum-mechanical sign convention;
-in the X-ray crystallography convention it would be a minus sign.
-\index{Refractive index!sign convention}%
-\index{Sign convention!refractive index}}
-and much smaller than~1.
-A nonzero~$\beta$ describes absorption and leads to a damping of propagating waves.
-\index{Absorption}%
-\index{Damping}%
-
-The SLD fluctuation amplitude $|\delta v(\r)|$ is at most of order $1-n$.
-Therefore the right-hand side of the Schrödinger equation~\cref{ESchrodiK}
-is but a weak perturbation.
-This suggests a solution
-by means of a perturbation expansion in powers of $\delta v$,
-\index{Perturbation expansion}%
-known as the \E{Born expansion} or \E{Born series}.\footnote{
-Named after Max Born
-who introduced it in quantum mechanics.
-The idea goes back to Lord Rayleigh
-who devised it for sound,
-and later also applied it to electromagnetic waves,
-which resulted in his famous explanation of the blue sky.}
-The standard first-order Born approximation (BA, \cref{SBornApprox})
-is regularly used  for the analysis of small-angle scattering (SAS) experiments.
-\index{Small-angle scattering}%
-\index{BA|see{Born approximation}}%
-\index{Born approximation}%
-For grazing-incidence small-angle scattering (GISAS),
-one uses the slightly more generic distorted wave Born approximation (DWBA, \Cref{SDWBA}).
-\index{Distorted-wave Born approximation}%
-
-\index{Wave propagation!neutron|)}%
-\index{Neutron!wave propagation|)}%
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\section{Neutron scattering in Born approximation}\label{SBornApprox}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%===============================================================================
-\subsection{The Born expansion}\label{SBornExpans}
-%===============================================================================
-
-\index{Born approximation|(}%
-\index{Scattering!plane wave|(}%
-
-To describe an elastic scattering experiment,
-we need to solve the Schrödinger equation~\cref{ESchrodiK}
-under the asymptotic boundary condition\footnote
-{A more formal variant of this is known as the \E{Sommerfeld radiation condition}.%
-\index{Sommerfeld radiation condition}%
-\index{Radiation condition}%
-}
-\index{Boundary conditions!elastic scattering}%
-\begin{equation}\label{Escabouco}
-  \psi(\r)
-  \simeq \psi_\si(\r) + f(\vartheta,\varphi)\frac{\e^{iKr}}{4\pi r}
-  \text{~for~}r\to\infty,
-\end{equation}
-\nomenclature[1ψ034 2i000 2r040]{$\psi_\si(\r)$}{Incident wavefunction}%
-\nomenclature[2i000]{i}{Subscript ``incident''}%
-\index{Incident radiation!Born approximation}%
-where $\psi_\si(\r)$ is the incident wave
-as prepared by the experimental apparatus,
-and the second term on the right-hand side is
-the outgoing scattered wave
-that carries information in form of the angular distribution
-$f(\vartheta,\varphi)$.
-
-Equation~\cref{ESchrodiK} looks
-like an inhomogeneous differential equation ---
-except that the right-hand side contains the unknown function~$\psi$.
-The key idea of the Born expansion is to overcome this problem by iteration.
-Treating the right-hand side as a given inhomogeneity,
-one can solve~\cref{ESchrodiK} by the Green function method.
-The incident wave~$\psi_\si(\r)$ must be determined from the homogeneous wave equation
-\begin{equation}\label{EHomoK}
-  \left\{\Nabla^2+k(\r)^2\right\}\psi_\si(\r) = 0.
-\end{equation}
-The Green function~$G(\r,\r')$ must fulfill the wave equation with an isolated inhomogeneity,
-\index{Green function}%
-\begin{equation}\label{EGreenK}
-  \left\{\Nabla^2+k(\r)^2\right\}G(\r,\r') = \delta(\r-\r').
-\end{equation}
-\nomenclature[2g134]{$G(\r,\r')$}{Green function}%
-Let us postpone the explicit or asymptotic solution of these two equations
-to later sections (\cref{Sfarfield} for the standard plane-wave case with $k(\r)=K$,
-\cref{SfarDW} for the more generic distorted-wave case).
-Here we only need to assume that solutions $\psi_\si$ and~$G$ exist.
-We can then posit the \E{Lippmann-Schwinger equation}
-\index{Lippmann-Schwinger equation}%
-\begin{equation}\label{EPsiFormal}
-  \psi(\r)
-  = \psi_\si(\r)
-  + \int\!\d^3r'\, G(\r,\r') 4\pi\delta v(\r')\psi(\r').
-\end{equation}
-By operating on both sides with~$\{\Nabla^2+k(\r)^2\}$
-it is easily seen that solutions~$\psi$ of this integral equation
-fulfill the perturbed Schrödinger equation \cref{ESchrodiK}.
-
-The Lippmann-Schwinger equation can be resolved into an infinite series
-by iteratively substituting the full right-hand side of~\cref{EPsiFormal}
-for the occurence of~$\psi$ in the integrand.
-Successive terms in this series contain rising powers of $\delta v$.
-Since $\delta v$ is assumed to be small, the series is likely to converge.
-In \E{first-order Born approximation},
-only the linear order in $\delta v$ is retained,
-\begin{equation}\label{EBorn}
-  \psi(\r)
-  \doteq \psi_\si(\r)
-  + 4\pi \int\!\d^3r'\, G(\r,\r') \delta v(\r') \psi_\si(\r').
-\end{equation}
-This is practically always adequate for
-material investigations with X-rays or neutrons,
-where the aim is to
-deduce $\delta v(\r')$ from the scattered intensity ${|\psi(\r)|}^2$.
-Since detectors are always placed at positions $\r$
-that are not illuminated by the incident beam,
-we are only interested in the scattered wave
-\index{Scattered wave}%
-\index{Wave!scattered}%
-\begin{equation}\label{EBornS}
-  \psi_\text{s}(\r)
-  \coloneqq
-  4\pi \int\!\d^3r'\, G(\r,\r') \delta v(\r') \psi_\si(\r').
-\end{equation}
-\nomenclature[1ψ034 2s000 0 2r040]{$\psi_\text{s}(\r)$}{Scattered wavefunction}%
-\nomenclature[2s000 0]{s}{Subscript ``scattered''}%
-For brevity and mathematical convenience,
-the integral introduced in~\cref{EPsiFormal} has no bounds
-and therefore formally runs over the entire space.
-However, the scattering potential $\delta v(\r')$ in the integrand is nonzero
-only if $\r'$ lies inside the sample volume.
-On the other hand, we only need to compute the scattered wave~$\psi_\text{s}(\r)$
-at detector positions~$\r$ far outside the sample.
-This is just the condition for \E{Fraunhofer diffraction}:
-\index{Fraunhofer approximation}%
-the distance from the sample to the detector location~$\r$
-must be much larger than the size of the sample.
-In the context of generic scattering theory,
-it is known as the \E{far-field approximation}.
-\index{Far-field approximation}%
-To keep notation light,
-we assume from now on that the coordinate origin
-\index{Coordinate origin}%
-\index{Origin!coordinate system}%
-lies inside the sample.
-Then far-field asymptotes are obtained by taking the limit $r\to\infty$.
-Since we only need the asymptote $\psi_{\text{s}\infty}(\r)$ of the scattered wave,
-it is sufficient to solve~\cref{EGreenK} for the far-field Green function
-\begin{equation}\label{EGinftydef}
-  G_\infty(\r,\r')\coloneqq \lim_{r\to\infty} G(\r,\r').
-\end{equation}
-This will be done in very different ways for plane waves (\cref{Sfarfield})
-and for distorted waves (\cref{SfarDW}).
-
-\index{Scattering!plane wave|)}%
-\index{Born approximation|)}%
-
-%===============================================================================
-\subsection{Vacuum solution}\label{Sfarfield}
-%===============================================================================
-
-\index{Far-field approximation|(}%
-
-As said in connection with~\cref{Edecompose_v},
-there is some freedom in the choice of $\mv(\r)$.
-In the standard variant of the Born expansion,
-one makes the simplest possible choice,
-setting $\mv(\r)$ to the constant vacuum value.
-With~\cref{Edecompose_v},
-all fluctuations in $v(\r)$ are ascribed to the scattering potential~$\delta v(\r)$.
-With~\cref{Edispersion}, we have $k(\r)=K$.
-The homogeneous equation~\cref{EHomoK} reduces to the \E{Helmholtz equation},
-\index{Helmholtz wave equation}%
-\index{Wave propagation!Helmholtz equation}%
-and is solved by plane waves and superpositions thereof.
-In the following we choose the incident plane wave
-\index{Incident radiation!plane wave}%
-\begin{equation}\label{EPsi0Plane}
-  \psi_\si(\r)=\e^{i \k_\si \r}
-\end{equation}
-\nomenclature[2k040]{$\k$}{wavevector}%
-with $k_\si=K$.
-Superposition of plane waves
-\index{Superposition}%
-will be discussed when we come to instrumental resolution effects (\cref{SBeam}).
-\index{Instrument!resolution|see{Resolution}}%
-\index{Resolution}%
-
-The Green function of the inhomogeneous Helmholtz equation~\cref{EGreenK}
-with $k(\r)=K$ is well known:\footnote
-{Verification under the condition $\r\ne0$
-is a straightforward exercise in vector analysis.
-For the special case $\r=0$,
-one encloses the origin in a small sphere
-and integrates by means of the Gauss-Ostrogadsky divergence theorem.
-This explains the appearance of the factor $4\pi$.}
-\index{Green function!homogeneous material}%
-\begin{equation}\label{EGreens1}
-  G(\r,\r') = \frac{\e^{iK|\r-\r'|}}{4\pi |\r-\r'|}.
-\end{equation}
-Read as a function of~$\r$, it is an outgoing spherical wave centered at $\r'$.
-To compute the far-field limit~\cref{EGinftydef},
-we expand for $\r'$ with $r'\ll r$:
-\begin{equation}
-  \left|\r-\r'\right|
-  \doteq \sqrt{r^2-2\r\,\r'}
-  \doteq r - \frac{\r\,\r'}{r}
-  \equiv r - \frac{\k_\sf \r'}{K},
-\end{equation}
-\nomenclature[2f000]{f}{Subscript ``final''}%
-where we have introduced the outgoing wavevector
-$  \k_\sf\coloneqq K \r / r$.
-We apply this to~\cref{EGreens1},
-\index{Green function!homogeneous material}%
-and obtain in leading order the far-field Green function
-\begin{equation}\label{EGreenFar}
-  G_\infty(\r,\r')
-  = \frac{\e^{iKr}}{4\pi r}\psi^*_\sf(\r'),
-\end{equation}
-\nomenclature[2g134 2far]{$G_\infty(\r,\r')$}{Far-field
-   approximation to the Green function $G(\r,\r')$}%
-where
-\begin{equation}\label{EPsisfar}
-  \psi_\sf(\r) \coloneqq  \e^{i\k_\sf \r}
-\end{equation}
-\nomenclature[1ψ034 2f000 2r040]{$\psi_\sf(\r)$}{Plane
-  wave propagating from the sample towards the detector}%
-is a plane wave propagating towards the detector,
-and $\psi^*$ designates the complex conjugate of $\psi$.
-As function of~$\r$, $G_\infty$ is an outgoing spherical wave.
-Inserting \cref{EGreenFar} in \cref{EBornS},
-we obtain the far-field approximation for the scattered wave,
-\index{Scattered wave!far-field}%
-\begin{equation}\label{EsandwichC}
-  \psi_{\text{s}\infty}(\r)
-  = \frac{\e^{iKr}}{r}
-    \bra \psi_\si|\delta v|\psi_\sf\ket^*
-\end{equation}
-\nomenclature[1ψ034 2s000 2far]{$\psi_{\text{s}\infty}(\r)$}{Far-field
-   approximation to the scattered wavefunction $\psi_\text{s}(\r)$}%
-with the Dirac notation for the scattering matrix element
-\index{Scattering matrix}%
-\index{Transition matrix|see{Scattering matrix}}%
-\Emph{%
-\begin{equation}\label{Etrama}
-  \bra \psi_\si|\delta v|\psi_\sf\ket
-  \coloneqq  \int\!\d^3r\, \psi^*_\si(\r)\delta v(\r)\psi_\sf(\r).
-\end{equation}
-\vspace*{-5pt}}
-\nomenclature[0$\langle$0]{{$\bra\ldots\vert\ldots\vert\ldots\ket$}}{Matrix
-  element, defined as a volume integral}%
-Since per \cref{EPsi0Plane} and~\cref{EPsisfar} our $\psi_\si$ and~$\psi_\sf$ are plane waves,
-the matrix element can be simplified as
-\begin{equation}\label{Echiq}
-  \bra \psi_\si|\delta v|\psi_\sf\ket
-  = \int\!\d^3r\, {\rm e}^{-i\k_\si\r}\delta v(\r){\rm e}^{i\k_\sf\r}
-  = \int\!\d^3r\, {\rm e}^{i\q\r}\delta v(\r)
-  \eqqcolon v(\q),
-\end{equation}
-\nomenclature[2v030 2q040]{$v(\v{q})$}{Fourier
-   transform of the SLD~$\delta v(\r)$}%
-with the \E{scattering vector}\footnote
-{With this choice of sign,
-\index{Sign convention!scattering vector}%
-$\hbar\q$ is the momentum
-\index{Momentum transfer|see {Scattering vector}}%
-\E{gained} by the scattered neutron,
-and \E{lost} by the sample.
-In much of the literature the opposite convention is prefered,
-since it emphasizes the sample physics over the scattering experiment.
-However, when working with two-dimensional detectors
-it is highly desirable to express pixel coordinates
-\index{Coordinate system}
-\index{Detector!pixel coordinate}
-and scattering vector components
-with respect to equally oriented coordinate axes,
-which can only be achieved by the convention~\cref{Eq}.}
-\index{Scattering!vector}%
-\begin{equation}\label{Eq}
-  \q\coloneqq \k_\sf-\k_\si.
-\end{equation}
-\nomenclature[2q040]{$\q$}{Scattering vector}%
-\Cref{Echiq} summarizes the well-known fact that
-small-angle neutron scattering basically measures
-the Fourier transform $v(\q)$ of the SLD.
-\index{Scattering potential!Fourier transform}%
-\index{Fourier transform!scattering potential}%
-
-\index{Far-field approximation|)}%
-
-
-%===============================================================================
-\subsection{Differential cross section}\label{SdiffCross}
-%===============================================================================
-
-In connection with \cref{EBorn} we mentioned
-that a scattering experiment measures intensities~${|\psi(\r)|}^2$.
-We shall now restate this in a more rigorous way.
-In the case of neutron scattering,
-one actually measures a \E{probability flux}.
-We define it in arbitrary relative units as
-\begin{equation}\label{EdefJ}
-  \v{J}(\r) \coloneqq  \psi^*\frac{\Nabla}{2i}\psi - \psi\frac{\Nabla}{2i}\psi^*.
-\end{equation}
-\nomenclature[2j150 2r040]{$\v{J}(\r)$}{Probability flux}%
-\index{Flux!incident and scattered}%
-The ratio of the scattered flux hitting an infinitesimal detector area
-$r^2\d\Omega$ to the incident flux is expressed as a
-\E{differential cross section}
-\index{Cross section}%
-\index{Scattering!cross section}%
-\index{Elastic scattering cross section}%
-\index{Incident radiation!flux|(}%
-\begin{equation}\label{Exsectiondef}
-  \xElas
-  \coloneqq  \frac{r^2 J(\r)}{J_\si}.
-\end{equation}
-\nomenclature[1ω120]{$\Omega$}{Solid angle}%
-\nomenclature[1σ020]{$\sigma$}{Scattering or absorption cross section}%
-% TODO RESTORE XREF
-% The geometric factors that are needed to
-% convert $\d\sigma/\d\Omega$ into detector counts will be discussed
-% below in \cref{SdetImg}.
-For a plane wave~\cref{EPsi0Plane}, the incident flux is
-\index{Incident radiation!flux|)}%
-\index{Flux!Born approximation}%
-\begin{equation}\label{EJi}
-  \v{J}_\si = \k_\si.
-\end{equation}
-With the far-field result~\cref{EsandwichC}
-and the notation~\cref{Etrama},
-the scattered flux at the detector is
-\begin{equation}\label{EJr}
-  \v{J}(\r)
-  = \v{\hat r}\frac{K}{r^2}
-    {\left|\bra\psi_\si|\delta v|\psi_\sf\ket\right|}^2.
-\end{equation}
-Inserting these into definition~\cref{Exsectiondef},
-we obtain the generic differential cross section
-of elastic scattering in first order Born approximation,
-\index{Born approximation!elastic scattering cross section}%
-\index{Cross section!Born approximation}%
-\index{Scattering!cross section!Born approximation}%
-\index{Elastic scattering cross section!Born approximation}%
-\Emph{
-\begin{equation}\label{Exsection}
-  \xElas
-  =  {\left|\bra\psi_\si|\delta v|\psi_\sf\ket\right|}^2.
-\end{equation}\vspace*{-5pt}
-}
-As we shall see below,
-it holds not only for plane waves governed
-by the Helmholtz equation,
-but also for distorted waves.
-\index{Distorted-wave Born approximation!elastic cross section}%
-In the plane-wave case \cref{Echiq} considered here,
-the differential cross section is just the squared modulus
-of the Fourier transform of the SLD,
-\index{Scattering!length density!Fourier transform}%
-\begin{equation}\label{Ecross1}
-  \xElas
-  = {\left| v(\q) \right|}^2.
-\end{equation}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\section{Distorted-wave Born approximation (DWBA)}\label{SDWBA}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\index{Distorted-wave Born approximation|(}%
-\index{DWBA|see {Distorted-wave Born approximation}}%
-
-%===============================================================================
-\subsection{Introduction}\label{SDWBA1}
-%===============================================================================
-
-The standard Born approximation depends on the choice $\mv=\text{const}$,
-which implies that $\psi_\si$ and $\psi_\sf$ are plane waves.
-In the distorted-wave Born approximation (DWBA),\footnote{
-The DWBA was originally devised by Massey and Mott (ca 1933)
-for collisions of charged particles.
-Summaries can be found in some quantum mechanics textbooks (Messiah, Schiff)
-and in monographs on scattering theory (e.~g.\ Newton).
-The first explicit applications to grazing-incidence scattering
-were published in 1982:
-Vineyard \cite{Vin82} discussed X-ray scattering,
-but failed to account for the distortion of the scattered wave;
-Mazur and Mills \cite{MaMi82} deployed heavy formalism
-to compute the inelastic neutron scattering cross section
-of ferromagnetic surface spin waves from scratch.
-A concise derivation of the DWBA cross section
-was provided by Dietrich and Wagner (1984/85)
-for X-rays \cite{DiWa84} and neutrons \cite{DiWa85}.
-Unfortunately, their work was overlooked in much of the later literature,
-which often fell back to less convincing derivations.}
-this requirement is dropped.
-The SLD decomposition~\cref{Edecompose_v}
-is restored to full genericity,
-and it is taken for granted
-that somehow analytical or numerical solutions $\psi_\si$ and~$\psi_\sf$
-of the homogeneous wave equation~\cref{EHomoK}
-have been obtained.
-
-Because these solutions are no longer plane waves,
-we need to work out a terminological and notational distinction
-that is blurred in the standard Born approximation:
-we need to distinguish
- between the \E{exciting} wave~$\psi_\se$
-\nomenclature[1ψ034 2e000]{$\psi_\se(\r)$}{Exciting wave}%
-and the \E{incident} wave~$\psi_\si$.
-The \E{exciting wave}
-\index{Exciting wave}%
-\index{Wave!exciting}%
-is prepared far
-outside the sample by a radiation source and some optical devices.
-\index{Radiation source}%
-It is a superposition of plane waves,
-as discussed later in the context of instrumental resolution effects
-(\cref{SInstr}).
-Here, while discussing scattering theory,
-it shall be represented by a single plane wave
-$\psi_\se(\r)=\e^{i\k_\se\r}$.
-This function is defined for all~$\r$,
-but is physical only along the primary beam, upstream of the sample.
-
-In contrast, by the \E{incident wave}~$\psi_\si(\r)$
-\index{Incident wave!DWBA}%
-\index{Incident wave!vs exciting wave}%
-\index{Wave!incident}%
-we understand an exact solution of~\cref{EHomoK}.
-Upstream of the sample, along the primary beam, it coincides with the exciting wave.
-Inside the sample, however, it undergoes refraction and reflection,
-and therefore no longer is a plane wave, and no longer equals~$\psi_\se(\r)$.
-This is different from the conventional Born approximation,
-where $\psi_\si$ is a plane wave throughout the sample,
-and therefore must not be distinguished from~$\psi_\se$.
-
-Differently from the above derivation of the Born expansion,
-we will not even attempt to obtain a full solution
-\index{Green function!DWBA}%
-of the Green function equation~\cref{EGreenK}.
-We will use indirect arguments to directly obtain its far-field asymptote $G_\infty$.
-
-%===============================================================================
-\subsection{Reciprocity of the Green function}\label{SReci}
-%===============================================================================
-
-Our computation of~$G_\infty$ will be based on a source-detector \E{reciprocity theorem}
-\index{Reciprocity|(}%
-\index{Green function!reciprocity}%
-for the scalar Schrödinger equation.\footnote
-{There exists a confusing multitude of reciprocity theorems \cite{Pot04}.
-In the end, we found it simpler to provide a derivation taylored for our application case
-than to refer to the literature.}
-The theorem states:
-Any Green function $G(\r,\r')$
-that solves~\cref{EGreenK} and as function of~$\r$ represents an outgoing wave
-[in accord with the Sommerfeld radiation condition,
-\index{Sommerfeld radiation condition}%
-\index{Radiation condition}%
-cf.~\cref{Escabouco}]
-is invariant under an exchange of source location~$\rS$ and detection point~$\rD$:
-\nomenclature[2r041 2d100]{$\rD$}{Position of detector}%
-\nomenclature[2r041 2s100]{$\rD$}{Position of source, locus of scattering}%
-\begin{equation}\label{Erecip}
-  G(\rS,\rD) = G(\rD,\rS).
-\end{equation}
-Readers not interested in mathematical details may skip the following \E{proof}:
-
-We introduce the auxiliary vector field
-\begin{equation}
-  \v{X}(\r,\rS,\rD)\coloneqq G(\r,\rD)\Nabla G(\r,\rS) - G(\r,\rS)\Nabla G(\r,\rD).
-\end{equation}
-%\nomenclature[2x150 2r040]{$\v{X}(\r,\rS,\rD)$}{Auxiliary vector field}%
-We inscribe the sample and the detector
-into a sphere $\Sphere$ around the coordinate origin with radius~$R$,
-%\nomenclature[2s180]{$\Sphere$}{Auxiliary spherical volume}%
-%\nomenclature[2r120]{$R$}{Radius of $\Sphere$}%
-and compute the volume integral
-\begin{equation}\label{Eprerecipro}
-    I(\rS,\rD) \coloneqq \displaystyle\int_\Sphere\!\d^3r\,\Nabla \v{X}(\r,\rS,\rD).
-\end{equation}
-After a few steps, not entirely trivial, but not too difficult either,
-we obtain
-\begin{equation}\label{EIBD}
-  I(\rS,\rD) = G(\rS,\rD) - G(\rD,\rS).
-\end{equation}
-Alternatively, we can compute $I$ as a surface integral
-\begin{equation}
-  I(\rS,\rD)
-  =\displaystyle\int_{\partial\Sphere}\d\v{\sigma}\,\v{X}(\r,\rS,\rD).
-\end{equation}
-On the surface $\partial\Sphere$,
-$G$ is an outgoing solution of the Helmholtz equation.
-As such, it has a well-known series expansion in spherical coordinates
-We send $R\to\infty$ so that we need only to retain the lowest order:
-\begin{equation}
-  \begin{array}{@{}l@{\;}c@{\;}l}
-   G(\r(R,\vartheta,\varphi),\rD)
-   &\doteq&\displaystyle \frac{\e^{iKR}}{4\pi R} a(\vartheta,\varphi),
-   \\[3.8ex]
-   G(\r(R,\vartheta,\varphi),\rS)
-   &\doteq&\displaystyle \frac{\e^{iKR}}{4\pi R} b(\vartheta,\varphi).
-  \end{array}
-\end{equation}
-The factorization of $G$ and $B$ and their common $R$ dependence imply that
+\nomenclature[1ψ030 2r040 0]{$\psi(\r)$}{Stationary wavefunction}%
+factorizes into a stationary wave and a time-dependent phase factor.
+\index{Stationary wavefunction}%
+\index{Phase factor}%
+In the following, we will characterize the incoming radiation
+not by its energy~$\hbar\omega$,
+but by its \E{vacuum wavenumber}~$K$,
+\index{Vacuum!neutron wavenumber}%
+\index{Wavenumber!neutron}%
+\nomenclature[2k120]{$K$}{Wavenumber in vacuum}%
+given by the dispersion relation
+\index{Dispersion relation!neutron}%
+\index{Neutron!dispersion relation}%
 \begin{equation}
-  I(\rS,\rD)
-  =\displaystyle\int_{\partial\Sphere}\d\sigma\,
-       (\text{$R$-dependent})(ab-ba)
-  = 0.
+  \hbar\omega = \frac{(\hbar K)^2}{2m}.
 \end{equation}
-Comparison with \cref{EIBD} yields \cref{Erecip},
-which completes the proof.
+The Schrödinger equation~\cref{ESchrodi1} then takes the simple form
+\Emph{
+\begin{equation}\label{ESchrodi2}
+  \left\{\Nabla^2+K^2-4\pi v(\r)\right\} \psi(\r) = 0
+\end{equation}
+\vspace*{-5pt}}
+with the rescaled form of Fermi's pseudopotential
+\index{Fermi's pseudopotential}%
+\index{Pseudopotential!Fermi's}%
+\index{Potential!neutron}%
+\index{Neutron!potential}%
+\begin{equation}\label{Evrraw}
+  v(\r)
+  \coloneqq \frac{m}{2\pi\hbar^2} V(\r)
+  = \sum_j\left\langle b_j \delta\left(\r-\r_j(t)\right)\right\rangle.
+\end{equation}
+The sum runs over all nuclei exposed to~$\psi$.
+The \E{bound scattering length}~$b_j$
+\index{Scattering length}%
+\index{Bound scattering length|see{Scattering length}}%
+\nomenclature[2b0]{$b$}{Bound scattering length}%
+is isotope specific;
+\index{Isotope}%
+values are tabulated \cite{Sea92}.
 
-\index{Reciprocity|)}%
+In \E{small-angle scattering},
+\index{Scattering!small-angle}%
+\index{Small-angle scattering}%
+\index{SAS|see{Small-angle scattering}}%
+as elsewhere in \E{neutron optics} \cite{Sea89},
+\index{Neutron!optics}%
+\index{Optics!neutron}%
+the potential can be coarse-grained by spatially averaging over at least a few atomic diameters,
+\begin{equation}\label{Evrcoarse}
+  v(\r)
+  = \sum_s b_s \rho_s(\r),
+\end{equation}
+\nomenclature[2v030 2r040]{$v(\r)$}{Rescaled neutron potential, scattering length density (SLD)}%
+where the sum now runs over chemical elements,
+$b_s\coloneqq\langle b_j\rangle_{j\in s}$ is the bound \E{coherent} scattering length,
+\index{Coherent scattering length}%
+\index{Scattering length!coherent}%
+and $\rho_s$ is a number density.
+\index{Number density}%
+\index{Density}%
+\nomenclature[1ρ032 2s010]{$\rho_s$}{Number density of chemical element~$s$}%
+In passing from \cref{Evrraw} to \cref{Evrcoarse},
+we neglected \E{Bragg scattering}
+\index{Scattering!Bragg}%
+\index{Bragg scattering}%
+from atomic-scale correlation,
+\index{Atomic scale}%
+\index{Correlation!atomic scale}%
+and \E{incoherent scattering} from spin or isotope related fluctuations of $b_j$.
+\index{Scattering!incoherent}%
+\index{Incoherent scattering}%
+\index{Isotope}%
+\index{Spin!neutron}%
+\index{Neutron!spin}%
+In small-angle experiments,
+ these types of scattering only matter as loss channels.\footnote
+{Same remark as in \Cref{Flosses}: To model these losses, use the
+\index{Refractive index!losses from Bragg scattering}%
+\index{Refractive index!losses from incoherent scattering}%
+imaginary part of the refractive index.}
+Furthermore, incoherent scattering, as inelastic scattering,
+ contributes to the diffuse background in the detector.
+\index{Scattering!diffuse}%
+\index{Scattering!inelastic}%
+\index{Inelastic scattering}%
+\index{Background!diffuse}%
+\index{Detector!background}%
+In conclusion, the coarse-grained neutron optical potential~\cref{Evrcoarse}
+\index{Potential!optical}%
+\index{Neutron!optical potential}%
+\index{Neutron!potential}%
+is just a \E{scattering length density} (SLD)
+\index{Scattering length density}%
+\index{SLD|see{Scattering length density}}%
+\cite[eq.\ 2.8.37]{Sea89}.
+
+In general, the incident neutron beam in a scattering experiment
+is not a \E{pure} quantum state,
+\index{Pure quantum state}%
+\index{Quantum state!pure vs mixed}%
+but a statistical mixture of such states,
+\index{Mixed quantum state}%
+and must therefore be described by a density matrix,
+\index{Density matrix}%
+\nomenclature[1ρ020]{$\hat\rho$}{Density matrix operator}%
+\begin{equation}\label{EdefRho}
+  \hat\rho \coloneqq \sum_j p_j \ket{\psi_j}\bra{\psi_j},
+\end{equation}
+where $p_j$ is the probability of pure state~$\psi_j$.
+\nomenclature[2p022 2j000]{$p_j$}{Probability of state~$j$}%
+With the operator
+\begin{equation}\label{EdefJop}
+  \v{\hat J} \coloneqq  \ket{\r}\bra{\r}\v{\hat p} + \v{\hat p}^\dagger\ket{\r}\bra{\r}
+\end{equation}
+the current density, or \E{flux},
+\index{Flux!neutron}%
+\index{Current density|see{Flux}}%
+is given by
+\begin{equation}\label{EdefJ}
+  \v{J}(\r)
+  \coloneqq \Tr\{\hat\rho \hat{\v{J}}\}
+  \propto \sum_j p_j\left\{ \psi_j(\r)^*\frac{\Nabla}{2i}\psi_j(\r)
+                        - \psi_j(\r)\frac{\Nabla}{2i}\psi_j(\r)^*\right\}.
+\end{equation}
+\nomenclature[2j150 2r040]{$\v{J}(\r)$}{Flux}%
+This is in arbitrary units,
+\index{Unit!neutron wavefunction}%
+since we do not impose a specific normalization
+\index{Normalization!neutron wavefunction}%
+on the unbound wavefunction~$\psi$.
+To compute scattering cross sections,
+\index{Cross section}%
+\index{Scattering!cross section}%
+we will only need the \E{ratio} of scattered to incident flux.
+Mostly we will assume pure states to be \E{plane waves}
+\index{Plane wave}%
+\index{Wave!plane}%
+\begin{equation}\label{EplaneWave}
+  \psi_\k(\r)\coloneqq\e^{i\k\r}.
+\end{equation}
+In vacuum, the wavevector~$\k$ purely real.
+\index{Damping}%
+We replace the sum in~\cref{EdefRho} by an integral,
+and find that the flux is simply
+\begin{equation}
+  \v{J}(\r) = \int\!\d^3k\; p_\k\, |\psi_\k(\r)|^2 \k.
+\end{equation}
 
 %===============================================================================
-\subsection{Far-field Green function}\label{SfarDW}
+\subsection{Neutrons in a magnetic field}\label{SnSpinor}
 %===============================================================================
 
-\def\Do{\overset{o}{D}}
-\def\Go{\overset{o}{G}}
-\def\pfo{\overset{o}{\psi}_\sf}
+\index{Neutron!spin|(}%
+\index{Spin|(}%
+\index{Magnetic field!neutron propagation|(}%
 
-The following derivation of the far-field Green function~$G_\infty$
-\index{Green function!distorted waves, far-field|(}%
-is a simplified rendering of Dietrich and Wagner \cite{DiWa84},
-transcribed from electromagnetic to neutron waves.
-With the differential operators
-\begin{equation}\label{EDDdef}
-  \begin{array}{@{}l}
-    \Do(\r) \coloneqq \Nabla^2+K^2, \\[1.4ex]
-    D(\r) \coloneqq \Nabla^2+k(\r)^2 = \Do + \delta k(\r)^2,
-  \end{array}
-\end{equation}
-and with $\delta k^2\coloneqq k^2-K^2$,
-we rewrite the homogeneous and inhomogeneous differential equations \cref{EHomoK}
-and~\cref{EGreenK} for plane waves and distorted waves as
-\begin{equation}
-  \begin{array}{l@{\hspace{2em}}l}
-    \Do(\r)\pfo  (\r) = 0, &\Do(\r)\Go(\r,\r') = \delta(\r-\r'), \\[1.4ex]
-    D(\r)\psi_\sf(\r) = 0, &D(\r)  G  (\r,\r') = \delta(\r-\r').
-  \end{array}
-\end{equation}
-We now posit an integral equation that determines
-the full Green function $G$ if the vacuum Green function~$\Go$ is given:
-\begin{equation}\label{EGoG}
-  \Go(\rD,\rS) = G(\rD,\rS) + \int\!\d^3r\, \Go(\rD,\r)\delta k(\r)^2 G(\r,\rS).
-\end{equation}
-It can be verified by operating on both sides with $\Do(\rD)$.\footnote
-{This is not entirely convincing:
-Equality of the second derivates is not sufficient to prove equality of
-two sides in an equation.
-For a full prove, we also have to show that the two sides, and their first derivatives,
-agree at least in one point~$\rD$.
-Perhaps this point must be chosen in the limit~$r_\text{D}\to\infty$.
-Our source~\cite{DiWa84} provides no clue.}
-We use the reciprocity~\cref{Erecip} to transform~\cref{EGoG} into
-\begin{equation}
-  \Go(\rD,\rS) = G(\rD,\rS) + \int\!\d^3r\, G(\rD,\r)\delta k(\r)^2 \Go(\r,\rS).
-\end{equation}
-Below, we will only need the far-field limit in $\rD$:
-\begin{equation}\label{EGoFF}
-  \Go_\infty(\rD,\rS) = G_\infty(\rD,\rS) + \int\!\d^3r\, G_\infty(\rD,\r)\delta k(\r)^2 \Go(\r,\rS).
-\end{equation}
-We also posit an integral equation that determines the distorted wave~$\pfo$
-if the plane wave~$\psi_\sf$ is given:
-\begin{equation}\label{Epfo}
-  \pfo(\rS) = \psi_\sf(\rS) + \int\!\d^3r\, \psi_\sf(\r)\delta k(\r)^2 \Go(\r,\rS).
-\end{equation}
-Verification can be done by operating on both sides with~$\Do(\rS)$.
-We recall the far-field asymptote of the vacuum Green function from~\cref{EGreenFar},
-and rewrite it as
+\index{Field!magnetic|see{Magnetic field}}%
+\index{H Field@$H$ Field|see{Magnetizing field}}%
+\index{B Field@$B$ Field|see{Magnetic field}}%
+
+In presence of a magnetic field,
+the propagation of free neutrons becomes spin dependent.
+Therefore the scalar wavefunction of \cref{SnScalar}
+must be replaced by spinor $\v\Psi$.
+\index{Spinor}%
+The magnetic moment of the neutron couples to the magnetizing field~$\v{H}$ \cite{Mez86}.
+\nomenclature[2h150 2r040 2t020]{$\v{H}(\r,t)$}{Magnetizing field}%
+\index{Magnetizing field!coupling to neutron moment}%
+With the coupling term, the Schrödinger equation~\cref{ESchrodi1}
+\index{Schrodinger@Schrödinger equation!macroscopic}%
+becomes
+\begin{equation}\label{EHSchrodi}
+  \left\{-\frac{\hbar^2}{2m}\Nabla^2+V(\r)
+         +\mu_0\mu_\text{n}\v{H}(\r)\v{\sigma}-\hbar\omega\right\}
+      \v\Psi(\r) = 0,
+\end{equation}
+\nomenclature[1ψ150 2r040]{$\v\Psi(\r)$}{Stationary coherent spinor wavefunction}%
+where $\mu_0$ is the vacuum permeability,
+\nomenclature[1μ024 00]{$\mu_0$}{Vacuum permeability, $4\pi\cdot10^{-7}$ Vs/Am}%
+\index{Permeability}%
+\index{Magnetic permeability}%
+$\mu_\text{n}$ is the magnetic moment of the neutron,
+\nomenclature[1μ024 2n000]{$\mu_\text{n}$}{Magnetic moment of the neutron}
+\index{Neutron!magnetic moment}%
+\index{Magnetic moment!neutron}%
+and ${\v\sigma}$ is the Pauli vector, composed of the three Pauli matrices.
+\nomenclature[1σ04]{$\v\sigma$}{Pauli
+    vector, composed of the three Pauli matrices: $\v\sigma=(\sigma_x,\sigma_y,\sigma_z)$}%
+\index{Pauli vector}%
+\index{Pauli matrix}%
+The magnetic coupling is responsible for Larmor precession of the neutron spin,
+\index{Neutron!Larmor precession}%
+\index{Larmor precession}%
+\index{Spin!Larmor precession}%
+well known from uses in spin-echo techniques.
+\index{Spin!echo}%
+If the field is inhomogeneous,
+it can split a beam
+as in the Stern-Gerlach experiment \cite{ShSB54}.
+\index{Neutron!Stern-Gerlach splitting}%
+\index{Stern-Gerlach splitting}%
+We introduce the reduced field
 \begin{equation}
-  \Go_\infty(\rD,\rS) = \phi(\rD)\pfo^*(\rS)
+  \v{h} \coloneqq \frac{m\mu_0\mu_\text{n}}{2\pi\hbar^2}\v{H},
 \end{equation}
-with the far-field prefactor
-\begin{equation}\label{Effphidef}
-  \phi(r) \coloneqq \frac{\e^{iKr}}{4\pi r}.
+\nomenclature[2h050 2r040]{$\v{h}(\r)$}{Rescaled
+   field $\v{h}=(m\mu_0\mu_\text{n}/2\pi\hbar^2)\v{H}$}%
+\index{Magnetizing field!reduced}%
+to rewrite the Schrödinger equation in analogy to~\cref{ESchrodi2} as
+\index{Schrodinger@Schrödinger equation!macroscopic}%
+\Emph{
+\begin{equation}\label{ESchrodi2H}
+  \left\{\Nabla^2+K^2-4\pi v(\r)-4\pi\v{h}(\r)\v{\sigma}\right\} \v\Psi(\r) = 0.
 \end{equation}
-We take the complex conjugates of both sides of~\cref{Epfo},
- and multiply them with $\phi(\rD)$ to obtain
-\begin{equation}\label{Epfo2}
-  \Go_\infty(\rD,\rS)
-  = \phi(\rD)\psi^*_\sf(\rS) + \int\!\d^3r\, \phi(\rD)\psi^*_\sf(\r)\delta k(\r)^2 \Go(\r,\rS).
+\vspace*{-5pt}}
+
+The density matrix~\cref{EdefRho} becomes
+\begin{equation}\label{EdefRhoSpinor}
+  \hat\rho \coloneqq \sum_i p_i \ket{\v\Psi_i}\bra{\v\Psi_i}.
 \end{equation}
-We compare with~\cref{EGoFF},
-and read off the far-field asymptote of the distorted-waves Green function
-\begin{equation}
-  G_\infty(\rD,\rS) = \phi(\rD)\psi^*_\sf(\rS).
-\end{equation}
-Note that this is formally identical with with \cref{EGreenFar},
-but no longer requires $\psi_\sf$ to be a plane wave.
-\index{Green function!distorted waves, far-field|)}%
-
-\Emph{Accordingly,
-the differential cross section is still given by \cref{Exsection},
-and the scattering matrix element by~\cref{Etrama}.}
-\index{Scattering matrix!distorted waves}%
-\index{Cross section!distorted-wave Born approximation}%
-\index{Scattering!cross section!distorted-wave Born approximation}%
-\index{Elastic scattering cross section!distorted-wave Born approximation}%
-The plane-wave form~\cref{Echiq}, however, does no longer hold.
-Its replacement depends on the distorted wavefunctions
-$\psi_\si$ and $\psi_\sf$,
-is therefore application specific,
-and will be worked out later (\cref{Swave21}).
-
-\index{Distorted-wave Born approximation|)}%
+The total flux is still given by \cref{EdefJ,EdefJop}.
+This formalism also covers experiments with a polarization analyzer,
+\index{Polarization!analysis}%
+which must be described as modifying the density matrix.
+\index{Neutron!spin|)}%
+\index{Spin|)}%
+\index{Magnetic field!neutron propagation|)}%
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\section{X-ray scattering}\label{SXray}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\index{X-ray!scattering theory|(}%
+\index{Wave propagation!neutron|)}%
+\index{Neutron!wave propagation|)}%
 
 %===============================================================================
-\subsection{Wave equation}\label{SXwave}
+\subsection{X-rays}\label{SXwave}
 %===============================================================================
 
+\index{Wave propagation!X-ray|(}%
+\index{X-ray!wave propagation|(}%
+
 The propagation of X-rays is governed by Maxwell's equations,
 \index{Maxwell's equations}%
-\index{Wave propagation!X-ray}%
 \begin{equation}\label{EMaxwell}
   \begin{array}{@{}l@{\quad}l@{\quad}l}
     \Nabla\times\v{E}=-\partial_t \v{B},
@@ -882,29 +364,45 @@ The propagation of X-rays is governed by Maxwell's equations,
   \end{array}
 \end{equation}
 \nomenclature[2e150 2r040 2t020]{$\v{E}(\r,t)$}{Electric field}%
-\nomenclature[2h150 2r040 2t020]{$\v{H}(\r,t)$}{Magnetizing field}%
+\index{Electric field}
 \nomenclature[2d150 2r040 2t020]{$\v{D}(\r,t)$}{Displacement field}%
 \nomenclature[2b150 2r040 2t020]{$\v{B}(\r,t)$}{Magnetic field}%
+\index{Magnetic field}
+\index{Magnetizing field}
 \nomenclature[1ε070 2r040]{$\v\eps(\r)$}{Relative dielectric permittivity tensor}%
 \nomenclature[1μ070 2r040]{$\v\mu(\r)$}{Relative magnetic permeability tensor}%
 \nomenclature[1ε024 00]{$\eps_0$}{Vacuum permittivity, 8.854\ldots As/Vm}%
-\nomenclature[1μ024 00]{$\mu_0$}{Vacuum permeability, 1.256\ldots Vs/Am}%
 Since BornAgain only addresses elastic scattering,
 \index{Elastic scattering}%
 \index{Scattering!elastic}%
 we assume the permeability and permittivity tensors $\v\mu$ and~$\v\eps$
 to be time-independent.
-\index{Time}%
-Therefore, as in~\cref{ScohWave}, we only need to consider monochromatic waves
+\index{Time dependence!dielectric permittivity}%
+Therefore, as in~\cref{SnScalar}, we only need to consider monochromatic waves
 \index{Wave!monochromatic}%
 \index{Monochromatic wave}%
 with given frequency~$\omega$,
 and each of the fields $\v{E}$, $\v{D}$, $\v{H}$, $\v{B}$
-factorizes into a stationary field and a time-dependent phase factor.
+factorizes into a stationary field and a time-dependent phase factor.\footnote
+{This phase factor can be defined with a plus or a minus sign in the exponent.
+Most texts on X-ray crystallography,
+including influential texts on GISAXS \cite{ReLL09},
+prefer the \E{crystallographic convention} with a plus sign.
+\index{Wave propagation|seealso {Sign convention}}%
+\index{Convention!sign convention}%
+\index{Sign convention!wave propagation|(}%
+\index{Crystallographic sign convention}%
+In BornAgain, we prefer the opposite \E{quantum-mechanical convention}
+\index{Quantum-mechanical convention}%
+for consistency with the neutron case \cref{Estationarywave},
+where the minus sign is an inevitable consequence
+of the standard form of the Schrödinger equation.%
+\index{Sign convention!wave propagation|)}%
+}
 \index{Phase factor}%
-In the following, we will concentrate on the electric field
+We will formulate the following in terms of the electric field
 \index{Electric field}%
-\begin{equation}
+\begin{equation}\label{EstationaryX}
   \v{E}(\r,t) = \v{E}(\r)\e^{-i\omega t}.
 \end{equation}
 The other three fields can be obtained from~$\v{E}$
@@ -942,143 +440,641 @@ the electron number density~$\rho(\r)$,
 and the vacuum wavenumber~$K$,
 given by the dispersion relation
 \begin{equation}
-  K^2 = \mu_0\eps_0\omega^2.
+  K^2 = \mu_0\eps_0\omega^2.
+\end{equation}
+\index{Dispersion!X-ray}%
+
+With these simplifying assumptions about $\v{\eps}$ and~$\v{\mu}$,
+Maxwell's equations yield the wave equation
+\begin{equation}\label{ENabCrossNabE}
+  \Nabla\times\Nabla\times\v{E} = K^2\eps(\r)\v{E}.
+\end{equation}
+\index{Wave equation!X-ray}%
+\index{X-ray!wave equation}%
+Using a standard identity from vector analysis, it can be brought into the more tractable form
+\Emph{
+\begin{equation}\label{ENabNabE}
+  \left\{\Nabla^2-\Nabla\cdot\Nabla+ K^2\eps(\r)\right\}\v{E}(\r)=0.
+\end{equation}
+\vspace*{-5pt}}
+
+It is well known that the electromagnetic energy flux is given by the Poynting vector.
+\index{Poynting vector}%
+\index{X-ray!flux}%
+\index{Flux!X-rays}%
+However, its standard definition, $\v{S}\coloneqq\v{E}\times\v{H}$,
+is not applicable here because it only holds for \E{real} fields.
+With our complex notation, it must be replaced by
+\begin{equation}
+  \v{S}\coloneqq \Re\v E(\r,t)\times\Re\v H(\r,t).
+\end{equation}
+\nomenclature[2s150]{$\v S$}{Poyinting vector}%
+For stationary oscillations~\cref{EstationaryX},
+the time average is
+\begin{equation}
+  \braket{\v S} = \frac{1}{4}\braket{\v E(\r) \times \v H(\r)^* + \text{c.~c.}}.
+\end{equation}
+\nomenclature[2c000 2c000]{$\text{c.~c.}$}{Complex conjugate}%
+We specialize to vacuum with $\TENS\mu(\r)=1$ and $\TENS\eps(\r)=1$,
+and obtain
+\begin{equation}
+  \braket{\v S}
+  = \frac{1}{4i\omega\mu_0}
+    \left( \v E^*(\r)\times\left(\Nabla\times\v{E}(\r)\right) + \text{c.~c.} \right).
+\end{equation}
+For a plane wave $\v E(\r)=\v E_\k \e^{i\k\r}$, we find
+\begin{equation}
+  \braket{\v S}
+  = \frac{1}{2\omega\mu_0} |\v E_\k|^2 \Re \k,
+\end{equation}
+which confirms the common knowledge that the radiation intensity
+counted in a detector is proportional to the squared electric field amplitude.
+
+
+\index{Wave propagation!X-ray|)}%
+\index{X-ray!wave propagation|)}%
+
+%===============================================================================
+\subsection{Unified wave equation}\label{SuniWave}
+%===============================================================================
+
+We combine all the above in a unified wave equation
+\index{Wave equation!generic}%
+\Emph{
+\begin{equation}\label{EWAVE}
+  \left( \TDo(\r) - 4\pi\TV(\r) \right) \v\Psi(\r) = 0
+\end{equation}
+\vspace*{-5pt}}
+with the vacuum wave operator
+\index{Vacuum!wave operator}%
+\index{Wave!operator!vacuum}%
+\begin{equation}\label{EDo}
+  \TDo \coloneqq \left\{ \begin{array}{ll}
+      \Nabla^2 + K^2                     &\text{~~~for neutrons,}\\
+      \Nabla^2 - \Nabla\cdot\Nabla + K^2 &\text{~~~for X-rays}
+  \end{array}\right.
+\end{equation}
+\nomenclature[2d138 0 2r040]{$\TDo(\r)$}{Differential operator in the vacuum wave equation}%
+and the potential
+\index{Potential!generic}%
+\nomenclature[2v170 2r040]{$\TV(\r)$}{Generic potential}%
+\begin{equation}\label{ETV}
+  \TV(\r) \coloneqq \left\{ \begin{array}{ll}
+      v(\r)                         &\text{~~~for neutrons (scalar),}\\
+      v(\r)+\v{h}(\r)\v\sigma       &\text{~~~for neutrons (spinorial),}\\
+      K^2(\epsilon(\r)-1)/(4\pi) &\text{~~~for X-rays.}
+  \end{array}\right.
+\end{equation}
+The generic wave amplitude $\v{\Psi}$
+\nomenclature[1ψ150 2r040]{$\v\Psi(\r)$}{Generic wave amplitude,
+  possibly vectorial or spinorial}%
+shall represent
+the scalar neutron wavefunction~$\psi$,
+the spinor $\v{\Psi}$, or the electric field~$\v{E}$, as applicable.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Distorted-wave Born approximation}\label{SDWBA}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+To describe scattering from a condensed-matter sample,
+\index{Scattering!target|see{Sample}}%
+\index{Target|see{Sample}}%
+\index{Sample}%
+the wave equation is solved through a perturbation expansion.
+The ordinary form of this expansion, the \E{Born approximation} (BA),
+\index{BA|see{Born approximation}}%
+\index{Born approximation}%
+is derived in many textbooks.\footnote
+{For a particularly detailed derivation
+see Schober's lecture notes on neutron scattering~\cite{Sch14}.}
+%E.~g.\ \cite{} for neutrons;
+%\cite[Sect 9.7]{Jac75} for electromagnetic radiation}
+For scattering under grazing-incidence,
+\index{Grazing-incidence small-angle scattering}%
+however, the more generic
+\index{Distorted-wave Born approximation}%
+\E{distorted-wave Born approximation} (DWBA)\footnote
+{The DWBA was originally devised by Massey and Mott (ca 1933)
+for collisions of charged particles.
+Summaries can be found in some quantum mechanics textbooks (Messiah, Schiff)
+and in monographs on scattering theory (e.~g.\ Newton).
+The first explicit applications to grazing-incidence scattering
+were published in 1982:
+Vineyard \cite{Vin82} discussed X-ray scattering,
+but failed to account for the distortion of the scattered wave;
+Mazur and Mills \cite{MaMi82} deployed heavy formalism
+to compute the inelastic neutron scattering cross section
+of ferromagnetic surface spin waves from scratch.
+A concise derivation of the DWBA cross section
+was provided by Dietrich and Wagner (1984/85)
+for X-rays \cite{DiWa84} and neutrons \cite{DiWa85}.
+Unfortunately, their work was overlooked in much of the later literature,
+which often fell back to less convincing derivations.}
+is required.
+In this section, we provide a self-contained derivation
+based on the unified neutron and X-ray wave equation~\cref{EWAVE}.
+
+%===============================================================================
+\subsection{Distortion versus perturbation}\label{Sdecompose}
+%===============================================================================
+
+To get started,
+we decompose the potential \cref{ETV}
+into a more \E{regular} and a more \E{fluctuating} part:
+\begin{equation}\label{Edecompose}
+  \TV(\r) \eqqcolon \TL(\r) + \TU(\r).
+\end{equation}
+The \E{distortion field}~$\TL$
+\index{Distortion field}%
+\nomenclature[1λ170 2r040]{$\TL(\r)$}{Distortion field}%
+comprises regular, well-known features of the sample.
+The \E{perturbation potential}~$\TU$
+\index{Perturbation potential}%
+\index{Potential!perturbation}%
+\nomenclature[2u170 2r040]{$\TU(\r)$}{Perturbation potential}%
+stands for the more irregular, unknown features of the sample
+one ultimately wants to study in a scattering experiment.
+This is vague,
+and in certain situations the decomposition~\cref{Edecompose} is indeed
+to some extent arbitrary.
+However, in most practical cases $\TL$ and $\TU$ are clearly determined by
+the following basic idea of DWBA:
+
+The wave equation~\cref{EWAVE} shall henceforth be written as
+\Emph{
+\begin{equation}\label{EDPsi}
+  \TD(\r)\v\Psi(\r) = 4\pi\TENS{U}(\r)
+\end{equation}
+\vspace*{-5pt}}
+with the \E{distorted wave operator}
+\index{Distorted wave!operator}%
+\index{Wave!operator!distorted}%
+\nomenclature[2d138 2r040]{$\TD(\r)$}{Differential operator in the wave equation}%
+\begin{equation}
+  \TD(\r) \coloneqq \TDo - 4\pi\TL(\r).
+\end{equation}
+Only $\TENS{U}$ shall be treated as a \E{perturbation}.
+The propagation of incident and scattered waves under the influence of~$\TL$,
+in contrast,
+shall be handled \E{exactly},
+through analytical solution of the \E{unperturbed distorted wave equation}
+\index{Unperturbed distorted wave equation}%
+\index{Distorted wave!wave equation}%
+\index{Wave equation!unperturbed distorted}%
+\begin{equation}\label{EDPsi0}
+  \TD(\r)\v\Psi(\r) = 0.
+\end{equation}
+The solutions are called \E{distorted}
+\index{Distorted wave}%
+\index{Wave!distorted}%
+because they differ from the \E{plane} waves
+\index{Plane!wave}%
+\index{Wave!plane}%
+obtained in the \E{vacuum} case $\TL=0$.
+\index{Vacuum}%
+
+Except for neutrons in a magnetic field
+the distortion field is scalar so
+that it can be expressed through the \E{refractive index}
+\index{Refractive index}%
+\index{Index of refraction|see {Refractive index}}%
+\nomenclature[2n020]{$n$}{Refractive index}%
+\begin{equation}\label{EnkK}
+  n(\r)
+  \coloneqq\sqrt{1-\frac{4\pi\Lambda(\r)}{K^2}}
+  = \left\{\begin{array}{ll}
+       \sqrt{1-4\pi\mv(\r)/K^2} &\text{ for neutrons,}\\
+       \sqrt{\epsilon(\r)} &\text{ for X-rays.}
+    \end{array}\right.
+\end{equation}
+If $\mv(\r)$ or $\epsilon(\r)$ has an imaginary part, describing absorption,
+\index{Absorption}%
+then $n(\r)$ is a complex number.
+Conventionally, $n$ is parameterized by two real numbers:
+\begin{equation}\label{Endb1}
+  n \eqqcolon  1-\delta +i\beta.
+\end{equation}
+\nomenclature[1δ020]{$\delta$}{Small parameter in the refractive index
+   $n=1-\delta +i\beta$}%
+\nomenclature[1β020]{$\beta$}{Imaginary part of the refractive index}%
+For thermal neutrons and X-rays,
+$\delta$ and $\beta$ are almost always nonnegative,\footnote
+{The plus sign in front of~$i\beta$ is a consequence of
+the quantum-mechanical sign convention;
+in the X-ray crystallography convention it would be a minus sign.
+\index{Refractive index!sign convention}%
+\index{Sign convention!refractive index}}
+and much smaller than~1.
+This explains why in most scattering geometries
+\index{Scattering!geometry}%
+the ordinary Born approximation
+\index{Born approximation}%
+with $\TL\equiv0$ is perfectly adequate.
+In layered samples under grazing incidence,
+\index{Grazing incidence}%
+however, even small differences in~$n$ can cause substantial
+\E{refraction} and \E{reflection}.
+\index{Refraction}%
+\index{Reflection}%
+To model GISAS, therefore,
+it is necessary to use DWBA,
+\index{Distorted-wave Born approximation}%
+and to let $\TL$ represent
+the average vertical refractive index profile~$\overline{n}(z)$.
+\index{Refractive index!profile}%
+
+%===============================================================================
+\subsection{The Rayleigh-Born expansion}\label{SBornExpans}
+%===============================================================================
+
+The solution of the wave equation~\cref{EDPsi}
+starts with the determination of the \E{incident} wave~$\v\Psi_\si$.
+\nomenclature[1ψ074 2i000 2r040]{$\v\Psi_\si(\r)$}{Incident wavefunction}%
+\nomenclature[2i000]{i}{Subscript ``incident''}%
+\index{Incident radiation!Born approximation}%
+\index{Wave!incident}%
+\index{Radiation|seealso{Wave}}%
+\index{Incident wave!DWBA}%
+\index{Incident wave!vs exciting wave}%
+It is important to distinguish the \E{incident} from the \E{exciting} wave.
+\index{Exciting wave}%
+\index{Wave!exciting}%
+They coincide in ordinary Born approximation, but not in DWBA.
+\index{Born approximation}%,
+
+The \E{exciting wave}
+is prepared far
+outside the sample by a radiation source and some optical devices.
+\index{Radiation source}%
+It is a superposition of plane waves,
+as discussed later in the context of instrumental resolution effects
+(\cref{SInstr}).
+While discussing scattering theory,
+it is usually represented by a single plane wave
+$\v\Psi_\se(\r)=\e^{i\k_\se\r}$.
+\nomenclature[1ψ134 2e000]{$\v\Psi_\se(\r)$}{Exciting wave}%
+This function is defined for all~$\r$,
+but is physical only along the primary beam, upstream of the sample.
+
+The \E{incident wave}~$\v\Psi_\si$
+\index{Incident wave!DWBA}%
+\index{Incident wave!vs exciting wave}%
+\index{Wave!incident}%
+is an exact solution of~\cref{EDPsi0}
+under the boundary condition that it must match~$\v\Psi_\se$
+upstream of the sample.
+Inside the sample it undergoes refraction and reflection
+or other modifications under the influence of the distortion field~$\TL$.
+
+A formal solution of the wave equation~\cref{EDPsi} is provided
+by the \E{Lippmann-Schwinger equation}
+\index{Lippmann-Schwinger equation}%
+\begin{equation}\label{EPsiLS}
+  \v\Psi(\r)
+  = \v\Psi_\si(\r)
+  + \int\!\d^3r'\, \TG(\r,\r') \TU(\r')\v\Psi(\r').
+\end{equation}
+It involves the Green function~$\TG$,
+\index{Green function}%
+\nomenclature[2g170 2r020 2r021]{$\TG(\r,\r')$}{Generic (possibly tensorial) Green function}%
+which must fulfill
+\begin{equation}\label{EGREEN}
+  \TD(\r)\v\TG(\r,\r') = \ONE \delta(\r-\r') \eqqcolon \Td(\r-\r').
+\end{equation}
+To see that the Lippmann-Schwinger equation solves indeed the perturbed wave equation~\cref{EDPsi},
+operate on both sides of~\cref{EPsiLS} with~$\TD(\r)$.
+The Lippmann-Schwinger equation can be resolved into an infinite series
+by iteratively substituting the full right-hand side of~\cref{EPsiLS}
+for the occurence of~$\v\Psi$ in the integrand.
+\index{Perturbation expansion}%
+\index{Born!expansion (or series)}%
+This is the \E{Born expansion} or \E{Born series}.\footnote
+{Named after Max Born who introduced it in quantum mechanics.
+It is actually due to Lord Rayleigh who devised it for sound,
+and later also applied it to electromagnetic waves,
+which resulted in his famous explanation of the blue sky.}
+Successive terms in this series contain rising powers of $\TU$.
+As long as $\TU$ is a small perturbation, the series converges quickly.
+In \E{first-order Born approximation},
+\index{Born approximation}%
+only the linear order in $\TU$ is retained,
+\begin{equation}\label{EBorn}
+  \v\Psi(\r)
+  = \v\Psi_\si(\r)
+  + \int\!\d^3r'\, \TG(\r,\r') \TU(\r')\v\Psi_\si(\r').
+\end{equation}
+This is the base for material investigations with X-rays or neutrons,
+where sample structures that modulate the perturbation potential $\TU$
+are deduced from the scattered intensity ${|\v\Psi(\r)|}^2$.
+Since detectors are always placed at positions $\r$
+that are not illuminated by the incident beam,
+we are only interested in the scattered wave
+\index{Scattered radiation!Born approximation}%
+\index{Wave!scattered}%
+\Emph{
+\begin{equation}\label{EBornS}
+  \v\Psi_\text{s}(\r)
+  \coloneqq
+  \int\!\d^3r'\, \TG(\r,\r') \TU(\r') \v\Psi_\si(\r').
+\end{equation}
+\vspace*{-5pt}}
+\nomenclature[1ψ034 2s000 0 2r040]{$\psi_\text{s}(\r)$}{Scattered wavefunction}%
+\nomenclature[2s000 0]{s}{Subscript ``scattered''}%
+For brevity and mathematical convenience,
+the integral has no bounds
+and therefore formally runs over the entire space.
+However, $\TU(\r')$ is nonzero only if $\r'$ lies inside the finite sample volume.
+
+%===============================================================================
+\subsection{Far-field Green function}\label{SDWGreen}
+%===============================================================================
+
+In experiments, scattered radiation is measured
+at a detector position~$\r$ so far outside the sample
+that the distance from the sample to the detector
+is must be much larger than the size of the sample.
+This is just the condition for \E{Fraunhofer diffraction};
+\index{Fraunhofer approximation}%
+In scattering theory,
+it is known as the \E{far-field approximation}.
+\index{Far-field approximation}%
+We choose the coordinate origin
+\index{Coordinate system!origin}%
+\index{Origin!coordinate system}%
+inside the sample so that the far-field asymptote corresponds to the limit $r\to\infty$.
+To determine the far-field asymptote $\v\Psi_\text{s}^\infty(\r)$
+of the scattered wave~$\v\Psi_\text{s}$ from~\cref{EBornS},
+\index{Scattered radiation!far field}
+it is sufficient to solve~\cref{EGREEN} for the far-field Green function
+\begin{equation}\label{EGinftydef}
+  \TG^\infty(\r,\r')\coloneqq \lim_{r\to\infty} \TG(\r,\r').
+\end{equation}
+\nomenclature[2g174 2far]{$\TG^\infty(\r,\r')$}{Far-field
+   approximation to the Green function $G(\r,\r')$}%
+
+%--------------------------------------------------------------------------------
+\begin{figure}[tb]
+\begin{center}
+\includegraphics[width=1\textwidth]{fig/drawing/Green1.ps}
+\end{center}
+\caption{(a)
+The Green function $G(\rS,\rD)$
+\index{Green function}%
+is the probability that radiation emitted
+by a source~S is reaches a detector~D.
+If S is a locus of scattering in a multilayer sample,
+then $G$ is a sum over different trajectories,
+\index{Trajectory}
+involving refraction and reflection
+at layer interfaces.
+(b) For the far-field
+\index{Far-field approximation!Green function}%
+Green function $G_\infty(\rS,\rD)$,
+the detector is moved so far away from the sample
+that all trajectories are practically parallel when they leave the sample.}
+\label{Fgreen1}
+\end{figure}
+%--------------------------------------------------------------------------------
+
+In deriving~$\TG^\infty$, it is preferable to work with well-defined
+\E{polarization states}.
+\index{Polarization!state}%
+For either neutron spinors or electric fields,
+the scattered field amplitude in vacuum
+can be written as sum over two orthogonal states~$\alpha$
+\nomenclature[1α010]{$\alpha$}{Polarization state index}%
+with unit amplitudes~$\ue_\alpha$:
+\nomenclature[2u041]{$\ue$}{Polarized field amplitude unit vector}%
+\begin{equation}
+   \v\Psi_\text{s}(\r)
+   = \sum_\alpha\ue_\alpha\psi_\text{s}^\alpha(\r)
+\end{equation}
+with
+\begin{equation}
+  \psi_\text{s}^\alpha(\r)
+  \coloneqq \ue_\alpha^* \v\Psi_\text{s}(\r).
+\end{equation}
+Similarly, we introduce the vectorial Green function with final polarization state~$\alpha$,
+\begin{equation}
+   \v{G}^\alpha(\r,\r')
+   \coloneqq \ue_\alpha^* \TG(\r,\r').
+\end{equation}
+In the far-field limit, it is given by\footnote
+{To our knowledge,
+the simple expression \cref{EmyG} has never before been stated.
+Informations about similar results anywhere in the literature would be highly welcome.}
+\Emph{
+\begin{equation}\label{EmyG}
+  \v{G}^\infty_\alpha(\r,\r') = \phi(r) \v\Psi_\alpha^*(\r'),
+\end{equation}
+\vspace*{-5pt}}
+where $\phi$ is an outgoing spherical wave with
+\begin{equation}\label{Effphidef}
+  \phi(r) \coloneqq \frac{\e^{iKr}}{4\pi r},
+\end{equation}
+and $\v\Psi_\alpha$ is a solution of the unperturbed distorted wave equation
+\begin{equation}
+  \TD(\r)\v\Psi_\alpha(\r) = 0
+\end{equation}
+with the boundary condition
+\begin{equation}
+  \v\Psi_\alpha(\r) = \ue_\alpha\e^{i\k_\sf\r}
+\end{equation}
+for $r\to\infty$ and
+with an outgoing wavevector
+\nomenclature[2f000]{f}{Subscript ``final''}%
+$\k_\sf\coloneqq K \r / r$.
+
+We now outline a proof for~\cref{EmyG}.
+We take for granted that Green functions obye \E{source-detector reciprocity} \cite{Pot04},
+\begin{equation}
+  \TG(\r,\r') = \TG(\r',\r).
+\end{equation}
+We first consider wave propagation in vacuum,
+denoted by an overset circle.
+Exact Green functions
+are known.
+The far-field must be taken explicitly,
+and in all cases
+\begin{equation}
+  \vGo_\alpha^\infty(\r,\r') = \phi(r)\Psio_\alpha^*(\r')
+\end{equation}
+is obtained.
+Following Dietrich and Wagner \cite{DiWa84,DiWa85,DiWa16},
+we write Lippmann-Schwinger equations for a distorted wave
+\begin{equation}\label{ELS2Psi}
+   \Psio_\alpha(\r)
+   = \int\!\d^3r''\, \left( \delta(\r-\r'') + \vGo_\alpha(\r,\r'')4\pi\TL(\r'') \right)
+                     \v\Psi_\alpha(\r''),
+\end{equation}
+and for the Green function
+\begin{equation}\label{ELS2G}
+   \vGo_\alpha(\r,\r')
+   = \int\!\d^3r''\, \left( \delta(\r-\r'') + \vGo_\alpha(\r,\r'')4\pi\TL(\r'') \right)
+                     \v{G}_\alpha(\r'',\r').
+\end{equation}
+Operate on both sides with~$\TDo(\r)$ to verify that
+\begin{equation}
+  \TDo(\r)\TGo(\r,\r') = \Td(\r-\r') \text{ and } \TDo(\r)\Psio(r)=0
+\end{equation}
+imply
+\begin{equation}
+  \TD(\r)\TG(\r,\r') = \Td(\r-\r') \text{ and } \TD(\r)\v\Psi(r)=0.
+\end{equation}
+To continue, use the reciprocity of the Green function,
+and take the far-field limit to transform~\cref{ELS2G} into
+\begin{equation}\label{ELS2G2}
+   \phi(r')\Psio_\alpha^*(\r)
+   = \int\!\d^3r''\, \left( \delta(\r-\r'') + \vGo_\alpha(\r,\r'')4\pi\TL(\r'') \right)
+                     \v{G}_\alpha^\infty(\r',\r'').
+\end{equation}
+Take the complex conjugate of~\cref{ELS2Psi},
+multiply with~$\phi(r')$, and compare with \cref{ELS2G2}
+to read off
+\begin{equation}
+   \v{G}_\alpha^\infty(\r',\r'') = \phi(r')\v\Psi_\alpha(\r''),
+\end{equation}
+which is~\cref{EmyG}.
+
+%===============================================================================
+\iffalse
+\subsection{Reciprocity of the Green function}\label{SReci}
+%===============================================================================
+
+\index{Reciprocity|(}%
+\index{Green function!reciprocity|(}%
+
+Our computation of~$G_\infty$ will be based on a source-detector \E{reciprocity theorem}
+for the scalar Schrödinger equation.\footnote
+{There exists a confusing multitude of reciprocity theorems \cite{Pot04}.
+In the end, we found it simpler to provide a derivation taylored for our application case
+than to refer to the literature.}
+The theorem states:
+Any Green function $G(\r,\r')$
+that solves~\cref{EGREEN} and as function of~$\r$ represents an outgoing wave
+%(in accord with the Sommerfeld radiation condition)
+%\index{Sommerfeld radiation condition}%
+is invariant under an exchange of source location~$\rS$ and detection point~$\rD$:
+\nomenclature[2r041 2d100]{$\rD$}{Position of detector}%
+\nomenclature[2r041 2s100]{$\rD$}{Position of source, locus of scattering}%
+\begin{equation}\label{Erecip}
+  G(\rS,\rD) = G(\rD,\rS).
+\end{equation}
+Readers not interested in mathematical details may skip the following \E{proof}:
+
+We introduce the auxiliary vector field
+\begin{equation}
+  \v{X}(\r,\rS,\rD)\coloneqq G(\r,\rD)\Nabla G(\r,\rS) - G(\r,\rS)\Nabla G(\r,\rD).
 \end{equation}
-\index{Dispersion!X-ray}%
-With these simplifying assumptions about $\v{\eps}$ and~$\v{\mu}$,
-Maxwell's equations yield the wave equation
-\begin{equation}\label{ENabNabE}
-  \Nabla\times\Nabla\times\v{E} = K^2\eps(\r)\v{E}.
+%\nomenclature[2x150 2r040]{$\v{X}(\r,\rS,\rD)$}{Auxiliary vector field}%
+We inscribe the sample and the detector
+into a sphere $\Sphere$ around the coordinate origin with radius~$R$,
+%\nomenclature[2s180]{$\Sphere$}{Auxiliary spherical volume}%
+%\nomenclature[2r120]{$R$}{Radius of $\Sphere$}%
+and compute the volume integral
+\begin{equation}\label{Eprerecipro}
+    I(\rS,\rD) \coloneqq \displaystyle\int_\Sphere\!\d^3r\,\Nabla \v{X}(\r,\rS,\rD).
 \end{equation}
-\index{Wave equation!X-ray}%
-\index{X-ray!wave equation}%
-To solve this equation by a perturbation expansion,
-\index{Perturbation expansion}%
-we proceed as in \cref{Sfluct},
-and decompose the dielectric permittivity
-into a slowly varying component and a perturbation that fluctuates on atomic scales,
-\begin{equation}
-  \eps(\r) = \overline{\eps}(\r) + \delta\eps(\r).
+After a few steps, not entirely trivial, but not too difficult either,
+we obtain
+\begin{equation}\label{EIBD}
+  I(\rS,\rD) = G(\rS,\rD) - G(\rD,\rS).
 \end{equation}
-\nomenclature[1ε031 2r040]{$\overline\eps(\r)$}{Slowly varying part of the permittivity~$\eps(\r)$}%
-\nomenclature[1δ030
-  1ε030 2r040]{$\delta\eps(\r)$}{Fast varying part of the permittivity~$\eps(\r)$}%
-In analogy to~\cref{Ekkn} we define the material-dependent wavenumber by
-\index{Wavenumber!material dependent}%
+Alternatively, we can compute $I$ as a surface integral
 \begin{equation}
-  k(\r)^2 \coloneqq K^2 \overline{\eps}(\r).
+  I(\rS,\rD)
+  =\displaystyle\int_{\partial\Sphere}\d\v{\sigma}\,\v{X}(\r,\rS,\rD).
 \end{equation}
-Furthermore, we define the scattering potential by
-\index{Scattering potential!X-ray}%
+On the surface $\partial\Sphere$,
+$G$ is an outgoing solution of the Helmholtz equation.
+As such, it has a well-known series expansion in spherical coordinates.
+We send $R\to\infty$ so that we need only to retain the lowest order:
+\begin{align}
+   G(\r(R,\vartheta,\varphi),\rD)
+   &\doteq\displaystyle \frac{\e^{iKR}}{4\pi R} a(\vartheta,\varphi),
+   \\[3.8ex]
+   G(\r(R,\vartheta,\varphi),\rS)
+   &\doteq\displaystyle \frac{\e^{iKR}}{4\pi R} b(\vartheta,\varphi).
+\end{align}
+The factorization of $G$ and $B$ and their common $R$ dependence imply that
 \begin{equation}
-  4\pi\delta v(\r) \coloneqq - K^2\delta\eps.
-\end{equation}
-The wave equation~\cref{ENabNabE} then becomes
-\begin{equation}\label{EwaveE3}
-  \left\{-\Nabla\times\Nabla\times\ONE + k(\r)^2\right\}\v{E}(\r)
-  = 4\pi\delta v(\r)\v{E}(\r).
+  I(\rS,\rD)
+  =\displaystyle\int_{\partial\Sphere}\d\sigma\,
+       (\text{$R$-dependent})(ab-ba)
+  = 0.
 \end{equation}
-\index{Wave equation!X-ray}%
-\index{X-ray!wave equation}%
-This is very similar to the perturbed Schrödinger equation~\cref{ESchrodiK}.
-\index{Perturbed Schrödinger equation}%
-\index{Schrödinger equation!perturbed}%
-There are only two differences:
-the more complicated differential operator,
-and the fact that $\v{E}(\r)$ is vector valued,
-whereas unpolarized neutrons are described by a scalar wave function~$\psi(\r)$.
+Comparison with \cref{EIBD} yields \cref{Erecip},
+which completes the proof.
+
+\index{Reciprocity|)}%
+\index{Green function!reciprocity|)}%
+\fi
 
 %===============================================================================
-\subsection{Solution}\label{SXscasol}
+\subsection{Differential cross section}\label{SdiffCross}
 %===============================================================================
 
-\def\TD{\TENS{D}}
-\def\TG{\TENS{G}}
-\def\TDo{\TENS{\overset{o}{D}}}
-\def\TGo{\TENS{\overset{o}{G}}}
-\def\Ef{\v{E}_\sf}
-\def\Efo{\TENS{\overset{o}{\v{E}}}_\sf}
-\def\Efoc{\Efo^*}
-
-The far-field Green function for the wave equation~\cref{EwaveE3}
-can be derived along the lines of~\Cref{SfarDW}
-except that differential operators and Green functions are now dyadic tensors \cite{DiWa84}.
-\Work{This will be worked out soon.}
-As result, the scattering matrix element~\cref{Etrama} of the scalar case
-needs to be multiplied with \E{polarization factors}.
-\index{Polarization!factor (X-ray)}%
-For GISAS geometry, they can be found in equations (92)--(95) of Ref.~\cite{ReLL09}.
-For the usual small scattering angles of GISAS,
-they are close to unity and therefore can be neglected.
-In BornAgain, they are not yet implemented.
+TO REVISE: In connection with \cref{EBorn} we mentioned
+that a scattering experiment measures intensities~${|\psi(\r)|}^2$.
 
-\iffalse
-\index{Green function!distorted waves, far-field|(}%
-Instead of \cref{EDDdef}, we will need the differential operators
-\begin{equation}
-  \begin{array}{@{}l}
-    \TDo \coloneqq -\Nabla\times\Nabla\times\ONE+K^2
-          = \Nabla^2-\Nabla\cdot\Nabla+K^2, \\[1.4ex]
-   \TD \coloneqq -\Nabla\times\Nabla\times\ONE+k(\r)^2 = \TDo + \delta k(\r)^2,
-  \end{array}
-\end{equation}
-with $\delta k^2\coloneqq k^2-K^2$ as before.
-Based on~\cref{EwaveE3},
-the homogeneous and inhomogeneous differential equations
-for plane waves and distorted waves are
-\begin{equation}
-  \begin{array}{l@{\hspace{2em}}l}
-    \TDo\Efo  (\r) = 0, &\TDo\TGo(\r,\r') = \ONE\delta(\r-\r'), \\[1.4ex]
-    \TD\Ef(\r) = 0, &\TD  \TG  (\r,\r') = \ONE\delta(\r-\r').
-  \end{array}
-\end{equation}
-\Cref{EGoFF} becomes
-\begin{equation}\label{EXGoFF}
-  \TGo_\infty(\rD,\rS)
-  = \TG_\infty(\rD,\rS) + \int\!\d^3r\, \TG_\infty(\rD,\r)\delta k(\r)^2 \TGo(\r,\rS).
+\index{Flux!incident and scattered}%
+The ratio of the scattered flux hitting an infinitesimal detector area
+$r^2\d\Omega$ to the incident flux is expressed as a
+\E{differential cross section}
+\index{Cross section}%
+\index{Scattering!cross section}%
+\index{Incident radiation!flux|(}%
+\begin{equation}\label{Exsectiondef}
+  \xElas
+  \coloneqq  \frac{r^2 J(\r)}{J_\si}.
 \end{equation}
-\Cref{Epfo} gets replaced by
-\begin{equation}\label{EXpfo}
-  \Efo(\rS) = \Ef(\rS) + \int\!\d^3r\, \Ef(\r)\delta k(\r)^2 \TGo(\r,\rS).
+\nomenclature[1ω120]{$\Omega$}{Solid angle}%
+\nomenclature[1σ020]{$\sigma$}{Scattering or absorption cross section}%
+% TODO RESTORE XREF
+% The geometric factors that are needed to
+% convert $\d\sigma/\d\Omega$ into detector counts will be discussed
+% below in \cref{SdetImg}.
+For a plane wave~\cref{EPsi0Plane}, the incident flux is
+\index{Incident radiation!flux|)}%
+\index{Flux!Born approximation}%
+\begin{equation}\label{EJi}
+  \v{J}_\si = \k_\si.
 \end{equation}
-These equations can be verified by operating on both sides with~$\TDo$.
-We recall the far-field asymptote of the vacuum Green function from~\cref{EGreenFar},
-and rewrite it as
-\begin{equation}
-  \TGo_\infty(\rD,\rS) = \phi(\rD)\Efoc(\rS)
+With the far-field result~\cref{EsandwichC}
+and the notation~\cref{Etrama},
+the scattered flux at the detector is
+\begin{equation}\label{EJr}
+  \v{J}(\r)
+  = \v{\hat r}\frac{K}{r^2}
+    {\left|\braket{\psi_\si|\delta v|\psi_\sf}\right|}^2.
 \end{equation}
-with the far-field prefactor $\phi$ as defined in~\cref{Effphidef}.
-We take complex conjugate of both sides of~\cref{EXpfo},
- and multiply them with $\phi(\rD)$ to obtain
-\begin{equation}\label{EXpfo2}
-  \TGo_\infty(\rD,\rS)
-  = \phi(\rD)\psi^*_\sf(\rS) + \int\!\d^3r\, \phi(\rD)\psi^*_\sf(\r)\delta k(\r)^2 \TGo(\r,\rS).
+\index{Scattered radiation!flux}%
+Inserting these into definition~\cref{Exsectiondef},
+we obtain the generic differential cross section
+of elastic scattering in first order Born approximation,
+\index{Born approximation!elastic scattering cross section}%
+\index{Cross section!Born approximation}%
+\index{Scattering!cross section}%
+\Emph{
+\begin{equation}\label{Exsection}
+  \xElas
+  =  {\left|\braket{\psi_\si|\delta v|\psi_\sf}\right|}^2.
+\end{equation}\vspace*{-5pt}
+}
+As we shall see below,
+it holds not only for plane waves governed
+by the Helmholtz equation,
+but also for distorted waves.
+\index{Distorted-wave Born approximation!elastic cross section}%
+In the plane-wave case \cref{Echiq} considered here,
+the differential cross section is just the squared modulus
+of the Fourier transform of the SLD,
+\index{Scattering!length density!Fourier transform}%
+\begin{equation}\label{Ecross1}
+  \xElas
+  = {\left| v(\q) \right|}^2.
 \end{equation}
-We compare with~\cref{EXGoFF},
-and read off the far-field asymptote of the distorted-waves Green function
-\begin{equation}
-  \TG_\infty(\rD,\rS) = \phi(\rD)\psi^*_\sf(\rS).
-\end{equation}
-Note that this is formally identical with with \cref{EGreenFar},
-but no longer requires $\Ef$ to be a plane wave.
-\index{Green function!distorted waves, far-field|)}%
-
-\Emph{Accordingly,
-the differential cross section is still given by \cref{Exsection},
-and the scattering matrix element by~\cref{Etrama}.}
-\index{Scattering matrix!distorted waves}%
-\index{Cross section!distorted-wave Born approximation}%
-\index{Scattering!cross section!distorted-wave Born approximation}%
-\index{Elastic scattering cross section!distorted-wave Born approximation}%
-The plane-wave form~\cref{Echiq}, however, does no longer hold.
-Its replacement depends on the distorted wavefunctions
-$\psi_\si$ and $\Ef$,
-is therefore application specific,
-and will be worked out later (\cref{Swave21}).
-\fi
-%% TODO \index{Distorted-wave Born approximation|)}%
-
-\index{X-ray!scattering theory|)}%
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{Coherent vs incoherent scattering}\label{Scoherlen}
@@ -1090,10 +1086,10 @@ and will be worked out later (\cref{Swave21}).
 
 Per \cref{Exsection} and~\cref{Etrama},
 \index{Coherence length|(}%
-the matrix element $\bra \psi_\si|\delta v|\psi_\sf\ket$
+the matrix element $\braket{\psi_\si|\delta v|\psi_\sf}$
 is given by a three-dimensional integral
 \begin{equation}\label{Etrama3}
-  \bra \psi_\si|\delta v|\psi_\sf\ket
+  \braket{\psi_\si|\delta v|\psi_\sf}
   \coloneqq  \int\!\d^3r\, \psi^{*}_\si(\r)\delta v(\r)\psi_\sf(\r).
 \end{equation}
 The integration domain is effectively limited to a finite $z$ interval,
@@ -1126,7 +1122,7 @@ While each single neutron is described by a wavefunction
 that allows for \E{coherent} superposition of
 different contributions to the scattered wavefunction,
 the final detector statistics
-\index{Detector statistics}%
+\index{Detector!statistics}%
 is given by an \E{incoherent} sum
 over the differential cross sections of individual neutrons.
 The finite \E{resolution}
@@ -1220,3 +1216,231 @@ in $y$ or $z$ direction.\footnote
 % TODO: more about implementation !
 
 \index{Coherence length|)}%
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{OLD STUFF}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+NOMENCLATURE STUFF
+\nomenclature[1ε031 2r040]{$\overline\eps(\r)$}{Part of the permittivity~$\eps(\r)$ that can be analytically handled}%
+\nomenclature[1δ030
+  1ε030 2r040]{$\delta\eps(\r)$}{Part of the permittivity~$\eps(\r)$ that causes scattering}%
+
+The SLD fluctuations can typically written as a sum over different materials~$p$,
+\begin{equation}
+  \delta v(\r) = \sum_p (v_p-\mv(\r)) \chi_p(\r),
+\end{equation}
+where $v_p$ is the SLD of the bulk material~$p$,
+and $\chi_p$ is dimensionless function that takes values between 0 and~1.
+Internally, BornAgain computes $v_p$ from the material's refractive index,
+\begin{equation}
+  v_p = \frac{K^2}{4\pi}(1-n_p).
+\end{equation}
+
+Absolute values of~$U(\r)$ are always much smaller than~1.
+This enables us to solve \cref{EDPsi} by a first-order perturbation theory,
+\index{Perturbation expansion}%
+the \E{distorted-wave Born approximation} (DWBA).
+\index{Distorted-wave Born approximation}%
+The DWBA generalizes the standard \E{Born approximation},
+\index{Born approximation}%
+which corresponds to the special case~$\v\Lambda(\r)=0$.
+
+To describe an elastic scattering experiment,
+we need to solve the Schrödinger equation~\cref{ESchrodiK}
+under the asymptotic boundary condition\footnote
+{A more formal variant of this is known as the \E{Sommerfeld radiation condition}.%
+\index{Sommerfeld radiation condition}%
+\index{Radiation condition}%
+}
+\index{Boundary conditions!elastic scattering}%
+\begin{equation}%\label{Escabouco}
+  \psi(\r)
+  \simeq \psi_\si(\r) + f(\vartheta,\varphi)\frac{\e^{iKr}}{4\pi r}
+  \text{~for~}r\to\infty,
+\end{equation}
+
+The Green function of the inhomogeneous Helmholtz equation~\cref{EGreenK}
+with $k(\r)=K$ is well known:\footnote
+{Verification under the condition $\r\ne0$
+is a straightforward exercise in vector analysis.
+For the special case $\r=0$,
+one encloses the origin in a small sphere
+and integrates by means of the Gauss-Ostrogadsky divergence theorem.
+This explains the appearance of the factor $4\pi$.}
+\index{Green function!homogeneous material}%
+\begin{equation}%\label{EGreens1}
+  G(\r,\r') = \frac{\e^{iK|\r-\r'|}}{4\pi |\r-\r'|}.
+\end{equation}
+
+%===============================================================================
+\subsection{Vacuum solution}%\label{Sfarfield}
+%===============================================================================
+
+Read as a function of~$\r$, it is an outgoing spherical wave centered at $\r'$.
+To compute the far-field limit~\cref{EGinftydef},
+we expand for $\r'$ with $r'\ll r$:
+\begin{equation}
+  \left|\r-\r'\right|
+  \doteq \sqrt{r^2-2\r\,\r'}
+  \doteq r - \frac{\r\,\r'}{r}
+  \equiv r - \frac{\k_\sf \r'}{K},
+\end{equation}
+\nomenclature[2f000]{f}{Subscript ``final''}%
+where we have introduced the outgoing wavevector
+$  \k_\sf\coloneqq K \r / r$.
+We apply this to~\cref{EGreens1},
+\index{Green function!homogeneous material}%
+and obtain in leading order the far-field Green function
+\begin{equation}%\label{EGreenFar}
+  G_\infty(\r,\r')
+  = \frac{\e^{iKr}}{4\pi r}\psi^*_\sf(\r'),
+\end{equation}
+where
+\begin{equation}%\label{EPsisfar}
+  \psi_\sf(\r) \coloneqq  \e^{i\k_\sf \r}
+\end{equation}
+\nomenclature[1ψ034 2f000 2r040]{$\psi_\sf(\r)$}{Plane
+  wave propagating from the sample towards the detector}%
+is a plane wave propagating towards the detector,
+and $\psi^*$ designates the complex conjugate of $\psi$.
+As function of~$\r$, $G_\infty$ is an outgoing spherical wave.
+Inserting \cref{EGreenFar} in \cref{EBornS},
+we obtain the far-field approximation for the scattered wave,
+\index{Scattered radiation!far-field}%
+\begin{equation}%\label{EsandwichC}
+  \psi_{\text{s}\infty}(\r)
+  = \frac{\e^{iKr}}{r}
+    \braket{\psi_\si|\delta v|\psi_\sf}^*
+\end{equation}
+\nomenclature[1ψ034 2s000 2far]{$\psi_{\text{s}\infty}(\r)$}{Far-field
+   approximation to the scattered wavefunction $\psi_\text{s}(\r)$}%
+with the Dirac notation for the scattering matrix element
+\index{Scattering!matrix}%
+\index{Transition matrix|see{Scattering matrix}}%
+\Emph{%
+\begin{equation}%\label{Etrama}
+  \bra{\psi_\si|\delta v|\psi_\sf}
+  \coloneqq  \int\!\d^3r\, \psi^*_\si(\r)\delta v(\r)\psi_\sf(\r).
+\end{equation}
+\vspace*{-5pt}}
+\nomenclature[0$\langle$0]{{$\braket{\ldots|\ldots|\ldots}$}}{Matrix
+  element, defined as a volume integral}%
+Since per \cref{EPsi0Plane} and~\cref{EPsisfar} our $\psi_\si$ and~$\psi_\sf$ are plane waves,
+the matrix element can be simplified as
+\begin{equation}%\label{Echiq}
+  \braket{\psi_\si|\delta v|\psi_\sf}
+  = \int\!\d^3r\, {\rm e}^{-i\k_\si\r}\delta v(\r){\rm e}^{i\k_\sf\r}
+  = \int\!\d^3r\, {\rm e}^{i\q\r}\delta v(\r)
+  \eqqcolon v(\q),
+\end{equation}
+\nomenclature[2v030 2q040]{$v(\v{q})$}{Fourier
+   transform of the SLD~$\delta v(\r)$}%
+with the \E{scattering vector}\footnote
+{With this choice of sign,
+\index{Sign convention!scattering vector}%
+$\hbar\q$ is the momentum
+\index{Momentum transfer|see {Scattering vector}}%
+\E{gained} by the scattered neutron,
+and \E{lost} by the sample.
+In much of the literature the opposite convention is prefered,
+since it emphasizes the sample physics over the scattering experiment.
+However, when working with two-dimensional detectors
+it is highly desirable to express pixel coordinates
+\index{Coordinate system}
+\index{Detector!pixel coordinate}
+and scattering vector components
+with respect to equally oriented coordinate axes,
+which can only be achieved by the convention~\cref{Eq}.}
+\index{Scattering!vector}%
+\begin{equation}%\label{Eq}
+  \q\coloneqq \k_\sf-\k_\si.
+\end{equation}
+\nomenclature[2q040]{$\q$}{Scattering vector}%
+\Cref{Echiq} summarizes the well-known fact that
+small-angle neutron scattering basically measures
+the Fourier transform $v(\q)$ of the SLD.
+\index{Scattering!potential!Fourier transform}%
+\index{Fourier transform!scattering potential}%
+
+%===============================================================================
+\subsection{X-ray scattering cross section}%\label{SXscasol}
+%===============================================================================
+
+\def\Ei{\v{E}_\si}
+\def\Eic{\Ei^*}
+\def\Ef{\v{E}_\sf}
+\def\Efc{\Ef^*}
+\def\Eo{\TENS{\overset{o}{\v{E}}}}
+\def\Efo{\Eo_\sf}
+\def\Efoc{\Eo\vphantom{E}^*_\sf}
+%\def\EA{{\v{\cal E}}}
+\def\he{\v{\hat e}}
+\def\hef{\he_\sf}
+\def\hei{\he_\si}
+\def\sif{\text{i,f}}
+
+The differential cross section
+is defined as in \cref{Exsectiondef},
+namely as the ratio of scattered flux through the unit sphere to incident flux.
+\index{Born approximation!elastic scattering cross section}%
+\index{Cross section!Born approximation}%
+\index{Scattering!cross section}%
+For electromagnetic waves in vacuum, the flux is proportional to~$|\v{E}|^2$.
+So the X-ray scattering cross section for given incoming and detected polarization is
+\begin{equation}%\label{ExsectionXlong}
+  \xElas
+  =  \frac{ {\left|\braket{\Ei|\delta v|\Ef}\right|}^2 }{|\v{e}_\si|^2\,|\v{e}_\sf|^2}
+\end{equation}
+with the scattering matrix element
+\index{Scattering!matrix}%
+\Emph{
+\begin{equation}%\label{EtramaE}
+  \braket{\Ei|\delta v|\Ef}
+  \coloneqq  \int\!\d^3r\, \Eic(\r)\delta v(\r)\Ef(\r).
+\end{equation}\vspace*{-5pt}}
+For lighter notation,
+it is convenient to choose the vacuum plane waves \cref{EEoi,EEof} from the onset
+with normalized polarization vectors,
+\begin{equation}%\label{EbcE}
+  \Eo_\si(r) = \hei\, \e^{i\k_\si\r}, \text{~and~}
+  \Eo_\sf(r) = \hef\, \e^{i\k_\sf\r},
+\end{equation}
+so that~\cref{ExsectionXlong}
+takes the simple form
+\begin{equation}%\label{ExsectionX}
+  \xElas
+  =  {\left|\braket{\Ei|\delta v|\Ef}\right|}^2
+\end{equation}
+in full analogy with~\cref{Exsection}.
+Typically, scattered radiation is detected without polarization analysis.
+\index{Polarization!analysis}%
+\index{Scattered radiation!detection}%
+\index{Scattered radiation!polarization}%
+\index{Detector!polarization}%
+Then the measured cross section is an incoherent sum
+\index{Incoherent sum!polarization}%
+\index{Polarization!incoherent sum}%
+\index{Born approximation!elastic scattering cross section}%
+\index{Cross section!Born approximation}%
+\index{Scattering!cross section}%
+\Emph{
+\begin{equation}%\label{ExsectionXsum}
+  \xElas
+  =  \sum_{\hef} {\left|\braket{\Ei|\delta v|\Ef}\right|}^2.
+\end{equation}\vspace*{-5pt}}
+In this equation,
+the dependence of $\Ef$ on $\hef$ is implicit,
+mediated through the boundary condition
+that $\Ef(\r)$ must match $\Eo_\sf(\r)$ at the detector.
+If the incident radiation is not fully polarized,
+\index{Polarization!incident}%
+an additional summation is performed over~$\hei$,
+weighted with relative intensities.
+
+\index{X-ray!scattering theory|)}%
+
+\index{Small-angle scattering}%
diff --git a/Doc/UserManual/Setup.tex b/Doc/UserManual/Setup.tex
index bb0ff50b67892052a3a366ba17151bbe0501a9fb..06421dc539621021861923901b50157409647224 100644
--- a/Doc/UserManual/Setup.tex
+++ b/Doc/UserManual/Setup.tex
@@ -55,6 +55,7 @@
 % \usepackage{manfnt} % for \dbend
 \usepackage{dingbat}
 \usepackage{amssymb}
+\usepackage{braket}
 
 % prevent unicode-math from overwriting
 
@@ -65,6 +66,7 @@
 \DeclareMathOperator{\sinc}{sinc}
 \DeclareMathOperator{\expmone}{expm1}
 \DeclareMathOperator{\expmtwo}{expm2}
+\DeclareMathOperator{\Tr}{Tr}
 
 %-------------------------------------------------------------------------------
 %  Footer
@@ -414,6 +416,8 @@
 
 \crefformat{equation}{(#2#1#3)}
 \Crefformat{equation}{Equation~(#2#1#3)}
+\crefmultiformat{equation}{(#2#1#3)}{ and~(#2#1#3)}{, (#2#1#3)}{ and~(#2#1#3)}
+\crefrangeformat{equation}{(#3#1#4) to~(#5#2#6)}
 
 \crefformat{part}{Part~#2#1#3}
 \Crefformat{part}{Part~#2#1#3}
@@ -423,6 +427,7 @@
 
 \crefformat{section}{Sec.~#2#1#3}
 \Crefformat{section}{Section~#2#1#3}
+\crefmultiformat{section}{Secs.\ #2#1#3}{ and~#2#1#3}{, #2#1#3}{ and~#2#1#3}
 
 \crefformat{subsection}{Sec.~#2#1#3}
 \Crefformat{subsection}{Section~#2#1#3}
diff --git a/Doc/UserManual/ThreeAPIs.tex b/Doc/UserManual/ThreeAPIs.tex
index 287370f376cc3a1f19bff7087748ca14774e14ce..2a4affc9a7332fe93143b76c4d3518b1454923e2 100644
--- a/Doc/UserManual/ThreeAPIs.tex
+++ b/Doc/UserManual/ThreeAPIs.tex
@@ -80,7 +80,7 @@ The Python interface is then described at length in the next chapters.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \index{Graphical User Interface|(}
 \index{bornagain@\Code{bornagain}|see {Graphical User Interface}}
-\index{Exectutable!bornagain@\Code{bornagain}|see {Graphical User Interface}}
+\index{Executable!bornagain@\Code{bornagain}|see {Graphical User Interface}}
 \index{Binary|see {Executable}}
 %\index{Project name!BornAgain@\BornAgain}
 
diff --git a/Doc/UserManual/fig/drawing/Green.py b/Doc/UserManual/fig/drawing/Green.py
new file mode 100755
index 0000000000000000000000000000000000000000..0026ebed5c9a5c979476bd6c4d24968b736b67df
--- /dev/null
+++ b/Doc/UserManual/fig/drawing/Green.py
@@ -0,0 +1,107 @@
+#!/usr/bin/env python3
+
+'''
+Compute radiation trajectories through multilayer sample
+for use in figure that explains the Green function.
+'''
+
+xd = 52
+yd =  10   # detector
+s =  3 # source located at -s
+T = [ 6, 6 ] # layer thickness
+sd = T[0]-s # distance from source to lower interface
+DeltaLayer = [ .05, .1 ] # refractive index parameter delta, per layer
+x0   = 4
+xtot = xd - x0 # determine angles so that sum dx matches this
+
+PP = [
+    [ s, yd ],
+    [ -sd, T[0], yd ],
+    [ s, -T[0], T[0], yd ],
+    [ -sd, T[0], -T[0], T[0], yd ],
+    [ -sd, -T[1], T[1], T[0], yd ],
+    [ -sd, -T[1], T[1], -T[1], T[1], T[0], yd ],
+    [ -sd, -T[1], T[1], T[0], -T[0], T[0], yd ],
+]
+
+import math, re, scipy.optimize, sys
+
+def inside( y, mi, ma ):
+    return mi<=y and y<=ma
+
+def xsum( a0, P, D ):
+    n = len(P)
+    if len(D) != n:
+        sys.stderr.write( "Bug: inconsistent array lengths\n" )
+        exit(1)
+    ret = 0
+    for i in range(n):
+        a = math.acos( min( .99, math.cos(a0) / (1-D[i]) ) )
+        ret += abs(P[i])/math.tan(a)
+    return ret-xtot
+
+cmd0 = ""
+cmd0 += "/xd %6.3g def\n" % xd
+cmd0 += "/yd %6.3g def\n" % yd
+cmd1 = ""
+cmd2 = ""
+b0 = .8
+
+for P in PP:
+    y = -s
+    DeltaPath = []
+    for dy in P:
+        yold = y
+        y += dy
+        if yold>=0 and y>=0:
+            DeltaPath.append( 0 )
+        elif inside(y,-T[0],0) and inside(yold,-T[0],0) :
+            DeltaPath.append( DeltaLayer[0] )
+        elif inside(y,-T[0]-T[1],-T[0]) and inside(yold,-T[0]-T[1],-T[0]) :
+            DeltaPath.append( DeltaLayer[1] )
+        else:
+            sys.stderr.write( "Invalid input => layer ill defined\n" )
+    if y!=yd:
+        sys.stderr.write( "Invalid input => detector not hit\n" )
+        exit(1)
+
+    a0 = scipy.optimize.newton( xsum, .5, args = ( P, DeltaPath ) )
+    print( a0 )
+    y = -s
+    x1 =  x0
+    x2 =  x0
+    wgt = 5 - len(P)/2
+    cmd1 += "%1i [] lset\n" % (wgt)
+    cmd2 += "%1i [] lset\n" % (wgt)
+    cmd1 += "%6.3g %6.3g np mv\n" % ( x1, y )
+    cmd2 += "%6.3g %6.3g np mv\n" % ( x2, y )
+    for i in range(len(P)-1):
+        a = math.acos( math.cos(a0) / (1-DeltaPath[i]) )
+        x1 += abs(P[i])/math.tan(a)
+        b = math.acos( math.cos(b0) / (1-DeltaPath[i]) )
+        x2 += abs(P[i])/math.tan(b)
+        y += P[i]
+        cmd1 += "%6.3g %6.3g li\n" % ( x1, y )
+        cmd2 += "%6.3g %6.3g li\n" % ( x2, y )
+    cmd1 += "st\n"
+    cmd2 += "st\n"
+    len1 = math.sqrt( (xtot+x0-x1)**2 + yd**2 ) - 8
+    cmd1 += "%6.3g %6.3g %7.3g .8 %6.3g pfeiL\n" % ( x1, y, 180*a0/math.pi, len1 )
+    cmd2 += "%6.3g %6.3g %7.3g .8 %6.3g pfeiL\n" % ( x2, y, 180*b0/math.pi, 7 )
+    cmd1 += "\n"
+    cmd2 += "\n"
+#/pfeiL { % (arrow anchored at base) x y rot siz len
+
+t = "% This file is automatically generated by script " + sys.argv[0] + "\n% DO NOT EDIT!\n\n"
+fd = open( "Green1.ps.in", 'r' )
+t += fd.read()
+fd.close
+
+cmd0 += "/b0 %7.3g def\n" % (180*b0/math.pi)
+t = re.sub( r'%#0', cmd0, t )
+t = re.sub( r'%#1', cmd1, t )
+t = re.sub( r'%#2', cmd2, t )
+
+fd = open( "Green1.ps", 'w' )
+fd.write( t )
+fd.close
diff --git a/Doc/UserManual/fig/drawing/Green1.ps b/Doc/UserManual/fig/drawing/Green1.ps
new file mode 100644
index 0000000000000000000000000000000000000000..9b17ac748a115e6ee23330954c326145020ce3a2
--- /dev/null
+++ b/Doc/UserManual/fig/drawing/Green1.ps
@@ -0,0 +1,1780 @@
+%!PS-Adobe-1.0 EPSF-1.0
+%%BoundingBox:    24   580   522   702
+%%Comment: Bounding box extracted by bboxx
+%%+:       A program by Dov Grobgeld 2003
+% This file is automatically generated by script ./Green.py
+% DO NOT EDIT!
+
+%!PS-Adobe-1.0 EPSF-1.0
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  FRIDA: fast reliable interactive data analysis                           %%
+%%  wups11a.ps: graphic macros                                               %%
+%%  (C) Joachim Wuttke 1990-2016                                             %%
+%%  http://www.messen-und-deuten.de/frida                                    %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%  Sections:
+%   - Programming, Page Formatting, Coordinate Transforms
+%   - Colors
+%   - Fonts and Text Blocks
+%   - Coordinate Frame
+%   - Data Plotting (Symbols and Curves)
+%   - Lists
+%   - Macro Collection
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Programming, Page Formatting, Coordinate Transforms                      %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Framework:
+
+% For interleaving applications, isolate what follows in a dictionary
+/WuGdict11a 400 dict def
+WuGdict11a begin
+
+
+%%  Shortcuts:
+
+/np { newpath }   bind def
+/mv { moveto }    bind def
+/rm { rmoveto }   bind def
+/rl { rlineto }   bind def
+/li { lineto }    bind def
+/cp { closepath } bind def
+/st { stroke }    bind def
+/x  { exch }      bind def
+
+/black { 0 setgray } bind def
+/white { 1 setgray } bind def
+
+/F false def
+/T true  def
+
+
+%%  Constants:
+
+/pt {  .018567 mul} bind def % for line widths and font sizes, reason unclear
+/cm {28.346456 mul} bind def % typographic_point -> cm
+
+/twopi { 6.2831853072 } def
+
+
+%%  Math operators:
+
+/rnd  { rand cvr 1 30 bitshift div 2 div 0 max 1 min } def % -> between 0 and 1
+
+/min { 2 copy gt { x } if pop } def
+/max { 2 copy lt { x } if pop } def
+
+/tan { dup sin x cos div } def
+/cot { dup cos x sin div } def
+/pol2xy{ 2 copy cos mul 3 1 roll sin mul } def % r phi | x y
+
+/eexp { 2.71828 x exp } def % "exp" is x^y, eexp is e^x
+/tanh { 2.71828 x 2 copy exp 3 1 roll neg exp
+        2 copy sub 3 1 roll add div } def
+
+
+%%  Page layout and global figure size:
+
+% shift origin
+%    The PostScript coordinate system starts in the lower left corner
+%    of the page, whereas we want our figures to be justified in the
+%    upper left corner.  Therefore we need a vertical translation,
+%    depending on the paper size.  A4 is 210x297 mm^2.  By this occasion,
+%    we also provide a border of 7 mm.
+/cmtranslate { % x y cmtranslate | -
+   cm x cm x translate } bind def
+/originUpperLeft_A4{ .7 28.3 cmtranslate } bind def
+/goffsetA4 { ungscale originUpperLeft_A4 gscale } def
+/EdgeLeftDIN{ originUpperLeft_A4 } bind def % OBSOLETE since 11a
+
+% set absolute global scale and relative symbol size
+/defsiz { % size(cm) symbolsize(rel) | -
+   /ftot x def
+   /gsiz x cm 10 div def
+   gscale % within 'size', coordinates run from 0 to 10
+   } def
+/gscale {
+   gsiz dup scale
+} def
+/ungscale {
+   1 gsiz div dup scale
+} def
+
+% symbol (and label?) size as sublinear function of figure size
+/autolabel { % size(cm) | symbolsize(rel)
+   dup 7 div 2 add 4 mul % the simplest sublinear increase
+   x div % anticipate overall rescaling
+   } def
+
+
+%%  Frame size and shape, frame coordinates:
+
+% aspect ratios
+/gyld {0.447214 mul} bind def /Gyld {0.447214 div} bind def % sqrt(5)
+/guld {0.547723 mul} bind def /Guld {0.547723 div} bind def % sqrt(3)
+/gold {0.618034 mul} bind def /Gold {0.618034 div} bind def % goldener Schnitt
+/gild {0.707107 mul} bind def /Gild {0.707107 div} bind def % sqrt(2) : DIN
+/geld {0.759836 mul} bind def /Geld {0.759836 div} bind def % sqrt(sqrt(3))
+/gald {0.817765 mul} bind def /Gald {0.817765 div} bind def % sqrt sqrt sqrt 5
+
+% define frame coordinates
+/defred { % x_reduction y_reduction label_reduction | -
+   /fmm x ftot mul def
+   /ymm x def
+   /xmm x def
+
+   % conversion frame_coordinate -> global_coord
+   /xm {xmm mul} bind def
+   /ym {ymm mul} bind def
+   /fm {fmm mul} bind def
+   /xym {ym x xm x} bind def
+
+   % prefer rescaling over explicit conversion (make more use of this !)
+   /mmscale { xmm ymm scale } bind def
+   /mmunscale { 1 xmm div 1 ymm div scale } bind def
+
+   % graphic commands in frame coordinates
+   /offset { xym translate } bind def
+   /currentxy { currentpoint ymm div x xmm div x } bind def
+   /setline { pt fm setlinewidth [] 0 setdash } bind def
+   } def
+
+/stdred { % x_reduction y_reduction | -
+   2 copy mul sqrt defred
+   } def
+
+%%  World (= user application) coordinates:
+
+% user must declare x and y range
+/xSetCoord { % log min max | -
+   /wxmax x def
+   /wxmin x def
+   /wxlog x 0 eq not def
+   % prepare conversion world coord -> frame coord
+   /wxdel wxmax wxmin wxlog { div log } { sub } ifelse def
+   /wxd { % dx(world) | dx(frame)
+      wxlog { log } if wxdel div 10 mul
+      } bind def
+   /wx { % x(world) | x(frame)
+      wxmin wxlog { div } { sub } ifelse
+      wxd
+      } bind def
+   } def
+/ySetCoord { % log min max | -
+   /wymax x def
+   /wymin x def
+   /wylog x 0 eq not def
+   /wydel wymax wymin wylog { div log } { sub } ifelse def
+   /wyd { % dy(world) | dy(frame)
+      wylog { log } if wydel div 10 mul
+      } bind def
+   /wy { % y(world) | y(frame)
+      wymin wylog { div } { sub } ifelse
+      wyd
+      } bind def
+   } def
+
+% pair conversion
+/wxy { % x,y(world) -> x,y(frame)
+   wy x wx x
+   } def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Colors                                                                   %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Color operators:
+
+/setRGBcolor {
+   3 { 255 div 3 1 roll } repeat setrgbcolor
+   } def
+
+/colormix { % weight(0..1) col1(R|G|B) col2(R|G|B) | col(R|G|B)
+   7 -1 roll dup /weightA x def /weightB x 1 x sub def
+   4 -1 roll weightA mul x weightB mul add 5 1 roll
+   3 -1 roll weightA mul x weightB mul add 4 1 roll
+   2 -1 roll weightA mul x weightB mul add 3 1 roll
+   } def
+
+/relcol { % i_col n_col | rel(0..1) : for one-dimensional choices
+   1 sub div 0 max 1 min
+   } def
+
+
+%%  Named colors:
+
+/siemensorange { 255 153   0 setRGBcolor } bind def
+/siemensblue   { 0   102 153 setRGBcolor } bind def
+/siemenstext   {   0  51 102 setRGBcolor } bind def
+/siemensred    { 165   0  33 setRGBcolor } bind def
+/siemenspink   { 221 102 102 setRGBcolor } bind def
+/siemensgrey   { 221 221 221 setRGBcolor } bind def
+/siemensdark   { 102 102 102 setRGBcolor } bind def
+/siemensgreen  {  33 153 102 setRGBcolor } bind def
+/siemensyellow { 255 221   0 setRGBcolor } bind def
+
+/red           { 255   0   0 setRGBcolor } bind def
+
+
+%%  One-dimensional linear color choices:
+
+/iCol1 { % i i_max | - : default -2010, round the circle, RGBR
+   relcol dup 1 x % rel 1 rel
+   360 mul 255 add cos 1 add dup mul neg .053 mul 1 add % modulate saturation
+   sethsbcolor
+   } def
+/iCol2 { % i i_max | - : cyan  - yellow - magenta
+   relcol 3 mul
+   dup 1 le {
+      dup 1 sub neg 0 3 2 roll } {
+      dup 2 le {
+         1 sub dup 1 sub neg 0 3 1 roll } {
+         2 sub dup 1 sub neg 0 3 0 roll } ifelse
+      } ifelse
+   0 setcmykcolor
+   } def
+/iCol3 { % i i_max | - : siemens
+   div /icnow x def
+   165 1 icnow sub mul
+   102   icnow     mul
+    33 120 icnow mul add setRGBcolor
+   } def
+/iCol4 { % i i_max | - : red to blue (subsequence of old scheme iCol1)
+   relcol
+   3 x sub 3 div 1 iCol1
+   } def
+
+
+%%  One-dimensional color choice from given array:
+
+/iColA { % i i_max arr | -
+   /aCol x def
+   relcol
+   aCol length 1 sub mul % position within array
+   dup cvi dup 3 1 roll % idx pos idx
+   sub x % offset idx
+   0 max aCol length 1 sub min % offset safe_idx
+   dup 1 add aCol length 1 sub min % offset i i+1
+   aCol x get exec
+   4 3 roll aCol x get exec colormix setRGBcolor
+   } def
+
+
+%% Color arrays for non-linear one-dimensional choices:
+
+/aCol1 [ % red-blue
+   { 255   0   0 } %  1
+   { 240  10  10 } %  2
+   { 220  40  40 } %  3
+   { 205  65  90 } %  4
+   { 195  80 130 } %  5
+   { 180 110 180 } %  6
+   { 165 120 185 } %  7
+   { 150 130 190 } %  8
+   { 130 150 210 } %  9
+   { 110 125 220 } % 10
+   {  85 105 230 } % 11
+   {  70  90 255 } % 12
+   {   0   0 255 } % 13
+   ] def
+/aCol2 [ % orange-red-blue-darkblue
+   { 255 180   0 } %  1
+   { 255 160   0 } %  1
+   { 255 120   0 } %  2
+   { 255  70   0 } %  3
+   { 255   0   0 } %  4
+   { 220  30  30 } %  5
+   { 220  70  60 } %  6
+   { 220 100 110 } %  7
+   { 200 130 130 } %  8
+   { 200 130 160 } %  9
+   { 180 110 180 } % 10
+   { 165 110 185 } % 11
+   { 150 130 190 } % 12
+   { 130 150 210 } % 13
+   { 100 120 220 } % 14
+   {  85 105 230 } % 15
+   {  70  90 255 } % 16
+   {   0   0 255 } % 17
+   {   0   0 180 } % 18
+   {  10  10 150 } % 19
+   {  30  30 130 } % 20
+   ] def
+/aCol3 [ % [fixed size: 9] siemenscolors
+   { 165   0  33 } % siemensred
+   {  33 153 102 } % siemensgreen
+   { 0   102 153 } % siemensblue
+   {   0  51 102 } % siemenstext
+   { 255 153   0 } % siemensorange
+   { 102 102 102 } % siemensdark
+   { 255 221   0 } % siemensyellow
+   { 221 221 221 } % siemensgrey
+   { 221 102 102 } % siemenspink
+   ] def
+/aCol4 [ % green-blue-brown
+   { 120 160  60 }
+   {  90 185  40 }
+   {  50 215  20 }
+   {   0 245   0 }
+   {  10 235 112 }
+   {  20 235 143 }
+   {  30 230 173 }
+   {  40 225 194 }
+   {  50 205 215 }
+   {  40 153 204 }
+   {  40 102 153 }
+   {  40  82 122 }
+   {  90  74 101 }
+   { 140  68  80 }
+   { 170  59  60 }
+   { 190  50  40 }
+   { 180  65  40 }
+   { 160  80  40 }
+   { 140 100  40 }
+   { 120  80  30 }
+   { 100  60  20 }
+   ] def
+/aCol5 [ % [fixed size: 8] gnuplot default (see man gnuplot and rgb.txt)
+   { 255   0   0 } % red
+   {   0 255   0 } % green
+   {   0   0 255 } % blue
+   { 255   0 255 } % magenta
+   {   0 255 255 } % cyan
+   { 160  82  45 } % sienna
+   { 255 165   0 } % orange
+   { 255 127  80 } % coral
+   ] def
+
+
+%%  Specialized ifelse, depending on pcol / ccol - OBSOLETE since 11a:
+
+/ifpcol { % proc1 proc2 | -
+   pcol 0 eq { pop exec } { exec pop} ifelse % 3 1 roll ifelse
+   } def
+/ifccol { % proc1 proc2 | -
+   ccol 0 eq { pop exec } { exec pop} ifelse % 3 1 roll ifelse
+   } def
+
+
+%%  old-style colors round the circle - OBSOLETE since 10a:
+
+% global preset
+/pColSet { % col ncol | -
+   /npcol x def % # different colours
+   /pcol  x def % colours off/on
+   } def
+/cColSet { % col ncol | -
+   /nccol x def % # different colours
+   /ccol  x def % colours off/on
+   } def
+% default setting
+0 3 pColSet % default setting
+0 3 cColSet % default setting
+% now defined locally in g3.ps
+/ipCol { 100 iCol1 } def
+/icCol { 100 iCol1 } def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Fonts and Text Blocks                                                    %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Prepare standard fonts:
+
+% extend font encoding
+/ReEncode { % OldFont NewFont Encoding | -
+   /MyEncoding x def
+   x findfont % select OldFont
+   dup length dict begin
+      {def} forall
+      /Encoding MyEncoding def
+      currentdict
+      end
+   definefont % define as NewFont
+   } def
+
+% we assume that image scripts are Latin1 encoded
+/Helvetica             /MyFont             ISOLatin1Encoding ReEncode
+/Helvetica-Oblique     /MyFont-Oblique     ISOLatin1Encoding ReEncode
+/Helvetica-Bold        /MyFont-Bold        ISOLatin1Encoding ReEncode
+/Helvetica-BoldOblique /MyFont-BoldOblique ISOLatin1Encoding ReEncode
+
+/setPalatino {
+/Palatino             /MyFont             ISOLatin1Encoding ReEncode
+/Palatino-Italic      /MyFont-Oblique     ISOLatin1Encoding ReEncode
+/Palatino-Bold        /MyFont-Bold        ISOLatin1Encoding ReEncode
+/Palatino-BoldItalic  /MyFont-BoldOblique ISOLatin1Encoding ReEncode
+} def
+
+%% Preset standard styles:
+
+% scale and set font; define fontsize, fontheight
+/setfontandsize { % font size | -
+   dup 0 le { pop 100 } if % fontsize <= 0 not allowed !
+   /fontnonnil true def
+   pt fm dup /fontsize x def
+   x findfont
+   x scalefont
+   setfont
+   gsave % determine fontheight - from the cookbook :
+      np 0 0 mv (1) true charpath flattenpath
+      pathbbox  % low_left_x, low_left_y, up_right_x, up_right_y
+      x pop x pop x pop
+      /fontheight x def
+      grestore
+   } def
+
+% standard settings for labelling axes
+/setnum { /MyFont            24 setfontandsize } def
+/setlab { /MyFont            24 setfontandsize } def
+
+% user commands (free choice of fontsize, but fixed font family)
+/setown { /MyFont             x setfontandsize } def
+/setbol { /MyFont-Bold        x setfontandsize } def
+/setboq { /MyFont-BoldOblique x setfontandsize } def
+/setobl { /MyFont-Oblique     x setfontandsize } def
+
+
+%%  String treatment:
+
+/showif { % string | - : increment xwidth or plot string
+   prepare
+      { stringwidth pop xwidth add /xwidth x def }
+      { show }
+   ifelse
+   } def
+/script { % matrix relpos_y | -
+   /yoffset x fontheight mul def
+   currentfont x makefont setfont
+   0 yoffset rm
+   } def
+/scred .71 def
+/subsc {
+   showif
+   [scred 0 0 scred 0 0] -.2 script
+   } def
+/supsc {
+   showif
+   [scred 0 0 scred 0 0] .6 script
+   } def
+/endsc {
+   showif
+   regularfont setfont
+   0 yoffset neg rm
+   } def
+/grec {
+   showif
+   /Symbol findfont fontsize scalefont setfont
+   } def
+/endgr {
+   showif
+   regularfont setfont
+   } def
+/endall {
+   showif
+   regularfont setfont
+   } def
+/build { % string xrel yrel obj | - : plot obj above/below string
+   /obj x def /yrelbui x def /xrelbui x def
+   dup showif
+   prepare
+      { pop }
+      { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
+        currentpoint 4 2 roll % save position after string
+      rm obj pop       % obj must end with () that will be pop'ed
+      mv               % back to saved position
+      }
+   ifelse
+   } def
+/gbuild { % string xrel yrel obj | - : plot obj above/below string
+   /obj x def /yrelbui x def /xrelbui x def
+   /Symbol findfont fontsize scalefont setfont
+   dup showif
+   prepare
+      { pop regularfont setfont }
+      { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
+        currentpoint 4 2 roll % save position after string
+        regularfont setfont
+      rm obj pop       % obj must end with () that will be pop'ed
+      mv               % back to saved position
+      }
+   ifelse
+   } def
+/hut { % ..) (<Char>) hut (..            %%%  MISERABEL PROGRAMMIERT
+   x showif
+   1.4 .6 {(\136) show ()} build
+   } def
+/ghut { % ..) (<grec-Char>) ghut (..      %%%  BREITE PASST NUR FUER Phi(t)
+   x showif
+   .8 .65 {(\136) show ()} gbuild
+   } def
+/tilde {
+   x showif
+   1. .6 {(~) show ()} build
+   } def
+/gtilde {
+   x showif
+   1. .6 {(~) show ()} gbuild
+   } def
+/spce { % string n spce - ; insert n times ( )
+   {showif (  )} repeat
+   } def
+
+% the following macros use the symbol/curve plotting mechanism
+/pins { % string symins - ; symbol must be selected by pset
+   showif
+   ( ) showif ( ) .5 .5 { currentxy 0 p black ()} build ( ) showif
+   } def
+/clenins { % string len clenins - ; curve must be selected by cset
+   x showif % I suppose that pins is preceeded by 8 spaces
+   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def
+            % length of inserted curve :
+            % -1 space : curve begins and ends in  middle of ( )
+            % +3 spaces: pins requires 3 times ( )
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
+   2 add {( ) showif} repeat
+   } def
+/cins { % string symins - ; curve must be selected by cset
+   showif 8 % I suppose that pins is preceeded by 8 spaces
+   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div 10 div def
+   % nov03, ohne zu verstehen, "10 div" eingefuegt
+            % length of inserted curve :
+            % -1 space : curve begins and ends in  middle of ( )
+            % +3 spaces: pins requires 3 times ( )
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
+   2 add {( ) showif} repeat
+   } def
+
+/block { % x y ob xrel yrel | -
+   /yrel x def /xrel x def /blabla x def
+    /ypos x ym def /xpos x xm def
+   /regularfont currentfont def /yoffset 0 def % initialize for security
+   /prepare true def /xwidth 0 def 0 0 mv % to prevent empty-path-error
+    blabla endall % first pass : determine xwidth
+   boxif { /boxwidth  xwidth (M) stringwidth pop boxxr mul 2 mul add def
+           /boxheight fontheight 1 boxyr 2 mul add mul def
+           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub
+           ypos fontheight .5 boxyr add mul sub mv
+           boxwidth 0 rl 0 boxheight rl boxwidth neg 0 rl cp
+           boxproc
+    } if
+    xpos xwidth xrel mul sub ypos fontheight yrel mul sub mv
+    /prepare false def
+    blabla endall % second pass : plot
+   /boxif false def
+   } def
+/rblock { % x y ang ob proc rblock -
+   5 3 roll
+   gsave
+      xym translate
+      3 2 roll rotate
+      0 0 4 2 roll exec
+      grestore
+   } def
+
+/Box { % x y {exe}
+   /boxif true def
+   /boxproc x def /boxyr x def /boxxr x def
+   } def
+/nBox { .6 .6 3 2 roll Box } def
+/boxif false def
+/textW { % obj | length : calculate only length.
+   /blabla x def
+   /regularfont currentfont def /yoffset 0 def % initialize for security
+   /prepare true def /xwidth 0 def 0 0 mv % to prevent empty-path-error
+   blabla endall
+   xwidth % has been determined
+   } def
+/textw { % obj | y : dito, in 0..10-units
+   textW xmm div
+   } def
+
+% horizontal text: x y ob | -
+/textLB { 0. 0. block } bind def
+/textCB { .5 0. block } bind def
+/textRB { 1. 0. block } bind def
+/textLM { 0. .5 block } bind def
+/textCM { .5 .5 block } bind def
+/textRM { 1. .5 block } bind def
+/textLT { 0. 1. block } bind def
+/textCT { .5 1. block } bind def
+/textRT { 1. 1. block } bind def
+
+% rotated text: x y ang ob | -
+/rtextLB { {textLB} rblock } bind def
+/rtextLM { {textLM} rblock } bind def
+/rtextRB { {textRB} rblock } bind def
+/rtextRM { {textRM} rblock } bind def
+/rtextCM { {textCM} rblock } bind def
+
+
+%%  Language selection:
+
+% preset
+/language { % choose_this of_so_many | - % select current language
+   /langMax x def
+   /langChc x def
+   } def
+1 1 language % default
+% choose text from sequence
+/langSel { % text_1 .. text_M | text_C : choose text, M=langMax, C=langChc
+   langMax dup langChc sub 1 add roll
+   langMax 1 sub { pop } repeat
+   } def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Coordinate Frame                                                         %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Layout presets:
+
+/xyTicLen {0.10 fm} def
+/xyTacLen {0.20 fm} def
+/txllen {0.20 fm} def
+/tyllen {0.20 fm} def
+/linsetAxx {black 0.7 setline} def
+/linsetTic {black 0.7 setline} def
+/linsetTac {black 0.7 setline} def
+/linsetGri {black 0.4 setline} def
+
+%%  Start-up commands:
+
+/Resets {
+   /yNumLengthL 0 def /yNumLengthH 0 def
+   /xNumHeightL .3 def /xNumHeightH 0 def
+   /xNumHeightRel 2.4 def
+   /aMean 5 def
+   /xPlotFrame {} def
+   /yPlotFrame {} def
+   /zPlotFrame {} def
+   black
+   } def
+/BoxBackground {
+   0 0 10 10 boxit gsave setboxbackgroundcolor fill grestore
+} def
+/setboxbackgroundcolor { white } def
+
+
+%%  Some more presets for g3.ps:
+
+/iFrame 0 def
+
+/setnewpage { % xoff yoff
+  /yoffnewpage x def
+  /xoffnewpage x def
+} def
+/newpage {
+  goffsetA4
+  xoffnewpage yoffnewpage offset
+} def
+/setpagegrid { % ncol nrow xoffnewframe yoffnewframe
+  /yoffnewframe x def
+  /xoffnewframe x def
+  /nrowpage x def
+  /ncolpage x def
+} def
+/nextFrame {
+  /iFrame iFrame 1 add def
+  iFrame nrowpage ncolpage mul mod 0 eq {
+    showpage gscale newpage
+  } {
+    iFrame ncolpage mod 0 eq {
+      xoffnewframe ncolpage 1 sub neg mul yoffnewframe offset
+    } {
+      xoffnewframe 0 offset
+    } ifelse
+  } ifelse
+} def
+
+
+/zValues { pop pop } def
+/plotafter {} def
+/whiteframe { 1 0 0 10 10 graybox } def
+/plotframes { xPlotFrame yPlotFrame } def
+/plotbefore { plotframes } def
+
+/abc {abclab setown abcx abcy 3 2 roll textCM} def % usage ((a)) abc
+/abcset { % x y siz abcset - : preset for abc
+   /abclab x def /abcy x def /abcx x def
+   } def
+
+
+%%  Ticks:
+
+% set tick array - internal macros
+/tiputs { % rel_pos_of_tick | pos_of_tick : innermost routine for /taproc
+   tastep mul taloop add
+   } def
+/taproclin { % (#tick/tack) | - : define /taproc for use in SetVec
+   1 x div /tistep x def
+   /taproc { 0 tistep .999 { tiputs } for } def
+   } def
+/taproclog { % (#ticks/tacks) | - : define /taproc for use in SetVec
+      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def
+   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def
+   }{ dup 0 gt { pop /taproc { 0 tiputs } def
+   }{            neg taproclin
+   } ifelse } ifelse } ifelse
+   } def
+/SetVec { % tafro tatoo nta /vector | - : set /vector
+   4 1 roll
+   /nta x def /tatoo x def /tafro x def
+   /tastep tatoo tafro sub nta 1 sub div def
+   [
+      0 1 nta {
+         tastep mul tafro add /taloop x def
+         taproc exec
+         } for
+      ] def
+   } def
+% set tick array - user commands
+/SetTicVecLin { taproclin /TicVec SetVec } def
+/SetTicVecLog { taproclog /TicVec SetVec } def
+
+% set tack-and-number array
+/SetTacVec { % [ pos {label} pos {label} ... ] | -
+   /TacVec x def
+   } def
+
+% define axes
+   % note on angles : 0 = x-axis, 90 = y-axis
+/OneAxx { % fro to xpos ypos aang tang | - : presets for Axx, Tic, Tac, Num
+   % store arguments
+   /tAng x def /aAng x def
+   /yPos x def /xPos x def
+   /aTo x def /aFro x def
+   % set constants
+   /xTicLen tAng cos xyTicLen mul def /yTicLen tAng sin xyTicLen mul def
+   /xTacLen tAng cos xyTacLen mul def /yTacLen tAng sin xyTacLen mul def
+   /xAng aAng cos def /yAng aAng sin def
+   /aMean aFro aTo add 2 div def
+   /aArr false def
+   } def
+/ArrAxx { % label <args of OneAxx> | - : axis with arrow
+   OneAxx
+   /aLab x def
+   /aArr true def
+   } def
+
+% draw axis (with parameters preset by OneAxx or ArrAxx)
+/Axx { % - | -
+   linsetAxx
+   gsave
+      xPos yPos offset
+      mmscale
+      aAng rotate
+      % draw a line
+      aFro 0 np mv
+      aTo  0 li st
+      % draw an arrow and a label, if requested
+      aArr {
+         gsave
+            aTo 0 offset
+            aAng neg rotate
+            mmunscale
+            aAng rotate
+            0 0 0 .3 pfeilspitze % draw an arrow
+            .3 0 offset
+            aAng neg rotate
+            setlab
+            aAng 45 le
+               { 0 -.8 xNumHeightL sub aLab textRT }
+               { 0  .2 aLab textCB }
+               ifelse
+           grestore
+         } if
+      grestore
+   } def
+
+% draw ticks (positions given by SetTicVec, parameters preset by OneAxx/..)
+/Tic { % - | - : draw tick as defined in TicProc
+   linsetTic
+   TicVec {
+      dup dup aFro lt x aTo gt or {pop} {TicProc} ifelse
+      } forall
+   } def
+/TicProc { % aPos | - : default procedure to plot one tick
+   np
+   xPos yPos xym mv
+   dup xAng mul x yAng mul xym rm % eat argument, go to start pos.
+   xTicLen yTicLen rl st
+   } def
+/xGric { % yFro yTo | - : draw a grid line (instead of an x tick)
+   linsetGri
+   TicVec {
+      3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
+         dup % y1 y2 x x
+         4 -1 roll xym np mv % y2 x
+         x xym li st
+         } ifelse
+      } forall
+   pop pop
+   } def
+/yGric { % xFro xTo | - : draw a grid line (instead of an y tick)
+   linsetGri
+   TicVec {
+      3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
+         dup % x1 x2 y y
+         4 -1 roll x xym np mv % x2 y
+         xym li st
+         } ifelse
+      } forall
+   pop pop
+   } def
+
+% draw tacks (positions given by SetTacVec, parameters preset by OneAxx/..)
+/TacExe { % Proc | - % Execute Proc for all pairs of elements of TacVec
+                     % (but only if inside aFro..aTo)
+   /TacProc x def
+   /ispair true def % toggle: take pos, take label, take pos, take label ...
+   TacVec {
+      ispair
+         {
+            /aPos x def
+            /ispair false def
+         } {
+            aPos dup aFro lt x aTo gt or
+            {pop} {TacProc} ifelse
+            /ispair true def
+         } ifelse
+      } forall
+   } def
+/Tac {
+   linsetTac
+   { pop xPos yPos xym mv
+      aPos dup xAng mul x yAng mul xym rm
+      xTacLen yTacLen rl st
+      } TacExe
+   } def
+% unnecessary optimisation by specialisation: OBSOLETE since 11a
+/xTacL { Tac } def
+/xTacH { Tac } def
+/yTacL { Tac } def
+/yTacH { Tac } def
+% special tack routines, only for rectangular axes
+/xTacC { % : centered tack on x axis
+   linsetTac
+   { pop aPos xm yPos ym txllen 2 div sub np mv 0 txllen rl st } TacExe
+   } def
+/xGrid { % : rule instead of tack on x axis
+   linsetTac
+   { pop aPos xm np yPos ym mv 0 10 xym rl st } TacExe
+   } def
+/yTacC { % : centered tack on y axis
+   linsetTac
+   { pop xPos xm tyllen 2 div sub aPos ym np mv tyllen 0 rl st } TacExe
+   } def
+/yGrid { % : rule instead of tack on low y axis
+   linsetTac
+   { pop aPos ym np xPos xm x mv 10 0 xym rl st } TacExe
+   } def
+
+% draw numbers (pos-txt pairs given by SetTacVec)
+/Num { % Generic but useless. Adjust for your application.
+   setnum
+   fontheight ymm div yDisRel mul tAng sin mul /yDist x def
+   { dup textW xDisRel mul tAng cos mul /xDist x def
+     xPos aPos xAng mul add xDist sub
+     yPos aPos yAng mul add yDist sub 3 2 roll textCM } TacExe
+   } def
+/setnumDisRel { % xDisRel yDisRel | - : adjust just a little bit
+   /yDisRel x def /xDisRel x def
+   } def
+1.2 1.2 setnumDisRel % default setting
+% explicit Num routines for rectangular case
+/xNumL { % : numbers on low x axis
+   setnum
+   { fontheight ymm div % conversion -> user_scale
+     dup /xNumHeightL x def
+     -.6 mul yPos add aPos x 3 2 roll textCT } TacExe
+   } def
+/xNumH { % : numbers on high x axis
+   setnum
+   { fontheight ymm div % conversion -> user_scale
+     dup /xNumHeightH x def
+     .6 mul yPos add aPos x 3 2 roll textCB } TacExe
+   } def
+/yNumL { % : numbers on low y axis
+   setnum
+   { fontsize -.3 mul xmm div xPos add aPos 3 2 roll textRM
+     xwidth dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
+     } TacExe
+   } def
+/yNumLD { % : calculate only yNumLength (used for adjustement)
+   setnum
+   { textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
+     } TacExe
+   } def
+/yDumL { % {(..)} yDumL : compare yNumLength with one arg (used for adjustement)
+   setnum
+   textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
+   } def
+/yNumH { % : numbers on high y axis
+   setnum
+   { fontsize .3 mul xmm div xPos add aPos 3 2 roll textLM
+     xwidth dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
+     } TacExe
+   } def
+/yNumHD { % : calculate only yNumLength (used for adjustement)
+   setnum
+   {textW dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
+     } TacExe
+   } def
+/yDumH { % {(..)} yDumH : compare yNumLength with one arg (used for adjustement)
+   setnum
+   textW dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
+   } def
+
+% draw labels
+/xCL { % xlabel | - ; plots coordinate name below the x-axis.
+   setlab
+   aMean xNumHeightL xNumHeightRel neg mul
+   3 -1 roll textCT
+   } def
+/xCH { % xlabel | - ; plots coordinate name above the x-axis.
+   setlab
+   aMean xNumHeightH xNumHeightRel mul 10 add
+   3 -1 roll textCB
+   } def
+/yCL { % ylabel | - ; plots coordinate name to the left of the y-axis.
+   gsave
+      setlab
+      yNumLengthL neg fontsize -.85 mul add % yNumLengthL calculated in yN
+      aMean ym translate
+      0 0 mv
+      90 rotate
+      0 x 0 x textCB
+   grestore
+   } def
+/yCH { % ylabel | - ; plots coordinate name to the right of the y-axis.
+   gsave
+      setlab
+      yNumLengthH fontsize .85 mul add 10 xm add
+      aMean ym translate
+      0 0 mv
+      90 rotate
+      0 x 0 x textCT
+   grestore
+   } def
+/yCF { % ylabel | - ; plots coordinate name *falling* right of the y-axis.
+   gsave
+      setlab
+      yNumLengthH fontsize .85 mul add 10 xm add
+      aMEan ym translate
+      0 0 mv
+      -90 rotate
+      0 x 0 x textCB
+   grestore
+   } def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Data Plotting (Symbols and Curves)                                       %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Initializations:
+
+% asymmetric error bars?
+/err_asy false def % overwrite this if data are quadruples x y d- d+
+
+
+%%  Presets:
+
+% global preset [wups11a: exchanged rad<->lin to conform with pset]
+/SymGSet { % sradglo slinglo serrglo | -
+   /serrglo x def % plot error bars? 0=never, 1=always, 2=as_given_in_pset
+   /slinglo x def % symbol linewidth multiplier
+   /sradglo x def % symbol size multiplier
+   } def
+
+
+%%  Retrieve presets from style array:
+
+/pstyle { pStyles setstyle } def
+/cstyle { cStyles setstyle } def
+/setstyle { % chosen_number array | - : set p or c as predefined in array.
+   dup length % i A n
+   3 2 roll % A n i
+   dup 0 le {
+      pop pop pop ostyle % chosen_number<=0 means: don't plot
+      } {
+      1 sub x % A i-1 n
+      mod get % A(i-1)
+      exec
+      } ifelse
+   } def
+
+
+%% Set plot symbol:
+
+/pset { % styp sfill serr srad slin | -
+   % arg -> symbol linewidth
+   /slin x slinglo mul def
+   % arg -> symbol size
+   /srad x fm 0.16 mul sradglo mul def
+   % arg -> plot error bar?
+   2 serrglo ne { pop serrglo } if % if (serrglo=2) use serr else use serrglo
+   /plot_errorbar x 1 eq { { errorbar } } { { pop pop pop pop } } ifelse def
+   % arg -> fill the symbol? (0=open, 1=full, 2=colored_with_black_border)
+   /sfill x def
+   % adjust srad: it's the _outer_ radius
+   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if
+   % arg -> symbol type
+   /ps {ps_nil} def % default: don't plot (maybe we only want an error bar)
+   dup  1 eq {/ps {ps_square}     def} if
+   dup  2 eq {/ps {ps_diamond}    def} if
+   dup  3 eq {/ps {ps_circle}     def} if
+   dup  4 eq {/ps {ps_triangle}   def} if
+   dup  5 eq {/ps {ps_cedez}      def} if
+   dup  6 eq {/ps {ps_eieruhr}    def} if
+   dup  7 eq {/ps {ps_valve}      def} if
+   dup  8 eq {/ps {ps_tfwd}       def} if
+   dup  9 eq {/ps {ps_tbwd}       def} if
+   dup 10 eq {/ps {ps_pentagram}  def} if
+   dup 11 eq {/ps {ps_plus}       def} if
+   dup 12 eq {/ps {ps_cross}      def} if
+   dup 13 eq {/ps {ps_star}       def} if
+   dup 14 eq {/ps {ps_pentagon}   def} if
+   dup 15 eq {/ps {ps_horiz}      def} if
+   dup 16 eq {/ps {ps_verti}      def} if
+   pop
+   %
+   /t { % x y d[- d+] | -  : plot a symbol and eventually an error bar.
+       err_asy not { dup } if
+       4 copy pop pop plot_symbol
+       plot_errorbar
+      } bind def
+   /ti { t } bind def
+   /tf { t black } bind def
+   } def
+
+
+%%  Set curve:
+
+/lset { % lwidth dashes | -
+   0 setdash
+   dup 0 gt {
+      pt fm setlinewidth
+      % pop error bar and convert frame coord -> paper coord
+      /txy { err_asy { pop } if pop xym } def % x y d[- d+] | x' y'
+      % commands to plot points (can be overwritten by nopoints):
+      /ti { np txy mv } def % x y d[- d+] | - : start curve
+      /t  { txy li }    def % x y d[- d+] | - : continue curve
+      /tf { txy li st } def % x y d[- d+] | - : terminate and plot curve
+      } {
+         ostyle
+      } ifelse
+   } def
+
+
+%%  Plot nothing:
+
+/ostyle { % - | -
+   /ti { nopoint } def
+   /t  { nopoint } def
+   /tf { nopoint } def
+} def
+/nopoint { % x y d[- d+] | -
+   pop pop pop err_asy { pop } if
+} def
+
+
+%%  Plot an asymmetric vertical error bar:
+
+/errorbar { % x y d- d+ | -
+   gsave
+      slin setline
+      3 copy pop pop
+      dup 0 gt x 10 lt and {
+         4 copy
+         x pop add 10. 2 copy gt { x } if pop ym x xm x
+         2 copy x .05 sub x np mv .1 0 rl st
+         np mv
+         pop sub 0. 2 copy lt { x } if pop ym x xm x
+         2 copy lineto st
+         x .05 sub x np mv .1 0 rl st
+         } {
+         pop pop pop pop
+         } ifelse
+      grestore
+} def
+
+
+%%  Plot a data symbol:
+
+/plot_symbol { % x y | -
+    gsave
+       offset
+       srad dup scale
+       slin srad div setline % factor 1/srad compensates "scale"
+       ps % the actual plot symbol, defined by 'pset'
+       grestore
+   } def
+
+/fill_symbol {
+   sfill dup
+      0 eq {
+         pop st
+      } {
+         1 eq {
+            fill
+	 } {
+	    gsave fill grestore
+	    gsave black st grestore
+	 } ifelse
+      } ifelse
+   } def
+
+
+%%  The different symbols, designed for unit area (no arguments):
+
+/ps_nil {
+    } bind def
+
+/ps_square {
+   .5 .5 np mv
+   0 -1 rl
+   -1 0 rl
+   0  1 rl cp fill_symbol
+   } bind def
+
+/ps_diamond {
+   gsave 45 rotate ps_square grestore
+   } bind def
+
+/ps_circle {
+   0 0 np .564 0 360 arc cp fill_symbol
+   } bind def
+
+/ps_triangle {
+   .77 dup dup 90 pol2xy np mv
+   210 pol2xy li
+   330 pol2xy li cp fill_symbol
+   } bind def
+
+/ps_cedez {
+   gsave 180 rotate ps_triangle grestore
+   } bind def
+
+/ps_tfwd {
+   gsave 30 rotate ps_triangle grestore
+   } bind def
+
+/ps_tbwd {
+   gsave 210 rotate ps_triangle grestore
+   } bind def
+
+/ps_eieruhr {
+   -.7 -.7 np mv
+    .7 -.7 li
+   -.7  .7 li
+    .7  .7 li cp fill_symbol
+   } bind def
+
+/ps_valve {
+   gsave 90 rotate ps_eieruhr grestore
+   } bind def
+
+/ps_pentagram {
+   .8 dup dup dup dup
+    90 pol2xy np mv
+   234 pol2xy li
+    18 pol2xy li
+   162 pol2xy li
+   306 pol2xy li cp fill_symbol
+   } bind def
+
+/ps_pentagon {
+   .8 dup dup dup dup
+    18 pol2xy np mv
+    90 pol2xy li
+   162 pol2xy li
+   234 pol2xy li
+   306 pol2xy li cp fill_symbol
+   } bind def
+
+/ps_plus {
+   gsave 45 rotate ps_cross grestore
+   } bind def
+
+/ps_cross {
+   .5 .5 np mv
+   -1 -1 rl st
+  -.5 .5 np mv
+    1 -1 rl st
+   } bind def
+
+/ps_star {
+   .7 dup   0 pol2xy np mv 180 pol2xy li st
+   .7 dup 120 pol2xy np mv 300 pol2xy li st
+   .7 dup 240 pol2xy np mv  60 pol2xy li st
+   } bind def
+
+/ps_horiz {
+   -.7 0 np mv
+   1.4 0 rl st
+   } bind def
+
+/ps_verti {
+   0 -.7 np mv
+   0 1.4 rl st
+   } bind def
+
+
+%%  Set column plotting (use this instead of pset) - BROKEN in 11a or earlier
+
+/setcolumn{ % shift width exec | %
+   % usage: 0 .2 { gsave { .5 setgray fill } grestore cp } setcolumn
+   /colexec x def % what's this ?
+   /colwidth x def
+   /colshift x def
+   /t { % broken - may need rewrite
+      np x colshift add x xym 2 copy mv pop
+      colwidth xm 0 rl
+      colwidth xm add 0 wy ym li
+      colwidth neg xm 0 rl
+      cp colexec
+   } def
+   /ti { t } bind def
+   /tf { t black } bind def
+} def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  List                                                                     %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+/NewList { % xins yins size advance NewList -
+   /nl_advance x def setown /nl_yins x def /nl_xins x def
+   /nl_xshift fontsize xmm div .9 mul def
+   /nl_xrline 0.33 def
+   /nl_ystep fontheight ymm div nl_advance mul def
+   /newline {
+       /nl_yins nl_yins nl_ystep sub def
+      } def
+   /fracline { % frac | -
+      fontheight ymm div nl_advance mul mul /nl_yins x nl_yins x sub def
+      } def
+   } def
+/newlist { 1.65 NewList } def
+/TxLine { % text TxLine -
+   nl_xins nl_yins 3 -1 roll textLM newline
+   } bind def
+/TxCLine { % text TxLine -
+   nl_xins nl_yins 3 -1 roll textCM newline
+   } bind def
+/infline{ % Obsolete since Frida2.1.5
+   oooinfo 1 eq { TxLine } { pop } ifelse
+   } bind def
+/PtTxLine { % pstyle text | -
+   x pstyle
+   nl_xins nl_xshift .5 mul add nl_yins 0 t
+   black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/PttttTxLine { % pstyle text | - %% chain of very small symbols
+   x pstyle
+   nl_xins nl_xshift .10 mul add nl_yins 0 t
+   nl_xins nl_xshift .26 mul add nl_yins 0 t
+   nl_xins nl_xshift .42 mul add nl_yins 0 t
+   nl_xins nl_xshift .58 mul add nl_yins 0 t
+   nl_xins nl_xshift .74 mul add nl_yins 0 t
+   nl_xins nl_xshift .90 mul add nl_yins 0 t
+   black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/PtPtCvTxLine { % pstyle pstyle cstyle text | -
+   4 3 roll pstyle nl_xins nl_yins 0 t
+   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t
+   x cstyle
+   nl_xins nl_xshift 2 mul add
+   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti
+   nl_xshift nl_xrline mul add nl_yins 0 tf
+   nl_xshift add nl_yins 3 2 roll black textLM
+   newline
+   } bind def
+/PtCvTxLine { % pstyle cstyle text | -
+   3 2 roll pstyle nl_xins nl_yins 0 t
+   x cstyle
+   nl_xins nl_xshift 1 mul add
+   dup dup nl_xshift -.33 mul add nl_yins 0 ti
+   nl_xshift 0.33 mul add nl_yins 0 tf
+   nl_xshift add nl_yins 3 2 roll black textLM
+   newline
+   } bind def
+/PtPtTxLine { % pstyle pstyle text | -
+   3 2 roll pstyle nl_xins nl_yins 0 t
+   x pstyle nl_xins nl_xshift add nl_yins 0 t
+   black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/CvTxLine { % cstyle text | -
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf
+   black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/Cv2TxLine { % cstyle text | -
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf
+   black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/PCTxLine { % pstyle(with plset) text | -
+   x pstyle
+   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci
+   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf
+   nl_xins yins 0 t
+   black nl_xins
+      fontsize xmm div 1.9 mul % instead of xshift
+      add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/showfilename { % xins yins size | -
+   setown
+   ooofnam 1 eq { filename textRB } { pop pop } ifelse
+   } def
+/InfSet { % ooofnam oooinfo | - : set on(1) or off(0)
+   /oooinfo x def /ooofnam x def
+   } def
+0 0 InfSet % default setting
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Macro Collection                                                         %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  gray areas (mainly applied with grayval=1 for blank areas) [longtime grey..]
+
+/execOval3 { %  xl xh yl yh dr { proc } | -
+   gsave
+   6 1 roll
+   fm /qqdr x def
+   ym /qqyh x def
+   ym /qqyl x def
+   xm /qqxh x def
+   xm /qqxl x def
+   qqxl qqyl qqdr add np mv
+   qqxl qqyh qqdr sub li
+   qqxl qqdr add qqyh qqdr sub qqdr 180 90 arcn
+   qqxh qqdr sub qqyh li
+   qqxh qqdr sub qqyh qqdr sub qqdr 90 0 arcn
+   qqxh qqyl qqdr add li
+   qqxh qqdr sub qqyl qqdr add qqdr 0 -90 arcn
+   qqxl qqdr add qqyl li
+   qqxl qqdr add qqyl qqdr add qqdr -90 -180 arcn
+   cp exec grestore
+   } def
+/execRect3 { % xl xh yl yh {proc} | -
+   5 1 roll
+   gsave
+   ym /qqyh x def
+   ym /qqyl x def
+   xm /qqxh x def
+   xm /qqxl x def
+   np
+   qqxl qqyl mv
+   qqxh qqyl li
+   qqxh qqyh li
+   qqxl qqyh li
+   cp exec grestore
+   } def
+/execRectangle { % OBSOLETE
+   5 1 roll
+   gsave
+   wy /qqyh x def
+   wy /qqyl x def
+   wx /qqxh x def
+   wx /qqxl x def
+   np
+   qqxl xm qqyl ym mv
+   qqxh xm qqyl ym li
+   qqxh xm qqyh ym li
+   qqxl xm qqyh ym li
+   cp exec grestore
+   } def
+/execHexagon { % xl xh yl yh (all in user coords) {proc} | -
+   5 1 roll
+   gsave
+   wy /qqyh x def
+   wy /qqyl x def
+   wx /qqxh x def
+   wx /qqxl x def
+   /qqdr qqyh qqyl sub 2 div def
+   np
+   qqxl qqdr add qqyl xym mv
+   qqxh qqdr sub qqyl xym li
+   qqxh qqyl qqdr add xym li
+   qqxh qqdr sub qqyh xym li
+   qqxl qqdr add qqyh xym li
+   qqxl qqyl qqdr add xym li
+   cp exec grestore
+   } def
+/coordRectangle { % xl xh yl yh (all in plot coords) {proc} | -
+   5 1 roll
+   gsave
+   /qqyh x def
+   /qqyl x def
+   /qqxh x def
+   /qqxl x def
+   np
+   qqxl xm qqyl ym mv
+   qqxh xm qqyl ym li
+   qqxh xm qqyh ym li
+   qqxl xm qqyh ym li
+   cp exec grestore
+   } def
+
+
+%%  special objects
+
+/pfeilangle 36.87 def
+/pfeilspitze { % x[local] y[local] rot siz
+   % draw with current linestyle, as set e.g. by linsetAxx
+   x 4 2 roll % siz rot x y
+   gsave
+     xym translate 180 add rotate dup dup dup
+     [] 0 setdash
+     pfeilangle cos mul x pfeilangle sin mul np mv
+     0 0 li pfeilangle cos mul x pfeilangle sin neg mul li st
+   grestore
+   } def
+/pfeiL { % (arrow anchored at base) x y rot siz len
+   gsave
+      dup xm x ym mul sqrt % (scale len)
+      5 3 roll
+      xym translate % (origin at base) rot siz len
+      3 2 roll
+      rotate % (draw rightwards) siz len
+      dup 0 translate % (origin at head) siz len
+      x 0 0 0 4 3 roll pfeilspitze % len
+      0 0 np mv neg 0 li st
+   grestore
+   } def
+/Pfeil { % (arrow anchored at head) x y rot siz len
+   dup xm x ym mul sqrt 5 copy
+   pop pfeilspitze
+   x pop
+   x 4 2 roll % len rot x y
+   gsave
+      xym translate 180 add rotate
+      0 0 np mv 0 li st
+   grestore
+   } def
+/pfeil { % (OBSOLETE) x[local] y[local] rot siz len[global]
+   fm 5 copy % not working well
+   pop pfeilspitze
+   x pop
+   x 4 2 roll % len rot x y
+   gsave
+      xym translate 180 add rotate
+      0 0 np mv 0 li st
+   grestore
+   } def
+/pfeil_arcn { % x_cent y_cent radius ang_from ang_to siz
+   gsave
+     6 -2 roll offset
+     4 copy pop 0 0 5 2 roll
+     np arcn st
+     % radius ang_from ang_to siz
+     4 1 roll
+     gsave
+       rotate
+       pop
+       % siz radius
+       0 -90 4 3 roll
+       pfeilspitze
+       grestore
+     grestore
+} def
+
+/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis
+   % the total height of the generated object is y_tot
+   % of which y_knau(.le. y_tot) is for the real knautsch,
+   % the remainder is for vertical prolongations.
+   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def
+   /tmpa x ym tmpy 4 mul sub 2 div def
+   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl
+   tmpx tmpy rl 0 tmpa rl st
+   } def
+/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis
+   setline
+   /spang x def
+   /splng x def
+   /spsep x def
+   2 copy spsep sub gsave offset spang rotate
+      splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
+   spsep add gsave offset spang rotate
+      splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
+   } def
+
+/bemasz { % x y L ang text | - %% precede by '24 setown 1 [] lset /pfeilangle 90 def'
+    gsave
+    5 3 roll offset % consumes x and y
+    x rotate % consumes ang | L text
+    dup textw .5 mul fontheight .4 mul add /bmszDT x def % => half text width
+    0 0 3 2 roll textCM % L
+    .5 mul /bmszDX x def % => half bemasz length
+    bmszDX     0   0 fontheight .67 mul bmszDX bmszDT sub Pfeil
+    bmszDX neg 0 180 fontheight .67 mul bmszDX bmszDT sub Pfeil
+    grestore
+   } def
+
+
+%%  Text composition shortcuts:
+
+/g  { x grec endgr} bind def
+/sb { x subsc endsc} bind def
+/sp { x supsc endsc} bind def
+/sbgr { x grec () subsc endsc () endgr} bind def
+/spgr { x grec () supsc endsc () endgr} bind def
+
+
+%%  Text macros for neutron scattering:
+
+/hbar {
+   showif
+   (h) 1.2 .66 {
+      currentpoint fontheight .11 mul setline np mv
+      fontheight dup .8 mul x .3 mul rl
+      st ()
+      } build
+   } bind def
+/hbarw { hbar () grec (w) endgr } bind def
+/wbar { grec (w) endgr ( / 2) grec (p) endgr } bind def
+/taumean { () (\341t\361) g } bind def
+/Sqw { showif (S\(q,) grec (w) endgr (\)) showif } bind def
+/Sqn { showif (S\(q,) grec (n) endgr (\)) showif } bind def
+/SQw { showif (S\(Q,) grec (w) endgr (\)) showif } bind def
+/Sttw { showif (S\(2) grec (q) endgr (,) grec (w) endgr (\)) showif } bind def
+/Sttn { showif (S\(2) grec (q) endgr (,) grec (n) endgr (\)) showif } bind def
+/Xqw { grec (c) endgr (''\(q,) grec (w) endgr (\)) showif } bind def
+/Xqn { grec (c) endgr (''\(q,) grec (n) endgr (\)) showif } bind def
+/ueV{ grec (m) endgr (eV) showif} bind def
+/inueV { showif (\() grec (m) endgr (eV\)) showif } bind def
+/inmeVr { showif (\(meV) supsc (-1) endsc (\)) showif } bind def
+/inueVr { showif (\() grec (m) endgr (eV)
+          supsc (-1) endsc (\)) showif } bind def
+/inGHzr { showif (\(GHz) (-1) sp (\)) showif } def
+
+%% home-made Angstr is obsolete; use \305 (more reliable than Ã…)
+/Angstr {
+   showif
+   (A) .5 1.23 {
+      currentpoint fontheight .1 mul setline np
+      fontheight .14 mul 0 360 arc st ()
+   } build
+} bind def
+/Angr { showif (\305) supsc (-1) endsc } bind def
+/inAngr { showif (\() Angr (\)) showif } bind def
+/Angrr { showif (\305) supsc (-2) endsc } bind def
+/inAngrr { showif (\() Angrr (\)) showif } bind def
+/wmin {grec (w) endgr () subsc (min) endsc} def
+/winpi { grec (w) endgr ( / 2) grec (p) endgr } def
+/Celsius { showif (\26x)g(C) showif } bind def
+
+
+%%  More shortcuts for impatient users:
+
+/L { langSel } bind def
+/G { gsave exec grestore } bind def
+/gs { gsave } bind def
+/gr { grestore } bind def
+
+end % WuGdict...
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Mark "ewu", the end of the wups.. macro definition file                  %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+WuGdict11a begin
+setPalatino
+
+1.5 dup autolabel defsiz
+1 dup stdred
+2 -40 setnewpage newpage
+
+/Ecolor    {255   0  83 setRGBcolor } def
+/darkgreen { 13 133  13 setRGBcolor } def
+/litegreen {202 253 222 setRGBcolor } def
+/darkblue  { 13  13 133 setRGBcolor } def
+/liteblue  {202 202 255 setRGBcolor } def
+/darkbrown {215 175 135 setRGBcolor } def
+/litebrown {235 205 175 setRGBcolor } def
+
+% /execRect3 { % xl xh yl yh {proc} | -
+
+/xd     52 def
+/yd     10 def
+/b0    45.8 def
+
+
+/H 6 def
+/L 44 def
+
+/DOT { .4 0 360 np arc cp fill } def
+
+/Sample {
+    % Layers
+    litebrown  0 L H -1 mul H  0 mul { fill } execRect3
+    darkbrown  0 L H -2 mul H -1 mul { fill } execRect3
+    % Source
+    24 setbol black
+    { 4 H -.5 mul offset 0 0 DOT -2 0 {(S)} textCM } G
+} def
+
+black 32 setown 0 15 {((a))} textLM
+Sample
+% Detector
+{ xd yd offset 0 0 DOT 2 0 {(D)} textCM } G
+% Main part
+darkblue
+4 [] lset
+     4     -3 np mv
+  24.5      0 li
+st
+  24.5      0      20 .8   21.3 pfeiL
+
+3 [] lset
+     4     -3 np mv
+    13     -6 li
+  31.1      0 li
+st
+  31.1      0    25.6 .8   15.1 pfeiL
+
+3 [] lset
+     4     -3 np mv
+  10.3      0 li
+  22.8     -6 li
+  35.4      0 li
+st
+  35.4      0      31 .8   11.4 pfeiL
+
+2 [] lset
+     4     -3 np mv
+  8.89     -6 li
+  18.7      0 li
+  28.4     -6 li
+  38.2      0 li
+st
+  38.2      0    35.9 .8   9.04 pfeiL
+
+2 [] lset
+     4     -3 np mv
+  8.46     -6 li
+  19.4    -12 li
+  30.3     -6 li
+  39.2      0 li
+st
+  39.2      0      38 .8   8.26 pfeiL
+
+1 [] lset
+     4     -3 np mv
+  7.19     -6 li
+  14.4    -12 li
+  21.6     -6 li
+  28.8    -12 li
+    36     -6 li
+  42.4      0 li
+st
+  42.4      0    46.2 .8   5.85 pfeiL
+
+1 [] lset
+     4     -3 np mv
+   7.3     -6 li
+  14.8    -12 li
+  22.3     -6 li
+  28.9      0 li
+  35.5     -6 li
+  42.1      0 li
+st
+  42.1      0    45.3 .8   6.06 pfeiL
+
+
+
+60 0 offset
+black 32 setown 0 15 {((b))} textLM
+Sample
+xd 3 add yd {(D)} textCM
+3 [] lset xd yd b0 1.2 5 pfeiL
+darkblue
+4 [] lset
+     4     -3 np mv
+  7.24      0 li
+st
+  7.24      0    45.8 .8      7 pfeiL
+
+3 [] lset
+     4     -3 np mv
+  7.24     -6 li
+  13.7      0 li
+st
+  13.7      0    45.8 .8      7 pfeiL
+
+3 [] lset
+     4     -3 np mv
+  7.24      0 li
+  13.7     -6 li
+  20.2      0 li
+st
+  20.2      0    45.8 .8      7 pfeiL
+
+2 [] lset
+     4     -3 np mv
+  7.24     -6 li
+  13.7      0 li
+  20.2     -6 li
+  26.7      0 li
+st
+  26.7      0    45.8 .8      7 pfeiL
+
+2 [] lset
+     4     -3 np mv
+  7.24     -6 li
+  14.6    -12 li
+  21.9     -6 li
+  28.4      0 li
+st
+  28.4      0    45.8 .8      7 pfeiL
+
+1 [] lset
+     4     -3 np mv
+  7.24     -6 li
+  14.6    -12 li
+  21.9     -6 li
+  29.2    -12 li
+  36.6     -6 li
+  43.1      0 li
+st
+  43.1      0    45.8 .8      7 pfeiL
+
+1 [] lset
+     4     -3 np mv
+  7.24     -6 li
+  14.6    -12 li
+  21.9     -6 li
+  28.4      0 li
+  34.9     -6 li
+  41.3      0 li
+st
+  41.3      0    45.8 .8      7 pfeiL
+
+
+
+showpage
+end % WuGdict...
diff --git a/Doc/UserManual/fig/drawing/Green1.ps.in b/Doc/UserManual/fig/drawing/Green1.ps.in
new file mode 100644
index 0000000000000000000000000000000000000000..e65eaa388b428ccfe50176017ecf74990e1e42f0
--- /dev/null
+++ b/Doc/UserManual/fig/drawing/Green1.ps.in
@@ -0,0 +1,1648 @@
+%!PS-Adobe-1.0 EPSF-1.0
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  FRIDA: fast reliable interactive data analysis                           %%
+%%  wups11a.ps: graphic macros                                               %%
+%%  (C) Joachim Wuttke 1990-2016                                             %%
+%%  http://www.messen-und-deuten.de/frida                                    %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%  Sections:
+%   - Programming, Page Formatting, Coordinate Transforms
+%   - Colors
+%   - Fonts and Text Blocks
+%   - Coordinate Frame
+%   - Data Plotting (Symbols and Curves)
+%   - Lists
+%   - Macro Collection
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Programming, Page Formatting, Coordinate Transforms                      %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Framework:
+
+% For interleaving applications, isolate what follows in a dictionary
+/WuGdict11a 400 dict def
+WuGdict11a begin
+
+
+%%  Shortcuts:
+
+/np { newpath }   bind def
+/mv { moveto }    bind def
+/rm { rmoveto }   bind def
+/rl { rlineto }   bind def
+/li { lineto }    bind def
+/cp { closepath } bind def
+/st { stroke }    bind def
+/x  { exch }      bind def
+
+/black { 0 setgray } bind def
+/white { 1 setgray } bind def
+
+/F false def
+/T true  def
+
+
+%%  Constants:
+
+/pt {  .018567 mul} bind def % for line widths and font sizes, reason unclear
+/cm {28.346456 mul} bind def % typographic_point -> cm
+
+/twopi { 6.2831853072 } def
+
+
+%%  Math operators:
+
+/rnd  { rand cvr 1 30 bitshift div 2 div 0 max 1 min } def % -> between 0 and 1
+
+/min { 2 copy gt { x } if pop } def
+/max { 2 copy lt { x } if pop } def
+
+/tan { dup sin x cos div } def
+/cot { dup cos x sin div } def
+/pol2xy{ 2 copy cos mul 3 1 roll sin mul } def % r phi | x y
+
+/eexp { 2.71828 x exp } def % "exp" is x^y, eexp is e^x
+/tanh { 2.71828 x 2 copy exp 3 1 roll neg exp
+        2 copy sub 3 1 roll add div } def
+
+
+%%  Page layout and global figure size:
+
+% shift origin
+%    The PostScript coordinate system starts in the lower left corner
+%    of the page, whereas we want our figures to be justified in the
+%    upper left corner.  Therefore we need a vertical translation,
+%    depending on the paper size.  A4 is 210x297 mm^2.  By this occasion,
+%    we also provide a border of 7 mm.
+/cmtranslate { % x y cmtranslate | -
+   cm x cm x translate } bind def
+/originUpperLeft_A4{ .7 28.3 cmtranslate } bind def
+/goffsetA4 { ungscale originUpperLeft_A4 gscale } def
+/EdgeLeftDIN{ originUpperLeft_A4 } bind def % OBSOLETE since 11a
+
+% set absolute global scale and relative symbol size
+/defsiz { % size(cm) symbolsize(rel) | -
+   /ftot x def
+   /gsiz x cm 10 div def
+   gscale % within 'size', coordinates run from 0 to 10
+   } def
+/gscale {
+   gsiz dup scale
+} def
+/ungscale {
+   1 gsiz div dup scale
+} def
+
+% symbol (and label?) size as sublinear function of figure size
+/autolabel { % size(cm) | symbolsize(rel)
+   dup 7 div 2 add 4 mul % the simplest sublinear increase
+   x div % anticipate overall rescaling
+   } def
+
+
+%%  Frame size and shape, frame coordinates:
+
+% aspect ratios
+/gyld {0.447214 mul} bind def /Gyld {0.447214 div} bind def % sqrt(5)
+/guld {0.547723 mul} bind def /Guld {0.547723 div} bind def % sqrt(3)
+/gold {0.618034 mul} bind def /Gold {0.618034 div} bind def % goldener Schnitt
+/gild {0.707107 mul} bind def /Gild {0.707107 div} bind def % sqrt(2) : DIN
+/geld {0.759836 mul} bind def /Geld {0.759836 div} bind def % sqrt(sqrt(3))
+/gald {0.817765 mul} bind def /Gald {0.817765 div} bind def % sqrt sqrt sqrt 5
+
+% define frame coordinates
+/defred { % x_reduction y_reduction label_reduction | -
+   /fmm x ftot mul def
+   /ymm x def
+   /xmm x def
+
+   % conversion frame_coordinate -> global_coord
+   /xm {xmm mul} bind def
+   /ym {ymm mul} bind def
+   /fm {fmm mul} bind def
+   /xym {ym x xm x} bind def
+
+   % prefer rescaling over explicit conversion (make more use of this !)
+   /mmscale { xmm ymm scale } bind def
+   /mmunscale { 1 xmm div 1 ymm div scale } bind def
+
+   % graphic commands in frame coordinates
+   /offset { xym translate } bind def
+   /currentxy { currentpoint ymm div x xmm div x } bind def
+   /setline { pt fm setlinewidth [] 0 setdash } bind def
+   } def
+
+/stdred { % x_reduction y_reduction | -
+   2 copy mul sqrt defred
+   } def
+
+%%  World (= user application) coordinates:
+
+% user must declare x and y range
+/xSetCoord { % log min max | -
+   /wxmax x def
+   /wxmin x def
+   /wxlog x 0 eq not def
+   % prepare conversion world coord -> frame coord
+   /wxdel wxmax wxmin wxlog { div log } { sub } ifelse def
+   /wxd { % dx(world) | dx(frame)
+      wxlog { log } if wxdel div 10 mul
+      } bind def
+   /wx { % x(world) | x(frame)
+      wxmin wxlog { div } { sub } ifelse
+      wxd
+      } bind def
+   } def
+/ySetCoord { % log min max | -
+   /wymax x def
+   /wymin x def
+   /wylog x 0 eq not def
+   /wydel wymax wymin wylog { div log } { sub } ifelse def
+   /wyd { % dy(world) | dy(frame)
+      wylog { log } if wydel div 10 mul
+      } bind def
+   /wy { % y(world) | y(frame)
+      wymin wylog { div } { sub } ifelse
+      wyd
+      } bind def
+   } def
+
+% pair conversion
+/wxy { % x,y(world) -> x,y(frame)
+   wy x wx x
+   } def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Colors                                                                   %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Color operators:
+
+/setRGBcolor {
+   3 { 255 div 3 1 roll } repeat setrgbcolor
+   } def
+
+/colormix { % weight(0..1) col1(R|G|B) col2(R|G|B) | col(R|G|B)
+   7 -1 roll dup /weightA x def /weightB x 1 x sub def
+   4 -1 roll weightA mul x weightB mul add 5 1 roll
+   3 -1 roll weightA mul x weightB mul add 4 1 roll
+   2 -1 roll weightA mul x weightB mul add 3 1 roll
+   } def
+
+/relcol { % i_col n_col | rel(0..1) : for one-dimensional choices
+   1 sub div 0 max 1 min
+   } def
+
+
+%%  Named colors:
+
+/siemensorange { 255 153   0 setRGBcolor } bind def
+/siemensblue   { 0   102 153 setRGBcolor } bind def
+/siemenstext   {   0  51 102 setRGBcolor } bind def
+/siemensred    { 165   0  33 setRGBcolor } bind def
+/siemenspink   { 221 102 102 setRGBcolor } bind def
+/siemensgrey   { 221 221 221 setRGBcolor } bind def
+/siemensdark   { 102 102 102 setRGBcolor } bind def
+/siemensgreen  {  33 153 102 setRGBcolor } bind def
+/siemensyellow { 255 221   0 setRGBcolor } bind def
+
+/red           { 255   0   0 setRGBcolor } bind def
+
+
+%%  One-dimensional linear color choices:
+
+/iCol1 { % i i_max | - : default -2010, round the circle, RGBR
+   relcol dup 1 x % rel 1 rel
+   360 mul 255 add cos 1 add dup mul neg .053 mul 1 add % modulate saturation
+   sethsbcolor
+   } def
+/iCol2 { % i i_max | - : cyan  - yellow - magenta
+   relcol 3 mul
+   dup 1 le {
+      dup 1 sub neg 0 3 2 roll } {
+      dup 2 le {
+         1 sub dup 1 sub neg 0 3 1 roll } {
+         2 sub dup 1 sub neg 0 3 0 roll } ifelse
+      } ifelse
+   0 setcmykcolor
+   } def
+/iCol3 { % i i_max | - : siemens
+   div /icnow x def
+   165 1 icnow sub mul
+   102   icnow     mul
+    33 120 icnow mul add setRGBcolor
+   } def
+/iCol4 { % i i_max | - : red to blue (subsequence of old scheme iCol1)
+   relcol
+   3 x sub 3 div 1 iCol1
+   } def
+
+
+%%  One-dimensional color choice from given array:
+
+/iColA { % i i_max arr | -
+   /aCol x def
+   relcol
+   aCol length 1 sub mul % position within array
+   dup cvi dup 3 1 roll % idx pos idx
+   sub x % offset idx
+   0 max aCol length 1 sub min % offset safe_idx
+   dup 1 add aCol length 1 sub min % offset i i+1
+   aCol x get exec
+   4 3 roll aCol x get exec colormix setRGBcolor
+   } def
+
+
+%% Color arrays for non-linear one-dimensional choices:
+
+/aCol1 [ % red-blue
+   { 255   0   0 } %  1
+   { 240  10  10 } %  2
+   { 220  40  40 } %  3
+   { 205  65  90 } %  4
+   { 195  80 130 } %  5
+   { 180 110 180 } %  6
+   { 165 120 185 } %  7
+   { 150 130 190 } %  8
+   { 130 150 210 } %  9
+   { 110 125 220 } % 10
+   {  85 105 230 } % 11
+   {  70  90 255 } % 12
+   {   0   0 255 } % 13
+   ] def
+/aCol2 [ % orange-red-blue-darkblue
+   { 255 180   0 } %  1
+   { 255 160   0 } %  1
+   { 255 120   0 } %  2
+   { 255  70   0 } %  3
+   { 255   0   0 } %  4
+   { 220  30  30 } %  5
+   { 220  70  60 } %  6
+   { 220 100 110 } %  7
+   { 200 130 130 } %  8
+   { 200 130 160 } %  9
+   { 180 110 180 } % 10
+   { 165 110 185 } % 11
+   { 150 130 190 } % 12
+   { 130 150 210 } % 13
+   { 100 120 220 } % 14
+   {  85 105 230 } % 15
+   {  70  90 255 } % 16
+   {   0   0 255 } % 17
+   {   0   0 180 } % 18
+   {  10  10 150 } % 19
+   {  30  30 130 } % 20
+   ] def
+/aCol3 [ % [fixed size: 9] siemenscolors
+   { 165   0  33 } % siemensred
+   {  33 153 102 } % siemensgreen
+   { 0   102 153 } % siemensblue
+   {   0  51 102 } % siemenstext
+   { 255 153   0 } % siemensorange
+   { 102 102 102 } % siemensdark
+   { 255 221   0 } % siemensyellow
+   { 221 221 221 } % siemensgrey
+   { 221 102 102 } % siemenspink
+   ] def
+/aCol4 [ % green-blue-brown
+   { 120 160  60 }
+   {  90 185  40 }
+   {  50 215  20 }
+   {   0 245   0 }
+   {  10 235 112 }
+   {  20 235 143 }
+   {  30 230 173 }
+   {  40 225 194 }
+   {  50 205 215 }
+   {  40 153 204 }
+   {  40 102 153 }
+   {  40  82 122 }
+   {  90  74 101 }
+   { 140  68  80 }
+   { 170  59  60 }
+   { 190  50  40 }
+   { 180  65  40 }
+   { 160  80  40 }
+   { 140 100  40 }
+   { 120  80  30 }
+   { 100  60  20 }
+   ] def
+/aCol5 [ % [fixed size: 8] gnuplot default (see man gnuplot and rgb.txt)
+   { 255   0   0 } % red
+   {   0 255   0 } % green
+   {   0   0 255 } % blue
+   { 255   0 255 } % magenta
+   {   0 255 255 } % cyan
+   { 160  82  45 } % sienna
+   { 255 165   0 } % orange
+   { 255 127  80 } % coral
+   ] def
+
+
+%%  Specialized ifelse, depending on pcol / ccol - OBSOLETE since 11a:
+
+/ifpcol { % proc1 proc2 | -
+   pcol 0 eq { pop exec } { exec pop} ifelse % 3 1 roll ifelse
+   } def
+/ifccol { % proc1 proc2 | -
+   ccol 0 eq { pop exec } { exec pop} ifelse % 3 1 roll ifelse
+   } def
+
+
+%%  old-style colors round the circle - OBSOLETE since 10a:
+
+% global preset
+/pColSet { % col ncol | -
+   /npcol x def % # different colours
+   /pcol  x def % colours off/on
+   } def
+/cColSet { % col ncol | -
+   /nccol x def % # different colours
+   /ccol  x def % colours off/on
+   } def
+% default setting
+0 3 pColSet % default setting
+0 3 cColSet % default setting
+% now defined locally in g3.ps
+/ipCol { 100 iCol1 } def
+/icCol { 100 iCol1 } def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Fonts and Text Blocks                                                    %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Prepare standard fonts:
+
+% extend font encoding
+/ReEncode { % OldFont NewFont Encoding | -
+   /MyEncoding x def
+   x findfont % select OldFont
+   dup length dict begin
+      {def} forall
+      /Encoding MyEncoding def
+      currentdict
+      end
+   definefont % define as NewFont
+   } def
+
+% we assume that image scripts are Latin1 encoded
+/Helvetica             /MyFont             ISOLatin1Encoding ReEncode
+/Helvetica-Oblique     /MyFont-Oblique     ISOLatin1Encoding ReEncode
+/Helvetica-Bold        /MyFont-Bold        ISOLatin1Encoding ReEncode
+/Helvetica-BoldOblique /MyFont-BoldOblique ISOLatin1Encoding ReEncode
+
+/setPalatino {
+/Palatino             /MyFont             ISOLatin1Encoding ReEncode
+/Palatino-Italic      /MyFont-Oblique     ISOLatin1Encoding ReEncode
+/Palatino-Bold        /MyFont-Bold        ISOLatin1Encoding ReEncode
+/Palatino-BoldItalic  /MyFont-BoldOblique ISOLatin1Encoding ReEncode
+} def
+
+%% Preset standard styles:
+
+% scale and set font; define fontsize, fontheight
+/setfontandsize { % font size | -
+   dup 0 le { pop 100 } if % fontsize <= 0 not allowed !
+   /fontnonnil true def
+   pt fm dup /fontsize x def
+   x findfont
+   x scalefont
+   setfont
+   gsave % determine fontheight - from the cookbook :
+      np 0 0 mv (1) true charpath flattenpath
+      pathbbox  % low_left_x, low_left_y, up_right_x, up_right_y
+      x pop x pop x pop
+      /fontheight x def
+      grestore
+   } def
+
+% standard settings for labelling axes
+/setnum { /MyFont            24 setfontandsize } def
+/setlab { /MyFont            24 setfontandsize } def
+
+% user commands (free choice of fontsize, but fixed font family)
+/setown { /MyFont             x setfontandsize } def
+/setbol { /MyFont-Bold        x setfontandsize } def
+/setboq { /MyFont-BoldOblique x setfontandsize } def
+/setobl { /MyFont-Oblique     x setfontandsize } def
+
+
+%%  String treatment:
+
+/showif { % string | - : increment xwidth or plot string
+   prepare
+      { stringwidth pop xwidth add /xwidth x def }
+      { show }
+   ifelse
+   } def
+/script { % matrix relpos_y | -
+   /yoffset x fontheight mul def
+   currentfont x makefont setfont
+   0 yoffset rm
+   } def
+/scred .71 def
+/subsc {
+   showif
+   [scred 0 0 scred 0 0] -.2 script
+   } def
+/supsc {
+   showif
+   [scred 0 0 scred 0 0] .6 script
+   } def
+/endsc {
+   showif
+   regularfont setfont
+   0 yoffset neg rm
+   } def
+/grec {
+   showif
+   /Symbol findfont fontsize scalefont setfont
+   } def
+/endgr {
+   showif
+   regularfont setfont
+   } def
+/endall {
+   showif
+   regularfont setfont
+   } def
+/build { % string xrel yrel obj | - : plot obj above/below string
+   /obj x def /yrelbui x def /xrelbui x def
+   dup showif
+   prepare
+      { pop }
+      { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
+        currentpoint 4 2 roll % save position after string
+      rm obj pop       % obj must end with () that will be pop'ed
+      mv               % back to saved position
+      }
+   ifelse
+   } def
+/gbuild { % string xrel yrel obj | - : plot obj above/below string
+   /obj x def /yrelbui x def /xrelbui x def
+   /Symbol findfont fontsize scalefont setfont
+   dup showif
+   prepare
+      { pop regularfont setfont }
+      { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
+        currentpoint 4 2 roll % save position after string
+        regularfont setfont
+      rm obj pop       % obj must end with () that will be pop'ed
+      mv               % back to saved position
+      }
+   ifelse
+   } def
+/hut { % ..) (<Char>) hut (..            %%%  MISERABEL PROGRAMMIERT
+   x showif
+   1.4 .6 {(\136) show ()} build
+   } def
+/ghut { % ..) (<grec-Char>) ghut (..      %%%  BREITE PASST NUR FUER Phi(t)
+   x showif
+   .8 .65 {(\136) show ()} gbuild
+   } def
+/tilde {
+   x showif
+   1. .6 {(~) show ()} build
+   } def
+/gtilde {
+   x showif
+   1. .6 {(~) show ()} gbuild
+   } def
+/spce { % string n spce - ; insert n times ( )
+   {showif (  )} repeat
+   } def
+
+% the following macros use the symbol/curve plotting mechanism
+/pins { % string symins - ; symbol must be selected by pset
+   showif
+   ( ) showif ( ) .5 .5 { currentxy 0 p black ()} build ( ) showif
+   } def
+/clenins { % string len clenins - ; curve must be selected by cset
+   x showif % I suppose that pins is preceeded by 8 spaces
+   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def
+            % length of inserted curve :
+            % -1 space : curve begins and ends in  middle of ( )
+            % +3 spaces: pins requires 3 times ( )
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
+   2 add {( ) showif} repeat
+   } def
+/cins { % string symins - ; curve must be selected by cset
+   showif 8 % I suppose that pins is preceeded by 8 spaces
+   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div 10 div def
+   % nov03, ohne zu verstehen, "10 div" eingefuegt
+            % length of inserted curve :
+            % -1 space : curve begins and ends in  middle of ( )
+            % +3 spaces: pins requires 3 times ( )
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
+   2 add {( ) showif} repeat
+   } def
+
+/block { % x y ob xrel yrel | -
+   /yrel x def /xrel x def /blabla x def
+    /ypos x ym def /xpos x xm def
+   /regularfont currentfont def /yoffset 0 def % initialize for security
+   /prepare true def /xwidth 0 def 0 0 mv % to prevent empty-path-error
+    blabla endall % first pass : determine xwidth
+   boxif { /boxwidth  xwidth (M) stringwidth pop boxxr mul 2 mul add def
+           /boxheight fontheight 1 boxyr 2 mul add mul def
+           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub
+           ypos fontheight .5 boxyr add mul sub mv
+           boxwidth 0 rl 0 boxheight rl boxwidth neg 0 rl cp
+           boxproc
+    } if
+    xpos xwidth xrel mul sub ypos fontheight yrel mul sub mv
+    /prepare false def
+    blabla endall % second pass : plot
+   /boxif false def
+   } def
+/rblock { % x y ang ob proc rblock -
+   5 3 roll
+   gsave
+      xym translate
+      3 2 roll rotate
+      0 0 4 2 roll exec
+      grestore
+   } def
+
+/Box { % x y {exe}
+   /boxif true def
+   /boxproc x def /boxyr x def /boxxr x def
+   } def
+/nBox { .6 .6 3 2 roll Box } def
+/boxif false def
+/textW { % obj | length : calculate only length.
+   /blabla x def
+   /regularfont currentfont def /yoffset 0 def % initialize for security
+   /prepare true def /xwidth 0 def 0 0 mv % to prevent empty-path-error
+   blabla endall
+   xwidth % has been determined
+   } def
+/textw { % obj | y : dito, in 0..10-units
+   textW xmm div
+   } def
+
+% horizontal text: x y ob | -
+/textLB { 0. 0. block } bind def
+/textCB { .5 0. block } bind def
+/textRB { 1. 0. block } bind def
+/textLM { 0. .5 block } bind def
+/textCM { .5 .5 block } bind def
+/textRM { 1. .5 block } bind def
+/textLT { 0. 1. block } bind def
+/textCT { .5 1. block } bind def
+/textRT { 1. 1. block } bind def
+
+% rotated text: x y ang ob | -
+/rtextLB { {textLB} rblock } bind def
+/rtextLM { {textLM} rblock } bind def
+/rtextRB { {textRB} rblock } bind def
+/rtextRM { {textRM} rblock } bind def
+/rtextCM { {textCM} rblock } bind def
+
+
+%%  Language selection:
+
+% preset
+/language { % choose_this of_so_many | - % select current language
+   /langMax x def
+   /langChc x def
+   } def
+1 1 language % default
+% choose text from sequence
+/langSel { % text_1 .. text_M | text_C : choose text, M=langMax, C=langChc
+   langMax dup langChc sub 1 add roll
+   langMax 1 sub { pop } repeat
+   } def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Coordinate Frame                                                         %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Layout presets:
+
+/xyTicLen {0.10 fm} def
+/xyTacLen {0.20 fm} def
+/txllen {0.20 fm} def
+/tyllen {0.20 fm} def
+/linsetAxx {black 0.7 setline} def
+/linsetTic {black 0.7 setline} def
+/linsetTac {black 0.7 setline} def
+/linsetGri {black 0.4 setline} def
+
+%%  Start-up commands:
+
+/Resets {
+   /yNumLengthL 0 def /yNumLengthH 0 def
+   /xNumHeightL .3 def /xNumHeightH 0 def
+   /xNumHeightRel 2.4 def
+   /aMean 5 def
+   /xPlotFrame {} def
+   /yPlotFrame {} def
+   /zPlotFrame {} def
+   black
+   } def
+/BoxBackground {
+   0 0 10 10 boxit gsave setboxbackgroundcolor fill grestore
+} def
+/setboxbackgroundcolor { white } def
+
+
+%%  Some more presets for g3.ps:
+
+/iFrame 0 def
+
+/setnewpage { % xoff yoff
+  /yoffnewpage x def
+  /xoffnewpage x def
+} def
+/newpage {
+  goffsetA4
+  xoffnewpage yoffnewpage offset
+} def
+/setpagegrid { % ncol nrow xoffnewframe yoffnewframe
+  /yoffnewframe x def
+  /xoffnewframe x def
+  /nrowpage x def
+  /ncolpage x def
+} def
+/nextFrame {
+  /iFrame iFrame 1 add def
+  iFrame nrowpage ncolpage mul mod 0 eq {
+    showpage gscale newpage
+  } {
+    iFrame ncolpage mod 0 eq {
+      xoffnewframe ncolpage 1 sub neg mul yoffnewframe offset
+    } {
+      xoffnewframe 0 offset
+    } ifelse
+  } ifelse
+} def
+
+
+/zValues { pop pop } def
+/plotafter {} def
+/whiteframe { 1 0 0 10 10 graybox } def
+/plotframes { xPlotFrame yPlotFrame } def
+/plotbefore { plotframes } def
+
+/abc {abclab setown abcx abcy 3 2 roll textCM} def % usage ((a)) abc
+/abcset { % x y siz abcset - : preset for abc
+   /abclab x def /abcy x def /abcx x def
+   } def
+
+
+%%  Ticks:
+
+% set tick array - internal macros
+/tiputs { % rel_pos_of_tick | pos_of_tick : innermost routine for /taproc
+   tastep mul taloop add
+   } def
+/taproclin { % (#tick/tack) | - : define /taproc for use in SetVec
+   1 x div /tistep x def
+   /taproc { 0 tistep .999 { tiputs } for } def
+   } def
+/taproclog { % (#ticks/tacks) | - : define /taproc for use in SetVec
+      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def
+   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def
+   }{ dup 0 gt { pop /taproc { 0 tiputs } def
+   }{            neg taproclin
+   } ifelse } ifelse } ifelse
+   } def
+/SetVec { % tafro tatoo nta /vector | - : set /vector
+   4 1 roll
+   /nta x def /tatoo x def /tafro x def
+   /tastep tatoo tafro sub nta 1 sub div def
+   [
+      0 1 nta {
+         tastep mul tafro add /taloop x def
+         taproc exec
+         } for
+      ] def
+   } def
+% set tick array - user commands
+/SetTicVecLin { taproclin /TicVec SetVec } def
+/SetTicVecLog { taproclog /TicVec SetVec } def
+
+% set tack-and-number array
+/SetTacVec { % [ pos {label} pos {label} ... ] | -
+   /TacVec x def
+   } def
+
+% define axes
+   % note on angles : 0 = x-axis, 90 = y-axis
+/OneAxx { % fro to xpos ypos aang tang | - : presets for Axx, Tic, Tac, Num
+   % store arguments
+   /tAng x def /aAng x def
+   /yPos x def /xPos x def
+   /aTo x def /aFro x def
+   % set constants
+   /xTicLen tAng cos xyTicLen mul def /yTicLen tAng sin xyTicLen mul def
+   /xTacLen tAng cos xyTacLen mul def /yTacLen tAng sin xyTacLen mul def
+   /xAng aAng cos def /yAng aAng sin def
+   /aMean aFro aTo add 2 div def
+   /aArr false def
+   } def
+/ArrAxx { % label <args of OneAxx> | - : axis with arrow
+   OneAxx
+   /aLab x def
+   /aArr true def
+   } def
+
+% draw axis (with parameters preset by OneAxx or ArrAxx)
+/Axx { % - | -
+   linsetAxx
+   gsave
+      xPos yPos offset
+      mmscale
+      aAng rotate
+      % draw a line
+      aFro 0 np mv
+      aTo  0 li st
+      % draw an arrow and a label, if requested
+      aArr {
+         gsave
+            aTo 0 offset
+            aAng neg rotate
+            mmunscale
+            aAng rotate
+            0 0 0 .3 pfeilspitze % draw an arrow
+            .3 0 offset
+            aAng neg rotate
+            setlab
+            aAng 45 le
+               { 0 -.8 xNumHeightL sub aLab textRT }
+               { 0  .2 aLab textCB }
+               ifelse
+           grestore
+         } if
+      grestore
+   } def
+
+% draw ticks (positions given by SetTicVec, parameters preset by OneAxx/..)
+/Tic { % - | - : draw tick as defined in TicProc
+   linsetTic
+   TicVec {
+      dup dup aFro lt x aTo gt or {pop} {TicProc} ifelse
+      } forall
+   } def
+/TicProc { % aPos | - : default procedure to plot one tick
+   np
+   xPos yPos xym mv
+   dup xAng mul x yAng mul xym rm % eat argument, go to start pos.
+   xTicLen yTicLen rl st
+   } def
+/xGric { % yFro yTo | - : draw a grid line (instead of an x tick)
+   linsetGri
+   TicVec {
+      3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
+         dup % y1 y2 x x
+         4 -1 roll xym np mv % y2 x
+         x xym li st
+         } ifelse
+      } forall
+   pop pop
+   } def
+/yGric { % xFro xTo | - : draw a grid line (instead of an y tick)
+   linsetGri
+   TicVec {
+      3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
+         dup % x1 x2 y y
+         4 -1 roll x xym np mv % x2 y
+         xym li st
+         } ifelse
+      } forall
+   pop pop
+   } def
+
+% draw tacks (positions given by SetTacVec, parameters preset by OneAxx/..)
+/TacExe { % Proc | - % Execute Proc for all pairs of elements of TacVec
+                     % (but only if inside aFro..aTo)
+   /TacProc x def
+   /ispair true def % toggle: take pos, take label, take pos, take label ...
+   TacVec {
+      ispair
+         {
+            /aPos x def
+            /ispair false def
+         } {
+            aPos dup aFro lt x aTo gt or
+            {pop} {TacProc} ifelse
+            /ispair true def
+         } ifelse
+      } forall
+   } def
+/Tac {
+   linsetTac
+   { pop xPos yPos xym mv
+      aPos dup xAng mul x yAng mul xym rm
+      xTacLen yTacLen rl st
+      } TacExe
+   } def
+% unnecessary optimisation by specialisation: OBSOLETE since 11a
+/xTacL { Tac } def
+/xTacH { Tac } def
+/yTacL { Tac } def
+/yTacH { Tac } def
+% special tack routines, only for rectangular axes
+/xTacC { % : centered tack on x axis
+   linsetTac
+   { pop aPos xm yPos ym txllen 2 div sub np mv 0 txllen rl st } TacExe
+   } def
+/xGrid { % : rule instead of tack on x axis
+   linsetTac
+   { pop aPos xm np yPos ym mv 0 10 xym rl st } TacExe
+   } def
+/yTacC { % : centered tack on y axis
+   linsetTac
+   { pop xPos xm tyllen 2 div sub aPos ym np mv tyllen 0 rl st } TacExe
+   } def
+/yGrid { % : rule instead of tack on low y axis
+   linsetTac
+   { pop aPos ym np xPos xm x mv 10 0 xym rl st } TacExe
+   } def
+
+% draw numbers (pos-txt pairs given by SetTacVec)
+/Num { % Generic but useless. Adjust for your application.
+   setnum
+   fontheight ymm div yDisRel mul tAng sin mul /yDist x def
+   { dup textW xDisRel mul tAng cos mul /xDist x def
+     xPos aPos xAng mul add xDist sub
+     yPos aPos yAng mul add yDist sub 3 2 roll textCM } TacExe
+   } def
+/setnumDisRel { % xDisRel yDisRel | - : adjust just a little bit
+   /yDisRel x def /xDisRel x def
+   } def
+1.2 1.2 setnumDisRel % default setting
+% explicit Num routines for rectangular case
+/xNumL { % : numbers on low x axis
+   setnum
+   { fontheight ymm div % conversion -> user_scale
+     dup /xNumHeightL x def
+     -.6 mul yPos add aPos x 3 2 roll textCT } TacExe
+   } def
+/xNumH { % : numbers on high x axis
+   setnum
+   { fontheight ymm div % conversion -> user_scale
+     dup /xNumHeightH x def
+     .6 mul yPos add aPos x 3 2 roll textCB } TacExe
+   } def
+/yNumL { % : numbers on low y axis
+   setnum
+   { fontsize -.3 mul xmm div xPos add aPos 3 2 roll textRM
+     xwidth dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
+     } TacExe
+   } def
+/yNumLD { % : calculate only yNumLength (used for adjustement)
+   setnum
+   { textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
+     } TacExe
+   } def
+/yDumL { % {(..)} yDumL : compare yNumLength with one arg (used for adjustement)
+   setnum
+   textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
+   } def
+/yNumH { % : numbers on high y axis
+   setnum
+   { fontsize .3 mul xmm div xPos add aPos 3 2 roll textLM
+     xwidth dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
+     } TacExe
+   } def
+/yNumHD { % : calculate only yNumLength (used for adjustement)
+   setnum
+   {textW dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
+     } TacExe
+   } def
+/yDumH { % {(..)} yDumH : compare yNumLength with one arg (used for adjustement)
+   setnum
+   textW dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
+   } def
+
+% draw labels
+/xCL { % xlabel | - ; plots coordinate name below the x-axis.
+   setlab
+   aMean xNumHeightL xNumHeightRel neg mul
+   3 -1 roll textCT
+   } def
+/xCH { % xlabel | - ; plots coordinate name above the x-axis.
+   setlab
+   aMean xNumHeightH xNumHeightRel mul 10 add
+   3 -1 roll textCB
+   } def
+/yCL { % ylabel | - ; plots coordinate name to the left of the y-axis.
+   gsave
+      setlab
+      yNumLengthL neg fontsize -.85 mul add % yNumLengthL calculated in yN
+      aMean ym translate
+      0 0 mv
+      90 rotate
+      0 x 0 x textCB
+   grestore
+   } def
+/yCH { % ylabel | - ; plots coordinate name to the right of the y-axis.
+   gsave
+      setlab
+      yNumLengthH fontsize .85 mul add 10 xm add
+      aMean ym translate
+      0 0 mv
+      90 rotate
+      0 x 0 x textCT
+   grestore
+   } def
+/yCF { % ylabel | - ; plots coordinate name *falling* right of the y-axis.
+   gsave
+      setlab
+      yNumLengthH fontsize .85 mul add 10 xm add
+      aMEan ym translate
+      0 0 mv
+      -90 rotate
+      0 x 0 x textCB
+   grestore
+   } def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Data Plotting (Symbols and Curves)                                       %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Initializations:
+
+% asymmetric error bars?
+/err_asy false def % overwrite this if data are quadruples x y d- d+
+
+
+%%  Presets:
+
+% global preset [wups11a: exchanged rad<->lin to conform with pset]
+/SymGSet { % sradglo slinglo serrglo | -
+   /serrglo x def % plot error bars? 0=never, 1=always, 2=as_given_in_pset
+   /slinglo x def % symbol linewidth multiplier
+   /sradglo x def % symbol size multiplier
+   } def
+
+
+%%  Retrieve presets from style array:
+
+/pstyle { pStyles setstyle } def
+/cstyle { cStyles setstyle } def
+/setstyle { % chosen_number array | - : set p or c as predefined in array.
+   dup length % i A n
+   3 2 roll % A n i
+   dup 0 le {
+      pop pop pop ostyle % chosen_number<=0 means: don't plot
+      } {
+      1 sub x % A i-1 n
+      mod get % A(i-1)
+      exec
+      } ifelse
+   } def
+
+
+%% Set plot symbol:
+
+/pset { % styp sfill serr srad slin | -
+   % arg -> symbol linewidth
+   /slin x slinglo mul def
+   % arg -> symbol size
+   /srad x fm 0.16 mul sradglo mul def
+   % arg -> plot error bar?
+   2 serrglo ne { pop serrglo } if % if (serrglo=2) use serr else use serrglo
+   /plot_errorbar x 1 eq { { errorbar } } { { pop pop pop pop } } ifelse def
+   % arg -> fill the symbol? (0=open, 1=full, 2=colored_with_black_border)
+   /sfill x def
+   % adjust srad: it's the _outer_ radius
+   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if
+   % arg -> symbol type
+   /ps {ps_nil} def % default: don't plot (maybe we only want an error bar)
+   dup  1 eq {/ps {ps_square}     def} if
+   dup  2 eq {/ps {ps_diamond}    def} if
+   dup  3 eq {/ps {ps_circle}     def} if
+   dup  4 eq {/ps {ps_triangle}   def} if
+   dup  5 eq {/ps {ps_cedez}      def} if
+   dup  6 eq {/ps {ps_eieruhr}    def} if
+   dup  7 eq {/ps {ps_valve}      def} if
+   dup  8 eq {/ps {ps_tfwd}       def} if
+   dup  9 eq {/ps {ps_tbwd}       def} if
+   dup 10 eq {/ps {ps_pentagram}  def} if
+   dup 11 eq {/ps {ps_plus}       def} if
+   dup 12 eq {/ps {ps_cross}      def} if
+   dup 13 eq {/ps {ps_star}       def} if
+   dup 14 eq {/ps {ps_pentagon}   def} if
+   dup 15 eq {/ps {ps_horiz}      def} if
+   dup 16 eq {/ps {ps_verti}      def} if
+   pop
+   %
+   /t { % x y d[- d+] | -  : plot a symbol and eventually an error bar.
+       err_asy not { dup } if
+       4 copy pop pop plot_symbol
+       plot_errorbar
+      } bind def
+   /ti { t } bind def
+   /tf { t black } bind def
+   } def
+
+
+%%  Set curve:
+
+/lset { % lwidth dashes | -
+   0 setdash
+   dup 0 gt {
+      pt fm setlinewidth
+      % pop error bar and convert frame coord -> paper coord
+      /txy { err_asy { pop } if pop xym } def % x y d[- d+] | x' y'
+      % commands to plot points (can be overwritten by nopoints):
+      /ti { np txy mv } def % x y d[- d+] | - : start curve
+      /t  { txy li }    def % x y d[- d+] | - : continue curve
+      /tf { txy li st } def % x y d[- d+] | - : terminate and plot curve
+      } {
+         ostyle
+      } ifelse
+   } def
+
+
+%%  Plot nothing:
+
+/ostyle { % - | -
+   /ti { nopoint } def
+   /t  { nopoint } def
+   /tf { nopoint } def
+} def
+/nopoint { % x y d[- d+] | -
+   pop pop pop err_asy { pop } if
+} def
+
+
+%%  Plot an asymmetric vertical error bar:
+
+/errorbar { % x y d- d+ | -
+   gsave
+      slin setline
+      3 copy pop pop
+      dup 0 gt x 10 lt and {
+         4 copy
+         x pop add 10. 2 copy gt { x } if pop ym x xm x
+         2 copy x .05 sub x np mv .1 0 rl st
+         np mv
+         pop sub 0. 2 copy lt { x } if pop ym x xm x
+         2 copy lineto st
+         x .05 sub x np mv .1 0 rl st
+         } {
+         pop pop pop pop
+         } ifelse
+      grestore
+} def
+
+
+%%  Plot a data symbol:
+
+/plot_symbol { % x y | -
+    gsave
+       offset
+       srad dup scale
+       slin srad div setline % factor 1/srad compensates "scale"
+       ps % the actual plot symbol, defined by 'pset'
+       grestore
+   } def
+
+/fill_symbol {
+   sfill dup
+      0 eq {
+         pop st
+      } {
+         1 eq {
+            fill
+	 } {
+	    gsave fill grestore
+	    gsave black st grestore
+	 } ifelse
+      } ifelse
+   } def
+
+
+%%  The different symbols, designed for unit area (no arguments):
+
+/ps_nil {
+    } bind def
+
+/ps_square {
+   .5 .5 np mv
+   0 -1 rl
+   -1 0 rl
+   0  1 rl cp fill_symbol
+   } bind def
+
+/ps_diamond {
+   gsave 45 rotate ps_square grestore
+   } bind def
+
+/ps_circle {
+   0 0 np .564 0 360 arc cp fill_symbol
+   } bind def
+
+/ps_triangle {
+   .77 dup dup 90 pol2xy np mv
+   210 pol2xy li
+   330 pol2xy li cp fill_symbol
+   } bind def
+
+/ps_cedez {
+   gsave 180 rotate ps_triangle grestore
+   } bind def
+
+/ps_tfwd {
+   gsave 30 rotate ps_triangle grestore
+   } bind def
+
+/ps_tbwd {
+   gsave 210 rotate ps_triangle grestore
+   } bind def
+
+/ps_eieruhr {
+   -.7 -.7 np mv
+    .7 -.7 li
+   -.7  .7 li
+    .7  .7 li cp fill_symbol
+   } bind def
+
+/ps_valve {
+   gsave 90 rotate ps_eieruhr grestore
+   } bind def
+
+/ps_pentagram {
+   .8 dup dup dup dup
+    90 pol2xy np mv
+   234 pol2xy li
+    18 pol2xy li
+   162 pol2xy li
+   306 pol2xy li cp fill_symbol
+   } bind def
+
+/ps_pentagon {
+   .8 dup dup dup dup
+    18 pol2xy np mv
+    90 pol2xy li
+   162 pol2xy li
+   234 pol2xy li
+   306 pol2xy li cp fill_symbol
+   } bind def
+
+/ps_plus {
+   gsave 45 rotate ps_cross grestore
+   } bind def
+
+/ps_cross {
+   .5 .5 np mv
+   -1 -1 rl st
+  -.5 .5 np mv
+    1 -1 rl st
+   } bind def
+
+/ps_star {
+   .7 dup   0 pol2xy np mv 180 pol2xy li st
+   .7 dup 120 pol2xy np mv 300 pol2xy li st
+   .7 dup 240 pol2xy np mv  60 pol2xy li st
+   } bind def
+
+/ps_horiz {
+   -.7 0 np mv
+   1.4 0 rl st
+   } bind def
+
+/ps_verti {
+   0 -.7 np mv
+   0 1.4 rl st
+   } bind def
+
+
+%%  Set column plotting (use this instead of pset) - BROKEN in 11a or earlier
+
+/setcolumn{ % shift width exec | %
+   % usage: 0 .2 { gsave { .5 setgray fill } grestore cp } setcolumn
+   /colexec x def % what's this ?
+   /colwidth x def
+   /colshift x def
+   /t { % broken - may need rewrite
+      np x colshift add x xym 2 copy mv pop
+      colwidth xm 0 rl
+      colwidth xm add 0 wy ym li
+      colwidth neg xm 0 rl
+      cp colexec
+   } def
+   /ti { t } bind def
+   /tf { t black } bind def
+} def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  List                                                                     %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+/NewList { % xins yins size advance NewList -
+   /nl_advance x def setown /nl_yins x def /nl_xins x def
+   /nl_xshift fontsize xmm div .9 mul def
+   /nl_xrline 0.33 def
+   /nl_ystep fontheight ymm div nl_advance mul def
+   /newline {
+       /nl_yins nl_yins nl_ystep sub def
+      } def
+   /fracline { % frac | -
+      fontheight ymm div nl_advance mul mul /nl_yins x nl_yins x sub def
+      } def
+   } def
+/newlist { 1.65 NewList } def
+/TxLine { % text TxLine -
+   nl_xins nl_yins 3 -1 roll textLM newline
+   } bind def
+/TxCLine { % text TxLine -
+   nl_xins nl_yins 3 -1 roll textCM newline
+   } bind def
+/infline{ % Obsolete since Frida2.1.5
+   oooinfo 1 eq { TxLine } { pop } ifelse
+   } bind def
+/PtTxLine { % pstyle text | -
+   x pstyle
+   nl_xins nl_xshift .5 mul add nl_yins 0 t
+   black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/PttttTxLine { % pstyle text | - %% chain of very small symbols
+   x pstyle
+   nl_xins nl_xshift .10 mul add nl_yins 0 t
+   nl_xins nl_xshift .26 mul add nl_yins 0 t
+   nl_xins nl_xshift .42 mul add nl_yins 0 t
+   nl_xins nl_xshift .58 mul add nl_yins 0 t
+   nl_xins nl_xshift .74 mul add nl_yins 0 t
+   nl_xins nl_xshift .90 mul add nl_yins 0 t
+   black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/PtPtCvTxLine { % pstyle pstyle cstyle text | -
+   4 3 roll pstyle nl_xins nl_yins 0 t
+   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t
+   x cstyle
+   nl_xins nl_xshift 2 mul add
+   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti
+   nl_xshift nl_xrline mul add nl_yins 0 tf
+   nl_xshift add nl_yins 3 2 roll black textLM
+   newline
+   } bind def
+/PtCvTxLine { % pstyle cstyle text | -
+   3 2 roll pstyle nl_xins nl_yins 0 t
+   x cstyle
+   nl_xins nl_xshift 1 mul add
+   dup dup nl_xshift -.33 mul add nl_yins 0 ti
+   nl_xshift 0.33 mul add nl_yins 0 tf
+   nl_xshift add nl_yins 3 2 roll black textLM
+   newline
+   } bind def
+/PtPtTxLine { % pstyle pstyle text | -
+   3 2 roll pstyle nl_xins nl_yins 0 t
+   x pstyle nl_xins nl_xshift add nl_yins 0 t
+   black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/CvTxLine { % cstyle text | -
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf
+   black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/Cv2TxLine { % cstyle text | -
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf
+   black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/PCTxLine { % pstyle(with plset) text | -
+   x pstyle
+   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci
+   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf
+   nl_xins yins 0 t
+   black nl_xins
+      fontsize xmm div 1.9 mul % instead of xshift
+      add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/showfilename { % xins yins size | -
+   setown
+   ooofnam 1 eq { filename textRB } { pop pop } ifelse
+   } def
+/InfSet { % ooofnam oooinfo | - : set on(1) or off(0)
+   /oooinfo x def /ooofnam x def
+   } def
+0 0 InfSet % default setting
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Macro Collection                                                         %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  gray areas (mainly applied with grayval=1 for blank areas) [longtime grey..]
+
+/execOval3 { %  xl xh yl yh dr { proc } | -
+   gsave
+   6 1 roll
+   fm /qqdr x def
+   ym /qqyh x def
+   ym /qqyl x def
+   xm /qqxh x def
+   xm /qqxl x def
+   qqxl qqyl qqdr add np mv
+   qqxl qqyh qqdr sub li
+   qqxl qqdr add qqyh qqdr sub qqdr 180 90 arcn
+   qqxh qqdr sub qqyh li
+   qqxh qqdr sub qqyh qqdr sub qqdr 90 0 arcn
+   qqxh qqyl qqdr add li
+   qqxh qqdr sub qqyl qqdr add qqdr 0 -90 arcn
+   qqxl qqdr add qqyl li
+   qqxl qqdr add qqyl qqdr add qqdr -90 -180 arcn
+   cp exec grestore
+   } def
+/execRect3 { % xl xh yl yh {proc} | -
+   5 1 roll
+   gsave
+   ym /qqyh x def
+   ym /qqyl x def
+   xm /qqxh x def
+   xm /qqxl x def
+   np
+   qqxl qqyl mv
+   qqxh qqyl li
+   qqxh qqyh li
+   qqxl qqyh li
+   cp exec grestore
+   } def
+/execRectangle { % OBSOLETE
+   5 1 roll
+   gsave
+   wy /qqyh x def
+   wy /qqyl x def
+   wx /qqxh x def
+   wx /qqxl x def
+   np
+   qqxl xm qqyl ym mv
+   qqxh xm qqyl ym li
+   qqxh xm qqyh ym li
+   qqxl xm qqyh ym li
+   cp exec grestore
+   } def
+/execHexagon { % xl xh yl yh (all in user coords) {proc} | -
+   5 1 roll
+   gsave
+   wy /qqyh x def
+   wy /qqyl x def
+   wx /qqxh x def
+   wx /qqxl x def
+   /qqdr qqyh qqyl sub 2 div def
+   np
+   qqxl qqdr add qqyl xym mv
+   qqxh qqdr sub qqyl xym li
+   qqxh qqyl qqdr add xym li
+   qqxh qqdr sub qqyh xym li
+   qqxl qqdr add qqyh xym li
+   qqxl qqyl qqdr add xym li
+   cp exec grestore
+   } def
+/coordRectangle { % xl xh yl yh (all in plot coords) {proc} | -
+   5 1 roll
+   gsave
+   /qqyh x def
+   /qqyl x def
+   /qqxh x def
+   /qqxl x def
+   np
+   qqxl xm qqyl ym mv
+   qqxh xm qqyl ym li
+   qqxh xm qqyh ym li
+   qqxl xm qqyh ym li
+   cp exec grestore
+   } def
+
+
+%%  special objects
+
+/pfeilangle 36.87 def
+/pfeilspitze { % x[local] y[local] rot siz
+   % draw with current linestyle, as set e.g. by linsetAxx
+   x 4 2 roll % siz rot x y
+   gsave
+     xym translate 180 add rotate dup dup dup
+     [] 0 setdash
+     pfeilangle cos mul x pfeilangle sin mul np mv
+     0 0 li pfeilangle cos mul x pfeilangle sin neg mul li st
+   grestore
+   } def
+/pfeiL { % (arrow anchored at base) x y rot siz len
+   gsave
+      dup xm x ym mul sqrt % (scale len)
+      5 3 roll
+      xym translate % (origin at base) rot siz len
+      3 2 roll
+      rotate % (draw rightwards) siz len
+      dup 0 translate % (origin at head) siz len
+      x 0 0 0 4 3 roll pfeilspitze % len
+      0 0 np mv neg 0 li st
+   grestore
+   } def
+/Pfeil { % (arrow anchored at head) x y rot siz len
+   dup xm x ym mul sqrt 5 copy
+   pop pfeilspitze
+   x pop
+   x 4 2 roll % len rot x y
+   gsave
+      xym translate 180 add rotate
+      0 0 np mv 0 li st
+   grestore
+   } def
+/pfeil { % (OBSOLETE) x[local] y[local] rot siz len[global]
+   fm 5 copy % not working well
+   pop pfeilspitze
+   x pop
+   x 4 2 roll % len rot x y
+   gsave
+      xym translate 180 add rotate
+      0 0 np mv 0 li st
+   grestore
+   } def
+/pfeil_arcn { % x_cent y_cent radius ang_from ang_to siz
+   gsave
+     6 -2 roll offset
+     4 copy pop 0 0 5 2 roll
+     np arcn st
+     % radius ang_from ang_to siz
+     4 1 roll
+     gsave
+       rotate
+       pop
+       % siz radius
+       0 -90 4 3 roll
+       pfeilspitze
+       grestore
+     grestore
+} def
+
+/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis
+   % the total height of the generated object is y_tot
+   % of which y_knau(.le. y_tot) is for the real knautsch,
+   % the remainder is for vertical prolongations.
+   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def
+   /tmpa x ym tmpy 4 mul sub 2 div def
+   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl
+   tmpx tmpy rl 0 tmpa rl st
+   } def
+/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis
+   setline
+   /spang x def
+   /splng x def
+   /spsep x def
+   2 copy spsep sub gsave offset spang rotate
+      splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
+   spsep add gsave offset spang rotate
+      splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
+   } def
+
+/bemasz { % x y L ang text | - %% precede by '24 setown 1 [] lset /pfeilangle 90 def'
+    gsave
+    5 3 roll offset % consumes x and y
+    x rotate % consumes ang | L text
+    dup textw .5 mul fontheight .4 mul add /bmszDT x def % => half text width
+    0 0 3 2 roll textCM % L
+    .5 mul /bmszDX x def % => half bemasz length
+    bmszDX     0   0 fontheight .67 mul bmszDX bmszDT sub Pfeil
+    bmszDX neg 0 180 fontheight .67 mul bmszDX bmszDT sub Pfeil
+    grestore
+   } def
+
+
+%%  Text composition shortcuts:
+
+/g  { x grec endgr} bind def
+/sb { x subsc endsc} bind def
+/sp { x supsc endsc} bind def
+/sbgr { x grec () subsc endsc () endgr} bind def
+/spgr { x grec () supsc endsc () endgr} bind def
+
+
+%%  Text macros for neutron scattering:
+
+/hbar {
+   showif
+   (h) 1.2 .66 {
+      currentpoint fontheight .11 mul setline np mv
+      fontheight dup .8 mul x .3 mul rl
+      st ()
+      } build
+   } bind def
+/hbarw { hbar () grec (w) endgr } bind def
+/wbar { grec (w) endgr ( / 2) grec (p) endgr } bind def
+/taumean { () (\341t\361) g } bind def
+/Sqw { showif (S\(q,) grec (w) endgr (\)) showif } bind def
+/Sqn { showif (S\(q,) grec (n) endgr (\)) showif } bind def
+/SQw { showif (S\(Q,) grec (w) endgr (\)) showif } bind def
+/Sttw { showif (S\(2) grec (q) endgr (,) grec (w) endgr (\)) showif } bind def
+/Sttn { showif (S\(2) grec (q) endgr (,) grec (n) endgr (\)) showif } bind def
+/Xqw { grec (c) endgr (''\(q,) grec (w) endgr (\)) showif } bind def
+/Xqn { grec (c) endgr (''\(q,) grec (n) endgr (\)) showif } bind def
+/ueV{ grec (m) endgr (eV) showif} bind def
+/inueV { showif (\() grec (m) endgr (eV\)) showif } bind def
+/inmeVr { showif (\(meV) supsc (-1) endsc (\)) showif } bind def
+/inueVr { showif (\() grec (m) endgr (eV)
+          supsc (-1) endsc (\)) showif } bind def
+/inGHzr { showif (\(GHz) (-1) sp (\)) showif } def
+
+%% home-made Angstr is obsolete; use \305 (more reliable than Ã…)
+/Angstr {
+   showif
+   (A) .5 1.23 {
+      currentpoint fontheight .1 mul setline np
+      fontheight .14 mul 0 360 arc st ()
+   } build
+} bind def
+/Angr { showif (\305) supsc (-1) endsc } bind def
+/inAngr { showif (\() Angr (\)) showif } bind def
+/Angrr { showif (\305) supsc (-2) endsc } bind def
+/inAngrr { showif (\() Angrr (\)) showif } bind def
+/wmin {grec (w) endgr () subsc (min) endsc} def
+/winpi { grec (w) endgr ( / 2) grec (p) endgr } def
+/Celsius { showif (\26x)g(C) showif } bind def
+
+
+%%  More shortcuts for impatient users:
+
+/L { langSel } bind def
+/G { gsave exec grestore } bind def
+/gs { gsave } bind def
+/gr { grestore } bind def
+
+end % WuGdict...
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Mark "ewu", the end of the wups.. macro definition file                  %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+WuGdict11a begin
+setPalatino
+
+1.5 dup autolabel defsiz
+1 dup stdred
+2 -40 setnewpage newpage
+
+/Ecolor    {255   0  83 setRGBcolor } def
+/darkgreen { 13 133  13 setRGBcolor } def
+/litegreen {202 253 222 setRGBcolor } def
+/darkblue  { 13  13 133 setRGBcolor } def
+/liteblue  {202 202 255 setRGBcolor } def
+/darkbrown {215 175 135 setRGBcolor } def
+/litebrown {235 205 175 setRGBcolor } def
+
+% /execRect3 { % xl xh yl yh {proc} | -
+
+%#0
+
+/H 6 def
+/L 44 def
+
+/DOT { .4 0 360 np arc cp fill } def
+
+/Sample {
+    % Layers
+    litebrown  0 L H -1 mul H  0 mul { fill } execRect3
+    darkbrown  0 L H -2 mul H -1 mul { fill } execRect3
+    % Source
+    24 setbol black
+    { 4 H -.5 mul offset 0 0 DOT -2 0 {(S)} textCM } G
+} def
+
+black 32 setown 0 15 {((a))} textLM
+Sample
+% Detector
+{ xd yd offset 0 0 DOT 2 0 {(D)} textCM } G
+% Main part
+darkblue
+%#1
+
+60 0 offset
+black 32 setown 0 15 {((b))} textLM
+Sample
+xd 3 add yd {(D)} textCM
+3 [] lset xd yd b0 1.2 5 pfeiL
+darkblue
+%#2
+
+showpage
+end % WuGdict...
diff --git a/Doc/UserManual/fig/drawing/SAS_const_alphi.ps b/Doc/UserManual/fig/drawing/SAS_const_alphi.ps
index 170edca3a119f76b3eae507cee93e69bdeb7653f..8c901d7d5cba4f12d01bf102bebee681dd3f516c 100644
--- a/Doc/UserManual/fig/drawing/SAS_const_alphi.ps
+++ b/Doc/UserManual/fig/drawing/SAS_const_alphi.ps
@@ -28,7 +28,7 @@
 %%  Framework:
 
 % For interleaving applications, isolate what follows in a dictionary
-/WuGdict11a 400 dict def 
+/WuGdict11a 400 dict def
 WuGdict11a begin
 
 
@@ -82,14 +82,14 @@ WuGdict11a begin
 %    upper left corner.  Therefore we need a vertical translation,
 %    depending on the paper size.  A4 is 210x297 mm^2.  By this occasion,
 %    we also provide a border of 7 mm.
-/cmtranslate { % x y cmtranslate | - 
+/cmtranslate { % x y cmtranslate | -
    cm x cm x translate } bind def
 /originUpperLeft_A4{ .7 28.3 cmtranslate } bind def
 /goffsetA4 { ungscale originUpperLeft_A4 gscale } def
 /EdgeLeftDIN{ originUpperLeft_A4 } bind def % OBSOLETE since 11a
 
 % set absolute global scale and relative symbol size
-/defsiz { % size(cm) symbolsize(rel) | - 
+/defsiz { % size(cm) symbolsize(rel) | -
    /ftot x def
    /gsiz x cm 10 div def
    gscale % within 'size', coordinates run from 0 to 10
@@ -118,14 +118,14 @@ WuGdict11a begin
 /geld {0.759836 mul} bind def /Geld {0.759836 div} bind def % sqrt(sqrt(3))
 /gald {0.817765 mul} bind def /Gald {0.817765 div} bind def % sqrt sqrt sqrt 5
 
-% define frame coordinates 
+% define frame coordinates
 /defred { % x_reduction y_reduction label_reduction | -
-   /fmm x ftot mul def 
-   /ymm x def 
+   /fmm x ftot mul def
+   /ymm x def
    /xmm x def
 
    % conversion frame_coordinate -> global_coord
-   /xm {xmm mul} bind def 
+   /xm {xmm mul} bind def
    /ym {ymm mul} bind def
    /fm {fmm mul} bind def
    /xym {ym x xm x} bind def
@@ -238,7 +238,7 @@ WuGdict11a begin
    } def
 /iCol3 { % i i_max | - : siemens
    div /icnow x def
-   165 1 icnow sub mul 
+   165 1 icnow sub mul
    102   icnow     mul
     33 120 icnow mul add setRGBcolor
    } def
@@ -259,7 +259,7 @@ WuGdict11a begin
    0 max aCol length 1 sub min % offset safe_idx
    dup 1 add aCol length 1 sub min % offset i i+1
    aCol x get exec
-   4 3 roll aCol x get exec colormix setRGBcolor 
+   4 3 roll aCol x get exec colormix setRGBcolor
    } def
 
 
@@ -304,15 +304,15 @@ WuGdict11a begin
    {  30  30 130 } % 20
    ] def
 /aCol3 [ % siemenscolors
-   { 165   0  33 } % siemensred    
-   {  33 153 102 } % siemensgreen  
-   { 0   102 153 } % siemensblue   
-   {   0  51 102 } % siemenstext   
-   { 255 153   0 } % siemensorange 
-   { 102 102 102 } % siemensdark   
-   { 255 221   0 } % siemensyellow 
-   { 221 221 221 } % siemensgrey   
-   { 221 102 102 } % siemenspink   
+   { 165   0  33 } % siemensred
+   {  33 153 102 } % siemensgreen
+   { 0   102 153 } % siemensblue
+   {   0  51 102 } % siemenstext
+   { 255 153   0 } % siemensorange
+   { 102 102 102 } % siemensdark
+   { 255 221   0 } % siemensyellow
+   { 221 221 221 } % siemensgrey
+   { 221 102 102 } % siemenspink
    ] def
 /aCol4 [ % green-blue-brown
    { 120 160  60 }
@@ -345,7 +345,7 @@ WuGdict11a begin
    {   0 255 255 } % cyan
    { 160  82  45 } % sienna
    { 255 165   0 } % orange
-   { 255 127  80 } % coral  
+   { 255 127  80 } % coral
    ] def
 
 
@@ -403,12 +403,18 @@ WuGdict11a begin
 /Helvetica-Bold        /HelveticaLatin1-Bold        ISOLatin1Encoding ReEncode
 /Helvetica-BoldOblique /HelveticaLatin1-BoldOblique ISOLatin1Encoding ReEncode
 
+/setPalatino {
+/Palatino             /MyFont             ISOLatin1Encoding ReEncode
+/Palatino-Italic      /MyFont-Oblique     ISOLatin1Encoding ReEncode
+/Palatino-Bold        /MyFont-Bold        ISOLatin1Encoding ReEncode
+/Palatino-BoldItalic  /MyFont-BoldOblique ISOLatin1Encoding ReEncode
+} def
 
 %% Preset standard styles:
 
 % scale and set font; define fontsize, fontheight
-/setfontandsize { % font size | - 
-   dup 0 le { pop 100 } if % fontsize <= 0 not allowed ! 
+/setfontandsize { % font size | -
+   dup 0 le { pop 100 } if % fontsize <= 0 not allowed !
    /fontnonnil true def
    pt fm dup /fontsize x def
    x findfont
@@ -423,14 +429,14 @@ WuGdict11a begin
    } def
 
 % standard settings for labelling axes
-/setnum { /HelveticaLatin1            24 setfontandsize } def
-/setlab { /HelveticaLatin1            24 setfontandsize } def
+/setnum { /MyFont            24 setfontandsize } def
+/setlab { /MyFont            24 setfontandsize } def
 
 % user commands (free choice of fontsize, but fixed font family)
-/setown { /HelveticaLatin1             x setfontandsize } def
-/setbol { /HelveticaLatin1-Bold        x setfontandsize } def
-/setboq { /HelveticaLatin1-BoldOblique x setfontandsize } def
-/setobl { /HelveticaLatin1-Oblique     x setfontandsize } def
+/setown { /MyFont             x setfontandsize } def
+/setbol { /MyFont-Bold        x setfontandsize } def
+/setboq { /MyFont-BoldOblique x setfontandsize } def
+/setobl { /MyFont-Oblique     x setfontandsize } def
 
 
 %%  String treatment:
@@ -487,12 +493,12 @@ WuGdict11a begin
 /gbuild { % string xrel yrel obj | - : plot obj above/below string
    /obj x def /yrelbui x def /xrelbui x def
    /Symbol findfont fontsize scalefont setfont
-   dup showif 
+   dup showif
    prepare
       { pop regularfont setfont }
       { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
         currentpoint 4 2 roll % save position after string
-        regularfont setfont 
+        regularfont setfont
       rm obj pop       % obj must end with () that will be pop'ed
       mv               % back to saved position
       }
@@ -506,11 +512,11 @@ WuGdict11a begin
    x showif
    .8 .65 {(\136) show ()} gbuild
    } def
-/tilde { 
+/tilde {
    x showif
    1. .6 {(~) show ()} build
    } def
-/gtilde { 
+/gtilde {
    x showif
    1. .6 {(~) show ()} gbuild
    } def
@@ -520,26 +526,26 @@ WuGdict11a begin
 
 % the following macros use the symbol/curve plotting mechanism
 /pins { % string symins - ; symbol must be selected by pset
-   showif 
+   showif
    ( ) showif ( ) .5 .5 { currentxy 0 p black ()} build ( ) showif
    } def
 /clenins { % string len clenins - ; curve must be selected by cset
    x showif % I suppose that pins is preceeded by 8 spaces
-   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def 
-            % length of inserted curve : 
+   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def
+            % length of inserted curve :
             % -1 space : curve begins and ends in  middle of ( )
             % +3 spaces: pins requires 3 times ( )
-   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build 
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
    2 add {( ) showif} repeat
    } def
 /cins { % string symins - ; curve must be selected by cset
    showif 8 % I suppose that pins is preceeded by 8 spaces
    dup ( ) stringwidth pop mul 2 add /xstrich x xmm div 10 div def
    % nov03, ohne zu verstehen, "10 div" eingefuegt
-            % length of inserted curve : 
+            % length of inserted curve :
             % -1 space : curve begins and ends in  middle of ( )
             % +3 spaces: pins requires 3 times ( )
-   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build 
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
    2 add {( ) showif} repeat
    } def
 
@@ -551,10 +557,10 @@ WuGdict11a begin
     blabla endall % first pass : determine xwidth
    boxif { /boxwidth  xwidth (M) stringwidth pop boxxr mul 2 mul add def
            /boxheight fontheight 1 boxyr 2 mul add mul def
-           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub 
-           ypos fontheight .5 boxyr add mul sub mv 
+           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub
+           ypos fontheight .5 boxyr add mul sub mv
            boxwidth 0 rl 0 boxheight rl boxwidth neg 0 rl cp
-           boxproc 
+           boxproc
     } if
     xpos xwidth xrel mul sub ypos fontheight yrel mul sub mv
     /prepare false def
@@ -584,7 +590,7 @@ WuGdict11a begin
    xwidth % has been determined
    } def
 /textw { % obj textW y : dito, in 0..10-units
-   textW xmm div 
+   textW xmm div
    } def
 
 % horizontal text: x y ob | -
@@ -628,8 +634,8 @@ WuGdict11a begin
 
 %%  Layout presets:
 
-/xyTicLen {0.10 fm} def 
-/xyTacLen {0.20 fm} def 
+/xyTicLen {0.10 fm} def
+/xyTacLen {0.20 fm} def
 /txllen {0.20 fm} def
 /tyllen {0.20 fm} def
 /linsetAxx {black 0.7 setline} def
@@ -687,9 +693,9 @@ WuGdict11a begin
 } def
 
 
-/zValues { pop pop } def 
+/zValues { pop pop } def
 /plotafter {} def
-/whiteframe { 1 0 0 10 10 graybox } def 
+/whiteframe { 1 0 0 10 10 graybox } def
 /plotframes { xPlotFrame yPlotFrame } def
 /plotbefore { plotframes } def
 
@@ -703,21 +709,21 @@ WuGdict11a begin
 
 % set tick array - internal macros
 /tiputs { % rel_pos_of_tick | pos_of_tick : innermost routine for /taproc
-   tastep mul taloop add 
-   } def 
+   tastep mul taloop add
+   } def
 /taproclin { % (#tick/tack) | - : define /taproc for use in SetVec
    1 x div /tistep x def
    /taproc { 0 tistep .999 { tiputs } for } def
    } def
 /taproclog { % (#ticks/tacks) | - : define /taproc for use in SetVec
-      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def 
-   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def 
-   }{ dup 0 gt { pop /taproc { 0 tiputs } def 
-   }{            neg taproclin  
+      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def
+   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def
+   }{ dup 0 gt { pop /taproc { 0 tiputs } def
+   }{            neg taproclin
    } ifelse } ifelse } ifelse
    } def
 /SetVec { % tafro tatoo nta /vector | - : set /vector
-   4 1 roll 
+   4 1 roll
    /nta x def /tatoo x def /tafro x def
    /tastep tatoo tafro sub nta 1 sub div def
    [
@@ -728,8 +734,8 @@ WuGdict11a begin
       ] def
    } def
 % set tick array - user commands
-/SetTicVecLin { taproclin /TicVec SetVec } def 
-/SetTicVecLog { taproclog /TicVec SetVec } def 
+/SetTicVecLin { taproclin /TicVec SetVec } def
+/SetTicVecLog { taproclog /TicVec SetVec } def
 
 % set tack-and-number array
 /SetTacVec { % [ pos {label} pos {label} ... ] | -
@@ -740,7 +746,7 @@ WuGdict11a begin
    % note on angles : 0 = x-axis, 90 = y-axis
 /OneAxx { % fro to xpos ypos aang tang | - : presets for Axx, Tic, Tac, Num
    % store arguments
-   /tAng x def /aAng x def 
+   /tAng x def /aAng x def
    /yPos x def /xPos x def
    /aTo x def /aFro x def
    % set constants
@@ -795,7 +801,7 @@ WuGdict11a begin
    } def
 /TicProc { % aPos | - : default procedure to plot one tick
    np
-   xPos yPos xym mv 
+   xPos yPos xym mv
    dup xAng mul x yAng mul xym rm % eat argument, go to start pos.
    xTicLen yTicLen rl st
    } def
@@ -814,7 +820,7 @@ WuGdict11a begin
    linsetGri
    TicVec {
       3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
-         dup % x1 x2 y y 
+         dup % x1 x2 y y
          4 -1 roll x xym np mv % x2 y
          xym li st
          } ifelse
@@ -841,7 +847,7 @@ WuGdict11a begin
    } def
 /Tac {
    linsetTac
-   { pop xPos yPos xym mv 
+   { pop xPos yPos xym mv
       aPos dup xAng mul x yAng mul xym rm
       xTacLen yTacLen rl st
       } TacExe
@@ -874,7 +880,7 @@ WuGdict11a begin
    setnum
    fontheight ymm div yDisRel mul tAng sin mul /yDist x def
    { dup textW xDisRel mul tAng cos mul /xDist x def
-     xPos aPos xAng mul add xDist sub 
+     xPos aPos xAng mul add xDist sub
      yPos aPos yAng mul add yDist sub 3 2 roll textCM } TacExe
    } def
 /setnumDisRel { % xDisRel yDisRel | - : adjust just a little bit
@@ -882,19 +888,19 @@ WuGdict11a begin
    } def
 1.2 1.2 setnumDisRel % default setting
 % explicit Num routines for rectangular case
-/xNumL { % : numbers on low x axis 
+/xNumL { % : numbers on low x axis
    setnum
    { fontheight ymm div % conversion -> user_scale
      dup /xNumHeightL x def
      -.6 mul yPos add aPos x 3 2 roll textCT } TacExe
    } def
-/xNumH { % : numbers on high x axis 
+/xNumH { % : numbers on high x axis
    setnum
    { fontheight ymm div % conversion -> user_scale
      dup /xNumHeightH x def
      .6 mul yPos add aPos x 3 2 roll textCB } TacExe
    } def
-/yNumL { % : numbers on low y axis 
+/yNumL { % : numbers on low y axis
    setnum
    { fontsize -.3 mul xmm div xPos add aPos 3 2 roll textRM
      xwidth dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
@@ -909,7 +915,7 @@ WuGdict11a begin
    setnum
    textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
    } def
-/yNumH { % : numbers on high y axis 
+/yNumH { % : numbers on high y axis
    setnum
    { fontsize .3 mul xmm div xPos add aPos 3 2 roll textLM
      xwidth dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
@@ -967,7 +973,7 @@ WuGdict11a begin
    grestore
    } def
 
-   
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%  Data Plotting (Symbols and Curves)                                       %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -986,7 +992,7 @@ WuGdict11a begin
    /serrglo x def % plot error bars? 0=never, 1=always, 2=as_given_in_pset
    /slinglo x def % symbol linewidth multiplier
    /sradglo x def % symbol size multiplier
-   } def            
+   } def
 
 
 %%  Retrieve presets from style array:
@@ -998,7 +1004,7 @@ WuGdict11a begin
    3 2 roll % A n i
    dup 0 le {
       pop pop pop ostyle % chosen_number<=0 means: don't plot
-      } { 
+      } {
       1 sub x % A i-1 n
       mod get % A(i-1)
       exec
@@ -1010,7 +1016,7 @@ WuGdict11a begin
 
 /pset { % styp sfill serr srad slin | -
    % arg -> symbol linewidth
-   /slin x slinglo mul def   
+   /slin x slinglo mul def
    % arg -> symbol size
    /srad x fm 0.16 mul sradglo mul def
    % arg -> plot error bar?
@@ -1019,7 +1025,7 @@ WuGdict11a begin
    % arg -> fill the symbol? (0=open, 1=full, 2=colored_with_black_border)
    /sfill x def
    % adjust srad: it's the _outer_ radius
-   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if 
+   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if
    % arg -> symbol type
    /ps {ps_nil} def % default: don't plot (maybe we only want an error bar)
    dup  1 eq {/ps {ps_square}     def} if
@@ -1037,9 +1043,9 @@ WuGdict11a begin
    dup 13 eq {/ps {ps_star}       def} if
    dup 14 eq {/ps {ps_pentagon}   def} if
    pop
-   % 
+   %
    /t { % x y d[- d+] | -  : plot a symbol and eventually an error bar.
-       err_asy not { dup } if   
+       err_asy not { dup } if
        4 copy pop pop plot_symbol
        plot_errorbar
       } bind def
@@ -1072,7 +1078,7 @@ WuGdict11a begin
    /ti { nopoint } def
    /t  { nopoint } def
    /tf { nopoint } def
-} def   
+} def
 /nopoint { % x y d[- d+] | -
    pop pop pop err_asy { pop } if
 } def
@@ -1126,7 +1132,7 @@ WuGdict11a begin
 
 /ps_nil {
     } bind def
-    
+
 /ps_square {
    .5 .5 np mv
    0 -1 rl
@@ -1205,7 +1211,7 @@ WuGdict11a begin
    .7 dup 120 pol2xy np mv 300 pol2xy li st
    .7 dup 240 pol2xy np mv  60 pol2xy li st
    } bind def
-   
+
 
 %%  Set column plotting (use this instead of pset) - BROKEN in 11a or earlier
 
@@ -1243,7 +1249,7 @@ WuGdict11a begin
       fontheight ymm div nl_advance mul mul /nl_yins x nl_yins x sub def
       } def
    } def
-/newlist { 1.65 NewList } def 
+/newlist { 1.65 NewList } def
 /TxLine { % text TxLine -
    nl_xins nl_yins 3 -1 roll textLM newline
    } bind def
@@ -1260,50 +1266,50 @@ WuGdict11a begin
    newline
    } bind def
 /PtPtCvTxLine { % pstyle pstyle cstyle text | -
-   4 3 roll pstyle nl_xins nl_yins 0 t 
-   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t 
+   4 3 roll pstyle nl_xins nl_yins 0 t
+   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t
    x cstyle
-   nl_xins nl_xshift 2 mul add 
-   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti 
+   nl_xins nl_xshift 2 mul add
+   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti
    nl_xshift nl_xrline mul add nl_yins 0 tf
    nl_xshift add nl_yins 3 2 roll black textLM
    newline
    } bind def
 /PtCvTxLine { % pstyle cstyle text | -
-   3 2 roll pstyle nl_xins nl_yins 0 t 
+   3 2 roll pstyle nl_xins nl_yins 0 t
    x cstyle
-   nl_xins nl_xshift 1 mul add 
-   dup dup nl_xshift -.33 mul add nl_yins 0 ti 
+   nl_xins nl_xshift 1 mul add
+   dup dup nl_xshift -.33 mul add nl_yins 0 ti
    nl_xshift 0.33 mul add nl_yins 0 tf
    nl_xshift add nl_yins 3 2 roll black textLM
    newline
    } bind def
 /PtPtTxLine { % pstyle pstyle text | -
-   3 2 roll pstyle nl_xins nl_yins 0 t 
+   3 2 roll pstyle nl_xins nl_yins 0 t
    x pstyle nl_xins nl_xshift add nl_yins 0 t
    black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /CvTxLine { % cstyle text | -
-   x cstyle 
-   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti 
-   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf  
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf
    black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /Cv2TxLine { % cstyle text | -
-   x cstyle 
-   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti 
-   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf  
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf
    black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /PCTxLine { % pstyle(with plset) text | -
-   x pstyle 
-   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci 
-   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf  
+   x pstyle
+   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci
+   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf
    nl_xins yins 0 t
-   black nl_xins 
+   black nl_xins
       fontsize xmm div 1.9 mul % instead of xshift
       add nl_yins 3 2 roll textLM
    newline
@@ -1345,7 +1351,7 @@ WuGdict11a begin
    cp
    } def
 /execOval { %  xl yl dx dy dr { proc } | - % works only in quadratic grid
-   x 6 2 roll 
+   x 6 2 roll
    4 2 roll % proc dr dx dy xl yl
    gsave
       xym translate
@@ -1491,24 +1497,24 @@ WuGdict11a begin
        grestore
      grestore
 } def
-  
-/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis 
+
+/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis
    % the total height of the generated object is y_tot
    % of which y_knau(.le. y_tot) is for the real knautsch,
    % the remainder is for vertical prolongations.
-   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def 
+   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def
    /tmpa x ym tmpy 4 mul sub 2 div def
-   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl 
+   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl
    tmpx tmpy rl 0 tmpa rl st
    } def
-/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis 
+/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis
    setline
-   /spang x def 
+   /spang x def
    /splng x def
    /spsep x def
-   2 copy spsep sub gsave offset spang rotate 
+   2 copy spsep sub gsave offset spang rotate
       splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
-   spsep add gsave offset spang rotate 
+   spsep add gsave offset spang rotate
       splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
    } def
 
@@ -1532,7 +1538,7 @@ WuGdict11a begin
     4 1 roll 0 3 2 roll bmszRT x rtextCM % hlw dx/2
     dup 2 mul 3 1 roll x sub dup % dx len len
     0 0 180 4 -1 roll bmszSZ bmszTH arrow % dx len
-    x 0 0 4 -1 roll  bmszSZ bmszTH arrow 
+    x 0 0 4 -1 roll  bmszSZ bmszTH arrow
     grestore
    } def
 
@@ -1569,7 +1575,7 @@ WuGdict11a begin
 /ueV{ grec (m) endgr (eV) showif} bind def
 /inueV { showif (\() grec (m) endgr (eV\)) showif } bind def
 /inmeVr { showif (\(meV) supsc (-1) endsc (\)) showif } bind def
-/inueVr { showif (\() grec (m) endgr (eV) 
+/inueVr { showif (\() grec (m) endgr (eV)
           supsc (-1) endsc (\)) showif } bind def
 /inGHzr { showif (\(GHz) (-1) sp (\)) showif } def
 
@@ -1603,6 +1609,7 @@ end % WuGdict...
 %%  Mark "ewu", the end of the wups.. macro definition file                  %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 WuGdict11a begin
+setPalatino
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%  Customizable plot setup, copied from g3.ps (editör: use latin-1)
diff --git a/Doc/UserManual/fig/drawing/SAS_const_p_yz.ps b/Doc/UserManual/fig/drawing/SAS_const_p_yz.ps
index 39f4c0f4d2a32ddab3e8d4dd571ca77ac16b4c03..75b1be73ade55e127ce5be59c747825eb418184b 100644
--- a/Doc/UserManual/fig/drawing/SAS_const_p_yz.ps
+++ b/Doc/UserManual/fig/drawing/SAS_const_p_yz.ps
@@ -28,7 +28,7 @@
 %%  Framework:
 
 % For interleaving applications, isolate what follows in a dictionary
-/WuGdict11a 400 dict def 
+/WuGdict11a 400 dict def
 WuGdict11a begin
 
 
@@ -82,14 +82,14 @@ WuGdict11a begin
 %    upper left corner.  Therefore we need a vertical translation,
 %    depending on the paper size.  A4 is 210x297 mm^2.  By this occasion,
 %    we also provide a border of 7 mm.
-/cmtranslate { % x y cmtranslate | - 
+/cmtranslate { % x y cmtranslate | -
    cm x cm x translate } bind def
 /originUpperLeft_A4{ .7 28.3 cmtranslate } bind def
 /goffsetA4 { ungscale originUpperLeft_A4 gscale } def
 /EdgeLeftDIN{ originUpperLeft_A4 } bind def % OBSOLETE since 11a
 
 % set absolute global scale and relative symbol size
-/defsiz { % size(cm) symbolsize(rel) | - 
+/defsiz { % size(cm) symbolsize(rel) | -
    /ftot x def
    /gsiz x cm 10 div def
    gscale % within 'size', coordinates run from 0 to 10
@@ -118,14 +118,14 @@ WuGdict11a begin
 /geld {0.759836 mul} bind def /Geld {0.759836 div} bind def % sqrt(sqrt(3))
 /gald {0.817765 mul} bind def /Gald {0.817765 div} bind def % sqrt sqrt sqrt 5
 
-% define frame coordinates 
+% define frame coordinates
 /defred { % x_reduction y_reduction label_reduction | -
-   /fmm x ftot mul def 
-   /ymm x def 
+   /fmm x ftot mul def
+   /ymm x def
    /xmm x def
 
    % conversion frame_coordinate -> global_coord
-   /xm {xmm mul} bind def 
+   /xm {xmm mul} bind def
    /ym {ymm mul} bind def
    /fm {fmm mul} bind def
    /xym {ym x xm x} bind def
@@ -238,7 +238,7 @@ WuGdict11a begin
    } def
 /iCol3 { % i i_max | - : siemens
    div /icnow x def
-   165 1 icnow sub mul 
+   165 1 icnow sub mul
    102   icnow     mul
     33 120 icnow mul add setRGBcolor
    } def
@@ -259,7 +259,7 @@ WuGdict11a begin
    0 max aCol length 1 sub min % offset safe_idx
    dup 1 add aCol length 1 sub min % offset i i+1
    aCol x get exec
-   4 3 roll aCol x get exec colormix setRGBcolor 
+   4 3 roll aCol x get exec colormix setRGBcolor
    } def
 
 
@@ -304,15 +304,15 @@ WuGdict11a begin
    {  30  30 130 } % 20
    ] def
 /aCol3 [ % siemenscolors
-   { 165   0  33 } % siemensred    
-   {  33 153 102 } % siemensgreen  
-   { 0   102 153 } % siemensblue   
-   {   0  51 102 } % siemenstext   
-   { 255 153   0 } % siemensorange 
-   { 102 102 102 } % siemensdark   
-   { 255 221   0 } % siemensyellow 
-   { 221 221 221 } % siemensgrey   
-   { 221 102 102 } % siemenspink   
+   { 165   0  33 } % siemensred
+   {  33 153 102 } % siemensgreen
+   { 0   102 153 } % siemensblue
+   {   0  51 102 } % siemenstext
+   { 255 153   0 } % siemensorange
+   { 102 102 102 } % siemensdark
+   { 255 221   0 } % siemensyellow
+   { 221 221 221 } % siemensgrey
+   { 221 102 102 } % siemenspink
    ] def
 /aCol4 [ % green-blue-brown
    { 120 160  60 }
@@ -345,7 +345,7 @@ WuGdict11a begin
    {   0 255 255 } % cyan
    { 160  82  45 } % sienna
    { 255 165   0 } % orange
-   { 255 127  80 } % coral  
+   { 255 127  80 } % coral
    ] def
 
 
@@ -403,12 +403,19 @@ WuGdict11a begin
 /Helvetica-Bold        /HelveticaLatin1-Bold        ISOLatin1Encoding ReEncode
 /Helvetica-BoldOblique /HelveticaLatin1-BoldOblique ISOLatin1Encoding ReEncode
 
+/setPalatino {
+/Palatino             /MyFont             ISOLatin1Encoding ReEncode
+/Palatino-Italic      /MyFont-Oblique     ISOLatin1Encoding ReEncode
+/Palatino-Bold        /MyFont-Bold        ISOLatin1Encoding ReEncode
+/Palatino-BoldItalic  /MyFont-BoldOblique ISOLatin1Encoding ReEncode
+} def
+
 
 %% Preset standard styles:
 
 % scale and set font; define fontsize, fontheight
-/setfontandsize { % font size | - 
-   dup 0 le { pop 100 } if % fontsize <= 0 not allowed ! 
+/setfontandsize { % font size | -
+   dup 0 le { pop 100 } if % fontsize <= 0 not allowed !
    /fontnonnil true def
    pt fm dup /fontsize x def
    x findfont
@@ -423,14 +430,14 @@ WuGdict11a begin
    } def
 
 % standard settings for labelling axes
-/setnum { /HelveticaLatin1            24 setfontandsize } def
-/setlab { /HelveticaLatin1            24 setfontandsize } def
+/setnum { /MyFont            24 setfontandsize } def
+/setlab { /MyFont            24 setfontandsize } def
 
 % user commands (free choice of fontsize, but fixed font family)
-/setown { /HelveticaLatin1             x setfontandsize } def
-/setbol { /HelveticaLatin1-Bold        x setfontandsize } def
-/setboq { /HelveticaLatin1-BoldOblique x setfontandsize } def
-/setobl { /HelveticaLatin1-Oblique     x setfontandsize } def
+/setown { /MyFont             x setfontandsize } def
+/setbol { /MyFont-Bold        x setfontandsize } def
+/setboq { /MyFont-BoldOblique x setfontandsize } def
+/setobl { /MyFont-Oblique     x setfontandsize } def
 
 
 %%  String treatment:
@@ -487,12 +494,12 @@ WuGdict11a begin
 /gbuild { % string xrel yrel obj | - : plot obj above/below string
    /obj x def /yrelbui x def /xrelbui x def
    /Symbol findfont fontsize scalefont setfont
-   dup showif 
+   dup showif
    prepare
       { pop regularfont setfont }
       { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
         currentpoint 4 2 roll % save position after string
-        regularfont setfont 
+        regularfont setfont
       rm obj pop       % obj must end with () that will be pop'ed
       mv               % back to saved position
       }
@@ -506,11 +513,11 @@ WuGdict11a begin
    x showif
    .8 .65 {(\136) show ()} gbuild
    } def
-/tilde { 
+/tilde {
    x showif
    1. .6 {(~) show ()} build
    } def
-/gtilde { 
+/gtilde {
    x showif
    1. .6 {(~) show ()} gbuild
    } def
@@ -520,26 +527,26 @@ WuGdict11a begin
 
 % the following macros use the symbol/curve plotting mechanism
 /pins { % string symins - ; symbol must be selected by pset
-   showif 
+   showif
    ( ) showif ( ) .5 .5 { currentxy 0 p black ()} build ( ) showif
    } def
 /clenins { % string len clenins - ; curve must be selected by cset
    x showif % I suppose that pins is preceeded by 8 spaces
-   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def 
-            % length of inserted curve : 
+   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def
+            % length of inserted curve :
             % -1 space : curve begins and ends in  middle of ( )
             % +3 spaces: pins requires 3 times ( )
-   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build 
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
    2 add {( ) showif} repeat
    } def
 /cins { % string symins - ; curve must be selected by cset
    showif 8 % I suppose that pins is preceeded by 8 spaces
    dup ( ) stringwidth pop mul 2 add /xstrich x xmm div 10 div def
    % nov03, ohne zu verstehen, "10 div" eingefuegt
-            % length of inserted curve : 
+            % length of inserted curve :
             % -1 space : curve begins and ends in  middle of ( )
             % +3 spaces: pins requires 3 times ( )
-   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build 
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
    2 add {( ) showif} repeat
    } def
 
@@ -551,10 +558,10 @@ WuGdict11a begin
     blabla endall % first pass : determine xwidth
    boxif { /boxwidth  xwidth (M) stringwidth pop boxxr mul 2 mul add def
            /boxheight fontheight 1 boxyr 2 mul add mul def
-           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub 
-           ypos fontheight .5 boxyr add mul sub mv 
+           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub
+           ypos fontheight .5 boxyr add mul sub mv
            boxwidth 0 rl 0 boxheight rl boxwidth neg 0 rl cp
-           boxproc 
+           boxproc
     } if
     xpos xwidth xrel mul sub ypos fontheight yrel mul sub mv
     /prepare false def
@@ -584,7 +591,7 @@ WuGdict11a begin
    xwidth % has been determined
    } def
 /textw { % obj textW y : dito, in 0..10-units
-   textW xmm div 
+   textW xmm div
    } def
 
 % horizontal text: x y ob | -
@@ -628,8 +635,8 @@ WuGdict11a begin
 
 %%  Layout presets:
 
-/xyTicLen {0.10 fm} def 
-/xyTacLen {0.20 fm} def 
+/xyTicLen {0.10 fm} def
+/xyTacLen {0.20 fm} def
 /txllen {0.20 fm} def
 /tyllen {0.20 fm} def
 /linsetAxx {black 0.7 setline} def
@@ -687,9 +694,9 @@ WuGdict11a begin
 } def
 
 
-/zValues { pop pop } def 
+/zValues { pop pop } def
 /plotafter {} def
-/whiteframe { 1 0 0 10 10 graybox } def 
+/whiteframe { 1 0 0 10 10 graybox } def
 /plotframes { xPlotFrame yPlotFrame } def
 /plotbefore { plotframes } def
 
@@ -703,21 +710,21 @@ WuGdict11a begin
 
 % set tick array - internal macros
 /tiputs { % rel_pos_of_tick | pos_of_tick : innermost routine for /taproc
-   tastep mul taloop add 
-   } def 
+   tastep mul taloop add
+   } def
 /taproclin { % (#tick/tack) | - : define /taproc for use in SetVec
    1 x div /tistep x def
    /taproc { 0 tistep .999 { tiputs } for } def
    } def
 /taproclog { % (#ticks/tacks) | - : define /taproc for use in SetVec
-      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def 
-   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def 
-   }{ dup 0 gt { pop /taproc { 0 tiputs } def 
-   }{            neg taproclin  
+      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def
+   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def
+   }{ dup 0 gt { pop /taproc { 0 tiputs } def
+   }{            neg taproclin
    } ifelse } ifelse } ifelse
    } def
 /SetVec { % tafro tatoo nta /vector | - : set /vector
-   4 1 roll 
+   4 1 roll
    /nta x def /tatoo x def /tafro x def
    /tastep tatoo tafro sub nta 1 sub div def
    [
@@ -728,8 +735,8 @@ WuGdict11a begin
       ] def
    } def
 % set tick array - user commands
-/SetTicVecLin { taproclin /TicVec SetVec } def 
-/SetTicVecLog { taproclog /TicVec SetVec } def 
+/SetTicVecLin { taproclin /TicVec SetVec } def
+/SetTicVecLog { taproclog /TicVec SetVec } def
 
 % set tack-and-number array
 /SetTacVec { % [ pos {label} pos {label} ... ] | -
@@ -740,7 +747,7 @@ WuGdict11a begin
    % note on angles : 0 = x-axis, 90 = y-axis
 /OneAxx { % fro to xpos ypos aang tang | - : presets for Axx, Tic, Tac, Num
    % store arguments
-   /tAng x def /aAng x def 
+   /tAng x def /aAng x def
    /yPos x def /xPos x def
    /aTo x def /aFro x def
    % set constants
@@ -795,7 +802,7 @@ WuGdict11a begin
    } def
 /TicProc { % aPos | - : default procedure to plot one tick
    np
-   xPos yPos xym mv 
+   xPos yPos xym mv
    dup xAng mul x yAng mul xym rm % eat argument, go to start pos.
    xTicLen yTicLen rl st
    } def
@@ -814,7 +821,7 @@ WuGdict11a begin
    linsetGri
    TicVec {
       3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
-         dup % x1 x2 y y 
+         dup % x1 x2 y y
          4 -1 roll x xym np mv % x2 y
          xym li st
          } ifelse
@@ -841,7 +848,7 @@ WuGdict11a begin
    } def
 /Tac {
    linsetTac
-   { pop xPos yPos xym mv 
+   { pop xPos yPos xym mv
       aPos dup xAng mul x yAng mul xym rm
       xTacLen yTacLen rl st
       } TacExe
@@ -874,7 +881,7 @@ WuGdict11a begin
    setnum
    fontheight ymm div yDisRel mul tAng sin mul /yDist x def
    { dup textW xDisRel mul tAng cos mul /xDist x def
-     xPos aPos xAng mul add xDist sub 
+     xPos aPos xAng mul add xDist sub
      yPos aPos yAng mul add yDist sub 3 2 roll textCM } TacExe
    } def
 /setnumDisRel { % xDisRel yDisRel | - : adjust just a little bit
@@ -882,19 +889,19 @@ WuGdict11a begin
    } def
 1.2 1.2 setnumDisRel % default setting
 % explicit Num routines for rectangular case
-/xNumL { % : numbers on low x axis 
+/xNumL { % : numbers on low x axis
    setnum
    { fontheight ymm div % conversion -> user_scale
      dup /xNumHeightL x def
      -.6 mul yPos add aPos x 3 2 roll textCT } TacExe
    } def
-/xNumH { % : numbers on high x axis 
+/xNumH { % : numbers on high x axis
    setnum
    { fontheight ymm div % conversion -> user_scale
      dup /xNumHeightH x def
      .6 mul yPos add aPos x 3 2 roll textCB } TacExe
    } def
-/yNumL { % : numbers on low y axis 
+/yNumL { % : numbers on low y axis
    setnum
    { fontsize -.3 mul xmm div xPos add aPos 3 2 roll textRM
      xwidth dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
@@ -909,7 +916,7 @@ WuGdict11a begin
    setnum
    textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
    } def
-/yNumH { % : numbers on high y axis 
+/yNumH { % : numbers on high y axis
    setnum
    { fontsize .3 mul xmm div xPos add aPos 3 2 roll textLM
      xwidth dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
@@ -967,7 +974,7 @@ WuGdict11a begin
    grestore
    } def
 
-   
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%  Data Plotting (Symbols and Curves)                                       %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -986,7 +993,7 @@ WuGdict11a begin
    /serrglo x def % plot error bars? 0=never, 1=always, 2=as_given_in_pset
    /slinglo x def % symbol linewidth multiplier
    /sradglo x def % symbol size multiplier
-   } def            
+   } def
 
 
 %%  Retrieve presets from style array:
@@ -998,7 +1005,7 @@ WuGdict11a begin
    3 2 roll % A n i
    dup 0 le {
       pop pop pop ostyle % chosen_number<=0 means: don't plot
-      } { 
+      } {
       1 sub x % A i-1 n
       mod get % A(i-1)
       exec
@@ -1010,7 +1017,7 @@ WuGdict11a begin
 
 /pset { % styp sfill serr srad slin | -
    % arg -> symbol linewidth
-   /slin x slinglo mul def   
+   /slin x slinglo mul def
    % arg -> symbol size
    /srad x fm 0.16 mul sradglo mul def
    % arg -> plot error bar?
@@ -1019,7 +1026,7 @@ WuGdict11a begin
    % arg -> fill the symbol? (0=open, 1=full, 2=colored_with_black_border)
    /sfill x def
    % adjust srad: it's the _outer_ radius
-   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if 
+   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if
    % arg -> symbol type
    /ps {ps_nil} def % default: don't plot (maybe we only want an error bar)
    dup  1 eq {/ps {ps_square}     def} if
@@ -1037,9 +1044,9 @@ WuGdict11a begin
    dup 13 eq {/ps {ps_star}       def} if
    dup 14 eq {/ps {ps_pentagon}   def} if
    pop
-   % 
+   %
    /t { % x y d[- d+] | -  : plot a symbol and eventually an error bar.
-       err_asy not { dup } if   
+       err_asy not { dup } if
        4 copy pop pop plot_symbol
        plot_errorbar
       } bind def
@@ -1072,7 +1079,7 @@ WuGdict11a begin
    /ti { nopoint } def
    /t  { nopoint } def
    /tf { nopoint } def
-} def   
+} def
 /nopoint { % x y d[- d+] | -
    pop pop pop err_asy { pop } if
 } def
@@ -1126,7 +1133,7 @@ WuGdict11a begin
 
 /ps_nil {
     } bind def
-    
+
 /ps_square {
    .5 .5 np mv
    0 -1 rl
@@ -1205,7 +1212,7 @@ WuGdict11a begin
    .7 dup 120 pol2xy np mv 300 pol2xy li st
    .7 dup 240 pol2xy np mv  60 pol2xy li st
    } bind def
-   
+
 
 %%  Set column plotting (use this instead of pset) - BROKEN in 11a or earlier
 
@@ -1243,7 +1250,7 @@ WuGdict11a begin
       fontheight ymm div nl_advance mul mul /nl_yins x nl_yins x sub def
       } def
    } def
-/newlist { 1.65 NewList } def 
+/newlist { 1.65 NewList } def
 /TxLine { % text TxLine -
    nl_xins nl_yins 3 -1 roll textLM newline
    } bind def
@@ -1260,50 +1267,50 @@ WuGdict11a begin
    newline
    } bind def
 /PtPtCvTxLine { % pstyle pstyle cstyle text | -
-   4 3 roll pstyle nl_xins nl_yins 0 t 
-   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t 
+   4 3 roll pstyle nl_xins nl_yins 0 t
+   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t
    x cstyle
-   nl_xins nl_xshift 2 mul add 
-   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti 
+   nl_xins nl_xshift 2 mul add
+   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti
    nl_xshift nl_xrline mul add nl_yins 0 tf
    nl_xshift add nl_yins 3 2 roll black textLM
    newline
    } bind def
 /PtCvTxLine { % pstyle cstyle text | -
-   3 2 roll pstyle nl_xins nl_yins 0 t 
+   3 2 roll pstyle nl_xins nl_yins 0 t
    x cstyle
-   nl_xins nl_xshift 1 mul add 
-   dup dup nl_xshift -.33 mul add nl_yins 0 ti 
+   nl_xins nl_xshift 1 mul add
+   dup dup nl_xshift -.33 mul add nl_yins 0 ti
    nl_xshift 0.33 mul add nl_yins 0 tf
    nl_xshift add nl_yins 3 2 roll black textLM
    newline
    } bind def
 /PtPtTxLine { % pstyle pstyle text | -
-   3 2 roll pstyle nl_xins nl_yins 0 t 
+   3 2 roll pstyle nl_xins nl_yins 0 t
    x pstyle nl_xins nl_xshift add nl_yins 0 t
    black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /CvTxLine { % cstyle text | -
-   x cstyle 
-   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti 
-   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf  
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf
    black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /Cv2TxLine { % cstyle text | -
-   x cstyle 
-   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti 
-   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf  
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf
    black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /PCTxLine { % pstyle(with plset) text | -
-   x pstyle 
-   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci 
-   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf  
+   x pstyle
+   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci
+   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf
    nl_xins yins 0 t
-   black nl_xins 
+   black nl_xins
       fontsize xmm div 1.9 mul % instead of xshift
       add nl_yins 3 2 roll textLM
    newline
@@ -1345,7 +1352,7 @@ WuGdict11a begin
    cp
    } def
 /execOval { %  xl yl dx dy dr { proc } | - % works only in quadratic grid
-   x 6 2 roll 
+   x 6 2 roll
    4 2 roll % proc dr dx dy xl yl
    gsave
       xym translate
@@ -1491,24 +1498,24 @@ WuGdict11a begin
        grestore
      grestore
 } def
-  
-/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis 
+
+/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis
    % the total height of the generated object is y_tot
    % of which y_knau(.le. y_tot) is for the real knautsch,
    % the remainder is for vertical prolongations.
-   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def 
+   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def
    /tmpa x ym tmpy 4 mul sub 2 div def
-   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl 
+   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl
    tmpx tmpy rl 0 tmpa rl st
    } def
-/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis 
+/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis
    setline
-   /spang x def 
+   /spang x def
    /splng x def
    /spsep x def
-   2 copy spsep sub gsave offset spang rotate 
+   2 copy spsep sub gsave offset spang rotate
       splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
-   spsep add gsave offset spang rotate 
+   spsep add gsave offset spang rotate
       splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
    } def
 
@@ -1532,7 +1539,7 @@ WuGdict11a begin
     4 1 roll 0 3 2 roll bmszRT x rtextCM % hlw dx/2
     dup 2 mul 3 1 roll x sub dup % dx len len
     0 0 180 4 -1 roll bmszSZ bmszTH arrow % dx len
-    x 0 0 4 -1 roll  bmszSZ bmszTH arrow 
+    x 0 0 4 -1 roll  bmszSZ bmszTH arrow
     grestore
    } def
 
@@ -1569,7 +1576,7 @@ WuGdict11a begin
 /ueV{ grec (m) endgr (eV) showif} bind def
 /inueV { showif (\() grec (m) endgr (eV\)) showif } bind def
 /inmeVr { showif (\(meV) supsc (-1) endsc (\)) showif } bind def
-/inueVr { showif (\() grec (m) endgr (eV) 
+/inueVr { showif (\() grec (m) endgr (eV)
           supsc (-1) endsc (\)) showif } bind def
 /inGHzr { showif (\(GHz) (-1) sp (\)) showif } def
 
@@ -1603,6 +1610,7 @@ end % WuGdict...
 %%  Mark "ewu", the end of the wups.. macro definition file                  %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 WuGdict11a begin
+setPalatino
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%  Customizable plot setup, copied from g3.ps (editör: use latin-1)
diff --git a/Doc/UserManual/fig/drawing/SAS_const_q_x.ps b/Doc/UserManual/fig/drawing/SAS_const_q_x.ps
index 4434e0e5ae41c2a7bdc307339374d9e6d0c4663e..afeb1963edd1902c823db98bd90f5922721628f6 100644
--- a/Doc/UserManual/fig/drawing/SAS_const_q_x.ps
+++ b/Doc/UserManual/fig/drawing/SAS_const_q_x.ps
@@ -28,7 +28,7 @@
 %%  Framework:
 
 % For interleaving applications, isolate what follows in a dictionary
-/WuGdict11a 400 dict def 
+/WuGdict11a 400 dict def
 WuGdict11a begin
 
 
@@ -82,14 +82,14 @@ WuGdict11a begin
 %    upper left corner.  Therefore we need a vertical translation,
 %    depending on the paper size.  A4 is 210x297 mm^2.  By this occasion,
 %    we also provide a border of 7 mm.
-/cmtranslate { % x y cmtranslate | - 
+/cmtranslate { % x y cmtranslate | -
    cm x cm x translate } bind def
 /originUpperLeft_A4{ .7 28.3 cmtranslate } bind def
 /goffsetA4 { ungscale originUpperLeft_A4 gscale } def
 /EdgeLeftDIN{ originUpperLeft_A4 } bind def % OBSOLETE since 11a
 
 % set absolute global scale and relative symbol size
-/defsiz { % size(cm) symbolsize(rel) | - 
+/defsiz { % size(cm) symbolsize(rel) | -
    /ftot x def
    /gsiz x cm 10 div def
    gscale % within 'size', coordinates run from 0 to 10
@@ -118,14 +118,14 @@ WuGdict11a begin
 /geld {0.759836 mul} bind def /Geld {0.759836 div} bind def % sqrt(sqrt(3))
 /gald {0.817765 mul} bind def /Gald {0.817765 div} bind def % sqrt sqrt sqrt 5
 
-% define frame coordinates 
+% define frame coordinates
 /defred { % x_reduction y_reduction label_reduction | -
-   /fmm x ftot mul def 
-   /ymm x def 
+   /fmm x ftot mul def
+   /ymm x def
    /xmm x def
 
    % conversion frame_coordinate -> global_coord
-   /xm {xmm mul} bind def 
+   /xm {xmm mul} bind def
    /ym {ymm mul} bind def
    /fm {fmm mul} bind def
    /xym {ym x xm x} bind def
@@ -238,7 +238,7 @@ WuGdict11a begin
    } def
 /iCol3 { % i i_max | - : siemens
    div /icnow x def
-   165 1 icnow sub mul 
+   165 1 icnow sub mul
    102   icnow     mul
     33 120 icnow mul add setRGBcolor
    } def
@@ -259,7 +259,7 @@ WuGdict11a begin
    0 max aCol length 1 sub min % offset safe_idx
    dup 1 add aCol length 1 sub min % offset i i+1
    aCol x get exec
-   4 3 roll aCol x get exec colormix setRGBcolor 
+   4 3 roll aCol x get exec colormix setRGBcolor
    } def
 
 
@@ -304,15 +304,15 @@ WuGdict11a begin
    {  30  30 130 } % 20
    ] def
 /aCol3 [ % siemenscolors
-   { 165   0  33 } % siemensred    
-   {  33 153 102 } % siemensgreen  
-   { 0   102 153 } % siemensblue   
-   {   0  51 102 } % siemenstext   
-   { 255 153   0 } % siemensorange 
-   { 102 102 102 } % siemensdark   
-   { 255 221   0 } % siemensyellow 
-   { 221 221 221 } % siemensgrey   
-   { 221 102 102 } % siemenspink   
+   { 165   0  33 } % siemensred
+   {  33 153 102 } % siemensgreen
+   { 0   102 153 } % siemensblue
+   {   0  51 102 } % siemenstext
+   { 255 153   0 } % siemensorange
+   { 102 102 102 } % siemensdark
+   { 255 221   0 } % siemensyellow
+   { 221 221 221 } % siemensgrey
+   { 221 102 102 } % siemenspink
    ] def
 /aCol4 [ % green-blue-brown
    { 120 160  60 }
@@ -345,7 +345,7 @@ WuGdict11a begin
    {   0 255 255 } % cyan
    { 160  82  45 } % sienna
    { 255 165   0 } % orange
-   { 255 127  80 } % coral  
+   { 255 127  80 } % coral
    ] def
 
 
@@ -403,12 +403,19 @@ WuGdict11a begin
 /Helvetica-Bold        /HelveticaLatin1-Bold        ISOLatin1Encoding ReEncode
 /Helvetica-BoldOblique /HelveticaLatin1-BoldOblique ISOLatin1Encoding ReEncode
 
+/setPalatino {
+/Palatino             /MyFont             ISOLatin1Encoding ReEncode
+/Palatino-Italic      /MyFont-Oblique     ISOLatin1Encoding ReEncode
+/Palatino-Bold        /MyFont-Bold        ISOLatin1Encoding ReEncode
+/Palatino-BoldItalic  /MyFont-BoldOblique ISOLatin1Encoding ReEncode
+} def
+
 
 %% Preset standard styles:
 
 % scale and set font; define fontsize, fontheight
-/setfontandsize { % font size | - 
-   dup 0 le { pop 100 } if % fontsize <= 0 not allowed ! 
+/setfontandsize { % font size | -
+   dup 0 le { pop 100 } if % fontsize <= 0 not allowed !
    /fontnonnil true def
    pt fm dup /fontsize x def
    x findfont
@@ -423,14 +430,14 @@ WuGdict11a begin
    } def
 
 % standard settings for labelling axes
-/setnum { /HelveticaLatin1            24 setfontandsize } def
-/setlab { /HelveticaLatin1            24 setfontandsize } def
+/setnum { /MyFont            24 setfontandsize } def
+/setlab { /MyFont            24 setfontandsize } def
 
 % user commands (free choice of fontsize, but fixed font family)
-/setown { /HelveticaLatin1             x setfontandsize } def
-/setbol { /HelveticaLatin1-Bold        x setfontandsize } def
-/setboq { /HelveticaLatin1-BoldOblique x setfontandsize } def
-/setobl { /HelveticaLatin1-Oblique     x setfontandsize } def
+/setown { /MyFont             x setfontandsize } def
+/setbol { /MyFont-Bold        x setfontandsize } def
+/setboq { /MyFont-BoldOblique x setfontandsize } def
+/setobl { /MyFont-Oblique     x setfontandsize } def
 
 
 %%  String treatment:
@@ -487,12 +494,12 @@ WuGdict11a begin
 /gbuild { % string xrel yrel obj | - : plot obj above/below string
    /obj x def /yrelbui x def /xrelbui x def
    /Symbol findfont fontsize scalefont setfont
-   dup showif 
+   dup showif
    prepare
       { pop regularfont setfont }
       { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
         currentpoint 4 2 roll % save position after string
-        regularfont setfont 
+        regularfont setfont
       rm obj pop       % obj must end with () that will be pop'ed
       mv               % back to saved position
       }
@@ -506,11 +513,11 @@ WuGdict11a begin
    x showif
    .8 .65 {(\136) show ()} gbuild
    } def
-/tilde { 
+/tilde {
    x showif
    1. .6 {(~) show ()} build
    } def
-/gtilde { 
+/gtilde {
    x showif
    1. .6 {(~) show ()} gbuild
    } def
@@ -520,26 +527,26 @@ WuGdict11a begin
 
 % the following macros use the symbol/curve plotting mechanism
 /pins { % string symins - ; symbol must be selected by pset
-   showif 
+   showif
    ( ) showif ( ) .5 .5 { currentxy 0 p black ()} build ( ) showif
    } def
 /clenins { % string len clenins - ; curve must be selected by cset
    x showif % I suppose that pins is preceeded by 8 spaces
-   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def 
-            % length of inserted curve : 
+   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def
+            % length of inserted curve :
             % -1 space : curve begins and ends in  middle of ( )
             % +3 spaces: pins requires 3 times ( )
-   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build 
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
    2 add {( ) showif} repeat
    } def
 /cins { % string symins - ; curve must be selected by cset
    showif 8 % I suppose that pins is preceeded by 8 spaces
    dup ( ) stringwidth pop mul 2 add /xstrich x xmm div 10 div def
    % nov03, ohne zu verstehen, "10 div" eingefuegt
-            % length of inserted curve : 
+            % length of inserted curve :
             % -1 space : curve begins and ends in  middle of ( )
             % +3 spaces: pins requires 3 times ( )
-   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build 
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
    2 add {( ) showif} repeat
    } def
 
@@ -551,10 +558,10 @@ WuGdict11a begin
     blabla endall % first pass : determine xwidth
    boxif { /boxwidth  xwidth (M) stringwidth pop boxxr mul 2 mul add def
            /boxheight fontheight 1 boxyr 2 mul add mul def
-           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub 
-           ypos fontheight .5 boxyr add mul sub mv 
+           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub
+           ypos fontheight .5 boxyr add mul sub mv
            boxwidth 0 rl 0 boxheight rl boxwidth neg 0 rl cp
-           boxproc 
+           boxproc
     } if
     xpos xwidth xrel mul sub ypos fontheight yrel mul sub mv
     /prepare false def
@@ -584,7 +591,7 @@ WuGdict11a begin
    xwidth % has been determined
    } def
 /textw { % obj textW y : dito, in 0..10-units
-   textW xmm div 
+   textW xmm div
    } def
 
 % horizontal text: x y ob | -
@@ -628,8 +635,8 @@ WuGdict11a begin
 
 %%  Layout presets:
 
-/xyTicLen {0.10 fm} def 
-/xyTacLen {0.20 fm} def 
+/xyTicLen {0.10 fm} def
+/xyTacLen {0.20 fm} def
 /txllen {0.20 fm} def
 /tyllen {0.20 fm} def
 /linsetAxx {black 0.7 setline} def
@@ -687,9 +694,9 @@ WuGdict11a begin
 } def
 
 
-/zValues { pop pop } def 
+/zValues { pop pop } def
 /plotafter {} def
-/whiteframe { 1 0 0 10 10 graybox } def 
+/whiteframe { 1 0 0 10 10 graybox } def
 /plotframes { xPlotFrame yPlotFrame } def
 /plotbefore { plotframes } def
 
@@ -703,21 +710,21 @@ WuGdict11a begin
 
 % set tick array - internal macros
 /tiputs { % rel_pos_of_tick | pos_of_tick : innermost routine for /taproc
-   tastep mul taloop add 
-   } def 
+   tastep mul taloop add
+   } def
 /taproclin { % (#tick/tack) | - : define /taproc for use in SetVec
    1 x div /tistep x def
    /taproc { 0 tistep .999 { tiputs } for } def
    } def
 /taproclog { % (#ticks/tacks) | - : define /taproc for use in SetVec
-      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def 
-   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def 
-   }{ dup 0 gt { pop /taproc { 0 tiputs } def 
-   }{            neg taproclin  
+      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def
+   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def
+   }{ dup 0 gt { pop /taproc { 0 tiputs } def
+   }{            neg taproclin
    } ifelse } ifelse } ifelse
    } def
 /SetVec { % tafro tatoo nta /vector | - : set /vector
-   4 1 roll 
+   4 1 roll
    /nta x def /tatoo x def /tafro x def
    /tastep tatoo tafro sub nta 1 sub div def
    [
@@ -728,8 +735,8 @@ WuGdict11a begin
       ] def
    } def
 % set tick array - user commands
-/SetTicVecLin { taproclin /TicVec SetVec } def 
-/SetTicVecLog { taproclog /TicVec SetVec } def 
+/SetTicVecLin { taproclin /TicVec SetVec } def
+/SetTicVecLog { taproclog /TicVec SetVec } def
 
 % set tack-and-number array
 /SetTacVec { % [ pos {label} pos {label} ... ] | -
@@ -740,7 +747,7 @@ WuGdict11a begin
    % note on angles : 0 = x-axis, 90 = y-axis
 /OneAxx { % fro to xpos ypos aang tang | - : presets for Axx, Tic, Tac, Num
    % store arguments
-   /tAng x def /aAng x def 
+   /tAng x def /aAng x def
    /yPos x def /xPos x def
    /aTo x def /aFro x def
    % set constants
@@ -795,7 +802,7 @@ WuGdict11a begin
    } def
 /TicProc { % aPos | - : default procedure to plot one tick
    np
-   xPos yPos xym mv 
+   xPos yPos xym mv
    dup xAng mul x yAng mul xym rm % eat argument, go to start pos.
    xTicLen yTicLen rl st
    } def
@@ -814,7 +821,7 @@ WuGdict11a begin
    linsetGri
    TicVec {
       3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
-         dup % x1 x2 y y 
+         dup % x1 x2 y y
          4 -1 roll x xym np mv % x2 y
          xym li st
          } ifelse
@@ -841,7 +848,7 @@ WuGdict11a begin
    } def
 /Tac {
    linsetTac
-   { pop xPos yPos xym mv 
+   { pop xPos yPos xym mv
       aPos dup xAng mul x yAng mul xym rm
       xTacLen yTacLen rl st
       } TacExe
@@ -874,7 +881,7 @@ WuGdict11a begin
    setnum
    fontheight ymm div yDisRel mul tAng sin mul /yDist x def
    { dup textW xDisRel mul tAng cos mul /xDist x def
-     xPos aPos xAng mul add xDist sub 
+     xPos aPos xAng mul add xDist sub
      yPos aPos yAng mul add yDist sub 3 2 roll textCM } TacExe
    } def
 /setnumDisRel { % xDisRel yDisRel | - : adjust just a little bit
@@ -882,19 +889,19 @@ WuGdict11a begin
    } def
 1.2 1.2 setnumDisRel % default setting
 % explicit Num routines for rectangular case
-/xNumL { % : numbers on low x axis 
+/xNumL { % : numbers on low x axis
    setnum
    { fontheight ymm div % conversion -> user_scale
      dup /xNumHeightL x def
      -.6 mul yPos add aPos x 3 2 roll textCT } TacExe
    } def
-/xNumH { % : numbers on high x axis 
+/xNumH { % : numbers on high x axis
    setnum
    { fontheight ymm div % conversion -> user_scale
      dup /xNumHeightH x def
      .6 mul yPos add aPos x 3 2 roll textCB } TacExe
    } def
-/yNumL { % : numbers on low y axis 
+/yNumL { % : numbers on low y axis
    setnum
    { fontsize -.3 mul xmm div xPos add aPos 3 2 roll textRM
      xwidth dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
@@ -909,7 +916,7 @@ WuGdict11a begin
    setnum
    textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
    } def
-/yNumH { % : numbers on high y axis 
+/yNumH { % : numbers on high y axis
    setnum
    { fontsize .3 mul xmm div xPos add aPos 3 2 roll textLM
      xwidth dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
@@ -967,7 +974,7 @@ WuGdict11a begin
    grestore
    } def
 
-   
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%  Data Plotting (Symbols and Curves)                                       %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -986,7 +993,7 @@ WuGdict11a begin
    /serrglo x def % plot error bars? 0=never, 1=always, 2=as_given_in_pset
    /slinglo x def % symbol linewidth multiplier
    /sradglo x def % symbol size multiplier
-   } def            
+   } def
 
 
 %%  Retrieve presets from style array:
@@ -998,7 +1005,7 @@ WuGdict11a begin
    3 2 roll % A n i
    dup 0 le {
       pop pop pop ostyle % chosen_number<=0 means: don't plot
-      } { 
+      } {
       1 sub x % A i-1 n
       mod get % A(i-1)
       exec
@@ -1010,7 +1017,7 @@ WuGdict11a begin
 
 /pset { % styp sfill serr srad slin | -
    % arg -> symbol linewidth
-   /slin x slinglo mul def   
+   /slin x slinglo mul def
    % arg -> symbol size
    /srad x fm 0.16 mul sradglo mul def
    % arg -> plot error bar?
@@ -1019,7 +1026,7 @@ WuGdict11a begin
    % arg -> fill the symbol? (0=open, 1=full, 2=colored_with_black_border)
    /sfill x def
    % adjust srad: it's the _outer_ radius
-   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if 
+   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if
    % arg -> symbol type
    /ps {ps_nil} def % default: don't plot (maybe we only want an error bar)
    dup  1 eq {/ps {ps_square}     def} if
@@ -1037,9 +1044,9 @@ WuGdict11a begin
    dup 13 eq {/ps {ps_star}       def} if
    dup 14 eq {/ps {ps_pentagon}   def} if
    pop
-   % 
+   %
    /t { % x y d[- d+] | -  : plot a symbol and eventually an error bar.
-       err_asy not { dup } if   
+       err_asy not { dup } if
        4 copy pop pop plot_symbol
        plot_errorbar
       } bind def
@@ -1072,7 +1079,7 @@ WuGdict11a begin
    /ti { nopoint } def
    /t  { nopoint } def
    /tf { nopoint } def
-} def   
+} def
 /nopoint { % x y d[- d+] | -
    pop pop pop err_asy { pop } if
 } def
@@ -1126,7 +1133,7 @@ WuGdict11a begin
 
 /ps_nil {
     } bind def
-    
+
 /ps_square {
    .5 .5 np mv
    0 -1 rl
@@ -1205,7 +1212,7 @@ WuGdict11a begin
    .7 dup 120 pol2xy np mv 300 pol2xy li st
    .7 dup 240 pol2xy np mv  60 pol2xy li st
    } bind def
-   
+
 
 %%  Set column plotting (use this instead of pset) - BROKEN in 11a or earlier
 
@@ -1243,7 +1250,7 @@ WuGdict11a begin
       fontheight ymm div nl_advance mul mul /nl_yins x nl_yins x sub def
       } def
    } def
-/newlist { 1.65 NewList } def 
+/newlist { 1.65 NewList } def
 /TxLine { % text TxLine -
    nl_xins nl_yins 3 -1 roll textLM newline
    } bind def
@@ -1260,50 +1267,50 @@ WuGdict11a begin
    newline
    } bind def
 /PtPtCvTxLine { % pstyle pstyle cstyle text | -
-   4 3 roll pstyle nl_xins nl_yins 0 t 
-   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t 
+   4 3 roll pstyle nl_xins nl_yins 0 t
+   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t
    x cstyle
-   nl_xins nl_xshift 2 mul add 
-   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti 
+   nl_xins nl_xshift 2 mul add
+   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti
    nl_xshift nl_xrline mul add nl_yins 0 tf
    nl_xshift add nl_yins 3 2 roll black textLM
    newline
    } bind def
 /PtCvTxLine { % pstyle cstyle text | -
-   3 2 roll pstyle nl_xins nl_yins 0 t 
+   3 2 roll pstyle nl_xins nl_yins 0 t
    x cstyle
-   nl_xins nl_xshift 1 mul add 
-   dup dup nl_xshift -.33 mul add nl_yins 0 ti 
+   nl_xins nl_xshift 1 mul add
+   dup dup nl_xshift -.33 mul add nl_yins 0 ti
    nl_xshift 0.33 mul add nl_yins 0 tf
    nl_xshift add nl_yins 3 2 roll black textLM
    newline
    } bind def
 /PtPtTxLine { % pstyle pstyle text | -
-   3 2 roll pstyle nl_xins nl_yins 0 t 
+   3 2 roll pstyle nl_xins nl_yins 0 t
    x pstyle nl_xins nl_xshift add nl_yins 0 t
    black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /CvTxLine { % cstyle text | -
-   x cstyle 
-   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti 
-   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf  
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf
    black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /Cv2TxLine { % cstyle text | -
-   x cstyle 
-   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti 
-   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf  
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf
    black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /PCTxLine { % pstyle(with plset) text | -
-   x pstyle 
-   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci 
-   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf  
+   x pstyle
+   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci
+   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf
    nl_xins yins 0 t
-   black nl_xins 
+   black nl_xins
       fontsize xmm div 1.9 mul % instead of xshift
       add nl_yins 3 2 roll textLM
    newline
@@ -1345,7 +1352,7 @@ WuGdict11a begin
    cp
    } def
 /execOval { %  xl yl dx dy dr { proc } | - % works only in quadratic grid
-   x 6 2 roll 
+   x 6 2 roll
    4 2 roll % proc dr dx dy xl yl
    gsave
       xym translate
@@ -1491,24 +1498,24 @@ WuGdict11a begin
        grestore
      grestore
 } def
-  
-/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis 
+
+/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis
    % the total height of the generated object is y_tot
    % of which y_knau(.le. y_tot) is for the real knautsch,
    % the remainder is for vertical prolongations.
-   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def 
+   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def
    /tmpa x ym tmpy 4 mul sub 2 div def
-   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl 
+   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl
    tmpx tmpy rl 0 tmpa rl st
    } def
-/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis 
+/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis
    setline
-   /spang x def 
+   /spang x def
    /splng x def
    /spsep x def
-   2 copy spsep sub gsave offset spang rotate 
+   2 copy spsep sub gsave offset spang rotate
       splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
-   spsep add gsave offset spang rotate 
+   spsep add gsave offset spang rotate
       splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
    } def
 
@@ -1532,7 +1539,7 @@ WuGdict11a begin
     4 1 roll 0 3 2 roll bmszRT x rtextCM % hlw dx/2
     dup 2 mul 3 1 roll x sub dup % dx len len
     0 0 180 4 -1 roll bmszSZ bmszTH arrow % dx len
-    x 0 0 4 -1 roll  bmszSZ bmszTH arrow 
+    x 0 0 4 -1 roll  bmszSZ bmszTH arrow
     grestore
    } def
 
@@ -1569,7 +1576,7 @@ WuGdict11a begin
 /ueV{ grec (m) endgr (eV) showif} bind def
 /inueV { showif (\() grec (m) endgr (eV\)) showif } bind def
 /inmeVr { showif (\(meV) supsc (-1) endsc (\)) showif } bind def
-/inueVr { showif (\() grec (m) endgr (eV) 
+/inueVr { showif (\() grec (m) endgr (eV)
           supsc (-1) endsc (\)) showif } bind def
 /inGHzr { showif (\(GHz) (-1) sp (\)) showif } def
 
@@ -1603,6 +1610,7 @@ end % WuGdict...
 %%  Mark "ewu", the end of the wups.. macro definition file                  %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 WuGdict11a begin
+setPalatino
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%  Customizable plot setup, copied from g3.ps (editör: use latin-1)
diff --git a/Doc/UserManual/fig/drawing/SAS_const_q_yz.ps b/Doc/UserManual/fig/drawing/SAS_const_q_yz.ps
index 98226ca5c515dcf98155c1de08807d4c65fd908a..20b8309b2c607b836b0514a0af89399e1ab5f15e 100644
--- a/Doc/UserManual/fig/drawing/SAS_const_q_yz.ps
+++ b/Doc/UserManual/fig/drawing/SAS_const_q_yz.ps
@@ -28,7 +28,7 @@
 %%  Framework:
 
 % For interleaving applications, isolate what follows in a dictionary
-/WuGdict11a 400 dict def 
+/WuGdict11a 400 dict def
 WuGdict11a begin
 
 
@@ -82,14 +82,14 @@ WuGdict11a begin
 %    upper left corner.  Therefore we need a vertical translation,
 %    depending on the paper size.  A4 is 210x297 mm^2.  By this occasion,
 %    we also provide a border of 7 mm.
-/cmtranslate { % x y cmtranslate | - 
+/cmtranslate { % x y cmtranslate | -
    cm x cm x translate } bind def
 /originUpperLeft_A4{ .7 28.3 cmtranslate } bind def
 /goffsetA4 { ungscale originUpperLeft_A4 gscale } def
 /EdgeLeftDIN{ originUpperLeft_A4 } bind def % OBSOLETE since 11a
 
 % set absolute global scale and relative symbol size
-/defsiz { % size(cm) symbolsize(rel) | - 
+/defsiz { % size(cm) symbolsize(rel) | -
    /ftot x def
    /gsiz x cm 10 div def
    gscale % within 'size', coordinates run from 0 to 10
@@ -118,14 +118,14 @@ WuGdict11a begin
 /geld {0.759836 mul} bind def /Geld {0.759836 div} bind def % sqrt(sqrt(3))
 /gald {0.817765 mul} bind def /Gald {0.817765 div} bind def % sqrt sqrt sqrt 5
 
-% define frame coordinates 
+% define frame coordinates
 /defred { % x_reduction y_reduction label_reduction | -
-   /fmm x ftot mul def 
-   /ymm x def 
+   /fmm x ftot mul def
+   /ymm x def
    /xmm x def
 
    % conversion frame_coordinate -> global_coord
-   /xm {xmm mul} bind def 
+   /xm {xmm mul} bind def
    /ym {ymm mul} bind def
    /fm {fmm mul} bind def
    /xym {ym x xm x} bind def
@@ -238,7 +238,7 @@ WuGdict11a begin
    } def
 /iCol3 { % i i_max | - : siemens
    div /icnow x def
-   165 1 icnow sub mul 
+   165 1 icnow sub mul
    102   icnow     mul
     33 120 icnow mul add setRGBcolor
    } def
@@ -259,7 +259,7 @@ WuGdict11a begin
    0 max aCol length 1 sub min % offset safe_idx
    dup 1 add aCol length 1 sub min % offset i i+1
    aCol x get exec
-   4 3 roll aCol x get exec colormix setRGBcolor 
+   4 3 roll aCol x get exec colormix setRGBcolor
    } def
 
 
@@ -304,15 +304,15 @@ WuGdict11a begin
    {  30  30 130 } % 20
    ] def
 /aCol3 [ % siemenscolors
-   { 165   0  33 } % siemensred    
-   {  33 153 102 } % siemensgreen  
-   { 0   102 153 } % siemensblue   
-   {   0  51 102 } % siemenstext   
-   { 255 153   0 } % siemensorange 
-   { 102 102 102 } % siemensdark   
-   { 255 221   0 } % siemensyellow 
-   { 221 221 221 } % siemensgrey   
-   { 221 102 102 } % siemenspink   
+   { 165   0  33 } % siemensred
+   {  33 153 102 } % siemensgreen
+   { 0   102 153 } % siemensblue
+   {   0  51 102 } % siemenstext
+   { 255 153   0 } % siemensorange
+   { 102 102 102 } % siemensdark
+   { 255 221   0 } % siemensyellow
+   { 221 221 221 } % siemensgrey
+   { 221 102 102 } % siemenspink
    ] def
 /aCol4 [ % green-blue-brown
    { 120 160  60 }
@@ -345,7 +345,7 @@ WuGdict11a begin
    {   0 255 255 } % cyan
    { 160  82  45 } % sienna
    { 255 165   0 } % orange
-   { 255 127  80 } % coral  
+   { 255 127  80 } % coral
    ] def
 
 
@@ -403,12 +403,19 @@ WuGdict11a begin
 /Helvetica-Bold        /HelveticaLatin1-Bold        ISOLatin1Encoding ReEncode
 /Helvetica-BoldOblique /HelveticaLatin1-BoldOblique ISOLatin1Encoding ReEncode
 
+/setPalatino {
+/Palatino             /MyFont             ISOLatin1Encoding ReEncode
+/Palatino-Italic      /MyFont-Oblique     ISOLatin1Encoding ReEncode
+/Palatino-Bold        /MyFont-Bold        ISOLatin1Encoding ReEncode
+/Palatino-BoldItalic  /MyFont-BoldOblique ISOLatin1Encoding ReEncode
+} def
+
 
 %% Preset standard styles:
 
 % scale and set font; define fontsize, fontheight
-/setfontandsize { % font size | - 
-   dup 0 le { pop 100 } if % fontsize <= 0 not allowed ! 
+/setfontandsize { % font size | -
+   dup 0 le { pop 100 } if % fontsize <= 0 not allowed !
    /fontnonnil true def
    pt fm dup /fontsize x def
    x findfont
@@ -423,14 +430,14 @@ WuGdict11a begin
    } def
 
 % standard settings for labelling axes
-/setnum { /HelveticaLatin1            24 setfontandsize } def
-/setlab { /HelveticaLatin1            24 setfontandsize } def
+/setnum { /MyFont            24 setfontandsize } def
+/setlab { /MyFont            24 setfontandsize } def
 
 % user commands (free choice of fontsize, but fixed font family)
-/setown { /HelveticaLatin1             x setfontandsize } def
-/setbol { /HelveticaLatin1-Bold        x setfontandsize } def
-/setboq { /HelveticaLatin1-BoldOblique x setfontandsize } def
-/setobl { /HelveticaLatin1-Oblique     x setfontandsize } def
+/setown { /MyFont             x setfontandsize } def
+/setbol { /MyFont-Bold        x setfontandsize } def
+/setboq { /MyFont-BoldOblique x setfontandsize } def
+/setobl { /MyFont-Oblique     x setfontandsize } def
 
 
 %%  String treatment:
@@ -487,12 +494,12 @@ WuGdict11a begin
 /gbuild { % string xrel yrel obj | - : plot obj above/below string
    /obj x def /yrelbui x def /xrelbui x def
    /Symbol findfont fontsize scalefont setfont
-   dup showif 
+   dup showif
    prepare
       { pop regularfont setfont }
       { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
         currentpoint 4 2 roll % save position after string
-        regularfont setfont 
+        regularfont setfont
       rm obj pop       % obj must end with () that will be pop'ed
       mv               % back to saved position
       }
@@ -506,11 +513,11 @@ WuGdict11a begin
    x showif
    .8 .65 {(\136) show ()} gbuild
    } def
-/tilde { 
+/tilde {
    x showif
    1. .6 {(~) show ()} build
    } def
-/gtilde { 
+/gtilde {
    x showif
    1. .6 {(~) show ()} gbuild
    } def
@@ -520,26 +527,26 @@ WuGdict11a begin
 
 % the following macros use the symbol/curve plotting mechanism
 /pins { % string symins - ; symbol must be selected by pset
-   showif 
+   showif
    ( ) showif ( ) .5 .5 { currentxy 0 p black ()} build ( ) showif
    } def
 /clenins { % string len clenins - ; curve must be selected by cset
    x showif % I suppose that pins is preceeded by 8 spaces
-   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def 
-            % length of inserted curve : 
+   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def
+            % length of inserted curve :
             % -1 space : curve begins and ends in  middle of ( )
             % +3 spaces: pins requires 3 times ( )
-   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build 
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
    2 add {( ) showif} repeat
    } def
 /cins { % string symins - ; curve must be selected by cset
    showif 8 % I suppose that pins is preceeded by 8 spaces
    dup ( ) stringwidth pop mul 2 add /xstrich x xmm div 10 div def
    % nov03, ohne zu verstehen, "10 div" eingefuegt
-            % length of inserted curve : 
+            % length of inserted curve :
             % -1 space : curve begins and ends in  middle of ( )
             % +3 spaces: pins requires 3 times ( )
-   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build 
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
    2 add {( ) showif} repeat
    } def
 
@@ -551,10 +558,10 @@ WuGdict11a begin
     blabla endall % first pass : determine xwidth
    boxif { /boxwidth  xwidth (M) stringwidth pop boxxr mul 2 mul add def
            /boxheight fontheight 1 boxyr 2 mul add mul def
-           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub 
-           ypos fontheight .5 boxyr add mul sub mv 
+           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub
+           ypos fontheight .5 boxyr add mul sub mv
            boxwidth 0 rl 0 boxheight rl boxwidth neg 0 rl cp
-           boxproc 
+           boxproc
     } if
     xpos xwidth xrel mul sub ypos fontheight yrel mul sub mv
     /prepare false def
@@ -584,7 +591,7 @@ WuGdict11a begin
    xwidth % has been determined
    } def
 /textw { % obj textW y : dito, in 0..10-units
-   textW xmm div 
+   textW xmm div
    } def
 
 % horizontal text: x y ob | -
@@ -628,8 +635,8 @@ WuGdict11a begin
 
 %%  Layout presets:
 
-/xyTicLen {0.10 fm} def 
-/xyTacLen {0.20 fm} def 
+/xyTicLen {0.10 fm} def
+/xyTacLen {0.20 fm} def
 /txllen {0.20 fm} def
 /tyllen {0.20 fm} def
 /linsetAxx {black 0.7 setline} def
@@ -687,9 +694,9 @@ WuGdict11a begin
 } def
 
 
-/zValues { pop pop } def 
+/zValues { pop pop } def
 /plotafter {} def
-/whiteframe { 1 0 0 10 10 graybox } def 
+/whiteframe { 1 0 0 10 10 graybox } def
 /plotframes { xPlotFrame yPlotFrame } def
 /plotbefore { plotframes } def
 
@@ -703,21 +710,21 @@ WuGdict11a begin
 
 % set tick array - internal macros
 /tiputs { % rel_pos_of_tick | pos_of_tick : innermost routine for /taproc
-   tastep mul taloop add 
-   } def 
+   tastep mul taloop add
+   } def
 /taproclin { % (#tick/tack) | - : define /taproc for use in SetVec
    1 x div /tistep x def
    /taproc { 0 tistep .999 { tiputs } for } def
    } def
 /taproclog { % (#ticks/tacks) | - : define /taproc for use in SetVec
-      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def 
-   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def 
-   }{ dup 0 gt { pop /taproc { 0 tiputs } def 
-   }{            neg taproclin  
+      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def
+   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def
+   }{ dup 0 gt { pop /taproc { 0 tiputs } def
+   }{            neg taproclin
    } ifelse } ifelse } ifelse
    } def
 /SetVec { % tafro tatoo nta /vector | - : set /vector
-   4 1 roll 
+   4 1 roll
    /nta x def /tatoo x def /tafro x def
    /tastep tatoo tafro sub nta 1 sub div def
    [
@@ -728,8 +735,8 @@ WuGdict11a begin
       ] def
    } def
 % set tick array - user commands
-/SetTicVecLin { taproclin /TicVec SetVec } def 
-/SetTicVecLog { taproclog /TicVec SetVec } def 
+/SetTicVecLin { taproclin /TicVec SetVec } def
+/SetTicVecLog { taproclog /TicVec SetVec } def
 
 % set tack-and-number array
 /SetTacVec { % [ pos {label} pos {label} ... ] | -
@@ -740,7 +747,7 @@ WuGdict11a begin
    % note on angles : 0 = x-axis, 90 = y-axis
 /OneAxx { % fro to xpos ypos aang tang | - : presets for Axx, Tic, Tac, Num
    % store arguments
-   /tAng x def /aAng x def 
+   /tAng x def /aAng x def
    /yPos x def /xPos x def
    /aTo x def /aFro x def
    % set constants
@@ -795,7 +802,7 @@ WuGdict11a begin
    } def
 /TicProc { % aPos | - : default procedure to plot one tick
    np
-   xPos yPos xym mv 
+   xPos yPos xym mv
    dup xAng mul x yAng mul xym rm % eat argument, go to start pos.
    xTicLen yTicLen rl st
    } def
@@ -814,7 +821,7 @@ WuGdict11a begin
    linsetGri
    TicVec {
       3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
-         dup % x1 x2 y y 
+         dup % x1 x2 y y
          4 -1 roll x xym np mv % x2 y
          xym li st
          } ifelse
@@ -841,7 +848,7 @@ WuGdict11a begin
    } def
 /Tac {
    linsetTac
-   { pop xPos yPos xym mv 
+   { pop xPos yPos xym mv
       aPos dup xAng mul x yAng mul xym rm
       xTacLen yTacLen rl st
       } TacExe
@@ -874,7 +881,7 @@ WuGdict11a begin
    setnum
    fontheight ymm div yDisRel mul tAng sin mul /yDist x def
    { dup textW xDisRel mul tAng cos mul /xDist x def
-     xPos aPos xAng mul add xDist sub 
+     xPos aPos xAng mul add xDist sub
      yPos aPos yAng mul add yDist sub 3 2 roll textCM } TacExe
    } def
 /setnumDisRel { % xDisRel yDisRel | - : adjust just a little bit
@@ -882,19 +889,19 @@ WuGdict11a begin
    } def
 1.2 1.2 setnumDisRel % default setting
 % explicit Num routines for rectangular case
-/xNumL { % : numbers on low x axis 
+/xNumL { % : numbers on low x axis
    setnum
    { fontheight ymm div % conversion -> user_scale
      dup /xNumHeightL x def
      -.6 mul yPos add aPos x 3 2 roll textCT } TacExe
    } def
-/xNumH { % : numbers on high x axis 
+/xNumH { % : numbers on high x axis
    setnum
    { fontheight ymm div % conversion -> user_scale
      dup /xNumHeightH x def
      .6 mul yPos add aPos x 3 2 roll textCB } TacExe
    } def
-/yNumL { % : numbers on low y axis 
+/yNumL { % : numbers on low y axis
    setnum
    { fontsize -.3 mul xmm div xPos add aPos 3 2 roll textRM
      xwidth dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
@@ -909,7 +916,7 @@ WuGdict11a begin
    setnum
    textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
    } def
-/yNumH { % : numbers on high y axis 
+/yNumH { % : numbers on high y axis
    setnum
    { fontsize .3 mul xmm div xPos add aPos 3 2 roll textLM
      xwidth dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
@@ -967,7 +974,7 @@ WuGdict11a begin
    grestore
    } def
 
-   
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%  Data Plotting (Symbols and Curves)                                       %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -986,7 +993,7 @@ WuGdict11a begin
    /serrglo x def % plot error bars? 0=never, 1=always, 2=as_given_in_pset
    /slinglo x def % symbol linewidth multiplier
    /sradglo x def % symbol size multiplier
-   } def            
+   } def
 
 
 %%  Retrieve presets from style array:
@@ -998,7 +1005,7 @@ WuGdict11a begin
    3 2 roll % A n i
    dup 0 le {
       pop pop pop ostyle % chosen_number<=0 means: don't plot
-      } { 
+      } {
       1 sub x % A i-1 n
       mod get % A(i-1)
       exec
@@ -1010,7 +1017,7 @@ WuGdict11a begin
 
 /pset { % styp sfill serr srad slin | -
    % arg -> symbol linewidth
-   /slin x slinglo mul def   
+   /slin x slinglo mul def
    % arg -> symbol size
    /srad x fm 0.16 mul sradglo mul def
    % arg -> plot error bar?
@@ -1019,7 +1026,7 @@ WuGdict11a begin
    % arg -> fill the symbol? (0=open, 1=full, 2=colored_with_black_border)
    /sfill x def
    % adjust srad: it's the _outer_ radius
-   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if 
+   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if
    % arg -> symbol type
    /ps {ps_nil} def % default: don't plot (maybe we only want an error bar)
    dup  1 eq {/ps {ps_square}     def} if
@@ -1037,9 +1044,9 @@ WuGdict11a begin
    dup 13 eq {/ps {ps_star}       def} if
    dup 14 eq {/ps {ps_pentagon}   def} if
    pop
-   % 
+   %
    /t { % x y d[- d+] | -  : plot a symbol and eventually an error bar.
-       err_asy not { dup } if   
+       err_asy not { dup } if
        4 copy pop pop plot_symbol
        plot_errorbar
       } bind def
@@ -1072,7 +1079,7 @@ WuGdict11a begin
    /ti { nopoint } def
    /t  { nopoint } def
    /tf { nopoint } def
-} def   
+} def
 /nopoint { % x y d[- d+] | -
    pop pop pop err_asy { pop } if
 } def
@@ -1126,7 +1133,7 @@ WuGdict11a begin
 
 /ps_nil {
     } bind def
-    
+
 /ps_square {
    .5 .5 np mv
    0 -1 rl
@@ -1205,7 +1212,7 @@ WuGdict11a begin
    .7 dup 120 pol2xy np mv 300 pol2xy li st
    .7 dup 240 pol2xy np mv  60 pol2xy li st
    } bind def
-   
+
 
 %%  Set column plotting (use this instead of pset) - BROKEN in 11a or earlier
 
@@ -1243,7 +1250,7 @@ WuGdict11a begin
       fontheight ymm div nl_advance mul mul /nl_yins x nl_yins x sub def
       } def
    } def
-/newlist { 1.65 NewList } def 
+/newlist { 1.65 NewList } def
 /TxLine { % text TxLine -
    nl_xins nl_yins 3 -1 roll textLM newline
    } bind def
@@ -1260,50 +1267,50 @@ WuGdict11a begin
    newline
    } bind def
 /PtPtCvTxLine { % pstyle pstyle cstyle text | -
-   4 3 roll pstyle nl_xins nl_yins 0 t 
-   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t 
+   4 3 roll pstyle nl_xins nl_yins 0 t
+   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t
    x cstyle
-   nl_xins nl_xshift 2 mul add 
-   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti 
+   nl_xins nl_xshift 2 mul add
+   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti
    nl_xshift nl_xrline mul add nl_yins 0 tf
    nl_xshift add nl_yins 3 2 roll black textLM
    newline
    } bind def
 /PtCvTxLine { % pstyle cstyle text | -
-   3 2 roll pstyle nl_xins nl_yins 0 t 
+   3 2 roll pstyle nl_xins nl_yins 0 t
    x cstyle
-   nl_xins nl_xshift 1 mul add 
-   dup dup nl_xshift -.33 mul add nl_yins 0 ti 
+   nl_xins nl_xshift 1 mul add
+   dup dup nl_xshift -.33 mul add nl_yins 0 ti
    nl_xshift 0.33 mul add nl_yins 0 tf
    nl_xshift add nl_yins 3 2 roll black textLM
    newline
    } bind def
 /PtPtTxLine { % pstyle pstyle text | -
-   3 2 roll pstyle nl_xins nl_yins 0 t 
+   3 2 roll pstyle nl_xins nl_yins 0 t
    x pstyle nl_xins nl_xshift add nl_yins 0 t
    black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /CvTxLine { % cstyle text | -
-   x cstyle 
-   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti 
-   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf  
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf
    black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /Cv2TxLine { % cstyle text | -
-   x cstyle 
-   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti 
-   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf  
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf
    black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /PCTxLine { % pstyle(with plset) text | -
-   x pstyle 
-   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci 
-   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf  
+   x pstyle
+   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci
+   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf
    nl_xins yins 0 t
-   black nl_xins 
+   black nl_xins
       fontsize xmm div 1.9 mul % instead of xshift
       add nl_yins 3 2 roll textLM
    newline
@@ -1345,7 +1352,7 @@ WuGdict11a begin
    cp
    } def
 /execOval { %  xl yl dx dy dr { proc } | - % works only in quadratic grid
-   x 6 2 roll 
+   x 6 2 roll
    4 2 roll % proc dr dx dy xl yl
    gsave
       xym translate
@@ -1491,24 +1498,24 @@ WuGdict11a begin
        grestore
      grestore
 } def
-  
-/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis 
+
+/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis
    % the total height of the generated object is y_tot
    % of which y_knau(.le. y_tot) is for the real knautsch,
    % the remainder is for vertical prolongations.
-   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def 
+   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def
    /tmpa x ym tmpy 4 mul sub 2 div def
-   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl 
+   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl
    tmpx tmpy rl 0 tmpa rl st
    } def
-/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis 
+/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis
    setline
-   /spang x def 
+   /spang x def
    /splng x def
    /spsep x def
-   2 copy spsep sub gsave offset spang rotate 
+   2 copy spsep sub gsave offset spang rotate
       splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
-   spsep add gsave offset spang rotate 
+   spsep add gsave offset spang rotate
       splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
    } def
 
@@ -1532,7 +1539,7 @@ WuGdict11a begin
     4 1 roll 0 3 2 roll bmszRT x rtextCM % hlw dx/2
     dup 2 mul 3 1 roll x sub dup % dx len len
     0 0 180 4 -1 roll bmszSZ bmszTH arrow % dx len
-    x 0 0 4 -1 roll  bmszSZ bmszTH arrow 
+    x 0 0 4 -1 roll  bmszSZ bmszTH arrow
     grestore
    } def
 
@@ -1569,7 +1576,7 @@ WuGdict11a begin
 /ueV{ grec (m) endgr (eV) showif} bind def
 /inueV { showif (\() grec (m) endgr (eV\)) showif } bind def
 /inmeVr { showif (\(meV) supsc (-1) endsc (\)) showif } bind def
-/inueVr { showif (\() grec (m) endgr (eV) 
+/inueVr { showif (\() grec (m) endgr (eV)
           supsc (-1) endsc (\)) showif } bind def
 /inGHzr { showif (\(GHz) (-1) sp (\)) showif } def
 
@@ -1603,6 +1610,7 @@ end % WuGdict...
 %%  Mark "ewu", the end of the wups.. macro definition file                  %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 WuGdict11a begin
+setPalatino
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%  Customizable plot setup, copied from g3.ps (editör: use latin-1)
diff --git a/Doc/UserManual/fig/drawing/dwba_4terms.ps b/Doc/UserManual/fig/drawing/dwba_4terms.ps
index deea6d7cd9741849930ce3fd2e028faf90800742..23639ede81412bf148ac5ed73b0f8c8c6d00fc3c 100644
--- a/Doc/UserManual/fig/drawing/dwba_4terms.ps
+++ b/Doc/UserManual/fig/drawing/dwba_4terms.ps
@@ -1599,6 +1599,7 @@ end % WuGdict...
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 WuGdict11a begin
+setPalatino
 
 3 dup autolabel defsiz
 1 dup stdred
@@ -1710,8 +1711,5 @@ false false (2) 1.9 term
 true  true  (3) 2.9 term
 true  false (4) 3.8 term
 
-
-
-
 showpage
 end % WuGdict...
diff --git a/Doc/UserManual/fig/drawing/multilayer_boundary.ps b/Doc/UserManual/fig/drawing/multilayer_boundary.ps
index ecfc5bbf2650a87aeea0a68eec2c1e152bc3e255..77c85969dd690a39c2b678d43b749b822f8f8354 100644
--- a/Doc/UserManual/fig/drawing/multilayer_boundary.ps
+++ b/Doc/UserManual/fig/drawing/multilayer_boundary.ps
@@ -26,7 +26,7 @@
 %%  Framework:
 
 % For interleaving applications, isolate what follows in a dictionary
-/WuGdict11a 400 dict def 
+/WuGdict11a 400 dict def
 WuGdict11a begin
 
 
@@ -80,14 +80,14 @@ WuGdict11a begin
 %    upper left corner.  Therefore we need a vertical translation,
 %    depending on the paper size.  A4 is 210x297 mm^2.  By this occasion,
 %    we also provide a border of 7 mm.
-/cmtranslate { % x y cmtranslate | - 
+/cmtranslate { % x y cmtranslate | -
    cm x cm x translate } bind def
 /originUpperLeft_A4{ .7 28.3 cmtranslate } bind def
 /goffsetA4 { ungscale originUpperLeft_A4 gscale } def
 /EdgeLeftDIN{ originUpperLeft_A4 } bind def % OBSOLETE since 11a
 
 % set absolute global scale and relative symbol size
-/defsiz { % size(cm) symbolsize(rel) | - 
+/defsiz { % size(cm) symbolsize(rel) | -
    /ftot x def
    /gsiz x cm 10 div def
    gscale % within 'size', coordinates run from 0 to 10
@@ -116,14 +116,14 @@ WuGdict11a begin
 /geld {0.759836 mul} bind def /Geld {0.759836 div} bind def % sqrt(sqrt(3))
 /gald {0.817765 mul} bind def /Gald {0.817765 div} bind def % sqrt sqrt sqrt 5
 
-% define frame coordinates 
+% define frame coordinates
 /defred { % x_reduction y_reduction label_reduction | -
-   /fmm x ftot mul def 
-   /ymm x def 
+   /fmm x ftot mul def
+   /ymm x def
    /xmm x def
 
    % conversion frame_coordinate -> global_coord
-   /xm {xmm mul} bind def 
+   /xm {xmm mul} bind def
    /ym {ymm mul} bind def
    /fm {fmm mul} bind def
    /xym {ym x xm x} bind def
@@ -236,7 +236,7 @@ WuGdict11a begin
    } def
 /iCol3 { % i i_max | - : siemens
    div /icnow x def
-   165 1 icnow sub mul 
+   165 1 icnow sub mul
    102   icnow     mul
     33 120 icnow mul add setRGBcolor
    } def
@@ -257,7 +257,7 @@ WuGdict11a begin
    0 max aCol length 1 sub min % offset safe_idx
    dup 1 add aCol length 1 sub min % offset i i+1
    aCol x get exec
-   4 3 roll aCol x get exec colormix setRGBcolor 
+   4 3 roll aCol x get exec colormix setRGBcolor
    } def
 
 
@@ -302,15 +302,15 @@ WuGdict11a begin
    {  30  30 130 } % 20
    ] def
 /aCol3 [ % siemenscolors
-   { 165   0  33 } % siemensred    
-   {  33 153 102 } % siemensgreen  
-   { 0   102 153 } % siemensblue   
-   {   0  51 102 } % siemenstext   
-   { 255 153   0 } % siemensorange 
-   { 102 102 102 } % siemensdark   
-   { 255 221   0 } % siemensyellow 
-   { 221 221 221 } % siemensgrey   
-   { 221 102 102 } % siemenspink   
+   { 165   0  33 } % siemensred
+   {  33 153 102 } % siemensgreen
+   { 0   102 153 } % siemensblue
+   {   0  51 102 } % siemenstext
+   { 255 153   0 } % siemensorange
+   { 102 102 102 } % siemensdark
+   { 255 221   0 } % siemensyellow
+   { 221 221 221 } % siemensgrey
+   { 221 102 102 } % siemenspink
    ] def
 /aCol4 [ % green-blue-brown
    { 120 160  60 }
@@ -343,7 +343,7 @@ WuGdict11a begin
    {   0 255 255 } % cyan
    { 160  82  45 } % sienna
    { 255 165   0 } % orange
-   { 255 127  80 } % coral  
+   { 255 127  80 } % coral
    ] def
 
 
@@ -402,8 +402,8 @@ WuGdict11a begin
 %% Preset standard styles:
 
 % scale and set font; define fontsize, fontheight
-/setfontandsize { % font size | - 
-   dup 0 le { pop 100 } if % fontsize <= 0 not allowed ! 
+/setfontandsize { % font size | -
+   dup 0 le { pop 100 } if % fontsize <= 0 not allowed !
    /fontnonnil true def
    pt fm dup /fontsize x def
    x findfont
@@ -479,12 +479,12 @@ WuGdict11a begin
 /gbuild { % string xrel yrel obj | - : plot obj above/below string
    /obj x def /yrelbui x def /xrelbui x def
    /Symbol findfont fontsize scalefont setfont
-   dup showif 
+   dup showif
    prepare
       { pop regularfont setfont }
       { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
         currentpoint 4 2 roll % save position after string
-        regularfont setfont 
+        regularfont setfont
       rm obj pop       % obj must end with () that will be pop'ed
       mv               % back to saved position
       }
@@ -498,11 +498,11 @@ WuGdict11a begin
    x showif
    .8 .65 {(\136) show ()} gbuild
    } def
-/tilde { 
+/tilde {
    x showif
    1. .6 {(~) show ()} build
    } def
-/gtilde { 
+/gtilde {
    x showif
    1. .6 {(~) show ()} gbuild
    } def
@@ -512,26 +512,26 @@ WuGdict11a begin
 
 % the following macros use the symbol/curve plotting mechanism
 /pins { % string symins - ; symbol must be selected by pset
-   showif 
+   showif
    ( ) showif ( ) .5 .5 { currentxy 0 p black ()} build ( ) showif
    } def
 /clenins { % string len clenins - ; curve must be selected by cset
    x showif % I suppose that pins is preceeded by 8 spaces
-   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def 
-            % length of inserted curve : 
+   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def
+            % length of inserted curve :
             % -1 space : curve begins and ends in  middle of ( )
             % +3 spaces: pins requires 3 times ( )
-   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build 
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
    2 add {( ) showif} repeat
    } def
 /cins { % string symins - ; curve must be selected by cset
    showif 8 % I suppose that pins is preceeded by 8 spaces
    dup ( ) stringwidth pop mul 2 add /xstrich x xmm div 10 div def
    % nov03, ohne zu verstehen, "10 div" eingefuegt
-            % length of inserted curve : 
+            % length of inserted curve :
             % -1 space : curve begins and ends in  middle of ( )
             % +3 spaces: pins requires 3 times ( )
-   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build 
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
    2 add {( ) showif} repeat
    } def
 
@@ -543,10 +543,10 @@ WuGdict11a begin
     blabla endall % first pass : determine xwidth
    boxif { /boxwidth  xwidth (M) stringwidth pop boxxr mul 2 mul add def
            /boxheight fontheight 1 boxyr 2 mul add mul def
-           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub 
-           ypos fontheight .5 boxyr add mul sub mv 
+           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub
+           ypos fontheight .5 boxyr add mul sub mv
            boxwidth 0 rl 0 boxheight rl boxwidth neg 0 rl cp
-           boxproc 
+           boxproc
     } if
     xpos xwidth xrel mul sub ypos fontheight yrel mul sub mv
     /prepare false def
@@ -576,7 +576,7 @@ WuGdict11a begin
    xwidth % has been determined
    } def
 /textw { % obj textW y : dito, in 0..10-units
-   textW xmm div 
+   textW xmm div
    } def
 
 % horizontal text: x y ob | -
@@ -620,8 +620,8 @@ WuGdict11a begin
 
 %%  Layout presets:
 
-/xyTicLen {0.10 fm} def 
-/xyTacLen {0.20 fm} def 
+/xyTicLen {0.10 fm} def
+/xyTacLen {0.20 fm} def
 /txllen {0.20 fm} def
 /tyllen {0.20 fm} def
 /linsetAxx {black 0.7 setline} def
@@ -679,9 +679,9 @@ WuGdict11a begin
 } def
 
 
-/zValues { pop pop } def 
+/zValues { pop pop } def
 /plotafter {} def
-/whiteframe { 1 0 0 10 10 graybox } def 
+/whiteframe { 1 0 0 10 10 graybox } def
 /plotframes { xPlotFrame yPlotFrame } def
 /plotbefore { plotframes } def
 
@@ -695,21 +695,21 @@ WuGdict11a begin
 
 % set tick array - internal macros
 /tiputs { % rel_pos_of_tick | pos_of_tick : innermost routine for /taproc
-   tastep mul taloop add 
-   } def 
+   tastep mul taloop add
+   } def
 /taproclin { % (#tick/tack) | - : define /taproc for use in SetVec
    1 x div /tistep x def
    /taproc { 0 tistep .999 { tiputs } for } def
    } def
 /taproclog { % (#ticks/tacks) | - : define /taproc for use in SetVec
-      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def 
-   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def 
-   }{ dup 0 gt { pop /taproc { 0 tiputs } def 
-   }{            neg taproclin  
+      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def
+   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def
+   }{ dup 0 gt { pop /taproc { 0 tiputs } def
+   }{            neg taproclin
    } ifelse } ifelse } ifelse
    } def
 /SetVec { % tafro tatoo nta /vector | - : set /vector
-   4 1 roll 
+   4 1 roll
    /nta x def /tatoo x def /tafro x def
    /tastep tatoo tafro sub nta 1 sub div def
    [
@@ -720,8 +720,8 @@ WuGdict11a begin
       ] def
    } def
 % set tick array - user commands
-/SetTicVecLin { taproclin /TicVec SetVec } def 
-/SetTicVecLog { taproclog /TicVec SetVec } def 
+/SetTicVecLin { taproclin /TicVec SetVec } def
+/SetTicVecLog { taproclog /TicVec SetVec } def
 
 % set tack-and-number array
 /SetTacVec { % [ pos {label} pos {label} ... ] | -
@@ -732,7 +732,7 @@ WuGdict11a begin
    % note on angles : 0 = x-axis, 90 = y-axis
 /OneAxx { % fro to xpos ypos aang tang | - : presets for Axx, Tic, Tac, Num
    % store arguments
-   /tAng x def /aAng x def 
+   /tAng x def /aAng x def
    /yPos x def /xPos x def
    /aTo x def /aFro x def
    % set constants
@@ -787,7 +787,7 @@ WuGdict11a begin
    } def
 /TicProc { % aPos | - : default procedure to plot one tick
    np
-   xPos yPos xym mv 
+   xPos yPos xym mv
    dup xAng mul x yAng mul xym rm % eat argument, go to start pos.
    xTicLen yTicLen rl st
    } def
@@ -806,7 +806,7 @@ WuGdict11a begin
    linsetGri
    TicVec {
       3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
-         dup % x1 x2 y y 
+         dup % x1 x2 y y
          4 -1 roll x xym np mv % x2 y
          xym li st
          } ifelse
@@ -833,7 +833,7 @@ WuGdict11a begin
    } def
 /Tac {
    linsetTac
-   { pop xPos yPos xym mv 
+   { pop xPos yPos xym mv
       aPos dup xAng mul x yAng mul xym rm
       xTacLen yTacLen rl st
       } TacExe
@@ -866,7 +866,7 @@ WuGdict11a begin
    setnum
    fontheight ymm div yDisRel mul tAng sin mul /yDist x def
    { dup textW xDisRel mul tAng cos mul /xDist x def
-     xPos aPos xAng mul add xDist sub 
+     xPos aPos xAng mul add xDist sub
      yPos aPos yAng mul add yDist sub 3 2 roll textCM } TacExe
    } def
 /setnumDisRel { % xDisRel yDisRel | - : adjust just a little bit
@@ -874,19 +874,19 @@ WuGdict11a begin
    } def
 1.2 1.2 setnumDisRel % default setting
 % explicit Num routines for rectangular case
-/xNumL { % : numbers on low x axis 
+/xNumL { % : numbers on low x axis
    setnum
    { fontheight ymm div % conversion -> user_scale
      dup /xNumHeightL x def
      -.6 mul yPos add aPos x 3 2 roll textCT } TacExe
    } def
-/xNumH { % : numbers on high x axis 
+/xNumH { % : numbers on high x axis
    setnum
    { fontheight ymm div % conversion -> user_scale
      dup /xNumHeightH x def
      .6 mul yPos add aPos x 3 2 roll textCB } TacExe
    } def
-/yNumL { % : numbers on low y axis 
+/yNumL { % : numbers on low y axis
    setnum
    { fontsize -.3 mul xmm div xPos add aPos 3 2 roll textRM
      xwidth dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
@@ -901,7 +901,7 @@ WuGdict11a begin
    setnum
    textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
    } def
-/yNumH { % : numbers on high y axis 
+/yNumH { % : numbers on high y axis
    setnum
    { fontsize .3 mul xmm div xPos add aPos 3 2 roll textLM
      xwidth dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
@@ -959,7 +959,7 @@ WuGdict11a begin
    grestore
    } def
 
-   
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%  Data Plotting (Symbols and Curves)                                       %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -978,7 +978,7 @@ WuGdict11a begin
    /serrglo x def % plot error bars? 0=never, 1=always, 2=as_given_in_pset
    /slinglo x def % symbol linewidth multiplier
    /sradglo x def % symbol size multiplier
-   } def            
+   } def
 
 
 %%  Retrieve presets from style array:
@@ -990,7 +990,7 @@ WuGdict11a begin
    3 2 roll % A n i
    dup 0 le {
       pop pop pop ostyle % chosen_number<=0 means: don't plot
-      } { 
+      } {
       1 sub x % A i-1 n
       mod get % A(i-1)
       exec
@@ -1002,7 +1002,7 @@ WuGdict11a begin
 
 /pset { % styp sfill serr srad slin | -
    % arg -> symbol linewidth
-   /slin x slinglo mul def   
+   /slin x slinglo mul def
    % arg -> symbol size
    /srad x fm 0.16 mul sradglo mul def
    % arg -> plot error bar?
@@ -1011,7 +1011,7 @@ WuGdict11a begin
    % arg -> fill the symbol? (0=open, 1=full, 2=colored_with_black_border)
    /sfill x def
    % adjust srad: it's the _outer_ radius
-   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if 
+   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if
    % arg -> symbol type
    /ps {ps_nil} def % default: don't plot (maybe we only want an error bar)
    dup  1 eq {/ps {ps_square}     def} if
@@ -1029,9 +1029,9 @@ WuGdict11a begin
    dup 13 eq {/ps {ps_star}       def} if
    dup 14 eq {/ps {ps_pentagon}   def} if
    pop
-   % 
+   %
    /t { % x y d[- d+] | -  : plot a symbol and eventually an error bar.
-       err_asy not { dup } if   
+       err_asy not { dup } if
        4 copy pop pop plot_symbol
        plot_errorbar
       } bind def
@@ -1064,7 +1064,7 @@ WuGdict11a begin
    /ti { nopoint } def
    /t  { nopoint } def
    /tf { nopoint } def
-} def   
+} def
 /nopoint { % x y d[- d+] | -
    pop pop pop err_asy { pop } if
 } def
@@ -1118,7 +1118,7 @@ WuGdict11a begin
 
 /ps_nil {
     } bind def
-    
+
 /ps_square {
    .5 .5 np mv
    0 -1 rl
@@ -1197,7 +1197,7 @@ WuGdict11a begin
    .7 dup 120 pol2xy np mv 300 pol2xy li st
    .7 dup 240 pol2xy np mv  60 pol2xy li st
    } bind def
-   
+
 
 %%  Set column plotting (use this instead of pset) - BROKEN in 11a or earlier
 
@@ -1235,7 +1235,7 @@ WuGdict11a begin
       fontheight ymm div nl_advance mul mul /nl_yins x nl_yins x sub def
       } def
    } def
-/newlist { 1.65 NewList } def 
+/newlist { 1.65 NewList } def
 /TxLine { % text TxLine -
    nl_xins nl_yins 3 -1 roll textLM newline
    } bind def
@@ -1252,50 +1252,50 @@ WuGdict11a begin
    newline
    } bind def
 /PtPtCvTxLine { % pstyle pstyle cstyle text | -
-   4 3 roll pstyle nl_xins nl_yins 0 t 
-   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t 
+   4 3 roll pstyle nl_xins nl_yins 0 t
+   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t
    x cstyle
-   nl_xins nl_xshift 2 mul add 
-   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti 
+   nl_xins nl_xshift 2 mul add
+   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti
    nl_xshift nl_xrline mul add nl_yins 0 tf
    nl_xshift add nl_yins 3 2 roll black textLM
    newline
    } bind def
 /PtCvTxLine { % pstyle cstyle text | -
-   3 2 roll pstyle nl_xins nl_yins 0 t 
+   3 2 roll pstyle nl_xins nl_yins 0 t
    x cstyle
-   nl_xins nl_xshift 1 mul add 
-   dup dup nl_xshift -.33 mul add nl_yins 0 ti 
+   nl_xins nl_xshift 1 mul add
+   dup dup nl_xshift -.33 mul add nl_yins 0 ti
    nl_xshift 0.33 mul add nl_yins 0 tf
    nl_xshift add nl_yins 3 2 roll black textLM
    newline
    } bind def
 /PtPtTxLine { % pstyle pstyle text | -
-   3 2 roll pstyle nl_xins nl_yins 0 t 
+   3 2 roll pstyle nl_xins nl_yins 0 t
    x pstyle nl_xins nl_xshift add nl_yins 0 t
    black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /CvTxLine { % cstyle text | -
-   x cstyle 
-   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti 
-   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf  
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf
    black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /Cv2TxLine { % cstyle text | -
-   x cstyle 
-   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti 
-   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf  
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf
    black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /PCTxLine { % pstyle(with plset) text | -
-   x pstyle 
-   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci 
-   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf  
+   x pstyle
+   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci
+   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf
    nl_xins yins 0 t
-   black nl_xins 
+   black nl_xins
       fontsize xmm div 1.9 mul % instead of xshift
       add nl_yins 3 2 roll textLM
    newline
@@ -1337,7 +1337,7 @@ WuGdict11a begin
    cp
    } def
 /execOval { %  xl yl dx dy dr { proc } | - % works only in quadratic grid
-   x 6 2 roll 
+   x 6 2 roll
    4 2 roll % proc dr dx dy xl yl
    gsave
       xym translate
@@ -1483,24 +1483,24 @@ WuGdict11a begin
        grestore
      grestore
 } def
-  
-/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis 
+
+/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis
    % the total height of the generated object is y_tot
    % of which y_knau(.le. y_tot) is for the real knautsch,
    % the remainder is for vertical prolongations.
-   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def 
+   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def
    /tmpa x ym tmpy 4 mul sub 2 div def
-   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl 
+   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl
    tmpx tmpy rl 0 tmpa rl st
    } def
-/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis 
+/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis
    setline
-   /spang x def 
+   /spang x def
    /splng x def
    /spsep x def
-   2 copy spsep sub gsave offset spang rotate 
+   2 copy spsep sub gsave offset spang rotate
       splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
-   spsep add gsave offset spang rotate 
+   spsep add gsave offset spang rotate
       splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
    } def
 
@@ -1524,7 +1524,7 @@ WuGdict11a begin
     4 1 roll 0 3 2 roll bmszRT x rtextCM % hlw dx/2
     dup 2 mul 3 1 roll x sub dup % dx len len
     0 0 180 4 -1 roll bmszSZ bmszTH arrow % dx len
-    x 0 0 4 -1 roll  bmszSZ bmszTH arrow 
+    x 0 0 4 -1 roll  bmszSZ bmszTH arrow
     grestore
    } def
 
@@ -1561,7 +1561,7 @@ WuGdict11a begin
 /ueV{ grec (m) endgr (eV) showif} bind def
 /inueV { showif (\() grec (m) endgr (eV\)) showif } bind def
 /inmeVr { showif (\(meV) supsc (-1) endsc (\)) showif } bind def
-/inueVr { showif (\() grec (m) endgr (eV) 
+/inueVr { showif (\() grec (m) endgr (eV)
           supsc (-1) endsc (\)) showif } bind def
 /inGHzr { showif (\(GHz) (-1) sp (\)) showif } def
 
diff --git a/Doc/UserManual/fig/drawing/multilayer_z_conventions.ps b/Doc/UserManual/fig/drawing/multilayer_z_conventions.ps
index 97e593368f0c0a6dab4cbe3230ab78ccb728c2eb..8b26328b8b7829d421d9ab9c8a3acf828d9b9e1e 100644
--- a/Doc/UserManual/fig/drawing/multilayer_z_conventions.ps
+++ b/Doc/UserManual/fig/drawing/multilayer_z_conventions.ps
@@ -28,7 +28,7 @@
 %%  Framework:
 
 % For interleaving applications, isolate what follows in a dictionary
-/WuGdict11a 400 dict def 
+/WuGdict11a 400 dict def
 WuGdict11a begin
 
 
@@ -82,14 +82,14 @@ WuGdict11a begin
 %    upper left corner.  Therefore we need a vertical translation,
 %    depending on the paper size.  A4 is 210x297 mm^2.  By this occasion,
 %    we also provide a border of 7 mm.
-/cmtranslate { % x y cmtranslate | - 
+/cmtranslate { % x y cmtranslate | -
    cm x cm x translate } bind def
 /originUpperLeft_A4{ .7 28.3 cmtranslate } bind def
 /goffsetA4 { ungscale originUpperLeft_A4 gscale } def
 /EdgeLeftDIN{ originUpperLeft_A4 } bind def % OBSOLETE since 11a
 
 % set absolute global scale and relative symbol size
-/defsiz { % size(cm) symbolsize(rel) | - 
+/defsiz { % size(cm) symbolsize(rel) | -
    /ftot x def
    /gsiz x cm 10 div def
    gscale % within 'size', coordinates run from 0 to 10
@@ -118,14 +118,14 @@ WuGdict11a begin
 /geld {0.759836 mul} bind def /Geld {0.759836 div} bind def % sqrt(sqrt(3))
 /gald {0.817765 mul} bind def /Gald {0.817765 div} bind def % sqrt sqrt sqrt 5
 
-% define frame coordinates 
+% define frame coordinates
 /defred { % x_reduction y_reduction label_reduction | -
-   /fmm x ftot mul def 
-   /ymm x def 
+   /fmm x ftot mul def
+   /ymm x def
    /xmm x def
 
    % conversion frame_coordinate -> global_coord
-   /xm {xmm mul} bind def 
+   /xm {xmm mul} bind def
    /ym {ymm mul} bind def
    /fm {fmm mul} bind def
    /xym {ym x xm x} bind def
@@ -238,7 +238,7 @@ WuGdict11a begin
    } def
 /iCol3 { % i i_max | - : siemens
    div /icnow x def
-   165 1 icnow sub mul 
+   165 1 icnow sub mul
    102   icnow     mul
     33 120 icnow mul add setRGBcolor
    } def
@@ -259,7 +259,7 @@ WuGdict11a begin
    0 max aCol length 1 sub min % offset safe_idx
    dup 1 add aCol length 1 sub min % offset i i+1
    aCol x get exec
-   4 3 roll aCol x get exec colormix setRGBcolor 
+   4 3 roll aCol x get exec colormix setRGBcolor
    } def
 
 
@@ -304,15 +304,15 @@ WuGdict11a begin
    {  30  30 130 } % 20
    ] def
 /aCol3 [ % siemenscolors
-   { 165   0  33 } % siemensred    
-   {  33 153 102 } % siemensgreen  
-   { 0   102 153 } % siemensblue   
-   {   0  51 102 } % siemenstext   
-   { 255 153   0 } % siemensorange 
-   { 102 102 102 } % siemensdark   
-   { 255 221   0 } % siemensyellow 
-   { 221 221 221 } % siemensgrey   
-   { 221 102 102 } % siemenspink   
+   { 165   0  33 } % siemensred
+   {  33 153 102 } % siemensgreen
+   { 0   102 153 } % siemensblue
+   {   0  51 102 } % siemenstext
+   { 255 153   0 } % siemensorange
+   { 102 102 102 } % siemensdark
+   { 255 221   0 } % siemensyellow
+   { 221 221 221 } % siemensgrey
+   { 221 102 102 } % siemenspink
    ] def
 /aCol4 [ % green-blue-brown
    { 120 160  60 }
@@ -345,7 +345,7 @@ WuGdict11a begin
    {   0 255 255 } % cyan
    { 160  82  45 } % sienna
    { 255 165   0 } % orange
-   { 255 127  80 } % coral  
+   { 255 127  80 } % coral
    ] def
 
 
@@ -404,8 +404,8 @@ WuGdict11a begin
 %% Preset standard styles:
 
 % scale and set font; define fontsize, fontheight
-/setfontandsize { % font size | - 
-   dup 0 le { pop 100 } if % fontsize <= 0 not allowed ! 
+/setfontandsize { % font size | -
+   dup 0 le { pop 100 } if % fontsize <= 0 not allowed !
    /fontnonnil true def
    pt fm dup /fontsize x def
    x findfont
@@ -481,12 +481,12 @@ WuGdict11a begin
 /gbuild { % string xrel yrel obj | - : plot obj above/below string
    /obj x def /yrelbui x def /xrelbui x def
    /Symbol findfont fontsize scalefont setfont
-   dup showif 
+   dup showif
    prepare
       { pop regularfont setfont }
       { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
         currentpoint 4 2 roll % save position after string
-        regularfont setfont 
+        regularfont setfont
       rm obj pop       % obj must end with () that will be pop'ed
       mv               % back to saved position
       }
@@ -500,11 +500,11 @@ WuGdict11a begin
    x showif
    .8 .65 {(\136) show ()} gbuild
    } def
-/tilde { 
+/tilde {
    x showif
    1. .6 {(~) show ()} build
    } def
-/gtilde { 
+/gtilde {
    x showif
    1. .6 {(~) show ()} gbuild
    } def
@@ -514,26 +514,26 @@ WuGdict11a begin
 
 % the following macros use the symbol/curve plotting mechanism
 /pins { % string symins - ; symbol must be selected by pset
-   showif 
+   showif
    ( ) showif ( ) .5 .5 { currentxy 0 p black ()} build ( ) showif
    } def
 /clenins { % string len clenins - ; curve must be selected by cset
    x showif % I suppose that pins is preceeded by 8 spaces
-   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def 
-            % length of inserted curve : 
+   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def
+            % length of inserted curve :
             % -1 space : curve begins and ends in  middle of ( )
             % +3 spaces: pins requires 3 times ( )
-   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build 
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
    2 add {( ) showif} repeat
    } def
 /cins { % string symins - ; curve must be selected by cset
    showif 8 % I suppose that pins is preceeded by 8 spaces
    dup ( ) stringwidth pop mul 2 add /xstrich x xmm div 10 div def
    % nov03, ohne zu verstehen, "10 div" eingefuegt
-            % length of inserted curve : 
+            % length of inserted curve :
             % -1 space : curve begins and ends in  middle of ( )
             % +3 spaces: pins requires 3 times ( )
-   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build 
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
    2 add {( ) showif} repeat
    } def
 
@@ -545,10 +545,10 @@ WuGdict11a begin
     blabla endall % first pass : determine xwidth
    boxif { /boxwidth  xwidth (M) stringwidth pop boxxr mul 2 mul add def
            /boxheight fontheight 1 boxyr 2 mul add mul def
-           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub 
-           ypos fontheight .5 boxyr add mul sub mv 
+           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub
+           ypos fontheight .5 boxyr add mul sub mv
            boxwidth 0 rl 0 boxheight rl boxwidth neg 0 rl cp
-           boxproc 
+           boxproc
     } if
     xpos xwidth xrel mul sub ypos fontheight yrel mul sub mv
     /prepare false def
@@ -578,7 +578,7 @@ WuGdict11a begin
    xwidth % has been determined
    } def
 /textw { % obj textW y : dito, in 0..10-units
-   textW xmm div 
+   textW xmm div
    } def
 
 % horizontal text: x y ob | -
@@ -622,8 +622,8 @@ WuGdict11a begin
 
 %%  Layout presets:
 
-/xyTicLen {0.10 fm} def 
-/xyTacLen {0.20 fm} def 
+/xyTicLen {0.10 fm} def
+/xyTacLen {0.20 fm} def
 /txllen {0.20 fm} def
 /tyllen {0.20 fm} def
 /linsetAxx {black 0.7 setline} def
@@ -681,9 +681,9 @@ WuGdict11a begin
 } def
 
 
-/zValues { pop pop } def 
+/zValues { pop pop } def
 /plotafter {} def
-/whiteframe { 1 0 0 10 10 graybox } def 
+/whiteframe { 1 0 0 10 10 graybox } def
 /plotframes { xPlotFrame yPlotFrame } def
 /plotbefore { plotframes } def
 
@@ -697,21 +697,21 @@ WuGdict11a begin
 
 % set tick array - internal macros
 /tiputs { % rel_pos_of_tick | pos_of_tick : innermost routine for /taproc
-   tastep mul taloop add 
-   } def 
+   tastep mul taloop add
+   } def
 /taproclin { % (#tick/tack) | - : define /taproc for use in SetVec
    1 x div /tistep x def
    /taproc { 0 tistep .999 { tiputs } for } def
    } def
 /taproclog { % (#ticks/tacks) | - : define /taproc for use in SetVec
-      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def 
-   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def 
-   }{ dup 0 gt { pop /taproc { 0 tiputs } def 
-   }{            neg taproclin  
+      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def
+   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def
+   }{ dup 0 gt { pop /taproc { 0 tiputs } def
+   }{            neg taproclin
    } ifelse } ifelse } ifelse
    } def
 /SetVec { % tafro tatoo nta /vector | - : set /vector
-   4 1 roll 
+   4 1 roll
    /nta x def /tatoo x def /tafro x def
    /tastep tatoo tafro sub nta 1 sub div def
    [
@@ -722,8 +722,8 @@ WuGdict11a begin
       ] def
    } def
 % set tick array - user commands
-/SetTicVecLin { taproclin /TicVec SetVec } def 
-/SetTicVecLog { taproclog /TicVec SetVec } def 
+/SetTicVecLin { taproclin /TicVec SetVec } def
+/SetTicVecLog { taproclog /TicVec SetVec } def
 
 % set tack-and-number array
 /SetTacVec { % [ pos {label} pos {label} ... ] | -
@@ -734,7 +734,7 @@ WuGdict11a begin
    % note on angles : 0 = x-axis, 90 = y-axis
 /OneAxx { % fro to xpos ypos aang tang | - : presets for Axx, Tic, Tac, Num
    % store arguments
-   /tAng x def /aAng x def 
+   /tAng x def /aAng x def
    /yPos x def /xPos x def
    /aTo x def /aFro x def
    % set constants
@@ -789,7 +789,7 @@ WuGdict11a begin
    } def
 /TicProc { % aPos | - : default procedure to plot one tick
    np
-   xPos yPos xym mv 
+   xPos yPos xym mv
    dup xAng mul x yAng mul xym rm % eat argument, go to start pos.
    xTicLen yTicLen rl st
    } def
@@ -808,7 +808,7 @@ WuGdict11a begin
    linsetGri
    TicVec {
       3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
-         dup % x1 x2 y y 
+         dup % x1 x2 y y
          4 -1 roll x xym np mv % x2 y
          xym li st
          } ifelse
@@ -835,7 +835,7 @@ WuGdict11a begin
    } def
 /Tac {
    linsetTac
-   { pop xPos yPos xym mv 
+   { pop xPos yPos xym mv
       aPos dup xAng mul x yAng mul xym rm
       xTacLen yTacLen rl st
       } TacExe
@@ -868,7 +868,7 @@ WuGdict11a begin
    setnum
    fontheight ymm div yDisRel mul tAng sin mul /yDist x def
    { dup textW xDisRel mul tAng cos mul /xDist x def
-     xPos aPos xAng mul add xDist sub 
+     xPos aPos xAng mul add xDist sub
      yPos aPos yAng mul add yDist sub 3 2 roll textCM } TacExe
    } def
 /setnumDisRel { % xDisRel yDisRel | - : adjust just a little bit
@@ -876,19 +876,19 @@ WuGdict11a begin
    } def
 1.2 1.2 setnumDisRel % default setting
 % explicit Num routines for rectangular case
-/xNumL { % : numbers on low x axis 
+/xNumL { % : numbers on low x axis
    setnum
    { fontheight ymm div % conversion -> user_scale
      dup /xNumHeightL x def
      -.6 mul yPos add aPos x 3 2 roll textCT } TacExe
    } def
-/xNumH { % : numbers on high x axis 
+/xNumH { % : numbers on high x axis
    setnum
    { fontheight ymm div % conversion -> user_scale
      dup /xNumHeightH x def
      .6 mul yPos add aPos x 3 2 roll textCB } TacExe
    } def
-/yNumL { % : numbers on low y axis 
+/yNumL { % : numbers on low y axis
    setnum
    { fontsize -.3 mul xmm div xPos add aPos 3 2 roll textRM
      xwidth dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
@@ -903,7 +903,7 @@ WuGdict11a begin
    setnum
    textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
    } def
-/yNumH { % : numbers on high y axis 
+/yNumH { % : numbers on high y axis
    setnum
    { fontsize .3 mul xmm div xPos add aPos 3 2 roll textLM
      xwidth dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
@@ -961,7 +961,7 @@ WuGdict11a begin
    grestore
    } def
 
-   
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%  Data Plotting (Symbols and Curves)                                       %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -980,7 +980,7 @@ WuGdict11a begin
    /serrglo x def % plot error bars? 0=never, 1=always, 2=as_given_in_pset
    /slinglo x def % symbol linewidth multiplier
    /sradglo x def % symbol size multiplier
-   } def            
+   } def
 
 
 %%  Retrieve presets from style array:
@@ -992,7 +992,7 @@ WuGdict11a begin
    3 2 roll % A n i
    dup 0 le {
       pop pop pop ostyle % chosen_number<=0 means: don't plot
-      } { 
+      } {
       1 sub x % A i-1 n
       mod get % A(i-1)
       exec
@@ -1004,7 +1004,7 @@ WuGdict11a begin
 
 /pset { % styp sfill serr srad slin | -
    % arg -> symbol linewidth
-   /slin x slinglo mul def   
+   /slin x slinglo mul def
    % arg -> symbol size
    /srad x fm 0.16 mul sradglo mul def
    % arg -> plot error bar?
@@ -1013,7 +1013,7 @@ WuGdict11a begin
    % arg -> fill the symbol? (0=open, 1=full, 2=colored_with_black_border)
    /sfill x def
    % adjust srad: it's the _outer_ radius
-   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if 
+   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if
    % arg -> symbol type
    /ps {ps_nil} def % default: don't plot (maybe we only want an error bar)
    dup  1 eq {/ps {ps_square}     def} if
@@ -1031,9 +1031,9 @@ WuGdict11a begin
    dup 13 eq {/ps {ps_star}       def} if
    dup 14 eq {/ps {ps_pentagon}   def} if
    pop
-   % 
+   %
    /t { % x y d[- d+] | -  : plot a symbol and eventually an error bar.
-       err_asy not { dup } if   
+       err_asy not { dup } if
        4 copy pop pop plot_symbol
        plot_errorbar
       } bind def
@@ -1066,7 +1066,7 @@ WuGdict11a begin
    /ti { nopoint } def
    /t  { nopoint } def
    /tf { nopoint } def
-} def   
+} def
 /nopoint { % x y d[- d+] | -
    pop pop pop err_asy { pop } if
 } def
@@ -1120,7 +1120,7 @@ WuGdict11a begin
 
 /ps_nil {
     } bind def
-    
+
 /ps_square {
    .5 .5 np mv
    0 -1 rl
@@ -1199,7 +1199,7 @@ WuGdict11a begin
    .7 dup 120 pol2xy np mv 300 pol2xy li st
    .7 dup 240 pol2xy np mv  60 pol2xy li st
    } bind def
-   
+
 
 %%  Set column plotting (use this instead of pset) - BROKEN in 11a or earlier
 
@@ -1237,7 +1237,7 @@ WuGdict11a begin
       fontheight ymm div nl_advance mul mul /nl_yins x nl_yins x sub def
       } def
    } def
-/newlist { 1.65 NewList } def 
+/newlist { 1.65 NewList } def
 /TxLine { % text TxLine -
    nl_xins nl_yins 3 -1 roll textLM newline
    } bind def
@@ -1254,50 +1254,50 @@ WuGdict11a begin
    newline
    } bind def
 /PtPtCvTxLine { % pstyle pstyle cstyle text | -
-   4 3 roll pstyle nl_xins nl_yins 0 t 
-   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t 
+   4 3 roll pstyle nl_xins nl_yins 0 t
+   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t
    x cstyle
-   nl_xins nl_xshift 2 mul add 
-   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti 
+   nl_xins nl_xshift 2 mul add
+   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti
    nl_xshift nl_xrline mul add nl_yins 0 tf
    nl_xshift add nl_yins 3 2 roll black textLM
    newline
    } bind def
 /PtCvTxLine { % pstyle cstyle text | -
-   3 2 roll pstyle nl_xins nl_yins 0 t 
+   3 2 roll pstyle nl_xins nl_yins 0 t
    x cstyle
-   nl_xins nl_xshift 1 mul add 
-   dup dup nl_xshift -.33 mul add nl_yins 0 ti 
+   nl_xins nl_xshift 1 mul add
+   dup dup nl_xshift -.33 mul add nl_yins 0 ti
    nl_xshift 0.33 mul add nl_yins 0 tf
    nl_xshift add nl_yins 3 2 roll black textLM
    newline
    } bind def
 /PtPtTxLine { % pstyle pstyle text | -
-   3 2 roll pstyle nl_xins nl_yins 0 t 
+   3 2 roll pstyle nl_xins nl_yins 0 t
    x pstyle nl_xins nl_xshift add nl_yins 0 t
    black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /CvTxLine { % cstyle text | -
-   x cstyle 
-   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti 
-   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf  
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf
    black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /Cv2TxLine { % cstyle text | -
-   x cstyle 
-   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti 
-   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf  
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf
    black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
    newline
    } bind def
 /PCTxLine { % pstyle(with plset) text | -
-   x pstyle 
-   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci 
-   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf  
+   x pstyle
+   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci
+   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf
    nl_xins yins 0 t
-   black nl_xins 
+   black nl_xins
       fontsize xmm div 1.9 mul % instead of xshift
       add nl_yins 3 2 roll textLM
    newline
@@ -1339,7 +1339,7 @@ WuGdict11a begin
    cp
    } def
 /execOval { %  xl yl dx dy dr { proc } | - % works only in quadratic grid
-   x 6 2 roll 
+   x 6 2 roll
    4 2 roll % proc dr dx dy xl yl
    gsave
       xym translate
@@ -1485,24 +1485,24 @@ WuGdict11a begin
        grestore
      grestore
 } def
-  
-/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis 
+
+/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis
    % the total height of the generated object is y_tot
    % of which y_knau(.le. y_tot) is for the real knautsch,
    % the remainder is for vertical prolongations.
-   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def 
+   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def
    /tmpa x ym tmpy 4 mul sub 2 div def
-   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl 
+   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl
    tmpx tmpy rl 0 tmpa rl st
    } def
-/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis 
+/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis
    setline
-   /spang x def 
+   /spang x def
    /splng x def
    /spsep x def
-   2 copy spsep sub gsave offset spang rotate 
+   2 copy spsep sub gsave offset spang rotate
       splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
-   spsep add gsave offset spang rotate 
+   spsep add gsave offset spang rotate
       splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
    } def
 
@@ -1526,7 +1526,7 @@ WuGdict11a begin
     4 1 roll 0 3 2 roll bmszRT x rtextCM % hlw dx/2
     dup 2 mul 3 1 roll x sub dup % dx len len
     0 0 180 4 -1 roll bmszSZ bmszTH arrow % dx len
-    x 0 0 4 -1 roll  bmszSZ bmszTH arrow 
+    x 0 0 4 -1 roll  bmszSZ bmszTH arrow
     grestore
    } def
 
@@ -1563,7 +1563,7 @@ WuGdict11a begin
 /ueV{ grec (m) endgr (eV) showif} bind def
 /inueV { showif (\() grec (m) endgr (eV\)) showif } bind def
 /inmeVr { showif (\(meV) supsc (-1) endsc (\)) showif } bind def
-/inueVr { showif (\() grec (m) endgr (eV) 
+/inueVr { showif (\() grec (m) endgr (eV)
           supsc (-1) endsc (\)) showif } bind def
 /inGHzr { showif (\(GHz) (-1) sp (\)) showif } def
 
@@ -1673,11 +1673,11 @@ BoxBackground
     xl yl np mv xh yl li st
     xc yl 3 2 roll textLM
 } def
-xl  0.3 {(layer N)} textLM
+xl  0.3 {(layer N-1)} textLM
 xt  0.3 {(substrate)} textRM
-1 {(z)(N)sb()} hrul
-xl 1.5 {(layer N-1)} textLM
-2 {(z)(N-1)sb()} hrul
+1 {(z)(N-1)sb()} hrul
+xl 1.5 {(layer N-2)} textLM
+2 {(z)(N-2)sb()} hrul
 xl 3 {(\267  \267  \267)} textLM
 xc 3 {(\267 \267 \267)} textLM
 4 {(z)(2)sb()} hrul
diff --git a/Doc/UserManual/fig/drawing/s-vs-p-polarization.ps b/Doc/UserManual/fig/drawing/s-vs-p-polarization.ps
new file mode 100644
index 0000000000000000000000000000000000000000..f05539ddf214df2548b33036afa77106e85e2369
--- /dev/null
+++ b/Doc/UserManual/fig/drawing/s-vs-p-polarization.ps
@@ -0,0 +1,1689 @@
+%!PS-Adobe-1.0 EPSF-1.0
+%%BoundingBox:    79   683   420   803
+%%Comment: Bounding box extracted by bboxx
+%%+:       A program by Dov Grobgeld 2003
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  FRIDA: fast reliable interactive data analysis                           %%
+%%  wups11a.ps: graphic macros                                               %%
+%%  (C) Joachim Wuttke 1990-2016                                             %%
+%%  http://www.messen-und-deuten.de/frida                                    %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%  Sections:
+%   - Programming, Page Formatting, Coordinate Transforms
+%   - Colors
+%   - Fonts and Text Blocks
+%   - Coordinate Frame
+%   - Data Plotting (Symbols and Curves)
+%   - Lists
+%   - Macro Collection
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Programming, Page Formatting, Coordinate Transforms                      %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Framework:
+
+% For interleaving applications, isolate what follows in a dictionary
+/WuGdict11a 400 dict def
+WuGdict11a begin
+
+
+%%  Shortcuts:
+
+/np { newpath }   bind def
+/mv { moveto }    bind def
+/rm { rmoveto }   bind def
+/rl { rlineto }   bind def
+/li { lineto }    bind def
+/cp { closepath } bind def
+/st { stroke }    bind def
+/x  { exch }      bind def
+
+/black { 0 setgray } bind def
+/white { 1 setgray } bind def
+
+/F false def
+/T true  def
+
+
+%%  Constants:
+
+/pt {  .018567 mul} bind def % for line widths and font sizes, reason unclear
+/cm {28.346456 mul} bind def % typographic_point -> cm
+
+/twopi { 6.2831853072 } def
+
+
+%%  Math operators:
+
+/rnd  { rand cvr 1 30 bitshift div 2 div 0 max 1 min } def % -> between 0 and 1
+
+/min { 2 copy gt { x } if pop } def
+/max { 2 copy lt { x } if pop } def
+
+/tan { dup sin x cos div } def
+/cot { dup cos x sin div } def
+/pol2xy{ 2 copy cos mul 3 1 roll sin mul } def % r phi | x y
+
+/eexp { 2.71828 x exp } def % "exp" is x^y, eexp is e^x
+/tanh { 2.71828 x 2 copy exp 3 1 roll neg exp
+        2 copy sub 3 1 roll add div } def
+
+
+%%  Page layout and global figure size:
+
+% shift origin
+%    The PostScript coordinate system starts in the lower left corner
+%    of the page, whereas we want our figures to be justified in the
+%    upper left corner.  Therefore we need a vertical translation,
+%    depending on the paper size.  A4 is 210x297 mm^2.  By this occasion,
+%    we also provide a border of 7 mm.
+/cmtranslate { % x y cmtranslate | -
+   cm x cm x translate } bind def
+/originUpperLeft_A4{ .7 28.3 cmtranslate } bind def
+/goffsetA4 { ungscale originUpperLeft_A4 gscale } def
+/EdgeLeftDIN{ originUpperLeft_A4 } bind def % OBSOLETE since 11a
+
+% set absolute global scale and relative symbol size
+/defsiz { % size(cm) symbolsize(rel) | -
+   /ftot x def
+   /gsiz x cm 10 div def
+   gscale % within 'size', coordinates run from 0 to 10
+   } def
+/gscale {
+   gsiz dup scale
+} def
+/ungscale {
+   1 gsiz div dup scale
+} def
+
+% symbol (and label?) size as sublinear function of figure size
+/autolabel { % size(cm) | symbolsize(rel)
+   dup 7 div 2 add 4 mul % the simplest sublinear increase
+   x div % anticipate overall rescaling
+   } def
+
+
+%%  Frame size and shape, frame coordinates:
+
+% aspect ratios
+/gyld {0.447214 mul} bind def /Gyld {0.447214 div} bind def % sqrt(5)
+/guld {0.547723 mul} bind def /Guld {0.547723 div} bind def % sqrt(3)
+/gold {0.618034 mul} bind def /Gold {0.618034 div} bind def % goldener Schnitt
+/gild {0.707107 mul} bind def /Gild {0.707107 div} bind def % sqrt(2) : DIN
+/geld {0.759836 mul} bind def /Geld {0.759836 div} bind def % sqrt(sqrt(3))
+/gald {0.817765 mul} bind def /Gald {0.817765 div} bind def % sqrt sqrt sqrt 5
+
+% define frame coordinates
+/defred { % x_reduction y_reduction label_reduction | -
+   /fmm x ftot mul def
+   /ymm x def
+   /xmm x def
+
+   % conversion frame_coordinate -> global_coord
+   /xm {xmm mul} bind def
+   /ym {ymm mul} bind def
+   /fm {fmm mul} bind def
+   /xym {ym x xm x} bind def
+
+   % prefer rescaling over explicit conversion (make more use of this !)
+   /mmscale { xmm ymm scale } bind def
+   /mmunscale { 1 xmm div 1 ymm div scale } bind def
+
+   % graphic commands in frame coordinates
+   /offset { xym translate } bind def
+   /currentxy { currentpoint ymm div x xmm div x } bind def
+   /setline { pt fm setlinewidth [] 0 setdash } bind def
+   } def
+
+/stdred { % x_reduction y_reduction | -
+   2 copy mul sqrt defred
+   } def
+
+%%  World (= user application) coordinates:
+
+% user must declare x and y range
+/xSetCoord { % log min max | -
+   /wxmax x def
+   /wxmin x def
+   /wxlog x 0 eq not def
+   % prepare conversion world coord -> frame coord
+   /wxdel wxmax wxmin wxlog { div log } { sub } ifelse def
+   /wxd { % dx(world) | dx(frame)
+      wxlog { log } if wxdel div 10 mul
+      } bind def
+   /wx { % x(world) | x(frame)
+      wxmin wxlog { div } { sub } ifelse
+      wxd
+      } bind def
+   } def
+/ySetCoord { % log min max | -
+   /wymax x def
+   /wymin x def
+   /wylog x 0 eq not def
+   /wydel wymax wymin wylog { div log } { sub } ifelse def
+   /wyd { % dy(world) | dy(frame)
+      wylog { log } if wydel div 10 mul
+      } bind def
+   /wy { % y(world) | y(frame)
+      wymin wylog { div } { sub } ifelse
+      wyd
+      } bind def
+   } def
+
+% pair conversion
+/wxy { % x,y(world) -> x,y(frame)
+   wy x wx x
+   } def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Colors                                                                   %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Color operators:
+
+/setRGBcolor {
+   3 { 255 div 3 1 roll } repeat setrgbcolor
+   } def
+
+/colormix { % weight(0..1) col1(R|G|B) col2(R|G|B) | col(R|G|B)
+   7 -1 roll dup /weightA x def /weightB x 1 x sub def
+   4 -1 roll weightA mul x weightB mul add 5 1 roll
+   3 -1 roll weightA mul x weightB mul add 4 1 roll
+   2 -1 roll weightA mul x weightB mul add 3 1 roll
+   } def
+
+/relcol { % i_col n_col | rel(0..1) : for one-dimensional choices
+   1 sub div 0 max 1 min
+   } def
+
+
+%%  Named colors:
+
+/siemensorange { 255 153   0 setRGBcolor } bind def
+/siemensblue   { 0   102 153 setRGBcolor } bind def
+/siemenstext   {   0  51 102 setRGBcolor } bind def
+/siemensred    { 165   0  33 setRGBcolor } bind def
+/siemenspink   { 221 102 102 setRGBcolor } bind def
+/siemensgrey   { 221 221 221 setRGBcolor } bind def
+/siemensdark   { 102 102 102 setRGBcolor } bind def
+/siemensgreen  {  33 153 102 setRGBcolor } bind def
+/siemensyellow { 255 221   0 setRGBcolor } bind def
+
+/red           { 255   0   0 setRGBcolor } bind def
+
+
+%%  One-dimensional linear color choices:
+
+/iCol1 { % i i_max | - : default -2010, round the circle, RGBR
+   relcol dup 1 x % rel 1 rel
+   360 mul 255 add cos 1 add dup mul neg .053 mul 1 add % modulate saturation
+   sethsbcolor
+   } def
+/iCol2 { % i i_max | - : cyan  - yellow - magenta
+   relcol 3 mul
+   dup 1 le {
+      dup 1 sub neg 0 3 2 roll } {
+      dup 2 le {
+         1 sub dup 1 sub neg 0 3 1 roll } {
+         2 sub dup 1 sub neg 0 3 0 roll } ifelse
+      } ifelse
+   0 setcmykcolor
+   } def
+/iCol3 { % i i_max | - : siemens
+   div /icnow x def
+   165 1 icnow sub mul
+   102   icnow     mul
+    33 120 icnow mul add setRGBcolor
+   } def
+/iCol4 { % i i_max | - : red to blue (subsequence of old scheme iCol1)
+   relcol
+   3 x sub 3 div 1 iCol1
+   } def
+
+
+%%  One-dimensional color choice from given array:
+
+/iColA { % i i_max arr | -
+   /aCol x def
+   relcol
+   aCol length 1 sub mul % position within array
+   dup cvi dup 3 1 roll % idx pos idx
+   sub x % offset idx
+   0 max aCol length 1 sub min % offset safe_idx
+   dup 1 add aCol length 1 sub min % offset i i+1
+   aCol x get exec
+   4 3 roll aCol x get exec colormix setRGBcolor
+   } def
+
+
+%% Color arrays for non-linear one-dimensional choices:
+
+/aCol1 [ % red-blue
+   { 255   0   0 } %  1
+   { 240  10  10 } %  2
+   { 220  40  40 } %  3
+   { 205  65  90 } %  4
+   { 195  80 130 } %  5
+   { 180 110 180 } %  6
+   { 165 120 185 } %  7
+   { 150 130 190 } %  8
+   { 130 150 210 } %  9
+   { 110 125 220 } % 10
+   {  85 105 230 } % 11
+   {  70  90 255 } % 12
+   {   0   0 255 } % 13
+   ] def
+/aCol2 [ % orange-red-blue-darkblue
+   { 255 180   0 } %  1
+   { 255 160   0 } %  1
+   { 255 120   0 } %  2
+   { 255  70   0 } %  3
+   { 255   0   0 } %  4
+   { 220  30  30 } %  5
+   { 220  70  60 } %  6
+   { 220 100 110 } %  7
+   { 200 130 130 } %  8
+   { 200 130 160 } %  9
+   { 180 110 180 } % 10
+   { 165 110 185 } % 11
+   { 150 130 190 } % 12
+   { 130 150 210 } % 13
+   { 100 120 220 } % 14
+   {  85 105 230 } % 15
+   {  70  90 255 } % 16
+   {   0   0 255 } % 17
+   {   0   0 180 } % 18
+   {  10  10 150 } % 19
+   {  30  30 130 } % 20
+   ] def
+/aCol3 [ % [fixed size: 9] siemenscolors
+   { 165   0  33 } % siemensred
+   {  33 153 102 } % siemensgreen
+   { 0   102 153 } % siemensblue
+   {   0  51 102 } % siemenstext
+   { 255 153   0 } % siemensorange
+   { 102 102 102 } % siemensdark
+   { 255 221   0 } % siemensyellow
+   { 221 221 221 } % siemensgrey
+   { 221 102 102 } % siemenspink
+   ] def
+/aCol4 [ % green-blue-brown
+   { 120 160  60 }
+   {  90 185  40 }
+   {  50 215  20 }
+   {   0 245   0 }
+   {  10 235 112 }
+   {  20 235 143 }
+   {  30 230 173 }
+   {  40 225 194 }
+   {  50 205 215 }
+   {  40 153 204 }
+   {  40 102 153 }
+   {  40  82 122 }
+   {  90  74 101 }
+   { 140  68  80 }
+   { 170  59  60 }
+   { 190  50  40 }
+   { 180  65  40 }
+   { 160  80  40 }
+   { 140 100  40 }
+   { 120  80  30 }
+   { 100  60  20 }
+   ] def
+/aCol5 [ % [fixed size: 8] gnuplot default (see man gnuplot and rgb.txt)
+   { 255   0   0 } % red
+   {   0 255   0 } % green
+   {   0   0 255 } % blue
+   { 255   0 255 } % magenta
+   {   0 255 255 } % cyan
+   { 160  82  45 } % sienna
+   { 255 165   0 } % orange
+   { 255 127  80 } % coral
+   ] def
+
+
+%%  Specialized ifelse, depending on pcol / ccol - OBSOLETE since 11a:
+
+/ifpcol { % proc1 proc2 | -
+   pcol 0 eq { pop exec } { exec pop} ifelse % 3 1 roll ifelse
+   } def
+/ifccol { % proc1 proc2 | -
+   ccol 0 eq { pop exec } { exec pop} ifelse % 3 1 roll ifelse
+   } def
+
+
+%%  old-style colors round the circle - OBSOLETE since 10a:
+
+% global preset
+/pColSet { % col ncol | -
+   /npcol x def % # different colours
+   /pcol  x def % colours off/on
+   } def
+/cColSet { % col ncol | -
+   /nccol x def % # different colours
+   /ccol  x def % colours off/on
+   } def
+% default setting
+0 3 pColSet % default setting
+0 3 cColSet % default setting
+% now defined locally in g3.ps
+/ipCol { 100 iCol1 } def
+/icCol { 100 iCol1 } def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Fonts and Text Blocks                                                    %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Prepare standard fonts:
+
+% extend font encoding
+/ReEncode { % OldFont NewFont Encoding | -
+   /MyEncoding x def
+   x findfont % select OldFont
+   dup length dict begin
+      {def} forall
+      /Encoding MyEncoding def
+      currentdict
+      end
+   definefont % define as NewFont
+   } def
+
+% we assume that image scripts are Latin1 encoded
+/Helvetica             /MyFont             ISOLatin1Encoding ReEncode
+/Helvetica-Oblique     /MyFont-Oblique     ISOLatin1Encoding ReEncode
+/Helvetica-Bold        /MyFont-Bold        ISOLatin1Encoding ReEncode
+/Helvetica-BoldOblique /MyFont-BoldOblique ISOLatin1Encoding ReEncode
+
+/setPalatino {
+/Palatino             /MyFont             ISOLatin1Encoding ReEncode
+/Palatino-Italic      /MyFont-Oblique     ISOLatin1Encoding ReEncode
+/Palatino-Bold        /MyFont-Bold        ISOLatin1Encoding ReEncode
+/Palatino-BoldItalic  /MyFont-BoldOblique ISOLatin1Encoding ReEncode
+} def
+
+%% Preset standard styles:
+
+% scale and set font; define fontsize, fontheight
+/setfontandsize { % font size | -
+   dup 0 le { pop 100 } if % fontsize <= 0 not allowed !
+   /fontnonnil true def
+   pt fm dup /fontsize x def
+   x findfont
+   x scalefont
+   setfont
+   gsave % determine fontheight - from the cookbook :
+      np 0 0 mv (1) true charpath flattenpath
+      pathbbox  % low_left_x, low_left_y, up_right_x, up_right_y
+      x pop x pop x pop
+      /fontheight x def
+      grestore
+   } def
+
+% standard settings for labelling axes
+/setnum { /MyFont            24 setfontandsize } def
+/setlab { /MyFont            24 setfontandsize } def
+
+% user commands (free choice of fontsize, but fixed font family)
+/setown { /MyFont             x setfontandsize } def
+/setbol { /MyFont-Bold        x setfontandsize } def
+/setboq { /MyFont-BoldOblique x setfontandsize } def
+/setobl { /MyFont-Oblique     x setfontandsize } def
+
+
+%%  String treatment:
+
+/showif { % string | - : increment xwidth or plot string
+   prepare
+      { stringwidth pop xwidth add /xwidth x def }
+      { show }
+   ifelse
+   } def
+/script { % matrix relpos_y | -
+   /yoffset x fontheight mul def
+   currentfont x makefont setfont
+   0 yoffset rm
+   } def
+/scred .71 def
+/subsc {
+   showif
+   [scred 0 0 scred 0 0] -.2 script
+   } def
+/supsc {
+   showif
+   [scred 0 0 scred 0 0] .6 script
+   } def
+/endsc {
+   showif
+   regularfont setfont
+   0 yoffset neg rm
+   } def
+/grec {
+   showif
+   /Symbol findfont fontsize scalefont setfont
+   } def
+/endgr {
+   showif
+   regularfont setfont
+   } def
+/endall {
+   showif
+   regularfont setfont
+   } def
+/build { % string xrel yrel obj | - : plot obj above/below string
+   /obj x def /yrelbui x def /xrelbui x def
+   dup showif
+   prepare
+      { pop }
+      { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
+        currentpoint 4 2 roll % save position after string
+      rm obj pop       % obj must end with () that will be pop'ed
+      mv               % back to saved position
+      }
+   ifelse
+   } def
+/gbuild { % string xrel yrel obj | - : plot obj above/below string
+   /obj x def /yrelbui x def /xrelbui x def
+   /Symbol findfont fontsize scalefont setfont
+   dup showif
+   prepare
+      { pop regularfont setfont }
+      { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
+        currentpoint 4 2 roll % save position after string
+        regularfont setfont
+      rm obj pop       % obj must end with () that will be pop'ed
+      mv               % back to saved position
+      }
+   ifelse
+   } def
+/hut { % ..) (<Char>) hut (..            %%%  MISERABEL PROGRAMMIERT
+   x showif
+   1.4 .6 {(\136) show ()} build
+   } def
+/ghut { % ..) (<grec-Char>) ghut (..      %%%  BREITE PASST NUR FUER Phi(t)
+   x showif
+   .8 .65 {(\136) show ()} gbuild
+   } def
+/tilde {
+   x showif
+   1. .6 {(~) show ()} build
+   } def
+/gtilde {
+   x showif
+   1. .6 {(~) show ()} gbuild
+   } def
+/spce { % string n spce - ; insert n times ( )
+   {showif (  )} repeat
+   } def
+
+% the following macros use the symbol/curve plotting mechanism
+/pins { % string symins - ; symbol must be selected by pset
+   showif
+   ( ) showif ( ) .5 .5 { currentxy 0 p black ()} build ( ) showif
+   } def
+/clenins { % string len clenins - ; curve must be selected by cset
+   x showif % I suppose that pins is preceeded by 8 spaces
+   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def
+            % length of inserted curve :
+            % -1 space : curve begins and ends in  middle of ( )
+            % +3 spaces: pins requires 3 times ( )
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
+   2 add {( ) showif} repeat
+   } def
+/cins { % string symins - ; curve must be selected by cset
+   showif 8 % I suppose that pins is preceeded by 8 spaces
+   dup ( ) stringwidth pop mul 2 add /xstrich x xmm div 10 div def
+   % nov03, ohne zu verstehen, "10 div" eingefuegt
+            % length of inserted curve :
+            % -1 space : curve begins and ends in  middle of ( )
+            % +3 spaces: pins requires 3 times ( )
+   ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
+   2 add {( ) showif} repeat
+   } def
+
+/block { % x y ob xrel yrel | -
+   /yrel x def /xrel x def /blabla x def
+    /ypos x ym def /xpos x xm def
+   /regularfont currentfont def /yoffset 0 def % initialize for security
+   /prepare true def /xwidth 0 def 0 0 mv % to prevent empty-path-error
+    blabla endall % first pass : determine xwidth
+   boxif { /boxwidth  xwidth (M) stringwidth pop boxxr mul 2 mul add def
+           /boxheight fontheight 1 boxyr 2 mul add mul def
+           np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub
+           ypos fontheight .5 boxyr add mul sub mv
+           boxwidth 0 rl 0 boxheight rl boxwidth neg 0 rl cp
+           boxproc
+    } if
+    xpos xwidth xrel mul sub ypos fontheight yrel mul sub mv
+    /prepare false def
+    blabla endall % second pass : plot
+   /boxif false def
+   } def
+/rblock { % x y ang ob proc rblock -
+   5 3 roll
+   gsave
+      xym translate
+      3 2 roll rotate
+      0 0 4 2 roll exec
+      grestore
+   } def
+
+/Box { % x y {exe}
+   /boxif true def
+   /boxproc x def /boxyr x def /boxxr x def
+   } def
+/nBox { .6 .6 3 2 roll Box } def
+/boxif false def
+/textW { % obj | length : calculate only length.
+   /blabla x def
+   /regularfont currentfont def /yoffset 0 def % initialize for security
+   /prepare true def /xwidth 0 def 0 0 mv % to prevent empty-path-error
+   blabla endall
+   xwidth % has been determined
+   } def
+/textw { % obj | y : dito, in 0..10-units
+   textW xmm div
+   } def
+
+% horizontal text: x y ob | -
+/textLB { 0. 0. block } bind def
+/textCB { .5 0. block } bind def
+/textRB { 1. 0. block } bind def
+/textLM { 0. .5 block } bind def
+/textCM { .5 .5 block } bind def
+/textRM { 1. .5 block } bind def
+/textLT { 0. 1. block } bind def
+/textCT { .5 1. block } bind def
+/textRT { 1. 1. block } bind def
+
+% rotated text: x y ang ob | -
+/rtextLB { {textLB} rblock } bind def
+/rtextLM { {textLM} rblock } bind def
+/rtextRB { {textRB} rblock } bind def
+/rtextRM { {textRM} rblock } bind def
+/rtextCM { {textCM} rblock } bind def
+
+
+%%  Language selection:
+
+% preset
+/language { % choose_this of_so_many | - % select current language
+   /langMax x def
+   /langChc x def
+   } def
+1 1 language % default
+% choose text from sequence
+/langSel { % text_1 .. text_M | text_C : choose text, M=langMax, C=langChc
+   langMax dup langChc sub 1 add roll
+   langMax 1 sub { pop } repeat
+   } def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Coordinate Frame                                                         %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Layout presets:
+
+/xyTicLen {0.10 fm} def
+/xyTacLen {0.20 fm} def
+/txllen {0.20 fm} def
+/tyllen {0.20 fm} def
+/linsetAxx {black 0.7 setline} def
+/linsetTic {black 0.7 setline} def
+/linsetTac {black 0.7 setline} def
+/linsetGri {black 0.4 setline} def
+
+%%  Start-up commands:
+
+/Resets {
+   /yNumLengthL 0 def /yNumLengthH 0 def
+   /xNumHeightL .3 def /xNumHeightH 0 def
+   /xNumHeightRel 2.4 def
+   /aMean 5 def
+   /xPlotFrame {} def
+   /yPlotFrame {} def
+   /zPlotFrame {} def
+   black
+   } def
+/BoxBackground {
+   0 0 10 10 boxit gsave setboxbackgroundcolor fill grestore
+} def
+/setboxbackgroundcolor { white } def
+
+
+%%  Some more presets for g3.ps:
+
+/iFrame 0 def
+
+/setnewpage { % xoff yoff
+  /yoffnewpage x def
+  /xoffnewpage x def
+} def
+/newpage {
+  goffsetA4
+  xoffnewpage yoffnewpage offset
+} def
+/setpagegrid { % ncol nrow xoffnewframe yoffnewframe
+  /yoffnewframe x def
+  /xoffnewframe x def
+  /nrowpage x def
+  /ncolpage x def
+} def
+/nextFrame {
+  /iFrame iFrame 1 add def
+  iFrame nrowpage ncolpage mul mod 0 eq {
+    showpage gscale newpage
+  } {
+    iFrame ncolpage mod 0 eq {
+      xoffnewframe ncolpage 1 sub neg mul yoffnewframe offset
+    } {
+      xoffnewframe 0 offset
+    } ifelse
+  } ifelse
+} def
+
+
+/zValues { pop pop } def
+/plotafter {} def
+/whiteframe { 1 0 0 10 10 graybox } def
+/plotframes { xPlotFrame yPlotFrame } def
+/plotbefore { plotframes } def
+
+/abc {abclab setown abcx abcy 3 2 roll textCM} def % usage ((a)) abc
+/abcset { % x y siz abcset - : preset for abc
+   /abclab x def /abcy x def /abcx x def
+   } def
+
+
+%%  Ticks:
+
+% set tick array - internal macros
+/tiputs { % rel_pos_of_tick | pos_of_tick : innermost routine for /taproc
+   tastep mul taloop add
+   } def
+/taproclin { % (#tick/tack) | - : define /taproc for use in SetVec
+   1 x div /tistep x def
+   /taproc { 0 tistep .999 { tiputs } for } def
+   } def
+/taproclog { % (#ticks/tacks) | - : define /taproc for use in SetVec
+      dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def
+   }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def
+   }{ dup 0 gt { pop /taproc { 0 tiputs } def
+   }{            neg taproclin
+   } ifelse } ifelse } ifelse
+   } def
+/SetVec { % tafro tatoo nta /vector | - : set /vector
+   4 1 roll
+   /nta x def /tatoo x def /tafro x def
+   /tastep tatoo tafro sub nta 1 sub div def
+   [
+      0 1 nta {
+         tastep mul tafro add /taloop x def
+         taproc exec
+         } for
+      ] def
+   } def
+% set tick array - user commands
+/SetTicVecLin { taproclin /TicVec SetVec } def
+/SetTicVecLog { taproclog /TicVec SetVec } def
+
+% set tack-and-number array
+/SetTacVec { % [ pos {label} pos {label} ... ] | -
+   /TacVec x def
+   } def
+
+% define axes
+   % note on angles : 0 = x-axis, 90 = y-axis
+/OneAxx { % fro to xpos ypos aang tang | - : presets for Axx, Tic, Tac, Num
+   % store arguments
+   /tAng x def /aAng x def
+   /yPos x def /xPos x def
+   /aTo x def /aFro x def
+   % set constants
+   /xTicLen tAng cos xyTicLen mul def /yTicLen tAng sin xyTicLen mul def
+   /xTacLen tAng cos xyTacLen mul def /yTacLen tAng sin xyTacLen mul def
+   /xAng aAng cos def /yAng aAng sin def
+   /aMean aFro aTo add 2 div def
+   /aArr false def
+   } def
+/ArrAxx { % label <args of OneAxx> | - : axis with arrow
+   OneAxx
+   /aLab x def
+   /aArr true def
+   } def
+
+% draw axis (with parameters preset by OneAxx or ArrAxx)
+/Axx { % - | -
+   linsetAxx
+   gsave
+      xPos yPos offset
+      mmscale
+      aAng rotate
+      % draw a line
+      aFro 0 np mv
+      aTo  0 li st
+      % draw an arrow and a label, if requested
+      aArr {
+         gsave
+            aTo 0 offset
+            aAng neg rotate
+            mmunscale
+            aAng rotate
+            0 0 0 .3 pfeilspitze % draw an arrow
+            .3 0 offset
+            aAng neg rotate
+            setlab
+            aAng 45 le
+               { 0 -.8 xNumHeightL sub aLab textRT }
+               { 0  .2 aLab textCB }
+               ifelse
+           grestore
+         } if
+      grestore
+   } def
+
+% draw ticks (positions given by SetTicVec, parameters preset by OneAxx/..)
+/Tic { % - | - : draw tick as defined in TicProc
+   linsetTic
+   TicVec {
+      dup dup aFro lt x aTo gt or {pop} {TicProc} ifelse
+      } forall
+   } def
+/TicProc { % aPos | - : default procedure to plot one tick
+   np
+   xPos yPos xym mv
+   dup xAng mul x yAng mul xym rm % eat argument, go to start pos.
+   xTicLen yTicLen rl st
+   } def
+/xGric { % yFro yTo | - : draw a grid line (instead of an x tick)
+   linsetGri
+   TicVec {
+      3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
+         dup % y1 y2 x x
+         4 -1 roll xym np mv % y2 x
+         x xym li st
+         } ifelse
+      } forall
+   pop pop
+   } def
+/yGric { % xFro xTo | - : draw a grid line (instead of an y tick)
+   linsetGri
+   TicVec {
+      3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
+         dup % x1 x2 y y
+         4 -1 roll x xym np mv % x2 y
+         xym li st
+         } ifelse
+      } forall
+   pop pop
+   } def
+
+% draw tacks (positions given by SetTacVec, parameters preset by OneAxx/..)
+/TacExe { % Proc | - % Execute Proc for all pairs of elements of TacVec
+                     % (but only if inside aFro..aTo)
+   /TacProc x def
+   /ispair true def % toggle: take pos, take label, take pos, take label ...
+   TacVec {
+      ispair
+         {
+            /aPos x def
+            /ispair false def
+         } {
+            aPos dup aFro lt x aTo gt or
+            {pop} {TacProc} ifelse
+            /ispair true def
+         } ifelse
+      } forall
+   } def
+/Tac {
+   linsetTac
+   { pop xPos yPos xym mv
+      aPos dup xAng mul x yAng mul xym rm
+      xTacLen yTacLen rl st
+      } TacExe
+   } def
+% unnecessary optimisation by specialisation: OBSOLETE since 11a
+/xTacL { Tac } def
+/xTacH { Tac } def
+/yTacL { Tac } def
+/yTacH { Tac } def
+% special tack routines, only for rectangular axes
+/xTacC { % : centered tack on x axis
+   linsetTac
+   { pop aPos xm yPos ym txllen 2 div sub np mv 0 txllen rl st } TacExe
+   } def
+/xGrid { % : rule instead of tack on x axis
+   linsetTac
+   { pop aPos xm np yPos ym mv 0 10 xym rl st } TacExe
+   } def
+/yTacC { % : centered tack on y axis
+   linsetTac
+   { pop xPos xm tyllen 2 div sub aPos ym np mv tyllen 0 rl st } TacExe
+   } def
+/yGrid { % : rule instead of tack on low y axis
+   linsetTac
+   { pop aPos ym np xPos xm x mv 10 0 xym rl st } TacExe
+   } def
+
+% draw numbers (pos-txt pairs given by SetTacVec)
+/Num { % Generic but useless. Adjust for your application.
+   setnum
+   fontheight ymm div yDisRel mul tAng sin mul /yDist x def
+   { dup textW xDisRel mul tAng cos mul /xDist x def
+     xPos aPos xAng mul add xDist sub
+     yPos aPos yAng mul add yDist sub 3 2 roll textCM } TacExe
+   } def
+/setnumDisRel { % xDisRel yDisRel | - : adjust just a little bit
+   /yDisRel x def /xDisRel x def
+   } def
+1.2 1.2 setnumDisRel % default setting
+% explicit Num routines for rectangular case
+/xNumL { % : numbers on low x axis
+   setnum
+   { fontheight ymm div % conversion -> user_scale
+     dup /xNumHeightL x def
+     -.6 mul yPos add aPos x 3 2 roll textCT } TacExe
+   } def
+/xNumH { % : numbers on high x axis
+   setnum
+   { fontheight ymm div % conversion -> user_scale
+     dup /xNumHeightH x def
+     .6 mul yPos add aPos x 3 2 roll textCB } TacExe
+   } def
+/yNumL { % : numbers on low y axis
+   setnum
+   { fontsize -.3 mul xmm div xPos add aPos 3 2 roll textRM
+     xwidth dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
+     } TacExe
+   } def
+/yNumLD { % : calculate only yNumLength (used for adjustement)
+   setnum
+   { textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
+     } TacExe
+   } def
+/yDumL { % {(..)} yDumL : compare yNumLength with one arg (used for adjustement)
+   setnum
+   textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
+   } def
+/yNumH { % : numbers on high y axis
+   setnum
+   { fontsize .3 mul xmm div xPos add aPos 3 2 roll textLM
+     xwidth dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
+     } TacExe
+   } def
+/yNumHD { % : calculate only yNumLength (used for adjustement)
+   setnum
+   {textW dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
+     } TacExe
+   } def
+/yDumH { % {(..)} yDumH : compare yNumLength with one arg (used for adjustement)
+   setnum
+   textW dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
+   } def
+
+% draw labels
+/xCL { % xlabel | - ; plots coordinate name below the x-axis.
+   setlab
+   aMean xNumHeightL xNumHeightRel neg mul
+   3 -1 roll textCT
+   } def
+/xCH { % xlabel | - ; plots coordinate name above the x-axis.
+   setlab
+   aMean xNumHeightH xNumHeightRel mul 10 add
+   3 -1 roll textCB
+   } def
+/yCL { % ylabel | - ; plots coordinate name to the left of the y-axis.
+   gsave
+      setlab
+      yNumLengthL neg fontsize -.85 mul add % yNumLengthL calculated in yN
+      aMean ym translate
+      0 0 mv
+      90 rotate
+      0 x 0 x textCB
+   grestore
+   } def
+/yCH { % ylabel | - ; plots coordinate name to the right of the y-axis.
+   gsave
+      setlab
+      yNumLengthH fontsize .85 mul add 10 xm add
+      aMean ym translate
+      0 0 mv
+      90 rotate
+      0 x 0 x textCT
+   grestore
+   } def
+/yCF { % ylabel | - ; plots coordinate name *falling* right of the y-axis.
+   gsave
+      setlab
+      yNumLengthH fontsize .85 mul add 10 xm add
+      aMEan ym translate
+      0 0 mv
+      -90 rotate
+      0 x 0 x textCB
+   grestore
+   } def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Data Plotting (Symbols and Curves)                                       %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  Initializations:
+
+% asymmetric error bars?
+/err_asy false def % overwrite this if data are quadruples x y d- d+
+
+
+%%  Presets:
+
+% global preset [wups11a: exchanged rad<->lin to conform with pset]
+/SymGSet { % sradglo slinglo serrglo | -
+   /serrglo x def % plot error bars? 0=never, 1=always, 2=as_given_in_pset
+   /slinglo x def % symbol linewidth multiplier
+   /sradglo x def % symbol size multiplier
+   } def
+
+
+%%  Retrieve presets from style array:
+
+/pstyle { pStyles setstyle } def
+/cstyle { cStyles setstyle } def
+/setstyle { % chosen_number array | - : set p or c as predefined in array.
+   dup length % i A n
+   3 2 roll % A n i
+   dup 0 le {
+      pop pop pop ostyle % chosen_number<=0 means: don't plot
+      } {
+      1 sub x % A i-1 n
+      mod get % A(i-1)
+      exec
+      } ifelse
+   } def
+
+
+%% Set plot symbol:
+
+/pset { % styp sfill serr srad slin | -
+   % arg -> symbol linewidth
+   /slin x slinglo mul def
+   % arg -> symbol size
+   /srad x fm 0.16 mul sradglo mul def
+   % arg -> plot error bar?
+   2 serrglo ne { pop serrglo } if % if (serrglo=2) use serr else use serrglo
+   /plot_errorbar x 1 eq { { errorbar } } { { pop pop pop pop } } ifelse def
+   % arg -> fill the symbol? (0=open, 1=full, 2=colored_with_black_border)
+   /sfill x def
+   % adjust srad: it's the _outer_ radius
+   % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if
+   % arg -> symbol type
+   /ps {ps_nil} def % default: don't plot (maybe we only want an error bar)
+   dup  1 eq {/ps {ps_square}     def} if
+   dup  2 eq {/ps {ps_diamond}    def} if
+   dup  3 eq {/ps {ps_circle}     def} if
+   dup  4 eq {/ps {ps_triangle}   def} if
+   dup  5 eq {/ps {ps_cedez}      def} if
+   dup  6 eq {/ps {ps_eieruhr}    def} if
+   dup  7 eq {/ps {ps_valve}      def} if
+   dup  8 eq {/ps {ps_tfwd}       def} if
+   dup  9 eq {/ps {ps_tbwd}       def} if
+   dup 10 eq {/ps {ps_pentagram}  def} if
+   dup 11 eq {/ps {ps_plus}       def} if
+   dup 12 eq {/ps {ps_cross}      def} if
+   dup 13 eq {/ps {ps_star}       def} if
+   dup 14 eq {/ps {ps_pentagon}   def} if
+   dup 15 eq {/ps {ps_horiz}      def} if
+   dup 16 eq {/ps {ps_verti}      def} if
+   pop
+   %
+   /t { % x y d[- d+] | -  : plot a symbol and eventually an error bar.
+       err_asy not { dup } if
+       4 copy pop pop plot_symbol
+       plot_errorbar
+      } bind def
+   /ti { t } bind def
+   /tf { t black } bind def
+   } def
+
+
+%%  Set curve:
+
+/lset { % lwidth dashes | -
+   0 setdash
+   dup 0 gt {
+      pt fm setlinewidth
+      % pop error bar and convert frame coord -> paper coord
+      /txy { err_asy { pop } if pop xym } def % x y d[- d+] | x' y'
+      % commands to plot points (can be overwritten by nopoints):
+      /ti { np txy mv } def % x y d[- d+] | - : start curve
+      /t  { txy li }    def % x y d[- d+] | - : continue curve
+      /tf { txy li st } def % x y d[- d+] | - : terminate and plot curve
+      } {
+         ostyle
+      } ifelse
+   } def
+
+
+%%  Plot nothing:
+
+/ostyle { % - | -
+   /ti { nopoint } def
+   /t  { nopoint } def
+   /tf { nopoint } def
+} def
+/nopoint { % x y d[- d+] | -
+   pop pop pop err_asy { pop } if
+} def
+
+
+%%  Plot an asymmetric vertical error bar:
+
+/errorbar { % x y d- d+ | -
+   gsave
+      slin setline
+      3 copy pop pop
+      dup 0 gt x 10 lt and {
+         4 copy
+         x pop add 10. 2 copy gt { x } if pop ym x xm x
+         2 copy x .05 sub x np mv .1 0 rl st
+         np mv
+         pop sub 0. 2 copy lt { x } if pop ym x xm x
+         2 copy lineto st
+         x .05 sub x np mv .1 0 rl st
+         } {
+         pop pop pop pop
+         } ifelse
+      grestore
+} def
+
+
+%%  Plot a data symbol:
+
+/plot_symbol { % x y | -
+    gsave
+       offset
+       srad dup scale
+       slin srad div setline % factor 1/srad compensates "scale"
+       ps % the actual plot symbol, defined by 'pset'
+       grestore
+   } def
+
+/fill_symbol {
+   sfill dup
+      0 eq {
+         pop st
+      } {
+         1 eq {
+            fill
+	 } {
+	    gsave fill grestore
+	    gsave black st grestore
+	 } ifelse
+      } ifelse
+   } def
+
+
+%%  The different symbols, designed for unit area (no arguments):
+
+/ps_nil {
+    } bind def
+
+/ps_square {
+   .5 .5 np mv
+   0 -1 rl
+   -1 0 rl
+   0  1 rl cp fill_symbol
+   } bind def
+
+/ps_diamond {
+   gsave 45 rotate ps_square grestore
+   } bind def
+
+/ps_circle {
+   0 0 np .564 0 360 arc cp fill_symbol
+   } bind def
+
+/ps_triangle {
+   .77 dup dup 90 pol2xy np mv
+   210 pol2xy li
+   330 pol2xy li cp fill_symbol
+   } bind def
+
+/ps_cedez {
+   gsave 180 rotate ps_triangle grestore
+   } bind def
+
+/ps_tfwd {
+   gsave 30 rotate ps_triangle grestore
+   } bind def
+
+/ps_tbwd {
+   gsave 210 rotate ps_triangle grestore
+   } bind def
+
+/ps_eieruhr {
+   -.7 -.7 np mv
+    .7 -.7 li
+   -.7  .7 li
+    .7  .7 li cp fill_symbol
+   } bind def
+
+/ps_valve {
+   gsave 90 rotate ps_eieruhr grestore
+   } bind def
+
+/ps_pentagram {
+   .8 dup dup dup dup
+    90 pol2xy np mv
+   234 pol2xy li
+    18 pol2xy li
+   162 pol2xy li
+   306 pol2xy li cp fill_symbol
+   } bind def
+
+/ps_pentagon {
+   .8 dup dup dup dup
+    18 pol2xy np mv
+    90 pol2xy li
+   162 pol2xy li
+   234 pol2xy li
+   306 pol2xy li cp fill_symbol
+   } bind def
+
+/ps_plus {
+   gsave 45 rotate ps_cross grestore
+   } bind def
+
+/ps_cross {
+   .5 .5 np mv
+   -1 -1 rl st
+  -.5 .5 np mv
+    1 -1 rl st
+   } bind def
+
+/ps_star {
+   .7 dup   0 pol2xy np mv 180 pol2xy li st
+   .7 dup 120 pol2xy np mv 300 pol2xy li st
+   .7 dup 240 pol2xy np mv  60 pol2xy li st
+   } bind def
+
+/ps_horiz {
+   -.7 0 np mv
+   1.4 0 rl st
+   } bind def
+
+/ps_verti {
+   0 -.7 np mv
+   0 1.4 rl st
+   } bind def
+
+
+%%  Set column plotting (use this instead of pset) - BROKEN in 11a or earlier
+
+/setcolumn{ % shift width exec | %
+   % usage: 0 .2 { gsave { .5 setgray fill } grestore cp } setcolumn
+   /colexec x def % what's this ?
+   /colwidth x def
+   /colshift x def
+   /t { % broken - may need rewrite
+      np x colshift add x xym 2 copy mv pop
+      colwidth xm 0 rl
+      colwidth xm add 0 wy ym li
+      colwidth neg xm 0 rl
+      cp colexec
+   } def
+   /ti { t } bind def
+   /tf { t black } bind def
+} def
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  List                                                                     %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+/NewList { % xins yins size advance NewList -
+   /nl_advance x def setown /nl_yins x def /nl_xins x def
+   /nl_xshift fontsize xmm div .9 mul def
+   /nl_xrline 0.33 def
+   /nl_ystep fontheight ymm div nl_advance mul def
+   /newline {
+       /nl_yins nl_yins nl_ystep sub def
+      } def
+   /fracline { % frac | -
+      fontheight ymm div nl_advance mul mul /nl_yins x nl_yins x sub def
+      } def
+   } def
+/newlist { 1.65 NewList } def
+/TxLine { % text TxLine -
+   nl_xins nl_yins 3 -1 roll textLM newline
+   } bind def
+/TxCLine { % text TxLine -
+   nl_xins nl_yins 3 -1 roll textCM newline
+   } bind def
+/infline{ % Obsolete since Frida2.1.5
+   oooinfo 1 eq { TxLine } { pop } ifelse
+   } bind def
+/PtTxLine { % pstyle text | -
+   x pstyle
+   nl_xins nl_xshift .5 mul add nl_yins 0 t
+   black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/PttttTxLine { % pstyle text | - %% chain of very small symbols
+   x pstyle
+   nl_xins nl_xshift .10 mul add nl_yins 0 t
+   nl_xins nl_xshift .26 mul add nl_yins 0 t
+   nl_xins nl_xshift .42 mul add nl_yins 0 t
+   nl_xins nl_xshift .58 mul add nl_yins 0 t
+   nl_xins nl_xshift .74 mul add nl_yins 0 t
+   nl_xins nl_xshift .90 mul add nl_yins 0 t
+   black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/PtPtCvTxLine { % pstyle pstyle cstyle text | -
+   4 3 roll pstyle nl_xins nl_yins 0 t
+   3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t
+   x cstyle
+   nl_xins nl_xshift 2 mul add
+   dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti
+   nl_xshift nl_xrline mul add nl_yins 0 tf
+   nl_xshift add nl_yins 3 2 roll black textLM
+   newline
+   } bind def
+/PtCvTxLine { % pstyle cstyle text | -
+   3 2 roll pstyle nl_xins nl_yins 0 t
+   x cstyle
+   nl_xins nl_xshift 1 mul add
+   dup dup nl_xshift -.33 mul add nl_yins 0 ti
+   nl_xshift 0.33 mul add nl_yins 0 tf
+   nl_xshift add nl_yins 3 2 roll black textLM
+   newline
+   } bind def
+/PtPtTxLine { % pstyle pstyle text | -
+   3 2 roll pstyle nl_xins nl_yins 0 t
+   x pstyle nl_xins nl_xshift add nl_yins 0 t
+   black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/CvTxLine { % cstyle text | -
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf
+   black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/Cv2TxLine { % cstyle text | -
+   x cstyle
+   nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti
+   nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf
+   black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/PCTxLine { % pstyle(with plset) text | -
+   x pstyle
+   nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci
+   nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf
+   nl_xins yins 0 t
+   black nl_xins
+      fontsize xmm div 1.9 mul % instead of xshift
+      add nl_yins 3 2 roll textLM
+   newline
+   } bind def
+/showfilename { % xins yins size | -
+   setown
+   ooofnam 1 eq { filename textRB } { pop pop } ifelse
+   } def
+/InfSet { % ooofnam oooinfo | - : set on(1) or off(0)
+   /oooinfo x def /ooofnam x def
+   } def
+0 0 InfSet % default setting
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Macro Collection                                                         %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%  gray areas (mainly applied with grayval=1 for blank areas) [longtime grey..]
+
+/execOval3 { %  xl xh yl yh dr { proc } | -
+   gsave
+   6 1 roll
+   fm /qqdr x def
+   ym /qqyh x def
+   ym /qqyl x def
+   xm /qqxh x def
+   xm /qqxl x def
+   qqxl qqyl qqdr add np mv
+   qqxl qqyh qqdr sub li
+   qqxl qqdr add qqyh qqdr sub qqdr 180 90 arcn
+   qqxh qqdr sub qqyh li
+   qqxh qqdr sub qqyh qqdr sub qqdr 90 0 arcn
+   qqxh qqyl qqdr add li
+   qqxh qqdr sub qqyl qqdr add qqdr 0 -90 arcn
+   qqxl qqdr add qqyl li
+   qqxl qqdr add qqyl qqdr add qqdr -90 -180 arcn
+   cp exec grestore
+   } def
+/execRect3 { % xl xh yl yh {proc} | -
+   5 1 roll
+   gsave
+   ym /qqyh x def
+   ym /qqyl x def
+   xm /qqxh x def
+   xm /qqxl x def
+   np
+   qqxl qqyl mv
+   qqxh qqyl li
+   qqxh qqyh li
+   qqxl qqyh li
+   cp exec grestore
+   } def
+/execRectangle { % OBSOLETE
+   5 1 roll
+   gsave
+   wy /qqyh x def
+   wy /qqyl x def
+   wx /qqxh x def
+   wx /qqxl x def
+   np
+   qqxl xm qqyl ym mv
+   qqxh xm qqyl ym li
+   qqxh xm qqyh ym li
+   qqxl xm qqyh ym li
+   cp exec grestore
+   } def
+/execHexagon { % xl xh yl yh (all in user coords) {proc} | -
+   5 1 roll
+   gsave
+   wy /qqyh x def
+   wy /qqyl x def
+   wx /qqxh x def
+   wx /qqxl x def
+   /qqdr qqyh qqyl sub 2 div def
+   np
+   qqxl qqdr add qqyl xym mv
+   qqxh qqdr sub qqyl xym li
+   qqxh qqyl qqdr add xym li
+   qqxh qqdr sub qqyh xym li
+   qqxl qqdr add qqyh xym li
+   qqxl qqyl qqdr add xym li
+   cp exec grestore
+   } def
+/coordRectangle { % xl xh yl yh (all in plot coords) {proc} | -
+   5 1 roll
+   gsave
+   /qqyh x def
+   /qqyl x def
+   /qqxh x def
+   /qqxl x def
+   np
+   qqxl xm qqyl ym mv
+   qqxh xm qqyl ym li
+   qqxh xm qqyh ym li
+   qqxl xm qqyh ym li
+   cp exec grestore
+   } def
+
+
+%%  special objects
+
+/pfeilangle 36.87 def
+/pfeilspitze { % x[local] y[local] rot siz
+   % draw with current linestyle, as set e.g. by linsetAxx
+   x 4 2 roll % siz rot x y
+   gsave
+     xym translate 180 add rotate dup dup dup
+     [] 0 setdash
+     pfeilangle cos mul x pfeilangle sin mul np mv
+     0 0 li pfeilangle cos mul x pfeilangle sin neg mul li st
+   grestore
+   } def
+/pfeiL { % (arrow anchored at base) x y rot siz len
+   gsave
+      dup xm x ym mul sqrt % (scale len)
+      5 3 roll
+      xym translate % (origin at base) rot siz len
+      3 2 roll
+      rotate % (draw rightwards) siz len
+      dup 0 translate % (origin at head) siz len
+      x 0 0 0 4 3 roll pfeilspitze % len
+      0 0 np mv neg 0 li st
+   grestore
+   } def
+/Pfeil { % (arrow anchored at head) x y rot siz len
+   dup xm x ym mul sqrt 5 copy
+   pop pfeilspitze
+   x pop
+   x 4 2 roll % len rot x y
+   gsave
+      xym translate 180 add rotate
+      0 0 np mv 0 li st
+   grestore
+   } def
+/pfeil { % (OBSOLETE) x[local] y[local] rot siz len[global]
+   fm 5 copy % not working well
+   pop pfeilspitze
+   x pop
+   x 4 2 roll % len rot x y
+   gsave
+      xym translate 180 add rotate
+      0 0 np mv 0 li st
+   grestore
+   } def
+/pfeil_arcn { % x_cent y_cent radius ang_from ang_to siz
+   gsave
+     6 -2 roll offset
+     4 copy pop 0 0 5 2 roll
+     np arcn st
+     % radius ang_from ang_to siz
+     4 1 roll
+     gsave
+       rotate
+       pop
+       % siz radius
+       0 -90 4 3 roll
+       pfeilspitze
+       grestore
+     grestore
+} def
+
+/knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis
+   % the total height of the generated object is y_tot
+   % of which y_knau(.le. y_tot) is for the real knautsch,
+   % the remainder is for vertical prolongations.
+   x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def
+   /tmpa x ym tmpy 4 mul sub 2 div def
+   np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl
+   tmpx tmpy rl 0 tmpa rl st
+   } def
+/separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis
+   setline
+   /spang x def
+   /splng x def
+   /spsep x def
+   2 copy spsep sub gsave offset spang rotate
+      splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
+   spsep add gsave offset spang rotate
+      splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
+   } def
+
+/bemasz { % x y L ang text | - %% precede by '24 setown 1 [] lset /pfeilangle 90 def'
+    gsave
+    5 3 roll offset % consumes x and y
+    x rotate % consumes ang | L text
+    dup textw .5 mul fontheight .4 mul add /bmszDT x def % => half text width
+    0 0 3 2 roll textCM % L
+    .5 mul /bmszDX x def % => half bemasz length
+    bmszDX     0   0 fontheight .67 mul bmszDX bmszDT sub Pfeil
+    bmszDX neg 0 180 fontheight .67 mul bmszDX bmszDT sub Pfeil
+    grestore
+   } def
+
+
+%%  Text composition shortcuts:
+
+/g  { x grec endgr} bind def
+/sb { x subsc endsc} bind def
+/sp { x supsc endsc} bind def
+/sbgr { x grec () subsc endsc () endgr} bind def
+/spgr { x grec () supsc endsc () endgr} bind def
+
+
+%%  Text macros for neutron scattering:
+
+/hbar {
+   showif
+   (h) 1.2 .66 {
+      currentpoint fontheight .11 mul setline np mv
+      fontheight dup .8 mul x .3 mul rl
+      st ()
+      } build
+   } bind def
+/hbarw { hbar () grec (w) endgr } bind def
+/wbar { grec (w) endgr ( / 2) grec (p) endgr } bind def
+/taumean { () (\341t\361) g } bind def
+/Sqw { showif (S\(q,) grec (w) endgr (\)) showif } bind def
+/Sqn { showif (S\(q,) grec (n) endgr (\)) showif } bind def
+/SQw { showif (S\(Q,) grec (w) endgr (\)) showif } bind def
+/Sttw { showif (S\(2) grec (q) endgr (,) grec (w) endgr (\)) showif } bind def
+/Sttn { showif (S\(2) grec (q) endgr (,) grec (n) endgr (\)) showif } bind def
+/Xqw { grec (c) endgr (''\(q,) grec (w) endgr (\)) showif } bind def
+/Xqn { grec (c) endgr (''\(q,) grec (n) endgr (\)) showif } bind def
+/ueV{ grec (m) endgr (eV) showif} bind def
+/inueV { showif (\() grec (m) endgr (eV\)) showif } bind def
+/inmeVr { showif (\(meV) supsc (-1) endsc (\)) showif } bind def
+/inueVr { showif (\() grec (m) endgr (eV)
+          supsc (-1) endsc (\)) showif } bind def
+/inGHzr { showif (\(GHz) (-1) sp (\)) showif } def
+
+%% home-made Angstr is obsolete; use \305 (more reliable than Ã…)
+/Angstr {
+   showif
+   (A) .5 1.23 {
+      currentpoint fontheight .1 mul setline np
+      fontheight .14 mul 0 360 arc st ()
+   } build
+} bind def
+/Angr { showif (\305) supsc (-1) endsc } bind def
+/inAngr { showif (\() Angr (\)) showif } bind def
+/Angrr { showif (\305) supsc (-2) endsc } bind def
+/inAngrr { showif (\() Angrr (\)) showif } bind def
+/wmin {grec (w) endgr () subsc (min) endsc} def
+/winpi { grec (w) endgr ( / 2) grec (p) endgr } def
+/Celsius { showif (\26x)g(C) showif } bind def
+
+
+%%  More shortcuts for impatient users:
+
+/L { langSel } bind def
+/G { gsave exec grestore } bind def
+/gs { gsave } bind def
+/gr { grestore } bind def
+
+end % WuGdict...
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%  Mark "ewu", the end of the wups.. macro definition file                  %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+WuGdict11a begin
+setPalatino
+
+3 dup autolabel defsiz
+1 dup stdred
+7 -6 setnewpage newpage
+
+/Ecolor    {255   0  83 setRGBcolor } def
+/darkgreen { 13 133  13 setRGBcolor } def
+/litegreen {202 253 222 setRGBcolor } def
+/darkblue  { 13  13 133 setRGBcolor } def
+/liteblue  {202 202 255 setRGBcolor } def
+/darkbrown {215 175 135 setRGBcolor } def
+/litebrown {255 235 215 setRGBcolor } def
+
+% /execRect3 { % xl xh yl yh {proc} | -
+
+21 setown
+/H 6 def
+/L 40 def
+
+% Layers
+litebrown  0 L 0 H     { fill } execRect3
+darkbrown  0 L 0 H neg { fill } execRect3
+
+% Left margin
+/h  H 2 div def
+/xx 1.5 def
+black
+xx h     {(layer l-1)} textLM
+xx h neg {(layer l)} textLM
+
+% Definitions for main part
+/yTitle H neg 1 sub def
+/xx 5 def
+/kvecs {
+    darkblue 3 [] lset
+    xx neg h     -30 .6 4 pfeiL
+    xx neg h neg  20 .6 4 pfeiL
+    xx     h      30 .6 4 Pfeil
+    xx     h neg -20 .6 4 Pfeil
+} def
+
+% Main part
+15 0 offset
+black 0 yTitle {(p polarization)} textCM
+kvecs
+Ecolor 3 [] lset
+xx neg h     +60 .6 2 pfeiL
+xx neg h neg 110 .6 2 pfeiL
+xx     h     120 .6 2 pfeiL
+xx     h neg  70 .6 2 pfeiL
+
+21 setbol
+darkblue
+-.9 2. {(k)} textCM
+Ecolor
+-3  4.6 {(E)} textCM
+21 setown
+
+18 0 offset
+black 0 yTitle {(s polarization)} textCM
+Ecolor 2 [] lset
+/spol {
+   2 copy
+   np .3 0 360 arc cp fill
+   np .6 0 360 arc cp st
+} def
+xx neg h     spol
+xx neg h neg spol
+xx     h     spol
+xx     h neg spol
+kvecs
+
+21 setbol
+darkblue
+-.9 2. {(k)} textCM
+Ecolor
+-4  4. {(E)} textCM
+
+% Normal vector
+-9 0 offset
+darkgreen 3 [] lset
+0 0 90 .6 4 pfeiL
+21 setbol
+0 5 {(n)} textCM
+
+showpage
+end % WuGdict...
diff --git a/Doc/UserManual/fig/ff2/ff_det_box.pdf b/Doc/UserManual/fig/gisasmap/ff_det_box.pdf
similarity index 100%
rename from Doc/UserManual/fig/ff2/ff_det_box.pdf
rename to Doc/UserManual/fig/gisasmap/ff_det_box.pdf
diff --git a/Doc/UserManual/jw7.bib b/Doc/UserManual/jw7.bib
index 061c70d7deadaf6f25c9bec7ed2b43418a7ed3f4..c5956e234c46601b59868f872eafd57a4832c706 100644
--- a/Doc/UserManual/jw7.bib
+++ b/Doc/UserManual/jw7.bib
@@ -38,6 +38,7 @@
 
 %:a
 
+@Art{Abe50a, a={Abelès,F}, j={J.~Phys.\ Radium}, v=11, p=307, y=1950, x="reflectometry"}
 @Buk{AbSt64, a={Abramowitz,M and Stegun,I},
                    t={Handbook of Mathematical Functions},
                    f={National Bureau of Standards}, y=1964 }
@@ -1175,6 +1176,7 @@
                    j=zpB, v=56, p=207, y=1984, x="GISAXS" }
 @Art{DiWa85, a={Dietrich,S and Wagner,H},
                    j=zpB, v=59, p=35, y=1985, x="GISANS" }
+@Any{DiWa16, a={Dietrich,S and Wagner,H}, t={Private communication}, y=2016}
 @Art{Die95,  a={Diezemann,G},
 		   j=jcp, v=103, p=6368, y=1995, x="NMR.Dipol.Spindiff", c="C"}
 @Art{DiSi95b,a={Diezemann,G and Sillescu,H},
@@ -2264,6 +2266,9 @@
 		  f={Springer}, l={Berlin}, y=1981}
 @Art{Jac86,  a={J"ackle,J}, j=rpp, v=49, p=171, y=1986, x="g"}
 @Art{Jac89,  a={J"ackle,J}, j=jpCM, v=1, p=267, y=1989, x="mkt"}
+@Buk{Jac75,  a={Jackson,J D},
+                  t={Classical Electrodynamics}, f={John Wiley}, l={New York},
+                  y=1975, en=2 }
 @Art{JaPi68, a={Jakeman,E and Pike,E R},
                    j=jpi, v=1, p=128, y=1968, x="pcs.th", c="C"}
 @Art{JaPi69a,a={Jakeman,E and Pike,E R},
@@ -2689,7 +2694,7 @@
 @Art{LaSc96, a={Latz,A and Schmitz,R},
                    j=prE, v=53, p=2624, y=1996, x="LStrg", c="C"}
 @Art{Lau31,  a={v.~Laue,M},
-                   j={Erg.\ exakt.\ Naturwiss.}, v=10, p=133, pf=158, y=1931, x="X diffr"}
+                   j={Erg.\ exakt Naturwiss.}, v=10, p=133, pf=158, y=1931, x="X diffr"}
 @Art{LaUb58, a={McLaughlin,E and Ubbelohde,A R},
                    j=tfs, v=54, p=1804, y=1958, x="otp.visc"}
 @Art{LaUh72, a={Laughlin,W T and Uhlmann,D R},
@@ -3161,6 +3166,8 @@
                    v=128, f={Springer}, l={Berlin}, y=1980, x="nsc.inst"}
 @Art{Mez82,  a={Mezei,F},
                    j=jap, v=53, p=7654, y=1982, x="SpinG.NSc", c="C"}
+@Art{Mez86,  a={Mezei,F},
+                   j=pyBC, v=137, p=295, y=1986, x="nSpin.fundamentals"}
 @Art{MeKF87a,a={Mezei,F and Knaak,W and Farago,B},
                    j=prl, v=58, p=571, y=1987, x="ckn.n"}
 @Art{MeKF87b,a={Mezei,F and Knaak,W and Farago,B}, t={Neutron Spin Echo Study
@@ -4052,6 +4059,8 @@
 @Art{ScKT0x, a={Schober,H and Koza,M M and T\"olle,A and Masciovecchio,C and
                 Sette,F and Fujara,F},
                    j=prl, y={subm 200x}, x="H20.nsc", c="C"}
+@Art{Sch14,  a={Schober,H},
+                   j=jnr, v=17, p=109, y=2014, x="nsc"}
 @Art{ScLa91, a={Schober,H R and Laird,B B},
                    j=prB, v=44, p=6746, y=1991, x="G.sim", c="C"}
 @Art{ScOl93, a={Schober,H R and Oligschleger,C},
@@ -4206,7 +4215,9 @@
 @Art{ShTB00, a={Shen,G Q and Toulouse,J and Beaufils,S and Bonello,B
 		  and Hwang,Y H and Finkel,P and Hernandez,J and
 		  Bertault,M and Maglione,M and Ecolivet,C and Cummins,H Z},
-                   j=prE, v=62, p=783, y=2000, x="tmh.lsc,nsc,die", c="C"}
+                  j=prE, v=62, p=783, y=2000, x="tmh.lsc,nsc,die", c="C"}
+@Art{ShSB54, a={Sherwood,J E and Stephenson, T E and Bernstein,S},
+                  j=pr, v=96, p=1546, y=1954, x="n-spin.SternGerlach"}
 @Art{ShVJ07, a={Shi,Q and Voss,J and Jacobsen,H S and Lefmann,K and
                    Zamponi,M and Vegge,T},
                    j=jACmp, v={446--447}, p=469, y=2007 }
@@ -5464,4 +5475,4 @@ this is delightful reading for a member of the latter community.}}
 @Any{ba:ffp, a={Wuttke,J},
              t={Form factor (Fourier shape transform)
                 of polygon and polyhedron.},
-                y={to be submitted, available from the author} }
\ No newline at end of file
+                y={to be submitted, available from the author} }
diff --git a/Doc/UserManual/nomencl.txt b/Doc/UserManual/nomencl.txt
index 32fc184c96cb0c95185b7730e8fbde4f8d6937ff..8d317d7a1e5fa36fc83dc82dc71d7df0dfdb27cf 100644
--- a/Doc/UserManual/nomencl.txt
+++ b/Doc/UserManual/nomencl.txt
@@ -24,5 +24,6 @@ the symbol/letter
 1 decorated
 2 indexed
 4 subscripted
+8 superscripted
 
 [followed by subscript - index - decoration - funcarg]