21

I have 3 months to write a PhD thesis in French. I have a good level in LaTeX (wrote several memoires and many articles), however, I would like to know if you have any suggestions concerning good practises for this kind of work (more than 100 pages, figures, tables, bibliography, footnotes...)

What would be great would be to share a heading file, including all packages that will be needed during the writing.

I give you what I came up with:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[frenchb]{babel}
\usepackage{lipsum}


\begin{document}
\chapter{Chapter 1}
\section{A section}
\lipsum[1-10]

\chapter{Chapter 2}
\section{Another section}
\lipsum[1-10]
\end{document}

I also noticed this excellent link: Jamie Stevens' Webpage

Any other suggestion is welcome.

Dɑvïd
  • 465
Mermoz
  • 385

10 Answers10

26

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
  • 3
    I agree with Herbert, scrbook or memoir are better choice than book. The "classic" classes are for US or UK users but in other cases, the Koma classes are excellent choices. With memoir, you avoid to use a lot of packages, because a lot of tools are available inside the class memoir.cls – Alain Matthes Jan 31 '11 at 11:21
  • 3
    Memoir also has the advantage of being superbly documented – Seamus Jan 31 '11 at 12:45
  • I remember now. In the \inludeonly approach one would have to edit one file e.g. chapter1.tex but run another one (this would be main.tex or something like that). I found this a bit annoying so I made the custom flags. This way I would only have to edit and run one file at one time. – romeovs Feb 02 '11 at 09:32
  • 1
    @romeovs, there is also an \excludeonly. And it is much more simpler in usind as your custom flags –  Feb 02 '11 at 09:36
  • @Herbert: this is great but the bibliography doesn't work: I use cite{} in chap1.tex and in main document i have both \include{ref} and \bibliography{ref} in the main.tex. My bibliography file is called ref.bib. When comiling i got : `I found no \bibstyle command---while reading file main.aux' and questions marks are in citation brackets. – Mermoz Feb 08 '11 at 16:01
  • 1
    @Mermoz: where is your \bibligraphystyle{...} command? –  Feb 08 '11 at 16:15
  • @herbert: thanks for this question which answered the question: \bibliographystyle{} has to be just before \bibliography{ref} in the main file. – Mermoz Feb 09 '11 at 13:22
18

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

romeovs
  • 9,102
  • 1
    +1 for version control. But why not use \includeonly instead of custom flags? – Matthew Leingang Jan 31 '11 at 14:55
  • thanks, I'm used to git as version controller but i was scared that the diff command would be unreadable since a tex document doesn't have a line-per-line structure as would a piece of code. Or maybe you don't use return inside paragraphes? – Mermoz Jan 31 '11 at 15:02
  • @Mermoz: Git works fine with LaTeX. You may want to take a look at the vc package ( http://www.ctan.org/tex-archive/help/Catalogue/entries/vc.html ), which allows you to include version control information (from Git, Bazaar, or Subversion) in LaTeX documents. – las3rjock Jan 31 '11 at 19:43
  • @Mermoz write with a strict "one sentence per line" structure and git can diff perfectly well. – Seamus Feb 01 '11 at 13:49
  • @Matthew It's been a while now since I've started working using this setup. Can't remember exactly why I \includonly didn't do what I want.

    It had something to do with not being able to nest the \include commands if I remember correclty.

    – romeovs Feb 01 '11 at 14:36
  • I don't use the merge command a lot so I don't know if that does what it should, but the comparing tools in Cornerstone work like a charm with TeX. I reckon all Subversion clients will have similar compatability with TeX. Don't know about Git-based version control, but as Seamus pointed out that should work too (although my Subversion client doesn't need me to write line per line). – romeovs Feb 02 '11 at 14:07
  • In addition to version control, use off-site backup. – Caramdir Feb 03 '11 at 03:15
  • @Matthew: I remember, the main reason I did it like this was that I don't like the idea of editing one file and than compile another. Since I compile a lot (almost every paragraph I type), this would get my workflow crippled, switching back and forward through files. – romeovs Nov 30 '11 at 09:34
11

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/

  • @Mermoz: some stuff are very specific (Garamond Pro is a pain to install for example), and to be honest, I spent a lot of time to design it (I even defined my own BibTeX style), so if you only have 3 months, stay focused on content :-) – Stéphane Péchard Feb 03 '11 at 16:00
  • Wow. The result is excellent. I will certainly borrow a lot of things for mine in a couple of years. – YuppieNetworking Feb 03 '11 at 19:56
  • 2
    @Stéphane: the optional argument pdftex in some packages is not needed –  Feb 08 '11 at 16:18
  • @Herbert: thanks for the remark, I corrected the code – Stéphane Péchard Feb 08 '11 at 16:32
  • @Stéphane: In the PDF there is a vertical line containing a something like "tel-00...., version 1 - 19 Dec 2002". Is this added by the HAL site or is it a LaTeX package? – YuppieNetworking May 11 '11 at 08:39
  • @YuppieNetworking: it's added by HAL, it's not in my original pdf – Stéphane Péchard May 12 '11 at 09:55
  • I know this is rather old theme, but I like the look of this and I tried compiling it, but I keep getting amssymb error: Command\circledS' already defined. ...mbol{\circledS} {\mathord}{AMSa}{"73}` Do you know what's this about? – dingo_d Feb 02 '13 at 14:42
  • @dingo_d actually, I don't... Where does the problem seem to come from? Do you have the Fourier and Garamond Pro fonts installed? – Stéphane Péchard Feb 02 '13 at 16:28
  • I was getting errors with your default garamond (agaramondpro), but I used \usepackage[urw-garamond]{mathdesign} instead. But I had to disable the fourier package because my equations came all messed up :\ Oh, and when I left that \shutup and \youcanspeak, I got errors also... – dingo_d Feb 02 '13 at 20:59
  • @dingo_d yeah, my font install is kinda specific and old (2008), so it may be tricky to get it exactly as I did... Anyway, glad you could correct it! – Stéphane Péchard Feb 04 '13 at 09:15
  • Yeah, I don't think that I'll have many issues, I managed to get everything to work :) I still have time to finish the visuals on my thesis, so if there will be some problems, I'll post it on tex.stackexchange :) – dingo_d Feb 07 '13 at 21:38
