LaTeX table of contents, list of figures/tables and some customizations

I wrote a somewhat short post on list of figures and list of tables a few years ago. Nevertheless, it gets quite a bit of traffic, possibly due to the large number of comments. For that reason, I decided to put together another, more informative post on the same topic that includes table of contents.

I use the following common abbreviations throughout the post:

Topics
Creating content lists, the basic commands

Creating content lists in LaTeX documents is straight forward. Typing these three commands is sufficient to produce a toc, lof, and lot. To produce the lists, the document has to be typeset twice. The first iteration collects all headings and captions and writes them to meta files (*.toc, *.lof, *.lot). The second iteration prints the lists, based on the content of the meta files.

\tableofcontents \listoffigures \listoftables

simple-article-tocloflot

\documentclass[11pt] \begin \tableofcontents \listoffigures \listoftables \clearpage \section \begin[ht] \begin \caption \label \end \end \begin[ht] \begin \caption \label \end \end \begin[ht] \caption \begin \begin <|c|c|>\end \end \label \end \section \end

Depending on the document-class employed, page-breaks are added between toc, lof, and lot. Article produces lists without space between them. Report and book insert \clearpage or \cleardoublepage , depending on whether twoside and openright options are set (default for book ), to start each list on a blank page. See here for more details on document-class options.

Controlling the depth of content added to toc

Depending on the size of your document (length of chapters, sections, etc.), you might want to increase or decrease the level of headings added to toc. To control the depth of content added to toc the counter tocdepth is modified in the preamble as follows:

\setcounter %level -1: part, 0: chapter, 1: section, etc.

In the following example all headings are added to toc (level: 5):

toc-depth

\documentclass[11pt] \setcounter %shows all levels incl. paragraph \begin \tableofcontents \chapter \section \subsection \subsubsection \paragraph \end
Adding lof/lot to toc

lof-lot-in-toc1

Lists of figures and tables are not automatically added to the table of contents. I will introduce two different approaches here, an automatic and a manual approach.

Automatic approach:

Loading tocbibind (package documentation) adds entries for lof and lot to toc. In addition, the package adds bibliographies and table of contents itself, by default. This might not always be desirable. Therefore, specific entries can be removed from toc by loading the package with corresponding options, such as: nottoc, notbib, notlof:

%preamble \usepackage[nottoc] %content \tableofcontents \listoffigures \listoftables

Manual approach:

Lof and lot can be added manually through \addcontentsline . The command takes three arguments: the file (e.g. toc), the level (e.g. chapter), and the text to be added.

%article \tableofcontents \addcontentsline <\listfigurename>\listoffigures \addcontentsline <\listtablename>\listoftables %report and book \tableofcontents \clearpage %\cleardoublepage %for openright \addcontentsline <\listfigurename>\listoffigures \clearpage %\cleardoublepage %for openright \addcontentsline <\listtablename>\listoftables \clearpage %\cleardoublepage %for openright

\listfigurename and \listtablename produce the list headings. This way, toc entries are automatically updated, should the headings be changed for some reason. Adding the lists to toc before the actual command as well as them makes sure the page numbers are set correctly. The document-class option openright (requires twoside in report ) always starts chapters on odd pages, which is when \cleardoublepage comes in handy. It adds either one or two page-breaks depending on whether the content ends on an even or odd page.

Short captions for lof/lot

Some figures and tables have long captions. It might not always be preferable to reproduce the whole caption in lof/lot. The caption command provides a convenient way to produce a shorter figure/table description in the lof/lot by using its optional argument, without change to the actual figure/table caption.

\caption[short lof/lot caption]

long-caption-short-lof

\documentclass[11pt] \usepackage \begin \tableofcontents \listoffigures \section \begin[ht] \begin \rule<0.5\linewidth> <0.35\linewidth>\caption[Long caption figure] \label \end \end \end

The same works with headings and table of contents. The \chapter and \section commands also take an optional argument which, when used, produce an alternative chapter/section name in toc.

\chapter[Short chapter name]
Linking toc/lof/lot with content using hyperref

Loading hyperref (package documentation) is generally sufficient to link list entries with document content. With some exceptions, the hyperref package usually has to be loaded last. For a better visualisation of links, it is a good idea to change the link font color, e.g. to blue:

\usepackage[colorlinks=true,linkcolor=blue]

toc-hyperref

Further customizations

This earlier post describes 10 ways to customize toc/lof/lot, from basic to more advanced topics.

The tocloft package

The tocloft package provides means of controlling the typographic design of table of contents, list of figures and list of tables (copied from its documentation). Introducing the package would go beyond the scope of this article. However, I am happy to help should you have any specific question. Just drop me a comment below.

Share this:

Related

116 Comments

  1. Giannis 13. June 2013 at 11:45

