2

I am new to titletoc.

And I want to have a table of content like:

I. First Chapter
1. first section
2. section section
2.1 subsection
II. Second Chapter

So I would like to modify the "numbered-entry-format" argument of \titlecontents to achieve my goal.

Of all the examples I browsed, only \thecontentslabel is used here which, in my case, outputs 1.1, 1.2, 1.2.1 (Point is, I want to drop the chapter index).

Thanks for any thoughts!

1

2 Answers 2

3

Try this

\usepackage{titletoc}
       \titlecontents{chapter}[1em]{\smallskip}%
        {\contentslabel[\MakeUppercase{\romannumeral\thecontentslabel}.]{1.5em}\enspace }
        {}%numberless%
        {\enspace\dotfill\contentspage}[\medskip]%
        %
        \titlecontents{section}[0em]{\smallskip}%
        {\thechapter.\thecontentslabel\hskip0.8em}%numbered
        {}%numberless
        {\enspace\dotfill\contentspage}[\smallskip]%
1
2

Would you also be fine with a simple solution without titletoc?

\documentclass{book}

\renewcommand{\thechapter}{\Roman{chapter}} 
\renewcommand{\thesection}{\arabic{section}}

\begin{document}

    \tableofcontents

    \chapter{cap1}
    \section{First section}
    \subsection{First subsection}
    \subsection{Second subsection}
    \section{Second section}
    \subsection{First subsection}
    \subsection{Second subsection}
    \chapter{cap2}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .