2

Here's my MWE:

\documentclass[12pt,a4paper,titlepage]{report}
\usepackage[margin=1in]{geometry}

\usepackage[pagestyles]{titlesec}
\titleformat{\chapter}{\bfseries\centering\Huge}{}{0pt}{}
\titlespacing{\chapter}
{0em}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}

\begin{document}
    \setcounter{tocdepth}{0}
    \tableofcontents
    \chapter*{Sách tham khảo}
    \chapter{Tựa}
\end{document}

Note that the chapter with the asterix is not showing up. I liked having it not showing up but I need a way to delete the numbering on the chapter.

3
  • 1
    Should the numbering be removed in the actual chapter heading? Or just the table of contents? Commented Dec 22, 2022 at 11:25
  • table of contents as the chapter already have no numbers. Also all chapters, parts, ssection, subsection numbers must be removed Commented Dec 22, 2022 at 11:37
  • Ah yes - sorry missed that in your code. You can use the titletoc package. I'll write and answer for you Commented Dec 22, 2022 at 11:39

1 Answer 1

2

You can use the titletoc package to format table of contents entries and remove the numbering using the \titlecontents macro.

The \titlecontents macro is described on pages 15 and 16 of the titletoc manual.

\documentclass[12pt,a4paper,titlepage]{report}
\usepackage[margin=1in]{geometry}

\usepackage[pagestyles]{titlesec}
\titleformat{\chapter}{\bfseries\centering\Huge}{}{0pt}{}
\titlespacing{\chapter}{0em}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\setcounter{tocdepth}{0}

\usepackage{titletoc}
\titlecontents{chapter}[0pt]{\addvspace{1em}}{\bfseries}{\bfseries}{\hfill\bfseries\contentspage}

\begin{document}
    \tableofcontents
    \chapter*{Sách tham khảo}
    \chapter{Tựa}
\end{document}

output

4
  • Can you explain what these mean please? Commented Dec 22, 2022 at 11:55
  • All pages in the table of contents are displayed as 1 Commented Dec 22, 2022 at 11:56
  • Oops should be \contentspage not \thepage Commented Dec 22, 2022 at 11:58
  • the \titlecontents macro is described on pages 15 and 16 of the titletoc manual. Commented Dec 22, 2022 at 11:59

You must log in to answer this question.

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