# Tag Info

5

Putting the chapter counter on the reset list of part is easy with the LaTeX core macro \@addtoreset \makeatletter \@addtoreset{chapter}{part} \makeatother Or use the chngcntr package and \counterwithin*{chapter}{part}. \usepackage{chngcntr} \counterwithin*{chapter}{part} In this case I used \counterwithin* to prevent a change of \thechapter. For more ...

4

A possible solution working for article and scrartcl (i.e. without using features of KOMA) The page numbers are still right justified, but the width of the page number slot at the right margin is too small, because Roman numbers need more space to be typeset than arabic figures. Increasing the value of \@pnumwidth will solve this problem, however, this ...

4

Grabbing the theorem 'BODY', i.e. the content between \begin{theorem}...\end{theorem} can be done with \RenewEnviron and the \BODY command. The \RenewEnviron command defines theorem to be a wrapper around the original version (which has been stored before into \let\theorem@@orig and \let\theorem@@origend command). The package environ provides the \BODY ...

3

You should enclose everything in a \parbox, not just the chapter title. By the way, you should not load both titletoc and tocloft. The -15pt bit should correspond to some parameter in titletoc, find out which one. Add also a better separation between titles in the TOC. I removed most of the unnecessary package for the example. Changing \contentsname into ...

3

An appropriately-placed patch in the ToC can correct this behaviour. Below I've patched \l@chapter - the macro responsible for setting the chapter-related content in the ToC - and removed \bfseries: \documentclass{report} \usepackage[toc,page,titletoc]{appendix} \usepackage{etoolbox} \makeatletter \g@addto@macro\appendices{% \addtocontents{toc}{\...

3

From the titletoc documentation (section 6.1. A ten-minute guide to titletoc): \dottedcontents{<section>}[<left>]{<above-code>} {<label width>}{<leader width>} ... <left> even if bracketed is currently mandatory and it sets the left margin from the left page margin. ... \...

2

For titletoc to work with \part you have to redefine the formatting of part in titlesec, so that it yields the same result as the class. Here is an attempt: \documentclass{mwbk} \usepackage[toctitles, newparttoc]{titlesec} \usepackage{titletoc} \titleformat{\part}[display]{\bfseries\filcenter}{\huge\partname~\Roman{part}}{30pt}{\Large\itshape} \...

2

