Hot answers tagged

21

I figured it out by using: \setlength{\cftbeforetoctitleskip}{-3em} Which didn't work before since I forgot to change Z to toc: \cftbeforeZtitleskip to \cftbeforetoctitleskip I believe Z can be changed to other things, other than 'toc'


19

You could use the tocloft package; an example: \documentclass{book} \usepackage{tocloft} \newlength{\mylen} \renewcommand{\cftfigpresnum}{\figurename\enspace} \renewcommand{\cftfigaftersnum}{:} \settowidth{\mylen}{\cftfigpresnum\cftfigaftersnum} \addtolength{\cftfignumwidth}{\mylen} \begin{document} \listoffigures \begin{figure}[!ht] \centering ...


17

I recommend using the tocloft package, although I suspect the titletoc package could also be used quite easily. tocloft provides many hooks for content to be inserted into the table of contents. Here's an example: \documentclass{book} \usepackage{tocloft,calc} \renewcommand\chaptername{Day} \renewcommand\cftchappresnum{\chaptername\space} ...


16

The following table (taken from the tocloft documentation) lists the standard values for the indent and numwidth: You can use \cftsetindents to control the indent and numwidth values for the entries; the syntax is \cftsetindents{<entry>}{<indent>}{<numwidth>} To include the paragraphs, you will have to change the counters tocdepth ...


14

This is basically tocloft's \cftchapterprecis, but in the list of figures instead: \documentclass{article} \usepackage{tocloft} \makeatletter \newcommand{\figsourcefont}{\footnotesize} \newcommand{\figsource}[1]{% \addtocontents{lof}{% {\leftskip\cftfigindent \advance\leftskip\cftfignumwidth \rightskip\@tocrmarg ...


14

The error you are getting comes from loading the tocloft and subfigure packages simultaneously, as the following example swhows: \documentclass{article} \usepackage{tocloft} \usepackage{subfigure} \begin{document} test \end{document} As soon as one processes this document, the following error shows up: ! LaTeX Error: Command \c@lofdepth already ...


13

If I understand your requirements correctly, the following simple code will do (feel free to change the lengths and settings according to your needs): \documentclass{article} \usepackage{titletoc} \usepackage{lipsum} \titlecontents{section} [0cm]{\raggedleft\parshape 1 1cm \dimexpr\linewidth-3cm\relax} ...


13

Some packages and macros check whether \chapter is defined or not in order to take some action; for example, to typeset the bibliography as a chapter (book and report classes) or as a section (article class). The test they perform is based on \@ifundefined, something like \@ifundefined{chapter} {\section*{\refname}} {\chapter*{\bibname}} It's ...


12

Using the tocloft package you can do something like this: \documentclass{article} \usepackage{tocloft} \renewcommand\cftsecfont{\normalfont} \renewcommand\cftsecpagefont{\normalfont} \renewcommand{\cftsecleader}{\cftdotfill{\cftsecdotsep}} \renewcommand\cftsecdotsep{\cftdot} \renewcommand\cftsubsecdotsep{\cftdot} \begin{document} \tableofcontents ...


12

tocloft provides \cftsetpnumwidth{<len>} which sets the value of \@pnumwidth to <len>, so you could just execute \cftsetpnumwidth{3em}% 3em width for page numbers after loading tocloft (see 2.3 Typesetting the entries, p 8 of the tocloft documentation):


12

At the start of the appendix, a redefinition of \cftchappresnum must be forwarded to the .toc file. I have appended the definition of \appendix to do so. \documentclass{book} \usepackage{tocloft,calc} \renewcommand{\cftchappresnum}{\chaptername\space} \setlength{\cftchapnumwidth}{\widthof{\textbf{Appendix~999~}}} \makeatletter \g@addto@macro\appendix{% ...


11

There are numerous problems with the code you posted, which will explain why the titles don't line up. Specifically: \renewcommand{\cftchapfont}{ } % this should not have a space it should be \renewcommand{\cftchapfont}{} % notice there is no space here The following command: \renewcommand{\cftchapaftersnumb}{\phantom{CHAPTER}\rm} is a hack for ...


11

tocloft provides \cft<set>numwidth for the width of the number associated with an entry <set>. In your case, <set> is myequations, so we can adjust \cftmyequationsnumwidth in the following way: \documentclass[12pt]{report} \usepackage{tocloft} \usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry} %%gmedina ...


10

You can try the following: \documentclass{book} \usepackage[svgnames]{xcolor} \newcounter{chapcntr} \setcounter{chapcntr}{-1} \newcommand*\toccolor{% \ifcase\value{chapcntr}% \color{red}%----- 0 -- \or \color{blue}%---- 1 -- \or \color{green}%--- 2 -- \or \color{cyan}%---- 3 -- \else \color{black}%-- default \fi} ...


10

The width of \hbox{$\mkern10000mu.\mkern10000mu$} is 16003.67247pt when the font used by LaTeX is at 14.4pt; when you ask for 17.28pt size, the box becomes 19204.52904pt wide, which is more than \maxdimen and so everything goes awry. Notice that \fontsize{18}{18}\selectfont (the \selectfont is implicitly done when the formula begins) chooses, with the ...


