Headings and advice to write a PhD in physics using LaTeX

work with included files for each chapter one. Then you can uncomment single chapters in the list of \includeonly{} to speed up your compilation and the single files are less large which makes the navigation inside the code easier. All references, page numbers will be correct. In this examples code I name the files intro.tex, chap1.tex, chap2.tex and bib.tex. And using memoir or scrbook maybe a better choice.

\documentclass{book}
\input{preamble}% no \include here possible!

\includeonly{%
  intro,
  chap1,
  chap2,
  bib
}
\begin{document}

\include{intro}
\include{chap1}
\include{chap2}
\include{bib}

\end{document}
  • An \include can have several \input but no other \include and cannot be used in the preamble part of the document
  • An \input can be used anywhere and also be nested; the code will be exactly inserted at the place where \input appears

Use some sort of version control. This has already helped me numerous times.

It's especially handy when working with someone else (also using google projects), but it can provide life-saving resques when working alone too (for eg. when you changed a paragraph whilst tired/drunk and want to change it back).

I also like the way I can hide the excess files tex creates (for referencing, figures (gnuplot), toc, tos,...). These files should not be added to your repository, so they wont clutter up the folder that much.

I use Cornerstone for Subversion, which isn't free but it's super awesome. You'll be able to find free apps too with a quick google search.

subversion ftw!


Another thing to consider is using modified headers making it possible to generate the separate chapter/section files when you're working on them.

I use:

HEADER.TEX:

\providecommand{\setflag}{\newif \ifwhole \wholefalse}
\setflag
\ifwhole\else

    \documentclass[10pt,a4paper,oneside]{book}

    \input{package.tex}
    \input{tweak.tex}
    \input{commando.tex}
    %\input{font}

    \usepackage{MnSymbol}
    \usepackage{esint}

    \begin{document}

\fi

END.TEX:

\ifwhole\else
   \end{document}
\fi

MAIN.TEX:

   \input{header.tex}

    \author{Romeo Van Snick}
    \title{Thesis 1}
    \date{\today}

    \renewcommand{\setflag}{\newif \ifwhole
    \wholetrue}

%DOCUMENT   
    \maketitle
    \tableofcontents

    \include{CHAPTER1.TEX}
    \include{CHAPTER2.TEX} 
    ...


\end{document}

CHAPTER1.TEX:

\input{header.tex}
this is chapter 1...
\input{end.tex}

So I can write and typeset each chapter separatly, and in the end add them all to the MAIN.TEX file. This way I don't have to wait as long when I'm editing chapter 10 and I want to check my changes.

The package.tex, commando.tex and tweaking.tex files contain all the stuff that is normally in my preamble. I've got the preamble nicely tucked away in these files so that I can use them later if I need to write another paper in the same style.

good luck on your thesis!

greets, Romeo


Apart from very good things already said (version control and the use of \includeonly{}), here's what I did for my own PhD thesis written in French. I used this header (sorry for the long input and the French comments):

\RequirePackage[l2tabu, orthodox]{nag}
%%% Déclaration
\documentclass[a4paper,frenchb,pdftex,11pt,twoside,openright]{book}
\input{makeat} % bidouillages en tout genre

% \includeonly{a-base}
% introduction, 0-contextePbTVHD, 1-testsub, 2-HDContexteQual, 3-evalImpactSysDegsurQual, 4-metriques, 5-eval, 6-modQualVid, 7-modClassif, a-base, b-transfoCouleur, conclusion, publications

%%% Packages
%% Packages de programmation
\usepackage{ifpdf}
\usepackage{ifthen}
%% Packages primordiaux
\usepackage[utf8]{inputenc}
\usepackage[LY1]{fontenc}
\shutup \usepackage{fourier} \youcanspeak % pour les maths (avec suppression des warnings) !! À mettre avant lmodern ou garamond !!
\usepackage{agaramondpro}
\usepackage[kerning=true,babel=true]{microtype}
\usepackage{textcomp}
\usepackage{setspace}
\usepackage[headheight=15.91pt]{geometry}
\usepackage{fancyhdr}

%% autres packages
% maths
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{array}
\usepackage{multirow}
\usepackage{mathtools}
% déco
\usepackage{lettrine}
\renewcommand{\LettrineFontHook}{\color[gray]{0.6}}
\usepackage{tikz}
\usetikzlibrary{arrows,patterns,plotmarks,backgrounds,shapes,shadows}
% layout
\usepackage[center, labelsep=endash]{caption} % avant subfig
\usepackage{subfig} % plusieurs figures en une seule (remplace subfigure)
\usepackage{pdfpages} % inclusion de pdf
\usepackage{titlesec}
\usepackage{wrapfig}
\usepackage[nottoc]{tocbibind}
\usepackage{colortbl}
\usepackage{booktabs}
\setlength{\heavyrulewidth }{0.2em}
% utile
\usepackage{lastpage}
\usepackage{eurosym}
\usepackage[utopia]{quotchap}
\renewcommand{\chapnumfont}{\usefont{LY1}{AGaramondPro}{b}{n}\fontsize{100}{130}\selectfont\color{chaptergrey}}

