GeneralCustomizing toc, lof, and lot

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
phantom
Posts: 2
Joined: Wed Dec 03, 2008 10:25 am

Customizing toc, lof, and lot

Post by phantom »

Hello,

I am working on my dissertation and having some format issues. I would really appreciate if you could help me to solve these problems. I am using tocloft package for list of contents, list of figures, and list of tables.

My first problem is to add "Table"/"Figure" and "Page" text on the list for lot, lof, and indent any subsequent lines for each entry;

Currently, my list of tables looks like this;

Code: Select all

List of Tables

1.1 XXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXX................ YY

1.2 XXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXX
    XXXX.................... YY
Now, what is being required from me is this;

Code: Select all

List of Tables 

Table                            Page
1.1 XXXXXXXXXXXXXXXXXXXXXXXX
         XXXXXXXX............. YY

1.2 XXXXXXXXXXXXXXXXXXXXXXXX
         XXXXXXXXXXXXXXXXXXX
         XXXXXXX.............. YY

My second question is; These lists are multiple pages in my dissertation. In loc,tof,toc, I would like to put something like (left justified) "List of Figures/Tables (continued)" on top of each subsequent pages.

I will be grateful if you could help me for these problems.

Thank you very much.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Customizing toc, lof, and lot

Post by gmedina »

Hi,

some commands provided by the tocloft package can be used to solve the first problem. Please refer to the package documentation for further information. Take a look at the following example code:

Code: Select all

\documentclass{article}
\usepackage{tocloft}
\usepackage{calc}

% the value subtracted here has to be the same 4th argument of \parshape below
% and it controls the indentation of the subsequent lines of an entry in the list
\newlength\mylen
\setlength\mylen{\linewidth-1.5em}

\renewcommand{\cftafterlottitle}{%
  \\[\baselineskip]\noindent{\bfseries\tablename\hfill Page}}

\renewcommand{\cfttabafterpnum}{%
  \parshape = 2 0em \linewidth 1.5em \mylen}

\begin{document}
\listoftables
\newpage

\section{Dummy section}

\begin{table}[!ht]
  \centering
  \begin{tabular}{cc}\hline
    column1 & column 2 \\ \hline
  \end{tabular}
  \caption{text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text}
  \label{tab:test}
\end{table}

\end{document} 
Remarks: 1) Of course, you will have to do something similar for the LoF.
2) The \parshape command of course is used to change the shape of paragraphs. You can find information on this TeX primitive in TeX by topic (18.2.2 General paragraph shapes: \parshape, pp. 155ff.) by Victor Eijkhout.
3) My code is just a simple example. Feel free to adapt it according to your needs.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
phantom
Posts: 2
Joined: Wed Dec 03, 2008 10:25 am

Re: Customizing toc, lof, and lot

Post by phantom »

Thank you very much.
eadbanga
Posts: 2
Joined: Wed Sep 16, 2009 11:50 pm

Re: Customizing toc, lof, and lot

Post by eadbanga »

I have tried what you suggested in this thread to add the 'Chapter' and 'Page' TOC column headers to my document with no success. No errors are thrown after multiple compiles just no column headers. Any suggestions?

Thanks for your time!
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Customizing toc, lof, and lot

Post by gmedina »

Hi,

the following code works OK for me:

Code: Select all

\documentclass{book}
\usepackage{tocloft}
\usepackage{lipsum}% just to generate some text

\renewcommand{\cftaftertoctitle}{%
  \\[2\baselineskip]{\bfseries\chaptername\hfill Page}\vskip-25pt}

\begin{document}
\tableofcontents
\clearpage

\chapter{Test chapter one}
\lipsum[1-10]
\chapter{Test chapter two}
\lipsum[1-10]

\end{document} 
If the code doesn't work for you, please provide some relevant code (in the sense of a minimal working example) showing the relevant settings of your document.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
eadbanga
Posts: 2
Joined: Wed Sep 16, 2009 11:50 pm

Re: Customizing toc, lof, and lot

Post by eadbanga »

When I changed '\usepackage[titles]{tocloft}' to 'usepackage{tocloft}' and replaced the code from the tocloft documentation with your code it worked perfectly.

Thank you so very much!
Post Reply