Hi Tom, I would like to ask how could we add a short table of contents which will contain only the chapters’ name.

Add \setcounter to your preamble. The tocdepth counter controls the level of headings added to TOC (0: chapter, 1: section, etc.).

Hi Tom, Excellent article on TOC.
One question I have is, is there a way to suppress the toc title, i.e. ‘Contents’ as I am already using a fancyhead

\fancyhead[RO,RE]<\includegraphics[width=1.5cm]>
to generate title headers and the toc title overwrites the fancyhead? Hi Ciaran, The easiest way would be to redefine the title and leave it empty3:
\renewcommand*<>

Hi Tom, I’m using hyperref for my TOC. The issue I have is that the link is only on the chapter title and not the whole line. Because I also would like that if I click on page number, then I’m directed to that page. Thanks for your support.
Rom

Hi Romain, There is an package option which does exactly that. See the hyperref documentation for more details.

\documentclass[11pt] \usepackage \usepackage[linktoc=all] \begin \tableofcontents \blinddocument \end

Hi Tom, I need to obtain this on my LOF in the pdf file: ex: Figure 1 akudfkadgubkadjbvadivbakidbvadivblaidvblaidvblaivblai
akbadkvibadlivbadivladivbladivladivbaldivlaihlaidbldibnl
aivladivlaidvb……………………………………………………………..1 I’m sorry if became a little confuse but I’m brazilian. Thanks

Hi Igor, You’ll have to be a little more specific what your question is about, e.g. no line-breaks in long captions. Please also give a minimal example to illustrate the problem. Thanks, Tom.

I think he wants the word “Figure 1.1: A study” instead of “1.1 A study” which I am also trying to do but not yet successful.

Hi Sajjad, Thanks for the comment. Adding the following two lines does exactly what were looking for:

\usepackage \renewcommand See here for a few more customizations. Best, Tom

hi tom
i have same problem of adding word figure and table in list of figure and also i need to add “:” after number of figure so i used this code:

\renewcommand*\cftfigpresnum \settowidth \renewcommand

but in multilines caption it is not align always seconde ligne start before the “:”
if u can help? thanks

Hi Bilal, Below is a minimal working example that illustrates how to properly align multi-line text in the list of figures. Best, Tom

\documentclass[11pt] \usepackage[titles] \usepackage \newlength\mylength \renewcommand\cftfigpresnum \renewcommand\cftfigaftersnum \settowidth\mylength \addtolength\cftfignumwidth <\mylength>\begin \listoffigures \section \begin[ht] \centering \rule \caption \label \end \end Thanks tom
I had another pb of appendix
I add new table of content for just appendix \begin \startcontents[appendices] \printcontents[appendices] \setcounter> \section \section \end

I had perfectly my small toc of appendix but the pb is i want to remove all appendix from principale toc but i cant

Hi Bilal, Perhaps you find this Q&A tex.SX useful. In case this doesn’t solve your problem, please provide a minimal working example. Thanks, Tom

Hi Tom, I found your blog when I was looking for any answers about how not enumerate the page of lof/lot/loc? \pagestyle , \thispagestyle didn’t work as well.
Thanks

Hey Ricky, Try the following: \documentclass[11pt] \begin \pagenumbering \tableofcontents \listoffigures \listoftables \clearpage \pagenumbering \chapter \section \end

Hi Tom, I am trying to follow your example above. I want the LOF and LOT entries in the TOC to be sections. As it is below.. I get two LOF and LOT entries in the TOC (one as a section, one as a chapter) yet the hyperlink on the section entry is wrong. Thanks

\usepackage \newlength\mylena \settowidth\mylena \newlength\mylenb \settowidth\mylenb \addtolength\cftfignumwidth <\mylena>\addtolength\cfttabnumwidth <\mylenb>\renewcommand\cftfigpresnum \renewcommand\cfttabpresnum \tableofcontents \cleardoublepage \clearpage %\cleardoublepage %for openright \addcontentsline <\listfigurename>\listoffigures \clearpage %\cleardoublepage %for openright \addcontentsline <\listtablename>\listoftables \clearpage %\cleardoublepage %for openright

Hi James, Thanks for this question. You can use a little trick, by adding phantomsection before addcontentsline , the links are set properly. Best, Tom

\documentclass[11pt] \usepackage \usepackage \begin \tableofcontents \cleardoublepage \clearpage %\cleardoublepage %for openright \phantomsection \addcontentsline <\listfigurename>\listoffigures \clearpage %\cleardoublepage %for openright \phantomsection \addcontentsline <\listtablename>\listoftables \clearpage %\cleardoublepage %for openright \end

Great thanks Tom. I now have an issue with the sectioning…. The chapters are labeled correctly e.g Chapter 1, Chapter 2…
But the sections are also labelled section 1, section 2 … not section 1.1, 1.2 Weirdly the subsections are labelled 1.1 and the figures/tables are also labelled 1.1,1.2 etc Would really appreciate any help

