Hot answers tagged

6

Here, I use standard features of the tocloft package. Note, however, that page 10 of the tocloft documentation indicates that \cftpartaftersnum DOES NOT WORK for the standard document classes. Thus, I cannot add an en-dash following the part number. EDITED to make the words "Partie" and "Chapitre" in small caps. EDITED to center the chapter's en-dash in ...


4

To get numbered entries for a LOT, LOF and TOC in TOC with a KOMA-Script class use: \KOMAoptions{listof=numbered} \setupttoc{toc}{numbered} BTW use \cleardoubleoddpage before \pagenumbering. I would replace fancyhdr by scrlayer-scrpage that is part of the KOMA-Script bundle. \documentclass{scrartcl} \KOMAoptions{listof=numbered}% <- lists numberded ...


4

There are two errors and both that can be deduced of the excellent answers to When should I use \input vs. \include? 1) First error was use \include{} instead of \input{} for any chunk of text below a whole chapter because insert a \clearpage before and after the included code, and usually you do not want this for a section, a table or a few paragraphs. ...


3

By default tocloft can't hook into ToCs that are made by other packages, however, it's possible to use \newlistof{...} to redefine the \lstoflistings -- unfortunately, this requires knowledge of the counter being used for listings (its name is lstlisting) and \newlistof... tries to define a new counter for this -- this must fail (and is a design flaw of ...


3

Special setups require special means ;-) The spacings etc. can be done with tocloft features, however, this changes the \tableofcontents command too much. The section page numbers in the section title line require some change to the \@sect command. \documentclass{book} \makeatletter \let\latextableofcontents\tableofcontents % Save the original version ...


2

Here's the basic method: \documentclass{book} \usepackage{pdfpages} \begin{document} \tableofcontents \chapter{ch} \section{sec} text \clearpage \addcontentsline{toc}{section}{xsec} \includepdf{mypages} \end{document} Obviously if you want a numbered section etc. that needs to be specified. However, that really wouldn't make sense, so hopefully that's ...


2

Dealing with parts with tocloft is always a pain. I can propose two patches for the book class and two alternative settings, depending on the desired alignment of chapter titles. No attempt in aligning part titles is done, because Roman numbers are too variable in width. First proposal The chapter titles are not aligned with each other if there are more ...


2

In case that tocloft.sty is not a must, I can offer a solution with titletoc.sty. I think the interface is cleaner. There is also a solution at the end how to get rid of the additional vertical space in LOF. \documentclass[12pt,a4paper,draft,openany]{book} % For french \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[french]{babel} % For ...


2

If i understand, here is a solution \documentclass{article} \usepackage{etoolbox} \makeatletter \patchcmd{\@sect}{\addcontentsline}% {\ifnum #2>\c@secnumdepth \else \addtocontents{lof}{% \protect\contentsline{#1}{\protect\numberline{\csname the#1\endcsname}% #7}{}} ...


2

Here is a suggestion using tocbasic instead tocloft. \documentclass{article} \usepackage{blindtext}% dummy text \usepackage{chngcntr} \counterwithin{figure}{section} \counterwithin{table}{section} \counterwithin{equation}{section} \usepackage{tocbasic} \usepackage{scrbase} \renewcommand*{\tableofcontents}{\listoftoc[{\contentsname}]{toc}} ...


1

Here is a solution hyperref after titletoc \startcontents[chapters] add in \printmyminitoc to stop preview toc and start the new one. complete code \documentclass[13pt,twoside]{book} %\usepackage[utf8]{inputenc} \usepackage[centertags]{amsmath} \usepackage[dvipsnames]{xcolor} ...


1

The name={...} option to the definition in the \declaretheoremstyle command defaults to the theorem name, or it's possible to say name={} to remove the prefix in the List of Theorems, but this has an effect to the body-text display as well. (It's not the best solution) The parentheses can be removed by redefining \thmtformatoptarg to be ...


1

Use option dottedtoc for package classicthesis to align the page numbers on the right hand side of the page as suggested by Johannes_B in a comment. Package classicthesis uses package tocloft to format the TOC. So you can add something like \renewcommand{\cftpartpagefont}{\phantom} to remove the page numbers of the parts in TOC.


1

I don't think that it is a good idea. figure don't have a clear subsubsection level. But if you want it: with the koma classes it is is easier: \documentclass[11pt,a4paper]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage[demo]{graphicx} \makeatletter ...


1

This is not a solution, but a step in that direction...too lengthy to put in a comment. Two things had to change to recover the correct images. 1) In the \etocsetstyle macro, both instances of \end{tocleftbar} had to be changed to \endtocleftbar and the one instance of \begin{tocleftbar} had to be changed to \tocleftbar. 2) I had to turn off the ...


1

There are some possibilities: Use \protect\numberline{} to apply the usual indent for the chapter Remove the space of \cftchapnumwidth by setting it temporarily to 0pt (write this to the ToC) and restore later on. \hfill very very \documentclass[a4paper]{book} \usepackage{tocloft} \newlength{\standardchapnumwidth} ...


1

You can change the settings locally using { \hypersetup{linkcolor=black} \tableofcontents } or { \hypersetup{hidelinks} \tableofcontents } Code: \documentclass{report} \usepackage{blindtext}% dummy text \usepackage{amsmath} \usepackage{hyperref} \hypersetup{ colorlinks=true, % make the links colored } \begin{document} { ...


1

To get the part number centered, I had to use the tocloft package. \documentclass{book} \usepackage{tocloft} \renewcommand\cftpartpresnum{\hfill} \renewcommand\cftpartleader{\hfill} \begin{document} \tableofcontents \clearpage \part{Parte the First} \section{Introduction} \section{Next Section} \part{Parte the Second} \section{Introduction} ...


1

Since the part number should be centered as well, I choose to use a patch for the \addcontentsline within \@part -- note this is only working of the \secnumdepth is greater than -1. \documentclass{book} \usepackage{xpatch} \makeatletter \xpatchcmd{\@part}{% \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%% }{% ...



Only top voted, non community-wiki answers of a minimum length are eligible