9

As far as the formatting of your magnum opus goes, ask around or google "<university name> latex thesis class" to see if there's a class file already written. Use that first. If your university has formatting rules from the typewriter era and you want to produce a document that you are pleased to look at, you can develop your own class file that provides the same commands with your implementation.

You should definitely use the \include and \includeonly mechanism to format only the part of the document that you are currently writing.

I would also agree with others that bibtex or biblatex is necessary for large bibliographies.

As for writing, I would follow the YAGNI principle. Just start writing. If you realize you need some special functionality, and you don't know how to implement it, stop and google, or come back here.

Matthew Leingang
  • 44,937
  • 14
  • 131
  • 195
6

It would certainly be very difficult for us to give you any specific recommendations, as a lot could depend on your university's preferred styles and templates -- mine is very specific how a thesis dissertation should look like in terms of typefaces, page design, title and chapter formatting etc., and there is not much room for improvement or improvisation.

That being said, I'd recommend you start with some of the versatile classes such as memoir and KOMA-Script. They tend to be quite exhaustive in the amount of functionality and customization they include (memoir includes 25+ other packages for common operations such as glossaries, bibliography, indices, comprehensive front- and back-matter, etc.), but could be a bit restricting if you plan to go beyond what's offered from them.

5

buddy. I think you may consider checking beforehand what extra packages you will need to help you writing your thesis, e.g. code samples, long tables, custom indexes, endnotes, and so forth. That saved me a lot of research when I got to write my master thesis, as everything was ready, so I could focus only in my text.

I also agree with Herbert, create a separated file for each chapter and include them in your master document. You probably may also create some folder hierarchy to help you keeping track of figures and/or other files, e.g., figures/chap1 and so forth.

I also recommend you to use BibTeX in order to keep your references clean and concise.

On a sidenote, though I agree that memoir class is powerful enough and thus a better choice, I have been using the good old book class without problems.

Cheers!

Paulo Cereda
  • 44,220
3

For my PhD-Thesis I've used the excellent classicthesis package, which made most of the decisions regarding style obsolete. This was only possible, because my University has very lax restrictions on the layout. André Miede, the creator of the package, was also a great help in responding to a minor problem I had.

Obviously, other items from this thread apply

  • Use a version control system, git or SVN or anything else, but use it!
  • TikZ and PGF are great for grahps and figures (see my thesis, all (non-photo) figures were TikZed)
  • \include and \includeonly are your friend for large compilation sessions
  • add \usepackage{some package} for special needs as you go on with your writing
  • Use a version control system. Did I already say this? :)
Habi
  • 7,694
2

I don’t really like \include and \input so I’ve defined an \includechapter command for my master thesis. It works similar to \include but it also defines a new chapter so it can be used as follows:

% thesis.tex

% … preamble, document begin

\includechapter*{introduction} % unnumbered chapter

\includechapter{background}

\includechapter{outline}

…

% background.tex:

\title{Background and Related Work}

Lorem ipsum dolor sit amet …

And the command is defined as follows:

\newcommand*\includechapter{\thesis@includechapter}

\WithSuffix{\newcommand*}\includechapter*{\thesis@includechapter[*]}

\newcommand*\thesis@includechapter[2][]
 {\begingroup
    \ifx#1*
      \def\title##1
       {\chapter* {##1}
        \addcontentsline{toc}{chapter}{##1}}
    \else
      \let\title\chapter
    \fi
    \input{#2.tex}
    \clearpage
  \endgroup}

This has the advantage of being extensible. For example, \clearpage could be exchanged for \cleardoublepage, you could automatically define a label for each chapter etc.

(\WithSuffix requires the suffix package.)

Konrad Rudolph
  • 39,394
  • 22
  • 107
  • 160
  • You wrote that it works similiar to \include. I cannot see where the *.aux file will be created. –  Feb 02 '11 at 21:55
  • @Herbert: not similar in that regard, sorry, shouldn’t have brought \include into the game at all. – Konrad Rudolph Feb 02 '11 at 22:18
2

The main thing you need to do is to find out what your university requires. It can be quite a challenge meeting formatting demands. In case it's of any help, this latex style for MSc/PhD theses at Dalhousie University comes close to fulfilling the requirements at the university where I teach. Please feel to clone it, and modify it as desired, so long as you follow an open-source license.

Habi
  • 7,694
dank
  • 2,189
2

TikZ and PGF were indispensable for graphs and figures in my dissertation. Beamer was a hit for my defense.

Years ago, I saw a sign in a coffee shop across from university - "Lost: one floppy disk labeled 'Dissertation'". Thus, I will heartily second the above comment regarding version control, and I suggest regular, often use of it.