\usepackage[nottoc] % Potentially important for sectioning \renewcommand\thesection> % very important for structure ? \pagenumbering \doublespacing \baselineskip=15.5pt \tableofcontents \cleardoublepage \listoffigures \cleardoublepage \listoftables \cleardoublepage \baselineskip=20pt \pagenumbering \renewcommand[1]<\markboth<\chaptername\ \thechapter:\ #1><>> \renewcommand[1]<\markright<\S\thesection\ #1>> \renewcommand\thesection>

Hi James, It’s the second line of your code where you define sections to be labeled with just the section number instead of chapter and section. Also, delete the last line. I’m not sure why you change it there. Commenting it out should fix the problem. Alternatively, you could replace it with:

\renewcommand\thesection>

Also, please provide a full minimal working example next time. It’s much easier to reproduce your issue that way. Cheers, Tom.

Hi Tom,
Very useful post!
I’ve an extra question. I have a pretty long table of contents that fits on one page and a few lines more on a second page. But spaces between each item are pretty large.
Is there a way to reduce them, or an instruction to tell tex to fit the table of contents in one page only?
Thank you very much.
Pierre-Philippe

Hi Pierre-Philippe, If it’s only a few lines, you might use the spacing package: %Preamble \usepackage %Document \begin \tableofcontents \end

Possibly a more satisfying alternative is to use the tocloft package and play with, for example, the space before each chapter entry.

%Preamble \usepackage \setlength\cftbeforechapskip

Even if there was a way, I wouldn’t recommend forcing TeX to fit the ToC on a single page. What if you decide to add two more chapters a few weeks later…? HTH, Tom

Hi, Tom, I’m a bit new to this and have had trouble applying these ideas to my table of contents — perhaps because mine is un-numbered? I’m using the book (AMS) document class and have tocloft, and as of now, the “part” and “chapter” entries in the table of contents are set to the same indentation level. I want to make things more obvious and have the “part” entries not indented, but the “chapter” entries intended a bit. Is there any way to do this? I’ve tried throwing some things into the Preamble that I thought might work, but I keep getting error messages about “>” not being there, or there being too many. If you have any ideas, it would be greatly appreciated!
Thanks!
~J.D.

Hi J.D., Thanks for your comment. It seems the ams document classes are not compatible with tocloft. But what you can do is manually redefine how ToC entries are typeset. Here is a MWE to change the chapter indentation:

\documentclass \makeatletter \renewcommand<\l@chapter><>> %@tocline arguments %#1: sectioning level (chapter=0) %#2: vertical space before the entry %#3: indent of the entry (default 0pt) %#4: space for number %#5: style commands (e.g., font type/size) \makeatother \begin \tableofcontents \part \chapter\section \chapter\section \part \chapter\section \chapter\section \end Hope this helps,
Tom

Hi Tom,
Please I’m using the Memor Class and i want that my table of figures be like this : Figure 1.2, Figure 1.3 … and not only 1.2, 1.3
Thank you

Here is an example: \documentclass[11pt] \renewcommand \begin \listoffigures \chapter \section \begin[ht] \centering \rule<0.4\linewidth> <0.4\linewidth>\caption\label \end \end Please consider the memoir class documentation for more details.

Thank you for your reply. But using \cftfigurefont requires me using the tocloft package. When i use that package the format of my table of contents changes which I can’t afford to do. Can I do it it without using tocloft package?? Please help.

This doesn’t require the tocloft package. The tocloft command is \cftfigfont . Memoir provides a lot of flexibility by implementing commands that are provided by packages for the standard classes. Just give the code I posted a try…

you are asking me to change the class. But that will change the whole format of my thesis which I have compiled according to my university guidelines. Currently I am using a class “ThesisMtech” which I have modified according to my need. I am just not able to get this “Figure 1.1” in place of “1.1” in list of figures and list of tables. Have been trying this for 15 days now. Kindly provide some solution. I can attach my class file if you want. Thank you.

For some reason I thought you were using the memoir class. I wonder if using tocloft and change the lof/lot style according to your needs might work. Please prepare a minimal working example and a pointer to where I can get the ThesisMtech class file (ideally the one you modified) and I’ll see what I can do. Best, Tom

I want to resize heading “List of figure” and “List of tables”, default output using \listoffigure
is large list of figure written at the header, I want to align in left side with underline in normal font size. How to do that?

Hi Ranjana, Here’s a minimal working example, which uses the tocloft package: \documentclass \usepackage \renewcommand <\normalfont\normalsize\bfseries\underline>\begin \listoffigures \end Hi Tom,
whenever I use figure inserting format like below: \begin[h] \centering \includegraphics[scale = .85] \caption \label \end

