I am using a thesis template (http://www.latextemplates.com/template/masters-doctoral-thesis) but can't get the table of content to display the right language (Italian). Here's a snapshot of the problem: enter image description here

The self-referring title "Contents" should be in Italian, i.e. "Indice". I used the babel package to manage the language. [I am sorry but don't know how to embed code snippets in this site.]

Here are the actual translations:

acknowledgementsname = Ringraziamenti;

listsymbolname = Notazioni;

declarationname = Dichiarazione.

Don't really know what "listnomenclature" should be, maybe "Abbreviazioni" or "Nomenclatura" but i'm not sure. I think the best would be let the user choose the best wording.

  • 1
    Welcome to TeX.SX! Just open the question editor and add some code (not only snippets!) and mark it with the mouse, then press CTRL-K – user31729 Jul 10 '15 at 9:00
  • I've recently answered another question on this template -- its basically downfall is that it hardcodes basically anything in English and isn't meant for another language – user31729 Jul 10 '15 at 9:02
  • Oh! @ChristianHupfer so you're telling me I should just change template? – marco trevi Jul 10 '15 at 9:05
  • 2
    Well, I've realized that most templates are wrong. I'll try to improve that template a little bit. You can try another one, but I've got no recommendation. Using a base class is most times the better way. – user31729 Jul 10 '15 at 9:07
  • 1
    This will be fixed in a few days with the new release. Please be patient. – Johannes_B Jul 10 '15 at 9:46

There is a command \addtotoc{foo} in Thesis.cls which adds just the first argument to the ToC. This is ok, but in some cases the author of the class file just entered the English word and not a macro wrapper for the word, which could be redefined easily.

Now, there are some options:

  • Edit the class file directly
  • Patch/renewcommand \addtotoc
  • Patch the occurences of \addtotoc and replace it with \addcontentsline.... and use the name wrapper macros.

I've added some name wrapper macros and patches in the main.tex file which is delivered in the template .zip bundle, but I am no Italian, so please check the 'translations'

There might be some hardcoded English words left, I did not check so far.

\documentclass[11pt, oneside]{Thesis} % The default font size and one-sided printing (no margin offsets)

%%%%%% My additions    



\renewcommand{\listconstants}{Costanti naturali}

\renewcommand{\addtotoc}{} % Useless command, in my point of view

  \addtotoc{Declaration of Authorship}





%%%%% End of my additions

\graphicspath{{Pictures/}} % Specifies the directory where pictures are stored

\usepackage[square, numbers, comma, sort&compress]{natbib} % Use the natbib reference package - read up on this to edit the reference style; if you want text (e.g. Smith et al., 2012) for the in-text references (instead of numbers), remove 'numbers' 
\hypersetup{urlcolor=blue, colorlinks=true} % Colors hyperlinks in blue - change to black if annoying
\title{\ttitle} % Defines the thesis title - don't touch this


\frontmatter % Use roman page numbering style (i, ii, iii, iv...) for the pre-content pages

\setstretch{1.3} % Line spacing of 1.3

% Define the page headers using the FancyHdr package and set up for one-sided printing
\fancyhead{} % Clears all page headers and footers
\rhead{\thepage} % Sets the right side header to show the page number
\lhead{} % Clears the left side page header

\pagestyle{fancy} % Finally, use the "fancy" page style to implement the FancyHdr headers

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % New command to make the lines in the title page

% PDF meta-data



\textsc{\LARGE \univname}\\[1.5cm] % University name
\textsc{\Large Doctoral Thesis}\\[0.5cm] % Thesis type

\HRule \\[0.4cm] % Horizontal line
{\huge \bfseries \ttitle}\\[0.4cm] % Thesis title
\HRule \\[1.5cm] % Horizontal line

\begin{flushleft} \large
\href{http://www.johnsmith.com}{\authornames} % Author name - remove the \href bracket to remove the link
\begin{flushright} \large
\emph{Supervisor:} \\
\href{http://www.jamessmith.com}{\supname} % Supervisor name - remove the \href bracket to remove the link  

\large \textit{A thesis submitted in fulfilment of the requirements\\ for the degree of \degreename}\\[0.3cm] % University requirement text
\textit{in the}\\[0.4cm]
\groupname\\\deptname\\[2cm] % Research group name and department name

{\large \today}\\[4cm] % Date
%\includegraphics{Logo} % University/department logo - uncomment to place it



%   Your institution may give you a different text to place here


\addtocontents{toc}{\vspace{1em}} % Add a gap in the Contents, for aesthetics

I, \authornames, declare that this thesis titled, '\ttitle' and the work presented in it are my own. I confirm that:

\item[\tiny{$\blacksquare$}] This work was done wholly or mainly while in candidature for a research degree at this University.
\item[\tiny{$\blacksquare$}] Where any part of this thesis has previously been submitted for a degree or any other qualification at this University or any other institution, this has been clearly stated.
\item[\tiny{$\blacksquare$}] Where I have consulted the published work of others, this is always clearly attributed.
\item[\tiny{$\blacksquare$}] Where I have quoted from the work of others, the source is always given. With the exception of such quotations, this thesis is entirely my own work.
\item[\tiny{$\blacksquare$}] I have acknowledged all main sources of help.
\item[\tiny{$\blacksquare$}] Where the thesis is based on work done by myself jointly with others, I have made clear exactly what was done by others and what I have contributed myself.\\

\rule[1em]{25em}{0.5pt} % This prints a line for the signature

\rule[1em]{25em}{0.5pt} % This prints a line to write the date

\clearpage % Start a new page


\pagestyle{empty} % No headers or footers for the following pages

\null\vfill % Add some space to move the quote down the page a bit

\textit{``Thanks to my solid academic training, today I can write hundreds of words on virtually any topic without possessing a shred of information, which is how I got a good job in journalism."}

Dave Barry

\vfill\vfill\vfill\vfill\vfill\vfill\null % Add some space at the bottom to position the quote just right

\clearpage % Start a new page


\addtotoc{Abstract} % Add the "Abstract" page entry to the Contents

\abstract{\addtocontents{toc}{\vspace{1em}} % Add a gap in the Contents, for aesthetics

The Thesis Abstract is written here (and usually kept to just this page). The page is kept centered vertically so can expand into the blank space above the title too\ldots

\clearpage % Start a new page


\setstretch{1.3} % Reset the line-spacing to 1.3 for body text (if it has changed)

\acknowledgements{\addtocontents{toc}{\vspace{1em}} % Add a gap in the Contents, for aesthetics

The acknowledgements and the people to thank go here, don't forget to include your project advisor\ldots
\clearpage % Start a new page


\pagestyle{fancy} % The page style headers have been "empty" all this time, now use the "fancy" headers as defined before to bring them back

\lhead{\emph{Contents}} % Set the left side page header to "Contents"
\tableofcontents % Write out the Table of Contents

\lhead{\emph{List of Figures}} % Set the left side page header to "List of Figures"
\listoffigures % Write out the List of Figures

\lhead{\emph{List of Tables}} % Set the left side page header to "List of Tables"
\listoftables % Write out the List of Tables


\clearpage % Start a new page

\setstretch{1.5} % Set the line spacing to 1.5, this makes the following tables easier to read

\lhead{\emph{Abbreviations}} % Set the left side page header to "Abbreviations"
\listofsymbols{ll} % Include a list of Abbreviations (a table of two columns)
\textbf{LAH} & \textbf{L}ist \textbf{A}bbreviations \textbf{H}ere \\
%\textbf{Acronym} & \textbf{W}hat (it) \textbf{S}tands \textbf{F}or \\


\clearpage % Start a new page

\lhead{\emph{Physical Constants}} % Set the left side page header to "Physical Constants"

\listofconstants{lrcl} % Include a list of Physical Constants (a four column table)
Speed of Light & $c$ & $=$ & $2.997\ 924\ 58\times10^{8}\ \mbox{ms}^{-\mbox{s}}$ (exact)\\
% Constant Name & Symbol & = & Constant Value (with units) \\


\clearpage % Start a new page

\lhead{\emph{Symbols}} % Set the left side page header to "Symbols"

\listofnomenclature{lll} % Include a list of Symbols (a three column table)
$a$ & distance & m \\
$P$ & power & W (Js$^{-1}$) \\
% Symbol & Name & Unit \\

& & \\ % Gap to separate the Roman symbols from the Greek

$\omega$ & angular frequency & rads$^{-1}$ \\
% Symbol & Name & Unit \\


\setstretch{1.3} % Return the line spacing back to 1.3

\pagestyle{empty} % Page style needs to be empty for this page

\dedicatory{For/Dedicated to/To my\ldots} % Dedication text

\addtocontents{toc}{\vspace{2em}} % Add a gap in the Contents, for aesthetics


\mainmatter % Begin numeric (1,2,3...) page numbering

\pagestyle{fancy} % Return the page headers back to the "fancy" style

% Include the chapters of the thesis as separate files from the Chapters folder
% Uncomment the lines as you write the chapters



\addtocontents{toc}{\vspace{2em}} % Add a gap in the Contents, for aesthetics

\appendix % Cue to tell LaTeX that the following 'chapters' are Appendices

% Include the appendices of the thesis as separate files from the Appendices folder
% Uncomment the lines as you write the Appendices


\addtocontents{toc}{\vspace{2em}} % Add a gap in the Contents, for aesthetics




\lhead{\emph{Bibliography}} % Change the page header to say "Bibliography"

\bibliographystyle{unsrtnat} % Use the "unsrtnat" BibTeX style for formatting the Bibliography

\bibliography{Bibliography} % The references (bibliography) information are stored in the file named "Bibliography.bib"


enter image description here

  • Thank you for the effort, but it does not seem to work... – marco trevi Jul 10 '15 at 9:31
  • @marcotrevi: I added some code in main.tex, right after \documentclass... – user31729 Jul 10 '15 at 9:35
  • I don't recommend to use this template – user31729 Jul 10 '15 at 9:46
  • Patching all macros not to use addtotoc but addcontentsline? Really? Have you checked the def of addtotoc? That puts a high amount of complicated (from a starters pov) code that does absolutely nothing different. – Johannes_B Jul 10 '15 at 9:52
  • I recommend to delete all the other crap that came with the original template. – Johannes_B Jul 10 '15 at 9:53

Using an updated version of the template, the issue is gone almost completely. We have to make sure though, that all yet unknown strings are defined for the italian language. You can also redefine a preset string using \redefinecaptioncommand.

Note, that an entry for the toc is not printed to the toc by deafult, but has to be requested by an option. The same for the lists predefined by LaTeX or the template.

For the declaration and acknowledgements, you can use \addchaptertocentry inside the environment.


% Masters/Doctoral Thesis 
% LaTeX Template
% Version 2.1 (2/9/15)
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
% Version 2.0 major modifications by:
% Vel (vel@latextemplates.com)
% Original authors:
% Steven Gunn  (http://users.ecs.soton.ac.uk/srg/softwaretools/document/templates/)
% Sunil Patel (http://www.sunilpatel.co.uk/thesis-template/)
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)

11pt, % The default document font size, options: 10pt, 11pt, 12pt
oneside, % Two side (alternating margins) for binding by default, uncomment to switch to one side
singlespacing, % Single line spacing, alternatives: onehalfspacing or doublespacing
%draft, % Uncomment to enable draft mode (no pictures, no links, overfull hboxes indicated)
%nolistspacing, % If the document is onehalfspacing or doublespacing, uncomment this to set spacing in lists to single
liststotoc, % Uncomment to add the list of figures/tables/etc to the table of contents
toctotoc, % Uncomment to add the main table of contents to the table of contents

\newcaptionname{italian}{\authorshipname}{Title of that page}
\newcaptionname{italian}{\abbrevname}{Elenco delle abbreviazioni}




\textbf{LAH} & \textbf{L}ist \textbf{A}bbreviations \textbf{H}ere\\
\textbf{WSF} & \textbf{W}hat (it) \textbf{S}tands \textbf{F}or\\

\addchaptertocentry{\acknowledgementname} % Add the acknowledgements to the table of contents

The acknowledgements and the people to thank go here, don't forget to include your project advisor\ldots



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.