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:
- toc: table of contents
- lof: list of figures
- lot: list of tables
Topics
- Creating content lists, the basic commands
- Controlling the depth of content added to toc
- Adding lof/lot to toc
- Short captions for lof/lot
- Linking toc/lof/lot with content using hyperref
- Further customizations
- The tocloft package
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
\documentclass[11pt]{article} \begin{document} \tableofcontents \listoffigures \listoftables \clearpage \section{Dummy section 1} \begin{figure}[ht] \begin{center} \caption{Dummy figure 1} \label{fig:dum1} \end{center} \end{figure} \begin{figure}[ht] \begin{center} \caption{Dummy figure 2} \label{fig:dum2} \end{center} \end{figure} \begin{table}[ht] \caption{Dummy table 1} \begin{center} \begin{tabular}{|c|c|} \end{tabular} \end{center} \label{tab:dum1} \end{table} \section{Dummy section 2} \end{document}
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{tocdepth}{level} %level -1: part, 0: chapter, 1: section, etc.
In the following example all headings are added to toc (level: 5):
\documentclass[11pt]{report} \setcounter{tocdepth}{5} %shows all levels incl. paragraph \begin{document} \tableofcontents \chapter{Dummy chapter} \section{Dummy section} \subsection{Dummy subsection} \subsubsection{Dummy subsubsection} \paragraph{Dummy paragraph} \end{document}
Adding lof/lot to toc
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]{tocbibind} %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{toc}{section}{\listfigurename} \listoffigures \addcontentsline{toc}{section}{\listtablename} \listoftables %report and book \tableofcontents \clearpage %\cleardoublepage %for openright \addcontentsline{toc}{chapter}{\listfigurename} \listoffigures \clearpage %\cleardoublepage %for openright \addcontentsline{toc}{chapter}{\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 ...}
\documentclass[11pt]{article} \usepackage{blindtext} \begin{document} \tableofcontents \listoffigures \section{Dummy section 1} \begin{figure}[ht] \begin{center} \rule{0.5\linewidth}{0.35\linewidth} \caption[Long caption figure]{\blindtext} \label{fig:dum1} \end{center} \end{figure} \end{document}
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]{Long 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]{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.
Giannis
Hi Tom, I would like to ask how could we add a short table of contents which will contain only the chapters’ name.
tom
Add
\setcounter{tocdepth}{0}
to your preamble. Thetocdepth
counter controls the level of headings added to TOC (0: chapter, 1: section, etc.).Ciaran Mulloy
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
to generate title headers and the toc title overwrites the fancyhead?
tom
Hi Ciaran,
The easiest way would be to redefine the title and leave it empty3:
Best, Tom
Romain
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
tom
Hi Romain,
There is an package option which does exactly that. See the hyperref documentation for more details.
Igor
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
tom
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.
Sajjad
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.
tom
Hi Sajjad,
Thanks for the comment. Adding the following two lines does exactly what were looking for:
See here for a few more customizations.
Best, Tom
bilal
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:
but in multilines caption it is not align always seconde ligne start before the “:”
if u can help? thanks
tom
Hi Bilal,
Below is a minimal working example that illustrates how to properly align multi-line text in the list of figures.
Best, Tom
Bilal
Thanks tom
I had another pb of appendix
I add new table of content for just appendix
I had perfectly my small toc of appendix but the pb is i want to remove all appendix from principale toc but i cant
tom
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
Ricky
Hi Tom, I found your blog when I was looking for any answers about how not enumerate the page of lof/lot/loc?
\pagestyle{empty}
,\thispagestyle{empty}
didn’t work as well.Thanks
tom
Hey Ricky,
Try the following:
James
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
tom
Hi James,
Thanks for this question. You can use a little trick, by adding
phantomsection
beforeaddcontentsline
, the links are set properly.Best, Tom
James
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
tom
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:
Also, please provide a full minimal working example next time. It’s much easier to reproduce your issue that way.
Cheers, Tom.
Pierre-Philippe Combes
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
tom
Hi Pierre-Philippe,
If it’s only a few lines, you might use the spacing package:
Possibly a more satisfying alternative is to use the tocloft package and play with, for example, the space before each chapter entry.
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
J.D.
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.
tom
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:
Hope this helps,
Tom
El Ahmar Yossr
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
tom
Here is an example:
Please consider the memoir class documentation for more details.
Sajjad
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.
tom
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…Sajjad
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.
tom
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
ranjana
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?
tom
Hi Ranjana,
Here’s a minimal working example, which uses the tocloft package:
Clement
Hi Tom,
whenever I use figure inserting format like below:
and I also use the: \lstinputlisting{fish.m} for importing Matlab codes, there is always a problem; program will not execute, but if I use this format:
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
when inserting my my figures.
so what do I do to enable diaplay my list of figures and tables.
tom
You are right, the figure number will only be generated when it is wrapped in a floating environment (i.e.
\begin{figure}...\end{figure}
) 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
Ferhat
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.
tom
All you have to do is add this line to your preamble. It redefines the figure number.
HTH, Tom
Leon
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?
tom
The following line of code will add extra space between the number and the caption text through the tocloft package.
Best, Tom
Zakaria CHOUQAR
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.
tom
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.
Anggha
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!
tom
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 asarticle 1.5em
. For more details see the tocloft documentation.Best, Tom
Pravin Prajapati
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 ??
tom
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
Laxmi
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
tom
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.
poulose
Dear Tom,
I have used the
\addcontentline
to include the figures and tables in TOC using the code mentioned here.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)
tom
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.
Jim Riker
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
Jim Riker
Never mind, I figured it out. The commands below will generate dot leaders for the LOF, the chapter leads, etc.
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.
tom
Great, thanks for posting your solution!
rajendra
it is helpful for us.
Dylan
Hi Tom,
Titles for non-numbered
\chapter*{}
entries that I add to my toc using\addcontentsline{toc}{chapter}
(i.e. abstract, acknowledgements, nomenclature) appear indented compared to numberedchapter{}
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
Dylan
Apologies, my indents did not appear once posted.
Dylan
tom
No problem, this is not your fault. HTML ignores tabs/whitespace. Best wishes, Tom
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
Michael
Hi,
I am writing a new thesis class for my university project, and I want to change the default chaptername {Chapter 1} to {CHAPTER ONE} 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
tom
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
Blanca
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*{publications}
: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!!
tom
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
Tarun Parashar
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
tom
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
Maiki Mafessoli
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{empty}. 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 {empty}. What can I do? Thank you very much in advance.
tom
Hi Maiki,
\thispagestyle
works for a single page only. Use\pagestyle{empty}
instead, as shown in the example below.HTH,
Tom
A7donso
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.
tom
Hi there,
Please provide a minimal working example and I’ll be happy to take a look.
Best, Tom
A7donso
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.
tom
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
Marie-Christine
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)
Could you please help? I’d really appreciate it.
Many Thanks,
Marie-Christine
tom
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
Carlos
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.
The package used in this is also called
\usepackage{csm-thesis}
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
tom
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 thecsmlongfigure
macro instead, which is defined incsm-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:I hope this helps,
Tom
Jos Gunns
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]{in work name} no longer exists, what else can I use?
Cheers, Jos
tom
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
Ahmed
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, \addcontentsline{toc}{chapter}{\numberline{}Acknowledgements}..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
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
Nada
Hi,
I need to add two headings(Title, Page) into the table of content page.
Can you suggest a simple method?
Thank you
tom
Hi Nada,
You can use the macro:
\addcontentsline{list}{level}{text}
. Place the macro before the actual heading.You’ll find a minimal example below.
Cheers, Tom.
Dev
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
Hi Dev,
Please provide a minimal working example to illustrate the problem.
Thanks,
Tom
Syed Shaad
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
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
Mike Cosgrove
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
tom
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.HTH, Tom
Rek
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.
tom
Hi Rek,
Thanks for your question. Try changing the following parameter defined by the tocloft package:
If that is not what you were looking for, please provide a minimal working example to illustrate your problem.
Thanks, Tom
Yanpeng
Hi Tom,
How to put one line above and one line below ‘Content’, something like:
—————–
Content
—————–
tom
Hi Yanpeng,
Sorry for the late response. You could simply change the title by adding a line above and below.
Best, Tom
M.M. Haque
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 ….
tom
Hi there,
Please provide minimal working example and I will be happy to make a suggestion.
Cheers,
Tom
DaniB
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
tom
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
Prasoon Garg
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.
tom
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.
Best, Tom
Pablo Flores Vidal
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
tom
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
sudhamani
Hai TOM,
using \usepackage{tocloft}
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
tom
Hi Sudhamani,
The minimal example below shows how to center the titles and remove the dots using the tocloft package.
Lily
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
tom
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
Blanca Rius Sansalvador
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
tom
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:
Best,
Tom
Rosa
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
tom
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{chapter}
. 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
Dimple
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
tom
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.
Best, Tom
Dimple
Thanks Tom, the second option works. But the first does not.
Anyhow my problem is solved.
Thanks once again.
tom
Great, thanks for letting me know. Best, Tom
Dimple
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
tom
Hello Dimple,
Please take a look at the titlesec package. You should be able to get the formatting through the
titleformat
command.HTH,
Tom
WINNIE
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
tom
Hi Winnie,
You can produce chapters without numbering using
\chapter*{INTRODUCTION}
. If that does not solve your problem, please provide a minimal working example.Best, Tom
Meri
Hi Tom,
I use documentation class. How can I remove listoffigures and listoftables from the contents? Thanks a lot
tom
Use the tocbibind package with the following options:
\usepackage[notlof,notlot]{tocbibind}