and I also use the: \lstinputlisting for importing Matlab codes, there is always a problem; program will not execute, but if I use this format:

\begin \includegraphics[scale = .85] \end \[Figure 3.1: My dog]

it will run and show my Matlab codes and the diagrams. The problem now is that when I try to use the listoffigures or listoftables command to generate my list of figures and list of table respectively, it can not display the list of figures, probably, since the caption command is not used in the

\begin \includegraphics[scale = .85] \end \[Figure\: 3.1:\: A \:basic \:(SIR)\: model \:flow\: chart\]
when inserting my my figures.
so what do I do to enable diaplay my list of figures and tables.

You are right, the figure number will only be generated when it is wrapped in a floating environment (i.e. \begin

. \end
) and has a \caption . I wasn’t able to reproduce the issue with a Matlab input file (*.m). Could you provide a complete minimal working example. That would make it much easier for me to help. Thanks, Tom

First of all thank you for your sharings. On my report class document content of figures are like here: Figure 1.1 BWM Car……………………..5
Figure 1.2 Ferrari Car……………………7 But I want a suffix at the end of each number. I want like this: Figure 1.1. BWM Car……………………..5
Figure 1.2. Ferrari Car……………………7 *see the dot (.) after 1.1 Also this dot (.) should be on each figure explanation. I will be happy if you can help me. Here is my all document temaplate: http://pastebin.com/UttcnKpY Thanks in advance.

All you have to do is add this line to your preamble. It redefines the figure number.
\renewcommand.\arabic.>

Hi Tom.
Thanks for the article, but I have a question. My paper have a lot of figures in the same chapter. When I compile the LateX, however, I get Figure number overlaping its title. I want to increase the spacing between the Figure number and the Figure title. Do you know how I do that?

The following line of code will add extra space between the number and the caption text through the tocloft package.

\usepackage \setlength

Lemme ask you dear Tom; I have this annoying problem with table of contents: I’m a beginner in Latex. When I add \tableofcontents command, Latex encounters issues with compiling. And I get “Undefined Control Sequence”.. Do I need a use package here or where lies exactly the problem?? Thank you.

You don’t need to load a package to use \tableofcontents . Thus, the issue is with something else. However, I won’t be able to help without your code. Could you post a minimal working example here. Thanks, Tom.

Hi Tom, thanks for your post! Anyway, can you tell me how to add more horizontal space between the section’s number and its title? Cheers!

Hi Anggha, I assume you are referring to the table of contents. The code below let’s you change the space reserved for the section number. By default, chaptered document classes use 2.3em and others such as article 1.5em . For more details see the tocloft documentation.

\usepackage \setlength\cftsecnumwidth

Hi Dear TOm, My TOC table and figure and table title is too long and it overlap with page numbers ,
Please guide me , what should I do ? Which code I should Use ??

Long captions should automatically be wrapped in the list of figures and tables. Please provide a minimal working example for illustration of your problem and I’ll see what I can do… Thanks, Tom

In my report, till the table of contents pages are numbered in roman and after that full report is numbered in arabic. But i’m getting only arabic page no.s in the table of contents. Please give the code to solve this. i hope u got my problem

Hi Laxmi, It’d be easier for me if you sent a minimal working example. Here a code stab that illustrates how you can have roman page numbers in the lists and later arabic page numbers.

\documentclass[12pt] \begin \pagenumbering \tableofcontents\clearpage \listoffigures\clearpage \listoftables\clearpage \pagenumbering \chapter \end

Dear Tom, I have used the \addcontentline to include the figures and tables in TOC using the code mentioned here.

\addcontentsline <\listtablename>\addcontentsline

I would also additionally like to list in it the TOC itself on the page. Also if it is of any help, the documentclass of article is used and the cover page, page, appendix are all roman numeral, but the main body of the report is arabic. I would like to include the TOC in the TOC page itself and also show the roman numerals page number as has been done for the above two sections which were added added. Please can you kindly suggest what can to be done to this end. Regards and Thank you,
Poulose
PS: (Used to work earlier when I used the amsart documentclass)

Hi Poulose, Here’s a minimal example that adds the contents heading to the table of contents and uses roman page numbering in the front matter.

\documentclass[11pt] \begin \pagenumbering \addcontentsline \tableofcontents \addcontentsline <\listtablename>\listoffigures \addcontentsline <\listfigurename>\listoftables \clearpage \pagenumbering \section \end

Tom,
This is a really useful blog, thanks for setting it up. Here’s my problem: we are using tocloft.sty to generate the TOC, LOF, and LOT. The TOC comes out pretty nice, but there are no “dot leaders” for the main sections (like INTRODUCTION), although there are dot leaders for the subsections. Similarly for the LOF entry in the TOC, i.e., no dot leaders. How can I force LaTeX to include dot leaders on all entries in the TOC? Also, in the list of figures, the verbiage is bolded, and the report monitors want them unbolded. Can you help with these two issues? Thanks for your time! Jim