%% babel
\usepackage[english]{babel}
\usepackage[babel]{csquotes}
\MakeAutoQuote{«}{»}

% infos
\newcommand{\montitre}{Qualité d'usage en télévision haute définition : évaluations subjectives et métriques objectives}
\newcommand{\datesoutenance}{2 octobre 2008}

%% hyperref
\usepackage{graphicx}  % Graphiques internes et externes
\usepackage{pstricks}
\usepackage{pdflscape}
\usepackage[hyperindex, plainpages=false, pdfpagelabels, pagebackref, colorlinks=false, hypertexnames=false]{hyperref}

\hypersetup{
pdftitle={\montitre},
pdfauthor={...},
pdfsubject={...},
}
\usepackage[all]{hypcap}

%%% Commandes
\newcommand{\ornementChapitre}{\begin{center}\begin{Large}\textorn{2}\end{Large}\end{center}}
%% centrage des colonnes sur plusieurs lignes
\renewcommand\multirowsetup{\centering}
%% création d'un type de colonne centrée de largeur 1.5
\newcolumntype{D}{>{\centering}p{1.5cm}}
%% notes dans la marge
\newcommand{\note}[1]{\marginpar{%
  \vskip-\baselineskip %raise the marginpar a bit
  \raggedright\footnotesize
  \color{red}{\itshape\hrule\smallskip#1}\par\smallskip\hrule}}
\newcommand{\nonotes}{\renewcommand{\note}[1]{}}
%% strong %%
\DeclareRobustCommand{\strong}[1]{%
    \textbf{#1}%
}
%% dédicace %%
\DeclareRobustCommand{\dedicace}[1]{%
    \clearemptydoublepage
    \thispagestyle{empty}
    \vspace*{\stretch{1}}\par
    {\begin{flushright}\emph{#1}\end{flushright}\par}
    \vspace*{\stretch{2}}
}
%% sur-paragraphe (ligne entre deux groupes de paragraphes) %%
\DeclareRobustCommand{\surparagraph}{%
    \par\medskip
}
%% raccourcis %%
\newcommand\avc{H.264}
\newcommand\ituCC{ITU-R BT.500-11~\cite{itu-bt500-11}}
\newcommand\ituNfDx{ITU-T P.910~\cite{itu-bt910}}

%%% Paramétrages du document
%% url dans la même police que le reste
\urlstyle{rm}
%% profondeur de la table des matières
\setcounter{tocdepth}{2}
% \setcounter{secnumdepth}{8}
% on définit l'interligne pour tout le document
\onehalfspacing
% modification de la table des matières -- options titletoc
\usepackage{titletoc}
\titlecontents{part}
[3pc]
{\addvspace{1.5pc}\filcenter\hrule height 1pt \Large{\textbf{Partie}}~}
{\Large\textbf}
{\Large\textbf}
{}
[\hrule height 1pt\addvspace{.5pc}]
%% redéfinition des labels (tableaux, figures, etc.) % voir french.cfg
\addto\captionsfrench{\def\figurename{Figure}}
\addto\captionsfrench{\def\tablename{Tableau}}
\addto\captionsfrench{\def\listfigurename{Table des illustrations}}
%% définition des en-têtes et pieds de page
\pagestyle{fancy}
\fancyhf{} % on efface tout
\fancyhead[RO]{\nouppercase{\emph{\rightmark}}}
\fancyhead[LE]{\nouppercase{\emph{\leftmark}}}
\fancyfoot[RO,LE]{\ifthenelse{\value{page}=42}{\strong{--~\reflectbox{\thepage}~--}}{\strong{--~\thepage~--}}} % h2g2 style
\fancypagestyle{plain}{ % pour les pages de chapitre
\fancyhf{} % on efface tout
\fancyfoot[RO,LE]{\ifthenelse{\value{page}=42}{\strong{--~\reflectbox{\thepage}~--}}{\strong{--~\thepage~--}}} % h2g2 style
\renewcommand{\headrulewidth}{0pt}}
%% on enlève le pied et l'en-tête d'une page paire vide
\let\origdoublepage\cleardoublepage
\newcommand{\clearemptydoublepage}{%
    \clearpage
    {\pagestyle{empty}\origdoublepage}%
}
\let\cleardoublepage\clearemptydoublepage


%%% On attaque le vif du sujet
\title{Qualité d'usage en télévision haute définition : \\évaluations subjectives et métriques objectives}
\author{Stéphane Péchard}
\date{\datesoutenance}

\begin{document}
...
\end{document}

If you're interested in seeing the result, you can find it here: http://tel.archives-ouvertes.fr/tel-00348586/fr/