The mwbk class is not really compatible with titletoc or tocloft. A lower level strategy seems necessary. \documentclass{mwbk} \makeatletter \renewcommand*\l@part[2]{% \ifnum \c@tocdepth >-2\relax \mw@tocskip{-1}{.6\baselineskip}% \begingroup \parindent \z@ \rightskip \@pnumwidth \parfillskip -\@pnumwidth {\leavevmode\...

2

Using a separate listing environment for shell-scripts with a specific name is quite easy, see the \lstnewenvironment code. More difficult is the splitting of the .lol and .los settings: \lst@MakeCaption must be redefined and changed to use los instead of lol. Please note: The current version does not work well with hyperref due to the anchors! \...

2

You are using titlesec, tocloft, and titletoc in the same class file. You should include the option titles when loading tocloft. Compare the MWE (btw, your MWE is not really minimal) \documentclass{book} \usepackage{tocloft} \usepackage{setspace} \usepackage{titlesec} \usepackage{titletoc} \usepackage{blindtext} \titlecontents{chapter}[0mm]{\addvspace{...

2

The main problem is the loading order of subfig and tocloft. subfig defines c@lotdepth by a \@nameuse statement - as such it's already defined at the time when tocloft tries to setup this new counter. The same is true for c@lofdepth, leading to a similar error. The other way round, using tocloft first before loading subfig poses no problem. Another ...

2

This is a guess only: Using the book class and patching \tableofcontents and \@maketitle slightly to remove the \newpage or \cleardoublepage usage. \documentclass[notitlepage]{book} \usepackage{xcolor} \usepackage{pstricks} \usepackage{xpatch} \usepackage{auto-pst-pdf} \makeatletter \AtBeginDocument{% \xpretocmd{\tableofcontents}{% \begingroup\let\...

2

The minitoc package provides \mtcaddchapter[...] for addition of starred chapters to the ToC. This will maintain the ability for a minitoc as well -- see page 72 of the current minitoc documentation and make sure to use \mtcaddchapter after \chapter*! \documentclass[12pt,french]{report} \usepackage[T1]{fontenc} \usepackage{times} \usepackage[utf8]{inputenc}...

2

\documentclass{book} \usepackage[toc]{appendix} \begin{document} \tableofcontents \chapter{Foo} \chapter{Foobar} \begin{appendices} \chapter{Foo App} \chapter{Foobar App} \end{appendices} \end{document}

2

You have a couple of options here: Option 1 This is what you currently have: Updating the page styles for the Appendix to prepend Apx. to \thepage as part of the headers/footers. \addtodef{\appendix}{}{% \copypagestyle{apx}{plain}% \makeevenfoot{apx}{}{Apx. \thepage}{}% \makeoddfoot{apx}{}{Apx. \thepage}{}% \copypagestyle{chapter}{plain}% \...

1

Here is a solution. We use \printcontents[chapters]{}{1}{\setcounter{tocdepth}{1}} for chapter minitoc to show only sections and \printcontents[sections]{}{2}{ \setcounter{tocdepth}{2} \section*{Content from subsection*}} for section minitoc to show only subsections Note that i use here \section*{Content from subsection*} inside \printcontents i ...

1


1

\dominitoc should be used before \tableofcontents, not after it! There are also some issues (like the the figure environment within the titlepage (why?)) and hyperref should be loaded last (here!). \documentclass[a4paper,10pt]{report} \usepackage[utf8]{inputenc} \usepackage[demo]{graphicx} \usepackage{float} \usepackage{titlesec} \usepackage{listings} \...

1

If you want the page number itself to be recorded as Apx. #, then you shouldn't edit the page style. Instead you should just redefine \thepage. \documentclass[a4paper,oneside]{memoir} \begin{document} \tableofcontents \chapter{Test} \clearpage %So that the new \thepage will not leak to the previous chapter. \appendix \renewcommand\thepage{Apx. \...

1

Is this what you want? Note I replaced the obsolete package times with newtxtext, newtxmath, which provides true smallcaps and a few other glyphs. \documentclass[b5paper]{book} \usepackage{kantlipsum} \usepackage{geometry} \usepackage{xcolor} \usepackage{titletoc} \usepackage[rm,small,center,compact,newparttoc,clearempty,toctitles,pagestyles, newlinetospace]...

1

You can use scrextend. Then you can set the page style used on blank pages (pages inserted by \cleardoublepage) as package option cleardoublepage=<value>. Possible values are empty (default), plain, current or the name of another page style. The value of the option can be changed inside the document using \KOMAoptions{cleardoublepage=<value>}. ...

1

This is known problem because of starred chapters. Here are two ways: 1 (not recommended) Replace \setcounter{mtc}{9} with \setcounter{mtc}{6} (well try to find the correct value) 2 Remove \setcounter{mtc}{9} and redefine \addtotoc \renewcommand\addtotoc[1]{% \refstepcounter{dummy}% \addstarredchapter{#1}% or \mtcaddchapter[#1]% \markboth{#1}{}}

1

You can load the bookmarks package. Here's a complete example; I also loaded tocbibind to avoid most of the \addcontentsline instructions. The key is \bookmarksetup{startatroot} in the appropriate place. \documentclass[12pt,a4paper]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[brazil]{babel} \usepackage{imakeidx} \usepackage[...

1

The class memoir uses \addcontentsline{toc}{part}{\partnumberline{\thepart}...} -- redefining \thepart will change the numbering of parts throughout the document. If only the way of \thepart is used in the ToC, \thepart must be redefined within a group that contains \addcontentsline, as is done in the patch! hyperref must be loaded after the patch! \...

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