Tag Info

Hot answers tagged

5

You can use the tocloft package to adjust the spacing: \documentclass[12pt]{book} \usepackage{tocloft} \usepackage[spanish]{babel} \usepackage[utf8]{inputenc} \setlength{\cftchapnumwidth}{2em} \begin{document} \tableofcontents \chapter{A}\chapter{B}\chapter{C}\chapter{D} \chapter{E}\chapter{F}\chapter{G}\chapter{H} \chapter{I}\chapter{J}\chapter{K} ...


4

I think you are talking about \part and not \chapter. Since you are redefining the \part command, it suffices to add the line \addtocontents{toc}{\protect\vspace*{-15\p@}} in the redefinition (adjust -15\p@ to your needs). MWE: \documentclass{article} \usepackage{titletoc} \makeatletter \def\@part[#1]#2{% \ifnum \c@secnumdepth >\m@ne ...


3

The class gatech-thesis.cls is buggy. You will see this odd behaviour not just with \section* but also with \subsection*, and \subsubsection* . The problem is that the class has (around line 2448) in the definition for \section, \subsection and \subsubsection: \renewcommand{\section}{% \@startsection{section}{1}{\z@}% {-3.25ex \@plus -1ex \@minus ...


3

Here is a solution with the minitoc package. In this case you will need to number the subsections (i.e. no star) to have them appear in any ToC. \documentclass{article} \pagestyle{empty}% for cropping \usepackage{appendix,minitoc} \begin{document} \dosecttoc \faketableofcontents% replace with \tableofcontents if you want a ToC \section{My First Section} ...


3

You can set the section in toc and section in toc shaded colors appropriately: \documentclass{beamer} \AtBeginSection[] { \setbeamercolor{section in toc}{fg=alerted text.fg} \setbeamercolor{section in toc shaded}{fg=structure} \begin{frame}<beamer> \frametitle{Outline} \tableofcontents[currentsection] \end{frame} } \begin{document} ...


3

Here is something that you could use as a start: \documentclass{report} \usepackage[margin=1in]{geometry}% Just for this example \makeatletter \newcommand{\printcases}{\@starttoc{cse}} \newcommand{\l@case}{\@dottedtocline{1}{0em}{1.5em}} \makeatother \newcommand{\case}[6]{% \addcontentsline{cse}{case}{#1: #2} \begin{description} \item[Case]: #1 ...


3

Neither table, tabular or minipage add something to the list of tables. This is done by \caption inside table or \captionof{table} (package caption or capt-of). Example: \documentclass{article} \usepackage{caption} \begin{document} \listoftables \newpage \begin{table} \caption{First table} \begin{tabular}{l} foo\\bar \end{tabular} ...


2

Two patchings to \@part (one for the entries in the ToC and the other for the headings in the document) will do the job; the fmtcount package was used to turn the Arabic number representation for the part counter to a ordinal string: \documentclass{book} \usepackage{xpatch} \usepackage{fmtcount} \makeatletter \xpatchcmd{\@part} ...


2

It suffices to also re-define the formatting of \part in the table of contents and give spacing parameters. By the way, writing \@addtoreset{subsection}{section} \@addtoreset{subsubsection}{subsection} is useless — it is the default. Here is a possibility: \documentclass{article} \usepackage{titletoc} \makeatletter \def\@part[#1]#2{% \ifnum ...


2

Use option toc=indentunnumbered to setup the table of contents to indent entries without number and command \addsec to add such sections automatically to the table of contents: \documentclass[toc=indentunnumbered]{scrreprt} \begin{document} \tableofcontents \chapter{Test Chapter One} \section{Test Section One One} \section{Test Section One Two} ...


2

This is a design choice of the class; you can change this by redefining (or patching \@ssect@ltx). With the redefinition: \documentclass[]{revtex4-1} \makeatletter \def\@ssect@ltx#1#2#3#4#5#6[#7]#8{% \def\H@svsec{\phantomsection}% \@tempskipa #5\relax \@ifdim{\@tempskipa>\z@}{% \begingroup \interlinepenalty \@M #6{% ...


2

You can adopt this answer given by Karl. In case if you want the section to stay in the current page as a whole, you may use \addtocontents{toc}{\protect\enlargethispage{\baselineskip}} % here Change \baselineskip suitably. Code: (adopted from linked answer): \documentclass[12pt]{book} \begin{document} \tableofcontents \chapter{Chapter} ...


2

If you don't want to specify \titlecontents{part} and are satisfied by the default typesetting by the article class, it's sufficient to patch the original \l@part command, which titletoc calls \ttl@savel@part: \documentclass{article} \usepackage{titletoc} \usepackage{etoolbox} \makeatletter \patchcmd{\ttl@savel@part}{2.25em}{1em}{}{} % <--- adjust to ...


1

Below I present another two options. Here's one possibility using the titletoc package; simply use \DoToC whereever you want to generate the partial ToC: \documentclass{article} \usepackage{appendix} \usepackage{titletoc} \newcommand\DoToC{% \startcontents \printcontents{}{2}{\textbf{Contents}\vskip3pt\hrule\vskip5pt} \vskip3pt\hrule\vskip5pt } ...


1

One way to achieve it is to employ \etocsettocstyle: \documentclass{article} \usepackage{appendix} \usepackage{etoc} \makeatletter \etocsettocstyle {\section *{\Huge\contentsname% % FOLLOWING TWO LINES OPTIONAL DEPENDING ON YOUR NEED % \@mkboth {\MakeUppercase \contentsname} % {\MakeUppercase \contentsname}% ...


1

Here is a solution using titlesec, titletoc and fmtcount, plus the \rmntonum command from etoolbox; we have to use it to convert the way part numbers appear in the .aux file (Roman numerals) to arabic. \documentclass[english]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{fourier} \usepackage{microtype} \usepackage{babel} ...



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