1

How to remove indent between chapter and section in table of contents. I am using document class report. I have made a table of contents as shown in 1st Figure. Table of Contents created

The following is code used in package file to create entire formating

\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{mypackage}
 [2011/01/11 v0.01 LaTeX package for my own purpose]

\RequirePackage[dvips]{graphicx}
\RequirePackage[cmex10]{amsmath}
\RequirePackage{setspace}
\RequirePackage{float}
\usepackage{showframe}

\RequirePackage[margin=1in]{geometry}
\usepackage{subcaption}
\RequirePackage{cite}
\RequirePackage{caption}
\RequirePackage{etoolbox}
\RequirePackage{tabularx}
\RequirePackage[toc,page]{appendix}
\usepackage{tocloft}
\RequirePackage{titletoc}
\RequirePackage[compact]{titlesec}
\captionsetup{labelsep=period}
\setcounter{secnumdepth}{3}

\makeatletter
\patchcmd{\@makechapterhead}{50\p@}{0pt}{}{}
\patchcmd{\@makeschapterhead}{50\p@}{0pt}{}{}
\makeatother 

\cleardoublepage %\cleardoublepage %for openright

\renewcommand{\chaptername}{CHAPTER}

\renewcommand{\thechapter}{\Roman{chapter}}%chapter number in roman

%For displaying chapter title and heading in centre with required font
\titleformat{\chapter}[display]
{\normalfont\large\bfseries\centering}{\chaptertitlename\ \thechapter}         {0pc}{\large}%changing font size,and centering of chapter heading



\titleformat{\section}
{\normalfont}{\thesection}{1em}{\MakeUppercase}

However,I want the table of contents to look as in 2nd Figure . Also how to add page number header above the page numbers. Thanks. Table of contents wanted

Johannes_B
  • 24,235
  • 10
  • 93
  • 248
S.Dev
  • 75
  • 1
    Welcome to TeX SX! Waht have you tried? Which document class do you use? – Bernard Aug 09 '17 at 19:18
  • 1
    I am using document class report. I have made a style package and then used it in main document. – S.Dev Aug 10 '17 at 04:10
  • And what would be in that "style package"? Anything related to the appearance of the table of contents? Are the two screenshots you posted from two different documents, or from one and the same document? Please advise. – Mico Aug 10 '17 at 04:59
  • The screen shots are from different document. The first one is what i created using latex. The second one is made using word and thats the format I wanted to create using latex. I am pasting the code used in package file – S.Dev Aug 10 '17 at 05:26
  • There are several packages to modify the ToC, e.g., etoc, tocloft, tocbasic, titletoc – Schweinebacke Aug 10 '17 at 07:19
  • Thanks Schweinebacke,for the comment. I am able to get almost the answer using the link you have given. However, i am not able to add 'Page number' title above the page numbers. Whats the command for updating this.? Thanks – S.Dev Aug 10 '17 at 09:22

0 Answers0