\documentclass[thesis_guide.tex]{subfiles}
% chktex-file 1 chktex-file 46

\begin{document}

%==============================================================================
\chapter{Old or obsolete information and instructions}%
\label{sec:app:old}
%==============================================================================

\LaTeX\ file: \href{run:./guide_appendix_obsolete.tex}{guide\_appendix\_obsolete.tex}\\[1ex]
\noindent
With time things change! Some of the instruction or packages that I
recommended at an earlier time are superseded. Operating systems and
\TeX\ installations also change with time. In order to avoid
cluttering up the main chapters of the guide with outdated or obsolete
information, such things are collected in this appendix.

%------------------------------------------------------------------------------
\section*{Tips chapter}%
\label{sec:app:tips}
%------------------------------------------------------------------------------

%------------------------------------------------------------------------------
\section{Units}%
\label{sec:app:tips:units}
%------------------------------------------------------------------------------

Instead of \Package{SIunits}, I used to use \Package{hepunits}, which
is based on \Package{SIunits} but includes units commonly used in
particle physics such as \unit{\GeV} and \unit{\pico\barn}. Unfortunately
the syntax of the \Package{hepunits} and \Package{units} packages is
different even though they use the same macro name.
In \Package{hepunits} you write \verb+\unit{10}{\GeV}+, while in
\Package{units} you write \verb+\unit[10]{\GeV}+.
The \Package{siunitx} package is more modern and older versions were
supposed to have compatibility modes for both \Package{SIunits} and
\Package{units}, but I had problems getting them working. It uses the
macros \Macro{SI} and \Macro{num} rather than \Macro{unit}.

%------------------------------------------------------------------------------
\subsection{SIunits/hepunits packages}%
\label{sec:app:tips:siunits}\index{SIunits}\index{hepunits}

Before I found \Package{siunitx} these used to be my preferred units
packages.
% While \Package{siunitx} is supposed to have a compatibility
% mode for \Package{hepunits} I had problems getting this working.
This section therefore gives examples on how to use \Package{hepunits}
and what you should be careful about. As \Package{siunitx} has got
stricter about what it allows for a syntax, I have had to cheat in the
\LaTeX\ code several times to show the effect.

Even though \Macro{xspace} is used for some units in \Package{hepunits}
it does not appear to have the usual effect.
Hence, if you use units in normal text it is probably wise to
terminate them with \enquote{\textbackslash } or \enquote{\{\}}. Compare
\begin{itemize}
\item The \unit{\GeV}is a
  heavily used unit in particle physics and cross-sections measured in
  \unit{\pico\barn}or \unit{\nano\barn}are quite common.
  Masses can be given in either \unit{\MeVovercsq}or \unit{\MeV}.
\item The \unit{\GeV} is a
  heavily used unit in particle physics and cross-sections measured in
  \unit{\pico\barn} or \unit{\nano\barn} are quite common.
  Masses can be given in either \unit{\MeVovercsq} or \unit{\MeV}.
\end{itemize}
In the first bullet the units were not terminated, while in the second
they were.

Note that \Package{SIunits} typesets the value in text mode and the
unit in math mode. You only have to worry about this if you want to
use math mode symbols e.g.\ \(10^{8}\) in the value. Three different ways
of writing the velocity of light are:
\begin{itemize}\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}
\item \(c\) is \verb+\unit{\(3 \cdot 10^{8}\)}{\metre\per\second}+
\item \(c\) is
  \verb+\unit{3\(\cdot\)\power{10}{8}}{\metre\reciprocal\second}+
\item \(c\) is \verb+\unit{3 \(\cdot\) \power{10}{8}}{\metre\usk\reciprocal\second}+
\item Written in \Env{displaymath} or preferably \Env{equation*}:
\begin{verbatim}
  \begin{equation*}
    c = \unit{$3 \times \power{10}{8}$}{\metre\usk\reciprocal\second}
  \end{equation*}
