[Tex/LaTex] Center chapter name in the table of contents

chaptershorizontal alignmenttable of contents

I am adding chapter name for a set of sections with the following code:

\addcontentsline{toc}{section}{\protect\numberline{}Chapter I}

However, Chapter I is left-sided. What I want is something like:

        Chapter I

1. Introduction...

2. Related work

3. ...

        Chapter II

6. Section bla bla

where Chapter I and Chapter II are centered.

How can I enforce that without touching my document class?

I found an ugly, yet effective solution:

\addcontentsline{toc}{part}{\protect\centering{}Chapter I}

It is not really chapter, but part with the name Chapter I. I know that this is ugly solution. When I used section or chapter, it was kind of merging with the next line or being centered in the first half of the widthline.

Best Answer

Since you are using the journal class informs3.cls, it does not provide \chapters. You can modify \chapter to insert a "chapter-like entry in the ToC" or merely write what you want to the ToC. I've done the latter since it's faster/easier:

enter image description here

\documentclass{informs3}% https://www.informs.org/Find-Research-Publications/INFORMS-Journals/Author-Portal/LaTeX-Style-Files
\newcommand{\chapter}[1]{%
  \addtocontents{toc}{{\protect\centering\itshape #1\par}}
}
\begin{document}
\tableofcontents
\chapter{Methodology}
\section{Introduction}
\section{Related work}
\section{More stuff}
\chapter{Residual}
\section{Final remarks}
\section{Conclusions}
\end{document}

You may want to add similar titles/headings in your main document. However, that's left to you.

Related Question