0

I have a basic question but cannot find an answer in the (rich) titlesec titletoc documentation.

In the Toc, I would like to have the section titles formatted as the following, taken from the documentation of titlesec. Roughly I want them to be formatted as a block of text, with no idententations, and no line break between them. The pdf is here: https://texlive.mycozy.space/macros/latex/contrib/titlesec/titlesec.pdf Screen capture of the titledoc titlesec documentation,

The only difference is that, here, in the image, the blocks are made with the paragraph titles, I would like to have the same thing with the section titles (= chapter titles as usual, in bold, etc., section titles running consecutively). I do not use paragraph titles in my document. Is there a special option I should declare?

Edit: thanks to @Barbara Beeton, I was able to do just that. It works flawlessly, the only thing is that I sometimes have rare orphans or widows blocks in the TOC (the chapter titles are not "glued" to the section blocks), but this does not seem related to my question and I'll work further with the documentation. I'm not sure about the proper etiquette here, should I post the answer below? How to credit Barbara, who gave the right input?

\documentclass[a4paper]{book}
\usepackage{titletoc}

%The rest of the MWE is just here for the structure, the relevant lines are just below, I leave the rest, for the chapters, etc, just as it is \titlecontents*{section}[1.8pc] {\small} {\thecontentslabel. } {} {, \thecontentspage} [.---][.] % end of the relevant sequence

\begin{document} \tableofcontents \chapter{Introduction} \section{first section} \section{second section} \section{third section} \end{document}

Mathias
  • 36
  • Welcome to tex.sx. This question may be helpful: https://tex.stackexchange.com/a/24524 – barbara beeton Oct 03 '22 at 14:36
  • 1
    thanks @barbarabeeton! Your link is helpful. I am trying to see if just the \titlecontents*{section} instructions given on that page are not enough (and I leave the default titlecontents for chapters instead of redefining). I still have very minor issues, and I'll post a MWE if I'm not successful, but you definitely put me on the right track – Mathias Oct 03 '22 at 15:16

0 Answers0