# How can I customize the numbering in toc with titletoc

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

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]%


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}