10

There's really no need to define a new command for the chapter in the appendices section; just before the appendices you can redefine the \@chapter command (defined in report.cls), to include the appendices in the new list instead of including them in the ToC; here's an example of such a redefinition; note that the second mandatory argument of \newlistof ...


9

Here's a possible solution using the singlespace environment from setspace for the table of contents and tocloft to redefine the \cftXafterpnum commands to add the necessary space after the ToC entries: \documentclass{article} \usepackage[doublespacing]{setspace} \usepackage{tocloft} \renewcommand\cftsecafterpnum{\vskip\baselineskip} ...


9

book defines the ToC-related sectioning commands as follows: \newcommand*\l@chapter[2]{% \ifnum \c@tocdepth >\m@ne \addpenalty{-\@highpenalty}% \vskip 1.0em \@plus\p@ \setlength\@tempdima{1.5em}% \begingroup \parindent \z@ \rightskip \@pnumwidth \parfillskip -\@pnumwidth \leavevmode \bfseries ...


9

Loading tocloft with the titles option (see p.7 of the manual for details) is a good start. As there also seems to be an incompatibility between the \tableofcontents definition of the standard classes and fncychap, I use an unnumbered \contentsname chapter plus a "bare" ToC. \documentclass{book} \usepackage[Glenn]{fncychap} \usepackage[titles]{tocloft} ...


9

Update: for a solution working with hyperref, see below. An option, patching \l@section: \documentclass{article} \usepackage{etoolbox} \makeatletter \patchcmd{\l@section}{#1}{\MakeUppercase{#1}}{}{} \makeatother \begin{document} \tableofcontents \section{A test section} \section{Another test section} \end{document} If your section titles contain ...


9

Here's a possible solution; only information for sections with \todo notes will be written to the List of Todos: \documentclass{scrartcl} \usepackage{todonotes,xpatch,hyperref} % initial definitions for storing the section info (name and number) \def\thissectiontitle{} \def\thissectionnumber{} \newtoggle{noTodos} \makeatletter % redefinition of \@sect so ...


8

Sounds more like a job for an index package as for an list-of-x package. For example splitindex is able to generate multiple indexes with only one output stream. SplitIndex consists of a LaTeX package, splitidx, and a small program, splitindex. The package may be used to produce one index or several indexes. Without splitindex (for example, using the ...


8

(Assuming the real question is "how do I convince tocloft to put the word 'Figura' ahead of entries in my List of Figures?") \cftfigfont is for setting the font to typeset the List of Figures entries. \cftfigpresnum is for adding arbitrary text to the beginning on the entries. Both of these are described in section 2.3 of the tocloft manual. You'll probably ...


8

See "7.4. Partial lists" in titletoc package, it may be what you want. And I guess minitoc may also solve this problem itself. I'm not sure. For user-defined floats, I could only hack into titletoc. Luckily, it's not very difficult. And I think this feature should be added into titletoc. \documentclass{article} \usepackage{float,titletoc} ...


8

In this specific example, you need to remove the spurious space contained in your \addcontentsline definition: \addcontentsline{toc}{section} {% <------ Required \numberline{Problem 4.}Let $T$ be a tree with $n > 1$ nodes. What is the maximum number of degrees one vertex $T$ can have? What his the minimum number of degree one vertex $T$ can ...


8

Here are some broad-stroke suggestions: Rather use the following order/code to include your appendix: \clearpage \phantomsection \addcontentsline{toc}{chapter}{Appendices} \include{JaccardCode} It will ensure correct hyper-referencing from the bookmarks panel in your PDF viewer. \phantomsection is provided by hyperref. A similar approach should be used ...


8

Increase the space reserved to typeset the page number; add to your preamble \makeatletter \renewcommand\@pnumwidth{1cm} \makeatother and instead of 1cm use a suitable length. Your example code: \documentclass[12pt,draft,letterpaper]{report} \makeatletter \renewcommand\@pnumwidth{1cm} \makeatother \begin{document} \pagenumbering{roman} ...


8

amsart and tocloft are not compatible. You can either use another document class or, if you want to continue using amsart, you'll need to redefine \l@section, \l@subsection, and \l@subsubsection, \tocsection, \tocsubsection, and \tocsubsubsection; something along these lines: \documentclass[11pt]{amsart} \makeatletter ...


8

The label information is all in the aux file, so you can extract it something like this: \documentclass{article} \usepackage{hyperref} \long\def\findlabel#1#2\findlabel{% \ifx\newlabel#1\lablist\expandafter{\the\lablist\showlabel#2}\fi} %hyerref has 4 felds in each label culd use them but don't here \def\showlabel#1#2{% \par \noindent Label: ...


8

I think that this is an oversight, or even a bug, in the way that the table of contents is generated. Inside a latex file the \appendix command changes \@chapapp from \chaptername to \appendixname and this is used to get the right title in the chapter and appendix headings. Unfortunately, this information is NOT passed through to the table of contents file ...



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