\end{verbatim}
\end{itemize}
If you try these examples you will see differences in the spacing.
The first example gives the best result.
Two different ways of handling the value
are used in the second and third examples, either without or with space between
the number and \verb+\(\cdot\)+. In the fourth example, where you use
\Macro{unit} in math mode, you still need to enclose the value in
\$\ldots\$ if it includes characters from math mode.  Conversely if for
some reason you want normal text in your units, you should put it
inside \Macro{text}, e.g.\ the velocity of light is
\(\qty{3E8}{\text{metres per second}}\). If you forgot the
\Macro{text} command using\\
\verb+\unit{\(3 \cdot \power{10}{8}\)}{metres per second}+ you would
get:
\(3 \cdot 10^{8}\,metres per second\) or if you tried to write the units
yourself you would get \(3 \times 10^8\,m s^{-1}\).

If you have negative powers then you can play around with
the \Macro{power} command and the usual superscript:
\begin{itemize}
\item \(\hbar\) is \verb+\unit{\(1.054 \times 10^{-34}\)}{\joule\usk\second}+
\item \(\hbar\) is \verb+\unit{1.054 \(\times\) \power{10}{-34}}{\joule\usk\second}+
\item \(\hbar\) is \verb+\unit{1.054 \(\times\) \power{10}{\(-34\)}}{\joule\usk\second}+
\end{itemize}
Note the use of \Macro{usk} to get a bit of space between the
units. In the second example the minus sign appears as a dash,
\enquote{-}, rather than \enquote{\(-\)}, which is too small. Hence, if you
use \Macro{power} you should put the power in math mode.

Just to complicate things further, if you use the Palatino font for
example, then the standard \TeX{} font is used in math mode. You thus
have to decide from the very beginning whether numbers should
\textbf{ALL} be in text or in math mode. This is clearly one of the
disadvantages of using a font for which the math mode is different
from the text mode. ATLAS uses either the \Package{newtx} or \Package{txfonts} package,
which do not have this problem.
This is why I use \Package{newtx} in this guide.
If you compile the guide
with a different font and the numbers \(1234.56\) and 1234.56 look the
same then you do not have to worry!
Recent versions of this guide contain a Palatino font combination that works in both
text and math mode -- see the style file.
There are other ways to get around the problem with Palatino.
You can try either the \Package{pxfonts} or the
\Package{mathpazo} packages -- for my taste the sans serif font used
in \Package{pxfonts} looks a bit better.

For ranges with \Package{SIunits} and \Macro{unit} you can write
\verb+\unit{\power{10}{4}--\power{10}{5}}{}+, which would look almost
correct, but leaves some space for the unit! If you want to write
between 5 and \qty{7}{\GeV}, then \Macro{unit} works well:
\verb+\unit{5--7}{\GeV}+.


%------------------------------------------------------------------------------
\section*{Figures chapter}%
\label{sec:app:figs}
%------------------------------------------------------------------------------

%------------------------------------------------------------------------------
\subsection{PyFeyn}%
\label{sec:fig:pyfeyn}\index{PyFeyn}

