I want to remove the page break forcefully inserted by \tableofcontents and so far I have not had much success browsing through forums/StackExchange. [I have added page border only to show separation of pages]

Sample Page Output

In the sample image I have posted, I want the contents of page 2 to appear in the centre right after State of Uttar Pradesh and Others (given on pg 1).

I am using XeTeX and here is the relevant section from my code.

I have written a custom Class file called vakalatnama.cls, in which I have:

\ProvidesClass{vakalatnama}[2020/09/15 Vakalatnama template for Indian courts]


% \RequirePackage{xltxtra}

% Make entries in the index table as links

% Set font to Times New Roman
\setmainfont{Times New Roman}

% line spacing = 1.5


% Format section title to have numbers in Table of Contents, but not in document
\titleformat{\section}{\center \normalfont \bfseries}{}{0pt}{\newpage}


% Set title of Table of Contents from Contents -> Particulars. '*' implies that
% the argument must not be in multiple paragraphs i.e. /long
    \centering{\underline{\textsc{\large{Index}}}} \\
    \parbox{25pt}{\textbf{Si. No.}} \hfill \underline{\textbf{Particulars}} \hfill \underline{\textbf{Page}}

\newcommand{\dhc}{Delhi High Court}
\newcommand{\sci}{Supreme Court of India}

\NewDocumentCommand {\setname} {O{Shri} m m} { % Title (default=Shri), first, last
    \newcommand {\tfname} {#1 #2 #3} % Full name with title
    \newcommand {\fname} {#2 #3} % first + last name
    \newcommand {\tlname} {#1 #3} % title + last name

    \newcommand{\fulladv}{#1 #2}


    \newcommand{\fullcasenumber}{#1 of #2}

        \textsc{In the \crt{}} \newline
        \textsc{\jurisdctn{}} \newline
        \textsc{\ptntype{} \fullcasenumber{}} \newline

    % \begin {flushleft}
        \begin{tabular}{l c r}
             \multicolumn{3}{l}{\underline{\textsc{In the matter of:}}}  \tabularnewline
             \@petitioner & \ldots & Petitioner \tabularnewline
             & -- \textsc{versus} -- & \tabularnewline
             \respndt & \ldots & Respondent \tabularnewline
   % \end{flushleft}

    \begin {center}
        \begin{tabular}{l c r}
             \@petitioner & \ldots & Appellant/Petitioner \\ %\tabularnewline
             {} & -- \textsc{Between/And} -- & {}  \\ %\tabularnewline
             \respndt & \ldots & Defendant/Respondent/Opposite Party \\ % \tabularnewline

\newcommand{\tophead}{%Roll the Court Name, petition etc into a single command


And there is a separate tex file called cover.tex which contains:

\textbf{Advocate for the Respondent: \respndt{}} 

There is a third file called main.tex which only provides the parameters for these functions and that is the file I use for compilation. The contents of main.tex are:


\petitioner{Test Petitioner}
\court{Supreme Court Of India}
\respondent{State of Uttar Pradesh and Others}
\jurisdiction{Criminal Appellate Jurisdiction}
\petitiontype{SLP (Civil)}


I will be very very grateful for any help on this.

  • 1
    you make it very hard for anyone to help if you only post fragments not a test document that can be debugged, but your inmatterof isn't a heading just a flushleft environment so will have vertical space (and a legal page break point) after it, you don't show any code at all for \tableofcontents but if that is making an unbreakable box such as a tabular then it will have to break at the point you show, you could force the page break earlier by adding \clearpage at the point you want the page break. Sep 29, 2020 at 7:12
  • Hello David - Thank you for your comment. I have added more details, earlier I had not posted them in order to keep the post short and to-the-point. Sep 29, 2020 at 7:47
  • 1
    but we still can not run the example to see the problem. or test answers, you could remove the \input lines and replace by just enough \section{zzz} to show the page break you are asking about. Also you have said you do not want the page break where it is, but do you want it earlier so the preceding text comes at the top of the page, you presumably do not want it to break after the Particulars heading row, and there does not look to be space to get any of the table of contents rows on that page as it is? Sep 29, 2020 at 7:57
  • Thank you for your comment and being so patient with me David. I added the suggested edits. In short, I want the Index (which is the title I chose for Table of Contents) to appear on the first page (after the line starting with State of Uttar Pradesh). I removed the other two lines with \input and I have given the contents of cover.tex file in my question Sep 29, 2020 at 8:06
  • 1
    in article class sections do not start on a new page but you are forcing that with \titleformat{\section}{\center \normalfont \bfseries}{}{0pt}{\newpage} Sep 30, 2020 at 9:03

1 Answer 1


Note it is bad style to put formatting in \zzzname macros, they were introduced specifically to separate the text name from formatting, so they can be easily translated without having to copy formatting, however I am not suggesting changing that here.

White space at the beginning of a line is dropped this includes \hfill which is why your Index is flush right. \hspace* is a variant of \hspace that prevents this so:


would centre the text.

\tableofcontents in article class is a \section* so is affected by your declaration

\titleformat{\section}{\center \normalfont \bfseries}{}{0pt}{\newpage}

which forces a new page. If you want later sections to have this but not in the frontmatter use

\titleformat{\section}{\centering \normalfont \bfseries}{}{0pt}{\secpagebreak}

so it starts off doing nothing,then at some point do


so following sections start on a new page (and prevent floating figures flowing past that point with \clearpage rather than just \newpage).

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.