Page Layouttocloft has no effect on LoF and LoT

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
karianne
Posts: 6
Joined: Fri Jun 04, 2010 2:50 pm

tocloft has no effect on LoF and LoT

Post by karianne »

Hi,

I have searched this forum, googled, plus read the tocloft documentation but could not find a solution nor find anybody else having the same problems as I have. I am using the tocloft package which works brilliantly for my ToC but most commands seems to have no effect on my LoF and LoT.

I have attached the full tex file. The part not working is this:

Code: Select all

\makeatletter
%\renewcommand{\cftfigfont}{\hfill\bfseries}
\renewcommand{\cftfigleader}{}
\renewcommand{\cftfigafterpnum}{\cftparfillskip}
\renewcommand{\cftsubfigleader}{}
\renewcommand{\cftsubfigafterpnum}{\cftparfillskip}
\makeatother

[...]

\makeatletter
\renewcommand{\cfttableader}{}
\renewcommand{\cfttabafterpnum}{\cftparfillskip}
\renewcommand{\cftsubtableader}{}
\renewcommand{\cftsubtabafterpnum}{\cftparfillskip}
\makeatother
Basically all codes containing \cftX... where X = fig, tab don't work. Surprisingly enough,

Code: Select all

\makeatletter \renewcommand{\l@figure}{\@dottedtocline{0}{0em}{2.3em}}
\renewcommand{\l@table}{\@dottedtocline{0}{0em}{2.3em}}
works perfectly fine.

Please let me know what I am doing wrong.

Best regards, Karianne
Attachments
example.tex
(4.46 KiB) Downloaded 281 times
Last edited by karianne on Mon Oct 04, 2010 11:31 am, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

tocloft has no effect on LoF and LoT

Post by frabjous »

Please consult the Board Rules and the Post on Avoidable Mistakes. Pay particular to attention to the specification of what a minimal working example looks like. In particular, it should not load options or packages or have lots of lines that have nothing to do with the problem. Also, it should not use \input commands or call bibliographies that we do not have access to. How are we supposed to be able to test your code? We cannot diagnose a problem we cannot reproduce.

But one quick question, why are you using \makeatletter and \makeatother when there are no at signs in what you are redefining?
karianne
Posts: 6
Joined: Fri Jun 04, 2010 2:50 pm

tocloft has no effect on LoF and LoT

Post by karianne »

Sorry, I attached an mwe that can be run on its own with the attached figure.

These are the lines that seem to be causing problems:

Code: Select all

\makeatletter \renewcommand{\l@figure}{\@dottedtocline{0}{0em}{2.3em}}
\renewcommand{\l@table}{\@dottedtocline{0}{0em}{2.3em}}
\makeatother
When I remove the above, the \cftX... commands work ok. I would like to have both of them work if possible.

Cheers, Karianne
Attachments
example.tex
code
(1.72 KiB) Downloaded 276 times
fish.ps
figure
(151.02 KiB) Downloaded 264 times
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: tocloft has no effect on LoF and LoT

Post by frabjous »

What exactly are those lines meant to do? I suspect there's probably a way to get what you want just using tocloft, without that portion, but it wasn't clear to me exactly what look you were aiming at.
karianne
Posts: 6
Joined: Fri Jun 04, 2010 2:50 pm

tocloft has no effect on LoF and LoT

Post by karianne »

The lines remove the indent of the figure/table entries in LoF/LoT, i.e. move the lines further to the left. See page 4 in the tocloft documentation here: http://www.ctan.org/tex-archive/macros/ ... ocloft.pdf. This is part of the tocloft package.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

tocloft has no effect on LoF and LoT

Post by frabjous »

No, it isn't. Page 4 is under section 1.1. "LaTeX's methods". It's describing how things work in LaTeX if you don't load the package. Pay attention to what it goes on to say:
If it is necessary to change the default typesetting of the entries, then it is usually necessary to change these definitions (but the tocloft package gives you handles to easily alter things without having to know the LaTeX internals).
Look instead at page 9. I think what you want is something like:

Code: Select all

\setlength{\cftfigindent}{0em}
\setlength{\cfttabindent}{0em}
...and so on.
karianne
Posts: 6
Joined: Fri Jun 04, 2010 2:50 pm

Re: tocloft has no effect on LoF and LoT

Post by karianne »

Works like a charm, thanks a lot!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

tocloft has no effect on LoF and LoT

Post by localghost »

Now that the problem is solved, please be so kind and mark the topic (not the last post) accordingly as clearly written in the Board Rules. Please keep that in mind for the future so that further will not be necessary.


Best regards
Thorsten
Post Reply