1

I'm trying to add a dot after the number of figures in the LoF. I searched for solutions and the only workable one was to add the following to the preamble:

\usepackage{tocstyle}
\newcommand{\autodot}{.}

But this code affect my ToC style since it add dots to the sections which I don't want

My code for the ToC:

\usepackage{tocloft}

% Rename the contents title
\renewcommand*\contentsname{Table of Content}

%Add dot after the section number
\renewcommand{\cftsecaftersnum}{.}%

ToC

My List of Figures:

LoF

The document class is article.

Now how can I add a dot after the figure number without affecting my ToC.

Thanks

  • 1
    tocstyle and tocloft change the appearance of the table of contents and list ofs. Depending on what document class you are using, different packages are best choice. A minimal working example would be really really great to reliably answer your question. – Johannes_B May 14 '17 at 11:40
  • By the way: you do know \usetocstyle{standard}. Just in case you are using a standard class. – Johannes_B May 14 '17 at 11:46
4

f505AticleToc

\documentclass{article}
\usepackage{blindtext}
\usepackage{tocstyle}
\usepackage{capt-of}
\usetocstyle{standard}
\begin{document}
\tableofcontents
\newcommand{\autodot}{.}
\usetocstyle{allwithdot}
\listoffigures
\captionof{figure}{Wombat}
\blinddocument
\blinddocument
\end{document}

If you want a dot after the section number in the toc, move the autodot line to the preamble.

  • Thank you @Johannes_B for your answer. I want to ask if there is a way to add the dots in the LoF after the figure name?! really thanks – F 505 May 14 '17 at 11:57
  • @F505 Not sure i understand. You asked for after the figure number. Where in the screenshot posted is the figure name? Where should this dot be? – Johannes_B May 14 '17 at 11:59
  • see the output of the LoF in the question. I want it the same in addition to the dot after the number (1.) – F 505 May 14 '17 at 12:06
  • 2
    You can do it all in the preamble using \usetocstyle[lof]{allwithdot} \settocfeature[lof][1]{entryhook}{\def\autodot{.}} – Schweinebacke May 14 '17 at 13:31
4

tocstyle is an alpha package without support. AFAIK it will never become supported, because tocbasic will provide several of it's features in another manner. Here a solution using tocbasic:

\documentclass{article}
\usepackage{blindtext}
\usepackage{tocbasic}
\usepackage{capt-of}
\DeclareTOCStyleEntry[entrynumberformat=\adddot]{tocline}{figure}
\newcommand*{\adddot}[1]{#1\unskip.\hfil}
%\renewcommand*{\listoffigures}{\listoftoc{lof}}% use all of tocbasic (optional)
\begin{document}
\tableofcontents
\listoffigures
\captionof{figure}{wombat}
\blinddocument
\blinddocument
\end{document}

using tocbasic

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.