As the name suggests, \Package{PyFeyn} (\url{https://pyfeyn.hepforge.org})
is a Python package for drawing Feynman graphs.
It combines the advantages of using a programming language to draw the graphs
with the ability to use \LaTeX\ and the same fonts as you use in your thesis for the text.
I also wanted to improve my Python skills, so used this package quite a lot for my graphs.
However, the package no longer seems to be maintained
and some fixes may be needed before it works,
so I have relegated this section to the chapter on obsolete instructions.

The package \Package{hepnicenames} is included by \Package{PyFeyn}.
If you want your particles to be written with italics,
you have to add this option to \File{\_\_init\_\_.py} in the \File{pyfeyn} directory.
As of \TeXLive 2019 particles using the upright font do not seem to be printed properly,
so you really have to write your particles with italics.
This is due to a bug in \Package{hepparticles} (which is the underlying package of \Package{hepnicenames}).
I have a fix of the bug, but it has not yet been propagated into the official package.
Hence, in \File{\_\_init\_\_.py} of the package you have replace
\begin{bashlisting}
pyx.text.default_runner.preamble(r"\usepackage{hepnicenames}")
\end{bashlisting}
by
\begin{bashlisting}
pyx.text.default_runner.preamble(r"\usepackage[italic]{hepnicenames}")
\end{bashlisting}

\Package{PyFeyn} does not work out of the box any more,
unless you use a specific version of the \Package{PyX} package.
In order to install the package using Homebrew Python (set up with \Package{pyenv} under macOS), I did:
\begin{bashlisting}
pip install pyx==0.14.1
pip install pyfeyn
\end{bashlisting}
\noindent This installed the packages in \File{\textasciitilde/.pyenv/versions/3.8.2/lib/python3.8/site-packages/\ldots} etc.
For older versions of \Package{PyX} you may have to patch \File{pyx/dvi/vffiles.py}
to use the newtx fonts: \url{https://sourceforge.net/p/pyx/code/3678/}.
For the most recent version of \Package{PyX} (0.15), you also have to patch \Package{PyFeyn} to make it work.
This means replacing
\verb+pyx.text.defaulttexrunner.text+ by
\verb+pyx.text.defaulttextengine.text+
in \File{deco.py}
You have to adjust \File{\_\_init\_\_.py} in a similar way including the following lines:
\begin{bashlisting}
if pyxversion >= Version("0.15.0"):
    pyx.text.set(pyx.text.LatexEngine)
elif pyxversion >= Version("0.13.0"):
    pyx.text.set(pyx.text.LatexRunner)
else:
    pyx.text.defaulttexrunner.set(mode="latex")
\end{bashlisting}
%
\noindent Given these difficulties, I have moved to \Package{TikZ-FeynHand},
as discussed above.

While functions exist to draw a number of lines, I added my own wrapper functions
that adjust the style as I wanted.
Have a look at \File{pyfeyn/myPyFeyn/\_\_init\_\_.py} to see what default settings I use
to get the font and colours that I want.
Examples of Feynman graphs drawn using the package can be found in
\cref{fig:tZq-pyfeyn} and are included in the \File{pyfeyn} directory.
If you want to get started with \Package{PyFeyn} you can copy this directory
into your thesis directory, e.g.\ \File{mythesis}.

\begin{figure}[htbp]
\begin{tcblisting}{}
\centering
\raisebox{0ex}{%
  \includegraphics[width=0.4\textwidth]{../pyfeyn/tZq_4FS_feyn}
}
\quad
\raisebox{2ex}{%
  \includegraphics[width=0.4\textwidth]{../pyfeyn/tZq_5FS_feyn}
}
\caption{Example Feynman graphs for the associated production
  of a top quark and a \PZ boson.}%
\label{fig:tZq-pyfeyn}
\end{tcblisting}
\end{figure}


%------------------------------------------------------------------------------
\section{More on \Package{feynmf}}%
\label{sec:app:fig:feynman:feynmf}

I relegate this section to the chapter on obsolete instructions,
because I think it is much easier to just use \Package{feynmp} than \Package{feynmf}.
You can combine \Package{feynmp} with \Package{standalone} for a very convenient way
to develop and include Feynman graphs, as discussed in
\cref{G-sec:fig:feynman:feynmp}.

If you use \Package{feynmp} you can just give the command \texttt{make
feynmp} and it will produce PDF files of all the \texttt{tex} files in
the \texttt{feynmf} subdirectory.

If you do not want to include the \Package{feynmf} commands for Feynman
graphs in the thesis (or input the file containing them), you can try
to make encapsulated Postscript (or PDF) files that contain a single
Feynman graph and then include these as usual in your thesis.

If you want to use \Package{feynmf} you can start with the
\texttt{feynmf} command on the \texttt{tex} file containing the
graph.\footnote{Note that the example files that are included in this
  document tree are missing the \Macro{documentclass} and
  \Macro{usepackage} commands.}  This produces a \texttt{dvi} file
that you then have to convert to Encapsulated Postscript and/or
PDF\@. This is not totally trivial.

The best way is to specify the options to the \Package{geometry}
package so that the page size corresponds to the Feynman graph. For a
graph with size $(50,50)$, as specified at the beginning of the
\Env{fmfgraph*} environment (within \Macro{unitlength} in \unit{\mm}), the
following wrapper works well:
\begin{verbatim}
\documentclass{article}
%
\usepackage[papersize={60mm,56mm},text={58mm,52mm},centering]{geometry}
\usepackage{feynmf}
\usepackage{color}
%
\pagestyle{empty}
\begin{document}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\setlength{\unitlength}{1mm}
\begin{center}
\fbox{\input{figs/feynmf/ep_nc.tex}}
\end{center}
\end{document}
\end{verbatim}

I also had success with the command chain:
\begin{verbatim}
feynmf ep_nc
dvips ep_nc
ps2epsi ep_nc.ps
\end{verbatim}
and then you can include \texttt{ep\_nc.epsi} in your \LaTeX
file.\footnote{By default \LaTeX{} will not find \texttt{.epsi} files
  with the \Macro{includegraphics} command. Rename them to
  \texttt{.eps} instead or add \texttt{.epsi} to the list of file
  types that \Macro{includegraphics} can handle.} To
get PDF you need one more step:
\begin{verbatim}
epstopdf ep_nc.epsi
\end{verbatim}

An alternative with explicit Metafont calls is:
\begin{verbatim}
pdflatex ep_nc
mf '\mode=localfont; input ep_nc;'
pdflatex ep_nc
pdflatex ep_nc
\end{verbatim}
The trouble with this is that the Feynman graph is not clipped, unless
you have specified the page size appropriately as discussed above.


%==============================================================================
\section*{References chapter}%
\label{sec:app:ref}
%==============================================================================

%------------------------------------------------------------------------------
\section{Traditional \BibTeX{} styles}%
\label{sec:app:ref:bst}

I strongly recommend that you use \Package{biblatex} and \Package{biber}, but if you insist\ldots

If you use references directly from Spires or Inspire, then it is
probably best to use one of the style files that is compatible with
their format. A list can be found on
\url{http://www.slac.stanford.edu/spires/hep/refs/bibstyles.shtml}. I
have used \Option{utphys} a few times and it works OK\@. I see that
there are also style files available there for common HEP journals,
which could save quite a bit of work. The big advantage of
\Option{utphys} is that it also knows about the arXiv and preprints.

The equivalent of \Package{biblatex}'s \Option{ieee} style in \BibTeX\ is
\Option{ieeetr}. It also knows about arXiv and preprints. However, it
does not know about collaborations.

There used to also be standard ATLAS style files that work fairly well:
\texttt{atlasBibStyleWithTitle.bst} and \texttt{atlasBibStyleWoTitle.bst}
These have been removed in ATLAS \LaTeX{} version 15.12.0 and so are
now only available via an old commit in GitLab.

%------------------------------------------------------------------------------
\section{Using \Package{mcite}}%
\label{sec:app:ref:mcite}
%------------------------------------------------------------------------------

The \Package{mcite} package used to be a good way
of combining several articles into a single references and also
getting them to be printed out in the form \enquote{[m--n]}, rather
than \enquote{[l,m,n]} or \enquote{[l],[m],[n]}. How do you achieve
this?  Just put all the articles in a single \Macro{cite} and prefix
those that should be lumped together with a \enquote{*},\\
e.g.\ \verb+\cite{Chekanov:2009wt,*Aaron:2009wg,*Aaron:2009sma}+.
The problem is that this package does not appear to be compatible with the
\Package{hyperref} package, so you have to choose between the
two. Given the ability that the \Package{hyperref} package offers to
jump directly to sections, equations, references referred to in a
document, I guess most of you will go with \Package{hyperref} rather
than \Package{mcite}.

The \Package{biblatex} package offers a
more modern alternative and different ways of achieving the same
results! It is also not compatible with \Package{mcite}.

A modified version \Package{mcite} is used by ZEUS in its LaTeX4ZEUS
environment, which is why I include a short description here.

% %------------------------------------------------------------------------------
% \section{Windows}%
% \label{sec:app:old:windows}
% %------------------------------------------------------------------------------

%------------------------------------------------------------------------------
% \subsection{Windows XP}

% As I no longer have access to a Windows XP machine, and Windows XP is
% slowly disappearing, my experience with Windows XP stopped 2011.

% I started the \TeX{} Collection 2010 DVD\@. I started it as an
% Administrator, it opened a \TeX\ Collection window and I then clicked
% on proTeXt Quick Install and installed MiK\TeX{} (minimal
% version),\index{MiKTeX}\index{TeXnic Center} \TeXnicCenter,
% Ghostscript and Ghostview for all users. Once the installation was
% finished, I also updated all the packages using the MiK\TeX{}
% Maintenance (Admin) $\to$ Update (Admin) program. Be patient -- these
% updates always take a while!

% You should then be able to double-click on \texttt{mythesis.tex} and
% try to compile it! My first attempt at this failed. I had set
% MiK\TeX{} to install missing packages, but it was supposed to ask me
% first. This seems to work well if you are logged in as the same user
% (with Administration rights) as the one who installed MiK\TeX. The
% package updating does not seem to work properly (it only asks you for
% the first missing package I think) if you are a normal user. After
% going through the exercise once as an Administrator to compile the
% skeleton thesis, I could also compile both the thesis and the guide as
% a normal user.

% The second attempt was a complete MiK\TeX{} installation. I told it to
% install missing packages without asking. This also failed at the first
% attempt as it was missing the package \Package{logreq} and somehow did
% not install it automatically. I had to use the MiK\TeX{} Maintenance
% (Admin) $\to$ Package Manager (Admin) to install \Package{logreq}.


% %------------------------------------------------------------------------------
% \subsection{\TeXnicCenter}%
% \label{sec:app:texnic}\index{TeXnic Center}

% I tried out the \TeXnicCenter, which is also available. You first
% have to tell it where to find the \LaTeX\ executables. In my case
% this is \texttt{C:\textbackslash Program Files\textbackslash MiKTeX
%   2.8\textbackslash mktex\textbackslash bin}. You also have to tell
% the program where to find Acrobat (Reader) although it should find it
% automatically.

% In the \TeXnicCenter I opened one of the main files, i.e.\
% \texttt{mythesis.tex} or \texttt{thesis\_guide.tex} and then in the
% \texttt{Project} menu I declared this file to be the main file for a
% new project. You should declare the file format to be Unix. You can
% then compile the project and look at the output by hitting
% \texttt{Ctrl + F5}. It is also possible to set some options such that
% you do not have to close the file in Acrobat Reader before compiling.

% There is a small problem and irritation with \TeXnicCenter and
% Acrobat Reader X. Under \texttt{Build} $\to$ \texttt{Define Output
%   Profiles} $\to$ \texttt{Viewer} you have to change \texttt{acroview} to
% \texttt{acroviewR10} in the three places where it is given. If you
% then try to compile Adobe Reader opens but you get an error
% message. Just view the output again \texttt{F5} and the PDF file will
% be shown. Via Google, I found some tricks that are supposed to fix
% this problem, but they did not work for me. You can also just start
% Adobe Reader first and then \TeXnicCenter.

% In general, I thought I liked the \TeXnicCenter somewhat more than
% \TeXworks, which is the direct MiK\TeX{} interface. It allows you to
% set up projects and you then have the ability to navigate easily
% through all your files via the Navigator. However, it has a serious
% problem in that it does not handle UTF-8 files properly. Although
% support for UTF-8 has been advertised for almost two years I do not
% see much signs of progress.

% As \TeXnicCenter has been dropped on the Dante \TeX\ Collection 2011
% DVD I have relegated this information to a subsection.


%==============================================================================
% \chapter{Print shops}%
% \label{app:printer}
% %==============================================================================

% For a PhD thesis, as mentioned in \cref{G-sec:submit:phd},
% you have to print and bind the five copies that are needed by the
% university library externally.
% Contact the ULB for suggestions on print shops that 
% that can supply the required quality at a reasonable price.

% \begin{itemize}
% \item
% Typo-Druck \& Verlags-GmbH\\
% Irmintrudisstr. 1b\\
% 53111 Bonn\\
% Telefon 0228-650905\\ % chktex 8
% \url{http://www.typo-druck.de}

% \item
% Buchbinderei Hennemann\\
% Paulusplatz 12\\
% 53119 Bonn\\
% Telefon 0228-223521\\ % chktex 8
% \url{http://www.buchbinderei-hennemann.de}

% % Druckerei Schwarz
% % Annaberger Str. 206
% % 53175 Bonn
% % Telefon 0228-319052
% % druckerei-schwarz.de
% \end{itemize}

% It is also possible to order online, e.g.:
% \begin{itemize}
% \item \url{http://www.druckerei-eberwein.de/shop}
% \item \url{http://www.kunsthaus-schwanheide.de}
% \item \url{http://www.druckterminal}
% \item \url{http://www.sedruck.de}
% \item \url{http://hundt-druck.de}
% \item \url{http://copyteamcologne.de}
% \item \url{http://dr.hut-verlag.de}
% \end{itemize}
% We have tried out \foreignquote{ngerman}{Druckerei Eberwein}. Their
% price was reasonable and they delivered quickly and in good quality.

\end{document}
