LaTeX forum ⇒ Page LayoutHow to force table of contents to not show pages before it? Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
lukaszskowron96
Posts: 36
Joined: Tue Oct 09, 2018 1:01 pm

How to force table of contents to not show pages before it?

Postby lukaszskowron96 » Fri Oct 26, 2018 8:17 pm

Hi,

So basically the subject summarises what I want to do.

My document comprises of:

1st page: title page (no page number)
2nd page: abstract (i)
3rd page: acknowledgements (ii)
4th page: table of contents (iii)
5th page: document starts (1)

I want my arabic numbering to start from page 5(I know how to do that) and I want table of contents to be showing everything from 5th page only.

Here is the code I am using:

  1. \documentclass[toc=sectionentrywithdots,a4paper,11pt]{scrartcl}
  2. \usepackage{graphicx}
  3.  
  4. \usepackage{setspace}
  5. \doublespacing
  6.  
  7. \usepackage[a4paper, left=20mm, right=20mm, top=20mm]{geometry}
  8.  
  9. \usepackage{pdfpages}
  10.  
  11. \usepackage{fancyhdr}
  12. \pagestyle{fancy}
  13. \rhead{ }
  14. \lhead{ }
  15. \thispagestyle{empty}
  16.  
  17. \pagenumbering{roman}
  18. \setcounter{page}{1}
  19.  
  20. \renewcommand{\rmdefault}{phv}
  21. \renewcommand{\sfdefault}{phv}
  22.  
  23. \usepackage[margin=0pt,font=normalsize]{subcaption}
  24.  
  25. \counterwithin{figure}{section}
  26.  
  27. \begin{document}
  28.  
  29. \setcounter{page}{0}
  30.  
  31. Cover Page
  32.  
  33. \newpage
  34. \lhead{Abstract}
  35. \addcontentsline{toc}{section}{Abstract}
  36. Abstract
  37.  
  38. \newpage
  39. \lhead{Acknowledgements}
  40. \addcontentsline{toc}{section}{Acknowledgements}
  41. Acknowledgements
  42.  
  43. \newpage
  44. \lhead{Contents}
  45. \addtocontents{toc}{~\hfill\textbf{Page}\par}
  46. \addcontentsline{toc}{section}{Contents}
  47. \makeatletter
  48. \@starttoc{toc}
  49. \makeatother
  50. \clearpage
  51.  
  52. \newpage
  53. \pagenumbering{arabic}
  54. \lhead{Chapter 1: Introduction}
  55. \section{Introduction}
  56. \subsection{Introduction}
  57. Introduction
  58.  
  59. \section{Chapter 2}
  60.  
  61. \addcontentsline{toc}{section}{References}
  62.  
  63. \end{document}

lukaszskowron96
Posts: 36
Joined: Tue Oct 09, 2018 1:01 pm

Postby lukaszskowron96 » Fri Oct 26, 2018 8:36 pm

I actually sorted it out.

I put:

\usepackage{lipsum}

in the preamble and then after \begin{document}

\pagenumbering{gobble}

Also had to delete all:

\addcontentsline{toc}{section}{...}

I hope somebody finds this helpful!


Return to “Page Layout”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest