New answers tagged

1

You must enable \nameref to be aware of the current title, i.e. use \NR@gettitle{#1} inside of the \question command to store the information of the title into the label information, which is written to the .aux file. This is done by \NR@gettitle (actually by \newlabel) \documentclass{article} \usepackage{tocloft} \newlistof{question}{qcnt}{List of ...


1

Don't mix the use of two ToC-related packages. That's why any adjustment to \cftpnumalign doesn't show in the ToC, since titletoc has completely rewritten the way ToC-related entries are handled. The following is all that's needed to change the alignment (and width): \makeatletter ...


0

I don't know about tocloft or titletoc, but for plain old article class... \documentclass{article} \usepackage{showframe} \makeatletter \def\@pnumwidth{.5in}% maximum width for number on right \renewcommand*\l@part[2]{% \ifnum \c@tocdepth >-2\relax \addpenalty\@secpenalty \addvspace{2.25em \@plus\p@}% \setlength\@tempdima{3em}% ...


0

Since KOMA-Script Version 3.20 (current on CTAN) it is possible to remove the entry numbers in TOC using \RedeclareSectionCommands. \documentclass{scrbook}[2016/05/10] \usepackage{lipsum} \newcommand\remove[1]{} \RedeclareSectionCommands[ %tocindent=0pt,% if the indentation should also be removed tocnumwidth=0pt, tocentrynumberformat=\remove ...


1

You have to load tocloft with the titles option (see section 2.1 in the manual). \documentclass[draft,a4paper,11pt,oneside]{book} \usepackage[DIV=9,BCOR=2mm,headinclude=true,footinclude=false]{typearea} \usepackage{titlesec} \usepackage[titles]{tocloft} \usepackage{lipsum} %---Chapter Title Format \titleformat{\chapter}[display] ...


0

Simply using the following works too: \renewcommand{\contentsname}{\centering Contents}


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}} ...


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 ...


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}%% }{% ...


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} ...



Top 50 recent answers are included