% Ph.D. Thesis by N.W.S. van der Hoeff, defended on 10 November 2003
% ASCII file to be used with LaTeX2e

% General
\documentclass[a4paper]{book} % option DRAFT, extbook.cls possible
\usepackage[dutch,english]{babel} % last language is default
\usepackage[cp1252]{inputenc} % bijvoorbeeld ë kan gebruikt worden i.p.v. \"e.
\usepackage{lscape}
\usepackage[dvips,ghostview]{graphicx}
% \usepackage[pdftex]{graphicx} % in case of using PDFLaTeX
\usepackage{varioref} % advanced cross-references if label and reference fall onto the same page
\usepackage{float} % used for the specifier [H] to place float on fixed position in text (p. 149, LaTeX Companion). How about fancyhdr package?
\usepackage{dpfloat} % float on left and accompanying float on right page
\usepackage[figuresright]{rotating} % rotating page dependable. Figuresright: rotating in the same direction for every page

% Final: paper size for computer to plate --- not used
% \usepackage{vpage}
% \setpapersize{custom}{170mm}{240mm}
% \special{papersize=170mm,240mm} % for dvips
% \usepackage[left=2cm,right=2cm,top=2cm,width=13cm,height=21cm,twosideshift=0cm]{geometry} % 17x24cm, 2cm linker en rechter marge + 2cm onder en boven geeft een total-body van 13X21cm => a4=210x297, marges: 4cm links & rechts, 4cm boven (onder blijft 4,7cm over) geeft een total-body van 13x21cm

% Margins
\usepackage[left=4cm,right=4cm,top=4cm,width=13cm,height=21cm,twosideshift=0cm]{geometry} % 17x24cm, 2cm linker en rechter marge + 2cm onder en boven geeft een total-body van 13X21cm => a4=210x297, marges: 4cm links & rechts, 4cm boven (onder blijft 4,7cm over) geeft een total-body van 13x21cm
\newlength{\tekstbreedte} % nodig om de breedte van de captions en bijv. om de breedte van tabellen aan te geven op landscape pagina's met tabularx
\setlength{\tekstbreedte}{13cm}