Never mind, I figured it out. The commands below will generate dot leaders for the LOF, the chapter leads, etc.

\renewcommand> % for parts \renewcommand> % for chapters \renewcommand> % for sections

I found this in another google search. For unbolding the LOF, just remove \bf from the caption of the figure. Interestingly, the caption is still bolded in the PDF file, but not in the LOF. Perfect.

Great, thanks for posting your solution! it is helpful for us.

Hi Tom, Titles for non-numbered \chapter*<> entries that I add to my toc using \addcontentsline (i.e. abstract, acknowledgements, nomenclature) appear indented compared to numbered chapter<> by about the same length that would be left between the chapter number and title. I would like all chapter titles, numbered or not to be flush with the left margin. Right now it looks like this: Table of Contents Abstract
Acknowledgements List of Tables
List of Figures
Nomenclature 1 Introduction
2 Literature Review How can I remove this phantom distance between the left margin and non-numbered chapter titles, while leaving it for numbered chapters? Regards, Dylan

Apologies, my indents did not appear once posted. Dylan No problem, this is not your fault. HTML ignores tabs/whitespace. Best wishes, Tom

Hi Dylan, Thanks for your question. I can’t reproduce the issue with the information you provided. In the example below, starred and non-starred chapters are properly aligned. Please provide a minimal working example similar to the one below to illustrate the behavior. Thanks, Tom

\documentclass[11pt] \begin \tableofcontents \clearpage \addcontentsline \chapter* \chapter \chapter \end

Hi, I am writing a new thesis class for my university project, and I want to change the default chaptername to with all words capitalized and would like it to be appended to toc as “CHAPTER ONE INTRODUCTION” for example, how do I go about the renewcommand. Thanks

Hi Michael, Thanks for your interesting question. The fmtcount package can “spell out” numbers. Below is a minimal working example, which more or less does what you asked for. You might have to change the spacing in the TOC. The tocloft package should do the trick. Let me know if you have any further question. Best, Tom

\documentclass \usepackage \pagestyle \renewcommand\chaptername \renewcommand<\NUMBERstring> \renewcommand\cftchappresnum \newlength\mylength \settowidth\mylength <\cftchappresnum\cftchapaftersnum\quad>\addtolength\cftchapnumwidth <2\mylength>\addtolength\cftsecnumwidth <\mylength>\setcounter \begin \tableofcontents \blinddocument \blinddocument \blinddocument \end

Hi Tom, what a wonderful blog! I am doing the thesis with tha classicthesis style, but I have introduced the publications at the end of the thesis and it doesn’t appear in the contents. I have included two lines right before \chapter* :

\addtocontents<\protect\vspace<\beforebibskip>> \addcontentsline

Now it appears correctly, but when I press the link it doesn’t take me to the publications, but a few pages before. Also, I have done the same with the abstract but at the begining right after the acronyms. As in the case of the publications the link is incorrect, and at the top, instead of being written “abstract”, “acronyms” is written Thanks!!

Hi Blanca, Thanks for getting in touch. It’s difficult to help without seeing some code. Could you please provide a minimal working example. Btw, you might find the discussion here helpful. Best,
Tom

Hi Tom, How could i create a toc like ABSTRACT
ACKNOWLEDGEMENT


— CHAPTER-1 ( 14 BOLD ALL CAP )
CHAPTER TITLE ( 14 BOLD ALL CAP ) …………………………………1
1. 1 SECTION TITLES ( 12 BOLD ALL CAP ) ………………………….3
1.1.1 SUB-SECTION TITLE ( 12 BOLD ALL CAP ) …………………..5

Hi Tarun, Thanks for your question. You can patch the list commands to make them uppercase. This is shown here. The font size depends on your document font size. Approximate sizes and the corresponding macro can be found on this page. Best, Tom

Boa noite. Estou tentando retirar a numeração da págia na lista de figuras, lista de tabelas e sumário. Fica aparecendo a numeração da parte inferior (rodapé) mesmo colocando \thispagestyle. O que posso fazer? Desde já agradeço. Good evening. I’m trying to pull a page numbering in a list of figures, a list of tables and a table of contents. The numbering of the bottom (footer) even appears by placing \ thispagestyle . What can I do? Thank you very much in advance.

Hi Maiki, \thispagestyle works for a single page only. Use \pagestyle instead, as shown in the example below. HTH,
Tom

\documentclass[11pt] \usepackage \begin \pagestyle \tableofcontents \clearpage \pagestyle \blinddocument\blinddocument\blinddocument \blinddocument\blinddocument\blinddocument \blinddocument\blinddocument\blinddocument \blinddocument\blinddocument\blinddocument \end

