Page LayoutPreamble roman, main arabic numbers

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

Preamble roman, main arabic numbers

Post by s140504 »

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:

Code: Select all

\documentclass[12pt,a4paper]{article}
%\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage{comment}
\usepackage{parskip}
\usepackage[nopar]{lipsum}
\usepackage{todonotes}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{tcolorbox}

%-----bibliography begin -----%
\usepackage[backend=biber, sorting=none]{biblatex}
\addbibresource{Bibliography.bib}
%-----bibliography end -----%

\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage[titletoc]{appendix}
\usepackage{amsmath}
\usepackage{float}
\usepackage{fancyhdr}
\setlength{\headheight}{19pt}
\pagestyle{fancy}
\usepackage{lastpage}
\usepackage{setspace}
\usepackage{hyperref}
\usepackage{afterpage}
\usepackage{caption}
\captionsetup[figure]{textfont={it}}
\usepackage[bottom]{footmisc}

%-----header/footer -----%
\lhead{\includegraphics[height=0.5cm]{figurer/DTU/DTU_Logo.jpg}}
\chead{s140504}
\rhead{\includegraphics[height=0.5cm]{figurer/BWSC/bwsclogo.jpg}}
\fancyfoot[L]{Section \thesection}
\fancyfoot[C]{Kristian Dalgaard}
\fancyfoot[R]{Page \thepage \hspace{1pt} of \pageref{LastPage}}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
%-----header/footer -----%

\begin{document}
\include{Frontpage}
\clearpage
\thispagestyle{empty}
\mbox{}
\newpage

\pagenumbering{Roman}

\include{Abstract}

\include{Preface}

\include{Abbreviations}

\include{Problem_statement}

\include{Introduction}

\pagenumbering{arabic}

\renewcommand{\baselinestretch}{1.0}\normalsize
\tableofcontents
\renewcommand{\baselinestretch}{1.0}\normalsize
\newpage

\renewcommand{\baselinestretch}{1.0}\normalsize
\listoffigures
\renewcommand{\baselinestretch}{1.0}\normalsize


\include{Introducing_Elements}

\include{Theory}

%\include{Generator_protection}

\include{Parameters}

\include{Simulation}

\include{LabTests}

\include{Results}

\include{Concluding}


%\input{Bibliography_test}
%\newpage

\pagestyle{empty}
\printbibliography

\begin{appendices}
  \include{Appendix/Appendix_A}
  
  \include{Appendix/Appendix_B}
  
  \include{Appendix/Appendix_C}
\end{appendices}

\clearpage
\thispagestyle{empty}
\mbox{}
\newpage

\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 8447 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 8447 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 8447 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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Preamble roman, main arabic numbers

Post by Johannes_B »

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

Preamble roman, main arabic numbers

Post by s140504 »

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

Preamble roman, main arabic numbers

Post by s140504 »

Anybody has a suggestion?

Thank you : )

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

Preamble roman, main arabic numbers

Post by Johannes_B »

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

Preamble roman, main arabic numbers

Post by s140504 »

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: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Preamble roman, main arabic numbers

Post by Johannes_B »

I am not quite sure I can follow. What does the following produce on your machine?

Code: Select all

\documentclass{article}
\begin{document}
\title{Test document}
\setcounter{secnumdepth}{-8}
\pagenumbering{roman}
\maketitle
\section{Thanks}
Content
\subsection{Subsection}
\cleardoublepage% important
\pagenumbering{arabic}
\setcounter{secnumdepth}{3}
\section{Introduction}
\subsection{Introducing the Wombats}
\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

Preamble roman, main arabic numbers

Post by s140504 »

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:

Code: Select all

\begin{document}

\include{Frontpage}
\clearpage
\thispagestyle{empty}
\mbox{}
\newpage

\setcounter{secnumdepth}{-8}
\pagenumbering{Roman}

\include{Abstract}

\include{Preface}

\include{Abbreviations}

\include{Problem_statement}

\include{Introduction}

\cleardoublepage %important
\pagenumbering{arabic}
\setcounter{secnumdepth}{3}

\renewcommand{\baselinestretch}{1.0}\normalsize
\tableofcontents
\renewcommand{\baselinestretch}{1.0}\normalsize
\newpage

\renewcommand{\baselinestretch}{1.0}\normalsize
\listoffigures
\renewcommand{\baselinestretch}{1.0}\normalsize


\include{Introducing_Elements}

\include{Theory}

%\include{Generator_protection}

\include{Parameters}

\include{Simulation}

\include{LabTests}

\include{Results}

\include{Concluding}


%\input{Bibliography_test}
%\newpage

\pagestyle{empty}
\printbibliography

\begin{appendices}
  \include{Appendix/Appendix_A}
  
  \include{Appendix/Appendix_B}
  
  \include{Appendix/Appendix_C}
\end{appendices}

\clearpage
\thispagestyle{empty}
\mbox{}
\newpage

\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 8339 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

Preamble roman, main arabic numbers

Post by s140504 »

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:

Code: Select all

\section{Introduction and practical information}
\thispagestyle{empty}
\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

Preamble roman, main arabic numbers

Post by s140504 »

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
Post Reply