Tag Info

New answers tagged

1

The following segment of code makes an entire copy of the macros involved with \listoffigures, applying them to a redefined \listofalgorithms: \usepackage{etoolbox} \makeatletter \AtBeginDocument{% \let\l@algorithm\l@figure% \let\listofalgorithms\listoffigures% Copy \listoffigures \let\@cftmakeloatitle\@cftmakeloftitle% Copy LoF title % Update ...


2

There are doubtless many, many reasons not to do this... Caveat emptor... The idea is essentially to write the list of algorithms to the auxiliary files twice. We let the algorithm package do its own thing: it has its own counter, its own contents lines, its own format. The lot. We just never print the list of algorithms it produces. Instead, we modify ...


4

Another solution based on titletoc, from the titlesecbundle; \documentclass[fleqn, a4paper, 11pt, oneside]{book} \pagestyle{plain} \renewcommand{\rmdefault}{ptm} \usepackage{newtxtext} \usepackage{titletoc} \contentsmargin[1cm]{0cm} \titlecontents{chapter}[0em]{\vskip12pt\bfseries\sffamily} {\thecontentslabel\enspace} {\hspace{1.05em}} { ...


3

When using tocloft, you have to set the fonts for each sectional component separately. There is no over-arching font setting, since each component is placed inside a box or group with their own font-specification. It allows the ultimate specificity, even though it might not suit your generic needs: \documentclass{book} \usepackage{mathptmx} ...


1

I think you are better off if you load minted.sty with option newfloat and use the interface to tocloft.sty as described in newfloat.pdf. Code: \documentclass{article} \usepackage[titles]{tocloft} \newlistof{listing}{lol}{List of Listings} \usepackage[newfloat]{minted} \usepackage{caption} \newenvironment{code}{\captionsetup{type=listing}}{} ...


1

Package tocloft changes the \tableofcontents so your addition probably need to be delayed. A construction like \AtBeginDocument{ } Can be used to delay a reconfigure until after the preamble. Also note @egregs suggestion of using \usepackage[titles]{tocloft} which will not change the \tableofcontents command it self.


4

Knuth & Plass's 1981 paper "Breaking Paragraphs into lines" explains the box and glue model underlying TeX's line-breaking algorithm and shows off some pyrotechnics enabled by it. Using one of those tricks, we can set a more ambitious goal: when the leaders and pagenum are place in their own line for lack of room, fill up the preceding line's with ...


0

I was able to fix my problem by following the steps in this answer. Since I am creating a class, I renewed the \tableofcontents command to look like the following: \renewcommand{\tableofcontents}{\part*{\contentsname}\pagestyle{empty}\@starttoc{toc}\clearpage\pagestyle{fancy}} (You can ignore \part*{\contentsname}, it's part of my class' style.) ...


4

One way is to directly patch the \@dottedtocline internal command so that it produces leaders that are at least two em long (say): \documentclass{scrbook} \makeatletter \renewcommand*\@dottedtocline[5]{% \ifnum #1>\c@tocdepth \else \vskip \z@ \@plus.2\p@ {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip \parindent ...



Top 50 recent answers are included