1

I want to put the table of contents as: the Chapter and Part:

Part 1 Title

Chapter 1 Title Chapter

Section 1 Section Title

Section 1 Section Title

Subsection 1 Section Title

Paragraph 1 Paragraph title

SubParagraph 1 Subp...

With just the first number, not 1.2.3.4, 1.2, 1.4 etc... Here is my MWE:

\documentclass[14pt]{book}
\usepackage[toctitles,pagestyles]{titlesec}
\newpagestyle{main}[]{%
\setheadrule{.55pt}%
\sethead[{\thepage}]%  even-left
         [\chaptertitle]%       even-center
         [{\sectiontitle}]%     even-right
          {{\sectiontitle}}%    odd-left
          {\chaptertitle}%      odd-center
          {{\thepage}}%         odd-right
     \setfoot{}{}{}%
}
\renewpagestyle{plain}[\small]{%
     \setheadrule{.55pt}%
     \sethead[{\thepage}]%  even-left
     []%                    even-center
     [{\sectiontitle}]%     even-right
     {{\sectiontitle}}%     odd-left
     {}%                    odd-center
     {{\thepage}}%  odd-right
     \setfoot{}{}{}%
}
\pagestyle{plain}

\titleformat{\section}[block]{\Large\filcenter}{}{1em}{}
\titleformat{\chapter}[block]{\Huge\filright}{}{1em}{}
\titleformat{\subsection}[runin]{\large}{}{1em}{}

\usepackage{lipsum} 
\usepackage{titletoc}
\titlecontents{part}[1.5em]{\large\bfseries}
    {\partname}
    {}
    {}

\titlecontents{chapter}[1.5em]{\large}
    {\chaptername}
    {}
    {}
    \titlecontents{section}[1.5em]{\large}
    {}
    {}
    {}
    \titlecontents{subsection}[1.5em]{\large}
    {}
    {}
    {}
\begin{document}
\tableofcontents

\part{Here 1 Part}
\chapter{Here 1 chapter}
\lipsum[2-3]
\section{section 1}
\lipsum[2-3]
\section{section 2}
\lipsum[2-3]
\subsection{Sub 1}
\lipsum[2]

\end{document}
  • Are you sure you want the lowest sectioning levels to appear in the table of contents? – Bernard May 3 '18 at 23:12
  • Also, must the section, subsection, … numbers be simplified in the body of the document? – Bernard May 3 '18 at 23:23
  • Are you sure you want the lowest sectioning levels to appear in the table of contents? Yes, I will try some Layout Styles. Also, must the section, subsection, … numbers be simplified in the body of the document? Yes, all numbers simplified – Gergian May 4 '18 at 1:48

Your Answer

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

Browse other questions tagged or ask your own question.