% Fonts
\usepackage{textcomp}
\usepackage{letterspace}
\renewcommand{\baselinestretch}{1.21} % leading to 14.5 everywhere; "not everywhere" use: \usepackage{setspace}\onehalfspacing. Let op: in hoofdstuk 5 is de \baselineskip op 1 pagina verkleint en daarna weer op 1.21 gezet
\renewcommand{\rmdefault}{mntx} % Times New Roman Monotype, "mntj" met old style figures
\renewcommand{\bfdefault}{b} % use `b' for bold instead of `bx' (source: Companion p. 339)
\renewcommand{\texteuro}{\textcurrency} % \texteuro werkt niet bij mntx (v 1.8 van fontinst(=gebruikte versie) ondersteunde deze nog niet), echter \texteuro is officiele naam; \textcurrency geeft euro
\frenchspacing
\newcommand{\greater}{{\fontencoding{T1}\selectfont\symbol{"3E}}} % Defining symbols in roman font to prevent the use of math font for the replacement of $>$; Cork encoding: p.261 LaTeX Companion use `\greater{}'; font code is hexadecimal
\newcommand{\less}{{\fontencoding{T1}\selectfont\symbol{"3C}}} % for the replacement of $<$: use `\less{}', although it might be easer for a font as e.g. pnb to use `\textless'
\newcommand{\greaterthanorequal}{{\raisebox{-0.5ex}[0pt][0pt]{\makebox[0pt][l]{=}}}{\raisebox{0.5ex}[0pt][0pt]{\greater}}}
\newcommand{\lessthanorequal}{{\raisebox{-0.5ex}[0pt][0pt]{\makebox[0pt][l]{=}}}{\raisebox{0.5ex}[0pt][0pt]{\less}}}

% Lists
% \def\bull{\vrule height .9ex width .8ex depth -.1ex } % square bullet. Source: TeXbook, p. 420
\renewcommand{\labelitemi}{\textbullet}
\renewcommand{\labelitemii}{\textminus}
\renewcommand{\labelitemiii}{\textasteriskcentered}
\renewcommand{\labelitemiv}{\textperiodcentered}

% Definition of new environments and counters
\newcounter{Concl}
\newenvironment{Conclusion}
    {\stepcounter{Concl}%
    \begin{description}\item[Conclusion
    \Alph{Concl}.]}{\end{description}}
\newcounter{Recom}
\newenvironment{Recommendation}
    {\stepcounter{Recom}%
    \begin{description}\item[Recommendation
    \arabic{Recom}.]}{\end{description}}

% Definition of new float type: boxedtext
\floatstyle{plain}
\newfloat{boxedtext}{htpb}{}{}

% Tables
\usepackage{tabularx}
%\tracingtabularx % geeft breedte X kolom weer
\usepackage{longtable}
\usepackage{ltxtable}
\usepackage{multirow} % waarde [vmove] bepalen door opmeten in Ghostview, zie p. 135 LaTeX Companion.
\usepackage{array} % extends longtable with array features
\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp} % staat afbreken van woorden toe in kolommen, see LaTeX Comp. p. 108
\let\PBS=\PreserveBackslash

% Table and figure captions
\usepackage[normal,longtable]{caption2}
\setcaptionwidth{\tekstbreedte} % zie definitie hierboven en niet \linewidth omdat je dan bij landscape pagina's extreem lange regels krijgt
\renewcommand{\captionfont}{\small}
\makeatletter
\renewcommand{\fnum@figure}[1]{\figurename~\thefigure.}
\renewcommand{\fnum@table}[1]{\tablename~\thetable.}
\makeatother

% Headings (source: LaTeX companion)
\usepackage{fancyhdr}
\pagestyle{fancy} % `fancyplain' will omit page number from first page in chapter
\renewcommand{\chaptermark}[1]{%
\markboth{\chaptername\ \thechapter.\ #1}{}} % \enspace added for extra space, see also appendix files
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} % \enspace added for extra space, see also appendix files
\renewcommand{\headrulewidth}{0pt} % no line
\fancyhf{} % clear all header and footer fields
\fancyhead[LE]{\normalfont\thepage\quad \textit{\nouppercase{\leftmark}}}%
\fancyhead[RO]{\textit{\nouppercase{\rightmark}}\quad \normalfont\thepage}%
\makeatletter % No headers on empty pages before new chapter (source: Fancyhdr-package)
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
    \hbox{}
    \thispagestyle{empty}
    \newpage
    \if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother \clearpage{\pagestyle{empty}\cleardoublepage}

% Headings Part, Chapter, Section, Subsection, paragraph and subparagraph
\usepackage[nobottomtitles*]{titlesec}
\usepackage{mysects} % file "mysects.sty" for redefining section, subsection, paragraph and subparagraph
\titleformat{\part}[display]{\normalfont\normalsize}{\LARGE Part
\thepart}{10pt}{\LARGE}
\titleformat{\chapter}[display]{\normalfont\normalsize}{\Large\thechapter}{10pt}{\Large}
\titlespacing*{\part}{0pt}{0pt}{30pt}
\titlespacing*{\chapter}{0pt}{0pt}{30pt}

% Footnotes
\usepackage[multiple]{footmisc} % multiple option alters `67' in `6,7'
\renewcommand{\footnoterule}{\vspace*{-3pt}\hrule\vspace*{2.6pt}}

% Bibliography
% \usepackage{cite} % collapse 3 or more cites into a range; WERKT NIET MET AUTHORINDEX OMDAT "\cite" hergedefinieerd wordt
\usepackage[nottoc]{tocbibind} % put Bibliography in Table of Contents
\usepackage{stdclsdv} % necessary for tocbibhind.sty

% Author index
\usepackage[withbib,editors]{authorindex}
\let\cite=\aicite

% Subject index
\usepackage{index}
\makeindex
\newindex{sub}{idx}{ind}{Subject index}
\newindex{aut}{adx}{and}{Author index}
% \newindex{x}{y}{z}
% x = identifier to refer to index
% y = extension of the raw index file where LaTeX writes unprocessed index entries
% z = extension of the index files where LaTeX expects to find the processed index
% reference: LaTeX Companion, p. 367
% \proofmodetrue % prints index entries in the margins
\newcommand{\ff}[1]{#1f} % indicating index reference in figure
\newcommand{\ffb}[1]{\textbf{#1f}} % idem, only primary index reference
\newcommand{\nn}[1]{#1n} % indicating index reference in note
\newcommand{\nnb}[1]{\textbf{#1n}} % idem, only primary index reference
\newcommand{\tbl}[1]{#1t} % indicating index reference in table
\newcommand{\tblb}[1]{\textbf{#1t}} % idem, only primary index reference
\newcommand{\bb}[1]{#1b} % indicating index reference in boxed text
\newcommand{\bbb}[1]{\textbf{#1b}} % idem, only primary index reference

% epigraph for subject index
\usepackage{epigraph}
\usepackage{epiindex} % eigen style file
\setlength{\epigraphwidth}{\tekstbreedte} % breedte wordt tekstbreedte
\renewcommand{\textflush}{flushepinormal} % uitvulling normaal
\renewcommand{\epigraphflush}{flushleft} % tekst begint links
\renewcommand{\epigraphsize}{\normalsize} % lettergrootte
\setlength{\epigraphrule}{0pt} % geen lijn
%\setlength{\beforeepigraphskip}{\baselineskip} % eventueel
%\setlength{\afterepigraphskip}{\baselineskip} % eventueel

% Hyphenation
\input{Nl} % Hyphenation of Dutch words
\input{En} % Hyphenation of English words
\renewcommand\slash{/\penalty\exhyphenpenalty\hspace{0pt}} % for the correct hyphenation of "fluid/concentration" and "protocol/procedure"

% Final layout
\newcommand{\finallongpage}{\enlargethispage{\baselineskip}}
\newcommand{\finalshortpage}{\enlargethispage{-\baselineskip}}
\newcommand{\finalpagebreak}{\pagebreak}

% Graphics files
\usepackage{pstricks}
% for extra hatch patterns in pie chart
\makeatletter
% D.G. addition begin - Sep.  1, 2002
% To define dashed and dotted hatched styles
\def\pshs@solid{0 setlinecap }
\def\pshs@dashed{[ \psk@dash ] 0 setdash }
\def\pshs@dotted{[ 0 \psk@dotsep CLW add ] 0 setdash 1 setlinecap }
\def\psset@hatchstyle#1{%
\@ifundefined{pshs@#1}%
{\@pstrickserr{Hatch style `#1' not defined}\@eha}%
{\edef\pshatchstyle{#1}}}

\psset@hatchstyle{solid}

\def\pst@linefill{%
% D.G. modification begin - Sep.  1, 2002
\@nameuse{pshs@\pshatchstyle}
% D.G. modification end
\psk@hatchangle rotate \psk@hatchwidth SLW
\pst@usecolor\pshatchcolor \psk@hatchsep \tx@LineFill}

\pst@def{LineFill}<{%
gsave
  abs CLW add
  /a ED
  a 0 dtransform
  round exch round exch 2 copy idtransform
  exch Atan rotate idtransform
  pop
  /a ED
  .25 .25 itransform
  pathbbox
  /y2 ED
  a Div ceiling cvi
  /x2 ED
  /y1 ED
  a Div cvi
  /x1 ED
  /y2 y2 y1 sub def
  clip
  newpath
% D.G. modification begin - Sep.  1, 2002
%  2 setlinecap
% D.G. modification end
  systemdict
  /setstrokeadjust
    known { true setstrokeadjust } if
    x2 x1 sub 1 add
    { x1 a mul y1 moveto
      0 y2 rlineto
      stroke
      /x1 x1 1 add def } repeat
  grestore
pop pop}> \makeatother
\graphicspath{{C:/Thesis/Figures/}} % Windows; for Linux: \graphicspath{{/windows/D/Figures/}}

\begin{document}

\input{Index} % Index cross-referencing commands

\frontmatter

\input{Titlep1} %Title page I
\input{Titlep2} % Title page II
\input{Copypage} % Copyright page and commission
\input{To-page} % `To'-page
\input{Colophon} % Colofon
\input{Preface} % Preface

\tableofcontents % Contents
\renewcommand{\listfigurename}{List of figures}
\listoffigures
\renewcommand{\listtablename}{List of tables}
\listoftables

\input{Abbrevia}% Abbreviations

\mainmatter

\cleardoublepage {\renewcommand{\thepage}{}

\part{Introduction and methods}} % Part 1

\input{Chapter1}
\input{Chapter2}
\input{Chapter3}

\cleardoublepage {\renewcommand{\thepage}{}

\part{Results and analysis}} % Part 2

\input{Chapter4}
\input{Chapter5}
\input{Chapter6}
\input{Chapter7}

\cleardoublepage {\renewcommand{\thepage}{}

\part{Conclusions and recommendations}} % Part 3

\input{Chapter8}

%\begin{flushleft} % \raggedright
{
\renewcommand{\newblock}{} % "\frenchspacing"; bereik herdefinieren beperkt tot bibliography door tussen {} te zetten.
\bibliography{Bibliogr} % Bibliography
\bibliographystyle{plain}
}
%\end{flushleft}

\appendix % Appendixes. Headings handmade via \markboth{}{}

\input{List}        % A
\input{ApCDrom}     % B
\input{ApManual}    % C
\input{ApScalHe}    % D
\input{ApECM}       % E
\input{ApProbHe}    % F
\input{ApCIIHe}     % G
\input{ApFMEAHe}    % H
\input{ApReport}    % I
\input{ApNIncid}    % J

\backmatter

\input{Summary} % Summery
\input{Samenvat} % Dutch summery
\input{Acknowle} % Acknowledgements
\input{Cv} % CV

\cleardoublepage \footnotesize
\addcontentsline{toc}{chapter}{Author index} % Author index
\renewcommand\indexname{Author index} % kennelijk nodig omdat epigraph package de author index weer hernoemt als index
\printindex[aut] \normalsize

\cleardoublepage \footnotesize
\addcontentsline{toc}{chapter}{Subject index} % Subject index
\renewcommand\indexname{Subject index} % kennelijk nodig omdat epigraph package de subject index weer hernoemt als index
\newcommand{\indexepi}{\epigraph{Page numbers are \textbf{bold} in
the index when they represent the definition or the main source of
information about whatever is being indexed. Page numbers which
contain a `b' indicate that the index entry can be found in the
boxed text on that page. Page numbers which contain an `f'
indicate that the index entry can be found in a figure on that
page. Page numbers which contain an `n' indicate that the index
entry can be found in a footnote text on that page. Page numbers
which contain a `t' indicate that the index entry can be found in
a table on that page. Sometimes both bold and an `f', 'n' or `t'
are appropriate.}{}}
\renewcommand{\indadd}{\indexepi}
\printindex[sub] \normalsize

\end{document}

Opmerkingen

\index{} niet direct na een \section{} heading plaatsen omdat
LaTeX dan de heading van de tekst kan scheiden.

Footnotes in table: index one smaller than text. However, text in
footnote not smaller than footnotesize.

