LaTeX forum ⇒ Page LayoutPreamble roman, main arabic numbers Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
s140504
Posts: 49
Joined: Mon Sep 24, 2018 2:49 pm

Preamble roman, main arabic numbers

Postby s140504 » Tue Nov 06, 2018 5:57 pm

Hello

I searched the net and I can't find the exact solution to my problem.

I'd like my report preamble to be numbered in roman numbers and the rest in arabic numbers.
I kind of succeded but the sections are still numbered as usual and my first 'real' chapther, the introduction is now listed as chapter 6.

I use the "article" version.

Below is my main:

  1. \documentclass[12pt,a4paper]{article}
  2. %\usepackage[utf8]{inputenc}
  3. \usepackage[english]{babel}
  4. \usepackage{csquotes}
  5. \usepackage{comment}
  6. \usepackage{parskip}
  7. \usepackage[nopar]{lipsum}
  8. \usepackage{todonotes}
  9. \usepackage{amsmath}
  10. \usepackage{mathtools}
  11. \usepackage{tcolorbox}
  12.  
  13. %-----bibliography begin -----%
  14. \usepackage[backend=biber, sorting=none]{biblatex}
  15. \addbibresource{Bibliography.bib}
  16. %-----bibliography end -----%
  17.  
  18. \usepackage{graphicx}
  19. \usepackage[export]{adjustbox}
  20. \usepackage[titletoc]{appendix}
  21. \usepackage{amsmath}
  22. \usepackage{float}
  23. \usepackage{fancyhdr}
  24. \setlength{\headheight}{19pt}
  25. \pagestyle{fancy}
  26. \usepackage{lastpage}
  27. \usepackage{setspace}
  28. \usepackage{hyperref}
  29. \usepackage{afterpage}
  30. \usepackage{caption}
  31. \captionsetup[figure]{textfont={it}}
  32. \usepackage[bottom]{footmisc}
  33.  
  34. %-----header/footer -----%
  35. \lhead{\includegraphics[height=0.5cm]{figurer/DTU/DTU_Logo.jpg}}
  36. \chead{s140504}
  37. \rhead{\includegraphics[height=0.5cm]{figurer/BWSC/bwsclogo.jpg}}
  38. \fancyfoot[L]{Section \thesection}
  39. \fancyfoot[C]{Kristian Dalgaard}
  40. \fancyfoot[R]{Page \thepage \hspace{1pt} of \pageref{LastPage}}
  41. \renewcommand{\headrulewidth}{0.5pt}
  42. \renewcommand{\footrulewidth}{0.5pt}
  43. %-----header/footer -----%
  44.  
  45. \begin{document}
  46. \include{Frontpage}
  47. \clearpage
  48. \thispagestyle{empty}
  49. \mbox{}
  50. \newpage
  51.  
  52. \pagenumbering{Roman}
  53.  
  54. \include{Abstract}
  55.  
  56. \include{Preface}
  57.  
  58. \include{Abbreviations}
  59.  
  60. \include{Problem_statement}
  61.  
  62. \include{Introduction}
  63.  
  64. \pagenumbering{arabic}
  65.  
  66. \renewcommand{\baselinestretch}{1.0}\normalsize
  67. \tableofcontents
  68. \renewcommand{\baselinestretch}{1.0}\normalsize
  69. \newpage
  70.  
  71. \renewcommand{\baselinestretch}{1.0}\normalsize
  72. \listoffigures
  73. \renewcommand{\baselinestretch}{1.0}\normalsize
  74.  
  75.  
  76. \include{Introducing_Elements}
  77.  
  78. \include{Theory}
  79.  
  80. %\include{Generator_protection}
  81.  
  82. \include{Parameters}
  83.  
  84. \include{Simulation}
  85.  
  86. \include{LabTests}
  87.  
  88. \include{Results}
  89.  
  90. \include{Concluding}
  91.  
  92.  
  93. %\input{Bibliography_test}
  94. %\newpage
  95.  
  96. \pagestyle{empty}
  97. \printbibliography
  98.  
  99. \begin{appendices}
  100. \include{Appendix/Appendix_A}
  101.  
  102. \include{Appendix/Appendix_B}
  103.  
  104. \include{Appendix/Appendix_C}
  105. \end{appendices}
  106.  
  107. \clearpage
  108. \thispagestyle{empty}
  109. \mbox{}
  110. \newpage
  111.  
  112. \end{document}


