I want to do two things in my document

  1. Add borders to my table of contents
  2. Centre/align the title of table to title of the page

In the following image, I am only showing the contents (not the whole page, the rest of it is blank). This is how I want my page to look: Title page

My code is as follows, firstly I have a class file called Vakalatnama.cls which contains the majority of code:

\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}{\secpagebreak}


% Set title of Table of Contents from Contents -> Particulars. '*' implies that
% the argument must not be in multiple paragraphs i.e. /long
    \par\noindent\hspace*{\fill} \textbf{\underline{Index}} \hspace*{\fill} \\*
    \hspace*{-10pt}\underline{{\textbf{Si. No.}}} \hfill \underline{\textbf{Particulars}} \hfill \underline{\textbf{Page}}

\newcommand{\pnp}{Test Solicitor}
\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{tabular}{l c r}
             \multicolumn{3}{l}{\underline{\textsc{In the matter of:}}}  \tabularnewline
             \@petitioner & \ldots & Petitioner \\* %\tabularnewline
             \multicolumn{3}{c}{-- \textsc{versus} --} \tabularnewline
             \respndt & \ldots & Respondent \tabularnewline

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

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

\renewcommand \maketitle {
    % Cover page




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



And then main.tex


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


\section{Memo of Appearance}


Thank you in advance for your help :-)

  • 1
    For item (2) use \\ not \newline. I would normally typeset these a paragraps and not use any forced line breaks, but your use of enlarged line spacing makes that more difficult
    – daleif
    Oct 2, 2020 at 11:28

1 Answer 1


I used etoc package as follows in my class file:

% Format Table of Contents
\newcommand{\mktoc}{% Cover page
    {\etociffirst{ \\ \hline}{\\\hline}}
    {\etocnumber & \etocname & \etocnumber }
        \multicolumn{3}{c}{\titleoftoc} \\
        \multicolumn{1}{|c|}{\bfseries Si No} &
        {\bfseries Particulars} &
        {\bfseries Page}
    {\\ \hline\end{tabular}}

Afterwards, in main.tex


    % Set other paramaters


You must log in to answer this question.

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