Hi What can be the reason that TOC,LOT,LOF appear in blank, i.e. there is a sheet with their corresponding title, but without entries. I have compiled many times the document, and no different results.

Hi there, Please provide a minimal working example and I’ll be happy to take a look. Best, Tom

Hi, My main document is something like this: […]Code removed[…] I don’t know what i am doing wrong, TOC,LOF, and LOT are only sheets with title page but without any other thing. Thanks a lot.

Hi there, I removed your code, because it was impossible to debug. I’m happy to help if you provide a minimal working example that I can run on my system. Best, Tom

Hi Tom, What a great and very helpful blog! My problem refers to the numbering of pages in the table of contents.
My table of contents is longer than one page. When the PDF is created, in the table of contents everything before the toc is page-numbered correctly, but everything after the toc has a wrong page number (lagged).
In fact, the number of pages of the toc, lot and lof are not correctly counted, and each is treated as if they were only one page. The table of contents is 5 pages long, the list of tables is 5 pages long and the list of figures is 3 pages long – and they are counted as if they where only one page long) So for example what I see in the PDF wrongly shows:
Abstract…….5
Table of contents….7
List of Tables….8
List of Figures….9
Introduction…..10 Which is a mistake and it actually should have been:
Abstract…….5
Table of contents….7
List of Tables….12
List of Figures….17
Introduction…..20 I’m using this code to produce (unfortunately I wrote my entire thesis using Scientific Workplace which was a big mistake but now it is too late to change)

\cleardoublepage \phantomsection \label \tableofcontents \addcontentsline \cleardoublepage \phantomsection \label \listoftables \addcontentsline \cleardoublepage \phantomsection \label \listoffigures \addcontentsline Could you please help? I’d really appreciate it. Many Thanks, Marie-Christine

Hi Marie-Christine, Adding the list before creating them should fix the issue (see below). Alternatively, you can also load the tocbibind package. See the documentation for more details. I have no experience with Scientific Workplace, but this Q&A suggests that it shouldn’t be a problem to switch to standard LaTeX. All the best with your thesis!
Tom

\cleardoublepage \phantomsection \label \addcontentsline \tableofcontents \cleardoublepage \phantomsection \label \addcontentsline \listoftables \cleardoublepage \phantomsection \label \addcontentsline \listoffigures

Hi Tom, I am using the CSM-Thesis template for my master’s. The template can be easily found on internet.
The problem that I have is when my list of figures is generated, the list keeps the long name and any modification that I try to use with \caption does not help at all. You can see the code that the template uses to call the figure and put the long name in the list of figure.

\csmfigure[ht].>

The package used in this is also called \usepackage and probably the solution is modifying the code inside the package, but how could I fix this if I am not good coding in latex? Thanks, Carlos

Hi Carlos, Thanks for your question. I downloaded the csm-thesis template here. You can’t have a short caption for the list-of-figures using their csmfigure macro. Use the csmlongfigure macro instead, which is defined in csm-thesis.sty . The macro takes 6 arguments, where argument 5 is the short caption and argument 5 + 6 concatenated is the long caption. Here is the example from their template:

\csmlongfigure< of awesomeness~\cite.>
I hope this helps,
Tom

Hi Tom,
I’m currently writing up my PhD Thesis using amsart, and I have an instance where my subsection is just a maths term. In order to make it boldfont to match all my other subsections, I’m using mathbf, however this makes the entry in the toc also bolded. As far as I can tell, using \subsection[toc name] no longer exists, what else can I use?
Cheers, Jos

Hi Jos, Thanks for your question. The simplest solution would be to suppress the subsection from being added to the TOC and then add it manually. HTH,
Tom

\documentclass[12pt] \usepackage \begin \tableofcontents \section \subsection Some content \subsection Some content \addtocontents<\protect\setcounter> \subsection<$\mathbf$> Some content \addtocontents<\protect\setcounter> \addtocontents<\protect\contentsline <\thesubsection.\hspace<.5\linespacing>abc><>> \subsection \section \end

Hi Tom,
I have one request. In my thesis I wrote Abstract and Acknowledgments after my title page and beforeTOC while abbreviations after LOT and before the first chapter. Now how to insert Abstract, Acknowledgments, and abbreviations in TOC? I used, for example, \addcontentslineAcknowledgements>..but it yield wrong numbering of Acknowledgements and says that Acknowledgements lie on the same page number as TOC!
Any help will be appreciated,
Thanks,
Ahmed

  • tom 1. June 2017 at 16:44

Hi Ahmed, Below is a minimal working example that shows how to get the page numbers in the TOC right. Abbreviations works accordingly. Best, Tom

