1

how can I modify numberless chapters as Table of contents in book or report class? the following code, f.e., doesn't anthing. Wrong syntax or something else?

\documentclass[a4paper]{report}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{EB Garamond}

\usepackage{titlesec,titletoc}
\titleformat{name=\chapter,numberless}{\normalfont\huge}{}{0pt}{}[rightmargin]

\begin{document}

%\renewcommand*\contentsname{\hfill\mdseries\huge Contents\hspace*{1.2em}}

\tableofcontents

\end{document}
2

\titleformat{name=\chapter,numberless}... does nothing if it is not accompanied by a definition of the format for numbered chapters.

Adjust at will.

\documentclass[a4paper]{report}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{titlesec,titletoc}

\setmainlanguage{english}
\setmainfont[Numbers=OldStyle]{EB Garamond}

\titleformat{name=\chapter}[display]
 {\normalfont\huge}
 {\chaptername\ \thechapter}
 {1ex}
 {}

\titleformat{name=\chapter,numberless}[display]
  {\normalfont\huge}
  {}
  {0pt}
  {}

\begin{document}

\tableofcontents

\chapter{xx}

\end{document}
|improve this answer|||||
  • thanx! I didn't realize that, reading Titlesec/titletoc manual – user41063 Oct 30 '18 at 23:26

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.