1

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!

  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user36296 May 20 '16 at 14:17
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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.