\documentclass[11pt] \usepackage \begin \addcontentsline \chapter* \blindtext \clearpage \addcontentsline \chapter* \blindtext \clearpage \tableofcontents \clearpage \blinddocument \end
  • Nada 16. July 2017 at 0:08

Hi, I need to add two headings(Title, Page) into the table of content page. Can you suggest a simple method? Thank you

Hi Nada, You can use the macro: \addcontentsline . Place the macro before the actual heading. You’ll find a minimal example below. Cheers, Tom.

\documentclass \begin \tableofcontents \addcontentsline \end

Hi Tom… In my dissertation, the table of contents heading is showing up on only two pages. It does not show up in the third page. How to add table of contents (continued) in third page. Also in the list of contents bibliography is the last one and it does not have the dots between the content name and the page number. For ex: it should be Bibliography……………90 but it is showing Bibliography 90. How to add the dots between them? Please suggest a simple way. Thanks.

  • tom 9. August 2017 at 10:25
Hi Dev, Please provide a minimal working example to illustrate the problem. Thanks,
Tom

I have a 2 page TOC, and I want to have a page break between the pages. How can I do that?
Any help is appreciated.

  • tom 26. September 2017 at 19:40

Hi there, A page break is automatically inserted in the TOC where necessary. Please provide a minimal working example to illustrate the problem. Best, Tom

hello tom, my problem is spacing. for example, in chapter 24 of contents table:
24 chapter name
24.9 section name
24.10section name
24.11.1subsection name
24.11.1.1 subsubsection name as you can see, after certain contents numbers, above 24.10 and 24.11.1, but not 24.11.1.1, there is no space after the numbers..
do you have any suggestions. thanks

Hi Mike, You can increase the length of numwidth defined by the tocloft package to allow for long numbers. You would have to do that for each heading level separately (I picked an arbitrary length of 5em). See the tocloft documentation for more details.

\usepackage \setlength\cftchapnumwidth \setlength\cftsecnumwidth \setlength\cftsubsecnumwidth \setlength\cftsubsubsecnumwidth

Hi Tom,
Thanks for the post. I want to add space between the entries in LoC, LoT and LoF. Can you please help me with this using tocloft package.

Hi Rek, Thanks for your question. Try changing the following parameter defined by the tocloft package:

\setlength\cftparskip

If that is not what you were looking for, please provide a minimal working example to illustrate your problem. Thanks, Tom

Hi Tom,
How to put one line above and one line below ‘Content’, something like: —————–
Content
—————–

Hi Yanpeng, Sorry for the late response. You could simply change the title by adding a line above and below. Best, Tom

\documentclass \usepackage \renewcommand<\rule<\linewidth>\\Contents\vspace\\\rule<\linewidth>> \begin \tableofcontents \chapter \chapter \end

Hi, I have a question, in my contents in thesis the list of content of tables and figure is large, so that , I want to break the line in list of content….please help me ….

Hi there, Please provide minimal working example and I will be happy to make a suggestion. Cheers,
Tom

Hello Tom, Is it possible to set a background picture in all the pages of the TOC? I have tried with package ‘background’. The best I manage it to have it in the first and in the last pages of the TOC but not in all. Thanks for your response. Best, Daniel

Hi Daniel, Thanks for your question. If you provide a minimal working example, I would be happy to look at what you tried so far. In general, my approach would be similar to what David suggests here using \AddToShipoutPicture and \ClearShipoutPicture. Regards,
Tom

Hi Tom, Thank you for such a wonderful forum. I have a question regarding table of contents. I am using \tableofcontents to generate the contents for my thesis report. However, the first item on the Contents page is ‘Content’ with page number in roman. It is not desirable to have the ‘Contents’ heading on the Contents page. I want to exclude it and wants the first heading be the next chapter, say, ‘List of Symbols’. Kindly suggest a solution or a way around this. Thank you.

Hi Prasoon, Thanks for your question. Use the tocbibind package to control what should be included in your contents list. See the package documentation for a full list of options.

\usepackage[nottoc]

Hi Tom, How I could include te code so the Index (Table of Contents) is showed in the tree index at the left of the pdf navigator. I mean how to create the table of Concents (toc) marker? THANKS a lot, your post it is quite helpful

Hi Pablo, Thanks for your question. Is PDF Navigator the viewer you use? I’m not familiar with that software. In any case, see if loading the hyperref package solves your problem. That’s all I can think of at this point. Best, Tom

Hai TOM,
using \usepackage
I am getting Table of contents, list of figures and list of tables headings to the left. how can i adjust it to center. one more problem is how to avoid the dotted lines in the list of contents and figures, tables. Kindly suggest a solution Thank you. TABLE OF CONTENTS
Page No
ACKNOWLEDGEMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . i
ABSTRACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
LIST OF TABLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
ABBREVIATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
NOTATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Characteristics of Cognitive Radio . . . . . . . . . . . . . . . . . . 2
1.1.1 Cognitive Capability . . . . . . . . . . . . . . . . . . . . . 2