Below are examples of what I'd like to change.
The sections I'd like to have in 'contents' but without chapter numbers:
Capture1.PNG
Capture1.PNG (24.86 KiB) Viewed 162 times


In the text-files I'd like the sections and subsections to have the roman numbering:
Capture2.PNG
Capture2.PNG (34.24 KiB) Viewed 162 times


I'd like my footer to count the preamble as one thnig and rest of document as another and I'd like \lastpage to be last page of preamble and counted in roman numbers:
Capture3.PNG
Capture3.PNG (2.29 KiB) Viewed 162 times


The roman/arabic pagecount I currently have only does a little of what I need.
Would I e.g. need a second header/footer setup for preamble?

Thank you and have a good day

User avatar
Johannes_B
Site Moderator
Posts: 3883
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed Nov 07, 2018 7:46 am

I am not quite sure i understand the problem. The article class does not provide any chapters.

Are you talking about page numbers or the numbering of chapters/sections?

What you call preamble would probably be known to frontmatter to most people. The book documentclass provides a command \frontmatter that switches to roman page numbers and omits the numbering of chapters.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

s140504
Posts: 49
Joined: Mon Sep 24, 2018 2:49 pm

Postby s140504 » Wed Nov 07, 2018 9:26 am

Yes. It is the frontmatter I mean.

I tried frontmatter but it did not work.
Maybe I am missing a package but it could also be because I use 'article' and not 'book'.

What I would like is to get abstract, preface, etc to be numbered with Roman numbers only.
And not be given a chapter number in the contents page - while it still exists in the contents page.

Thank you

s140504
Posts: 49
Joined: Mon Sep 24, 2018 2:49 pm

Postby s140504 » Wed Nov 07, 2018 1:49 pm

Anybody has a suggestion?

Thank you : )

/Kris

User avatar
Johannes_B
Site Moderator
Posts: 3883
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed Nov 07, 2018 3:41 pm

Since you seem to be in a hurry, here is something untested. I am on my phone right now.

\setcounter{secnumdepth}{-8}
\pagenumbering{roman}
\maketitle
\section{Thanks}
Content
\cleardoublepage% important
\pagenumbering{arabic}
\setcounter{secnumdepth}{3}
\section{Introduction}



Using the book class would be much cleaner though.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

s140504
Posts: 49
Joined: Mon Sep 24, 2018 2:49 pm

Postby s140504 » Fri Nov 09, 2018 12:12 pm

Thank you Johannes

I am not very much in a hurry.
Your suggestion does most of what I'd like but I'll have to go without header+footer in the frontmatter though.
Also whatever is frontmatter seems to number the sections with a zero in front e.g. 0.1...

This is beacuse I use \include{blabla}
And nor \chapter{blabla}

It is the same if I change class to book. If I change the class to book and then rename all the 'includes' to 'chapter' it should be ok?
Also changing the \section{blabla} to chapters(?)

Thanks.

User avatar
Johannes_B
Site Moderator
Posts: 3883
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Nov 09, 2018 5:47 pm

I am not quite sure I can follow. What does the following produce on your machine?
  1. \documentclass{article}
  2. \begin{document}
  3. \title{Test document}
  4. \setcounter{secnumdepth}{-8}
  5. \pagenumbering{roman}
  6. \maketitle
  7. \section{Thanks}
  8. Content
  9. \subsection{Subsection}
  10. \cleardoublepage% important
  11. \pagenumbering{arabic}
  12. \setcounter{secnumdepth}{3}
  13. \section{Introduction}
  14. \subsection{Introducing the Wombats}
  15. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

