TeXnik - Tips TeX and LaTeX


Welcome to the TeXnik website (under construction)

tocloft - table of contents, list of figure / table, ...
TUG logo

Main page

Index
UK FAQ
Documentation
Software
CTAN
Search CTAN:

Statistics

Google c.t.t.

Google d.c.t.t.

 


 


Header  |  Labelwidth  |  Labelwidth without tocloft |  No Pagebreak between the Lists |  TOCstyle  |  Vertical Space | 


With the package tocloft you can define your own TOC-style. If it's not part of your local TeX-Installation download it at CTAN
Important: tocloft needs package stdclsdv.sty


Headerline
To get a header like:

then write in the preamble f.ex. for toc and lof:
\addtocontents{toc}{\hfill Page\endgraf}
\addtocontents{lof}{\ Figure\hfill Page}
The TOC is different to the other lists which belongs to the LaTeX-bug
1354


No Pagebreak between the Lists
For bookclasses you'll get a pagebreak between any new "list of ...". If you do not like this write just before the first "list of ..." should start
\begingroup
\chapter*{List of Figures, Tables and ...}\let\chapter=\section
\listoffigures
\listoftables
\endgroup


Vertical Space
Your lo? has sometimes following entries:
-->  \addvspace {10\p@ }
      \contentsline {figure}{\numberline {1.1}{\ignorespaces Bild A}}{1}
-->  \addvspace {10\p@ }
       \contentsline {figure}{\numberline {2.1}{\ignorespaces Bild B}}{2}
      \contentsline {figure}{\numberline {2.2}{\ignorespaces Bild B1}}{3}
For some textclasses LaTeX puts this space between the listentries of different chapters. If you do not like this one write before the first figure in tex (red)
\addtocontents{lof}{%
  \protect\renewcommand*{\protect\addvspace}[1]{}%
}
Alternative the listof??? can be redefine, if you also do not need ths space after the title:
\let\myListof\listof????
\renewcommand\listof???{%
  \begingroup
    \renewcommand*{\addvspace}[1]{}%
    \myListof
  \endgroup
}


TOCstyle
Changing for example the style for the section headers write in LaTeX preamble:
\usepackage{tocloft}
...
\renewcommand\cftsecfont{}
changes the sectionfont to normalfont (not in bold). Not very intelligent, but possible ... ;-)

Changing the TOC style in general, go to this page


Labelwidth in TOC
When you have a lot of figures/tables/algorithm you'll get some problems with the list of figures/tables/algorithm:

As you see, the labelwidth for the figure/table/algorithm-num is too small. Using package tocloft you can change these labelwidth. For example for the list of figure:

in latex preamble

\usepackage{tocloft}
\addtolength{\cftfignumwidth}{1em}
This commands add one space to the labelwidth:

In the same way you can change the labelwidth for the list of tables/algorithm. Look at the documentation of the package.

Changing the labelwidth without package tocloft is possible.

local time: Sat Dec 7 20:05:42 CET 2019 ; file is: 161.6046875 days old
contact webmaster _at_ TeXnik.de