Hi Sudhamani, The minimal example below shows how to center the titles and remove the dots using the tocloft package.

\documentclass[11pt] \usepackage \usepackage \renewcommand<> % Remove dots \renewcommand <\hfill\bfseries\Huge Contents\hfill>\renewcommand <\hfill>\renewcommand<\listfigurename> <\hfill\bfseries\Huge List of Figures>\renewcommand <\hfill>\renewcommand<\listtablename> <\hfill\bfseries\Huge List of Tables>\renewcommand <\hfill>\begin \tableofcontents \listoffigures \listoftables \chapter \section \end

Hi Tom ,
i have two listings in my work , that’s why i don’t want to create a whole table of listings for them so i was wondering is there a way to put them (mix them with ) in the list of tables , but still clearly define them as listings

Hi Lily, Below is my suggestion on how to add your listings to the list of tables. Just use the table environment. There are other ways of course, but this is relatively simple and lets you reference the listings the same way you reference tables. Best, Tom

\documentclass[11pt] \usepackage \usepackage \renewcommand<\listtablename> \begin \tableofcontents \listoftables \chapter \section \begin[ht] \caption \label \end% \begin \caption \begin Put your code here. \end \label \end \end

Hi Tom, Thank you for your post, it was helpful. However I don’t know how to change the title of the table of contents, it says “Contents” and I want to change it to my lenguage. Can you help me? Thank you in advanced

Hi there, If you change the document to your language using babel, the heading should change accordingly. See the package documentation for a list of supported languages (recommended). Alternatively, you can change the headings manually. Ie. for Spanish use:

\documentclass[11pt,a4paper] \usepackage[spanish] %\renewcommand \begin \tableofcontents \chapter \end

Hi Tom, I’m writing my thesis and I have a problem with chapter numbering.
I want the captions of my chapters to be: “1. Blablabla”. I used the code below to achieve this. The problem is that my toc (and lof and lot) now have a “0” in front of them. I would like the captions of these 3 chapters just to include the name, not a number. Is this possible? Thank you in advance, Rosa

\documentclass[11pt,a4paper] \usepackage[english] \usepackage \titleformat[display] <\Huge\bfseries><> \begin \tableofcontents \end

Hi Rosa, Sorry for the late response. To clarify a few things. Toc/lof/lot are unnumbered chapters (\chapter*<>), meaning that the counter is not increased when you print them. This explains why when you print the chapter counter before the chapter name, it is zero at the beginning of your document. You can manually increase the counter with \stepcounter . Not sure I understand what you are trying to achieve, though. Should your lists (toc/lof/lot) be numbered, but the toc entries should be unnumbered? Best, Tom

Hi
I am writing thesis in latex and now from this .tex file i want to have a pdf file in which front matter, table of contents to be appeared without having chapters. Is there any possibility?
In short i want i want to hide all the chapters but without hiding from table of contents

Hi Dimple, Thanks for your question. There are different ways to do that, not necessarily related to LaTeX. Below are two possibilities. Alternatively, you can manually generate table of content entries with \addcontentsline . But it seems an awful lot of work if you can get what you want much easier. Also, the page numbers would obviously be wrong. 1) You can typeset the entire document and delete all pages after table of contents. If you are on a Mac, Preview does the trick. Select the pages to delete from the thumbnails on the left and press delete. I am sure PDF readers on other system have similar functionality.
2) A more Texy option is to typeset the entire document. Then use the pdfpages package to create a document with the first few pages of your thesis.

\documentclass \usepackage \begin \includepdf[pages=] \end
  • Dimple 31. May 2019 at 3:36

Thanks Tom, the second option works. But the first does not.
Anyhow my problem is solved.
Thanks once again.

Great, thanks for letting me know. Best, Tom

Hi Tom
I have one more question ,
I want to set the font size of chapter(20), heading(18), subheading(16) and subsubheading(14) and the default text size as 12 in my thesis. can you please tell how to do this.
secondly i want my chapter heading in center.
hoping for your response.
Thanks

Hello Dimple, Please take a look at the titlesec package. You should be able to get the formatting through the titleformat command. HTH,
Tom

hello
need help on how to get rid of one before introduction in the table of contents generated example
ONE INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Characteristics of Cognitive Radio . . . . . . . . . . . . . . . . . . 2
Cognitive Capability . . . . . . . . . . . . . . . . . . . . . 2

Hi Winnie, You can produce chapters without numbering using \chapter* . If that does not solve your problem, please provide a minimal working example. Best, Tom

Hi Tom,
I use documentation class. How can I remove listoffigures and listoftables from the contents? Thanks a lot