s140504
Posts: 49
Joined: Mon Sep 24, 2018 2:49 pm

Postby s140504 » Mon Nov 12, 2018 2:00 pm

It is almost working as I'd like it to.

The issue is with a section called "Introduction..."
For some reason - the \thispagestyle{empty} does not pass on to the second side of the section where the subsection correctly numbered is.

Now I have:

  1. \begin{document}
  2.  
  3. \include{Frontpage}
  4. \clearpage
  5. \thispagestyle{empty}
  6. \mbox{}
  7. \newpage
  8.  
  9. \setcounter{secnumdepth}{-8}
  10. \pagenumbering{Roman}
  11.  
  12. \include{Abstract}
  13.  
  14. \include{Preface}
  15.  
  16. \include{Abbreviations}
  17.  
  18. \include{Problem_statement}
  19.  
  20. \include{Introduction}
  21.  
  22. \cleardoublepage %important
  23. \pagenumbering{arabic}
  24. \setcounter{secnumdepth}{3}
  25.  
  26. \renewcommand{\baselinestretch}{1.0}\normalsize
  27. \tableofcontents
  28. \renewcommand{\baselinestretch}{1.0}\normalsize
  29. \newpage
  30.  
  31. \renewcommand{\baselinestretch}{1.0}\normalsize
  32. \listoffigures
  33. \renewcommand{\baselinestretch}{1.0}\normalsize
  34.  
  35.  
  36. \include{Introducing_Elements}
  37.  
  38. \include{Theory}
  39.  
  40. %\include{Generator_protection}
  41.  
  42. \include{Parameters}
  43.  
  44. \include{Simulation}
  45.  
  46. \include{LabTests}
  47.  
  48. \include{Results}
  49.  
  50. \include{Concluding}
  51.  
  52.  
  53. %\input{Bibliography_test}
  54. %\newpage
  55.  
  56. \pagestyle{empty}
  57. \printbibliography
  58.  
  59. \begin{appendices}
  60. \include{Appendix/Appendix_A}
  61.  
  62. \include{Appendix/Appendix_B}
  63.  
  64. \include{Appendix/Appendix_C}
  65. \end{appendices}
  66.  
  67. \clearpage
  68. \thispagestyle{empty}
  69. \mbox{}
  70. \newpage
  71.  
  72. \end{document}


The \title and \maketitle do not work... or I am not sure what to do with them.
Maybe I am missing a package.

Here it can be seen that overleaf appears to not respect the \thispagestyle{empty} which I have in the beginning of this tex-file (as it makes the footer):
Capture2.PNG
Capture2.PNG (7.26 KiB) Viewed 54 times


Maybe it is poorly explained. I just do not understand why overleaf would not 'respect' the empty pagestyle
Last edited by s140504 on Mon Nov 12, 2018 2:28 pm, edited 3 times in total.

s140504
Posts: 49
Joined: Mon Sep 24, 2018 2:49 pm

Postby s140504 » Mon Nov 12, 2018 2:11 pm

PS. In the beginning of all the documents in the frontmatter I use \thispagestyle{empty} as to not geth the footer/header in those sections.

Example:
  1. \section{Introduction and practical information}
  2. \thispagestyle{empty}
  3. \label{sec:Introduction}


Could I just move my footer/header to after the frontmatter sections in the main?
Or somehow make \thispagestyle{empty} for everything in the frontmatter?

s140504
Posts: 49
Joined: Mon Sep 24, 2018 2:49 pm

Postby s140504 » Mon Nov 12, 2018 2:24 pm

I experimented a bit with \newpage
It seems that when there is a pageskip in the frontmatter the \thispagestyle becomes obsolete.
So I used \pagestyle{empty} which did the trick removing header/footer.

Thank you


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 2 guests