1

Minimal working example:

\documentclass{report}
\usepackage{titlesec}
\usepackage{titletoc}

\titleclass{\part}{top}
\titleformat{\part}[display]
{\centering\normalfont}
{\itshape \partname~\thepart}{1.0em}
{\bfseries\MakeUppercase}
\titlespacing*{\part}{0pt}{0pt}{20pt}

\renewcommand{\thechapter}{\Roman{chapter}}

\dottedcontents{section}[5.0em]{}{3.5em}{0.75pc}

\begin{document}

\startcontents[parts]

\part{Part I}

\printcontents[parts]{}{0}{}

\chapter{Chapter I}
\section{Section I.1}

\chapter{Chapter II}
\section{Section II.1}

\chapter{Chapter III}
\section{Section III.1}

\stopcontents[parts]

\end{document}

Problem: add space between the bold Roman numerals and words (for chapters) in the table of contents.

  • 1
    Use \titleclass{\part}{top} command from the titlesec package for your first problem. \part by default enforces a page break in the report document class. – Troy Mar 25 '17 at 08:27
  • 1
    Also, refer to the titletoc package. \printcontents takes in one optional argument in square brackets and three mandatory arguments in curly brackets. What you have in your MWE is four curly brackets, and so it produces an error. – Troy Mar 25 '17 at 08:31
  • @Troy now the table of contents doesn't show up for me – Randy Randerson Mar 25 '17 at 08:37
  • For the first issue: You might use a \vbox{...} around the part and the \printcontents. This should prevent the pagebreak. With this approach you don't change the behavior of \part on other occasions. – Skillmon Mar 25 '17 at 08:40
  • The optional argument that you're passing to the \printcontents command is the name, which you need to pass to \startcontents and \stopcontents as well, but this is only used if you want to have multiple TOCs.. (Read the documentation if you want to know more). If you only have this one, then try this: \printcontents{sections}{0}{} – Troy Mar 25 '17 at 08:41
  • @Troy with an empty [] I get an error "No partial toc named ." – Skillmon Mar 25 '17 at 08:43
  • @RandyRanderson Why are you editing away your questions? Surely there is some value in keeping it around so that others in the future with the same question can refer to this and fix their problem.. Are you gonna delete this question once your last query has been solved? Anyway, have a look at this for your third question: http://tex.stackexchange.com/questions/33841/how-to-modify-the-space-between-the-numbers-and-text-of-sectioning-titles-in-the – Troy Mar 25 '17 at 08:59
  • The additional space should only be in the TOC, not in the actual headings? – Skillmon Mar 25 '17 at 08:59
  • @Troy the deleted questions were clearly answered in the documentation. last one is useful – Randy Randerson Mar 25 '17 at 09:03
  • @RandyRanderson As it stands then, your question is a possible duplicate of the link I attached above? – Troy Mar 25 '17 at 09:07
  • @Troy no, that solution doesn't work for my question. in particular i don't see how to use \dottedcontents to fix the chapter spacing – Randy Randerson Mar 25 '17 at 09:15
  • @RandyRanderson What exactly do you want to fix? In your question you mentioned the spacing in the section level, and here you mention the spacing in the chapter level. – Troy Mar 25 '17 at 09:18
  • @Troy i was using "section" too loosely. I meant both chapters and sections. – Randy Randerson Mar 25 '17 at 09:18
  • Try this for sections: \dottedcontents{section}[0em]{}{3.2em}{1pc} – Skillmon Mar 25 '17 at 09:19
  • What's left? And if you find answers to your questions, you really shouldn't edit your question but post an answer so that future visitors of this site can solve their own problems. – Skillmon Mar 25 '17 at 09:27
  • Compiling error is because of your \dottedcontents{chapter}[1.0em]{}{3.0em}{} change it to \dottedcontents{chapter}[1.0em]{\bfseries}{3.0em}{0pc}. This also solves the non-bold chapters. – Skillmon Mar 25 '17 at 09:30

1 Answers1

3

To get the chapter entries in your TOC bold and with adjustable space use \dottedcontents{chapter}[1.0em]{\bfseries}{3.0em}{0pc}.

Skillmon
  • 60,462