Skip to content

Commit 7bb6914

Browse files
authored
Merge pull request #8 from mjpc13/fix-page-numbering
Fix numbering issues
2 parents eb27bb7 + 892df7e commit 7bb6914

1 file changed

Lines changed: 49 additions & 43 deletions

File tree

main.tex

Lines changed: 49 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@
4545
\usepackage{tikz,lipsum,lmodern}
4646
\usepackage[most]{tcolorbox}
4747
\usepackage{graphicx}
48-
%\usepackage[table,xcdraw]{xcolor}
4948
\usepackage{listings}
50-
\usepackage{lipsum}
49+
\usepackage{fancyhdr}
5150

5251
\lstset{
5352
backgroundcolor=\color{backcolour},
@@ -81,25 +80,25 @@
8180
% uncomment your preferred style
8281

8382
% Simple Format
84-
%\titleformat{\chapter}[hang]
85-
%{
86-
% \sffamily
87-
% \Huge
88-
% \bfseries
89-
%}
90-
%{\thechapter}{0.5em}
91-
%{}
92-
93-
% Line Format
9483
\titleformat{\chapter}[hang]
9584
{
96-
\sffamily
97-
\Huge
98-
\bfseries
85+
\sffamily
86+
\Huge
87+
\bfseries
9988
}
10089
{\thechapter}{0.5em}
10190
{}
102-
[\vspace{-3.0ex} \rule{\textwidth}{2pt}]
91+
92+
% Line Format
93+
% \titleformat{\chapter}[hang]
94+
% {
95+
% \sffamily
96+
% \Huge
97+
% \bfseries
98+
% }
99+
% {\thechapter}{0.5em}
100+
% {}
101+
% [\vspace{-3.0ex} \rule{\textwidth}{2pt}]
103102

104103
% Framed Format
105104
%\titleformat{\chapter}[frame]
@@ -114,7 +113,7 @@
114113

115114
%---STYLE FOR CODE---
116115

117-
%Example of adding a new language (Julia in this case)
116+
%Example of adding a language not included in the package (Julia in this case)
118117
%\lstdefinelanguage{Julia}%
119118
% {morekeywords={abstract,break,case,catch,const,continue,do,else,elseif,%
120119
% end,export,false,for,function,immutable,import,importall,if,in,%
@@ -161,46 +160,52 @@
161160
\newcommand{\supervisorname}{Supervisor's Name} % Your supervisor's name
162161
\newcommand{\cosupervisorname}{co-supervisor 1 \linebreak co-supervisor 2} % Your co-supervisor's name, if any.
163162

163+
164+
% Handle page styling for headers and footers
165+
\fancypagestyle{plain}{
166+
\fancyhf{}
167+
\fancyfoot[CE,CO]{\thepage}
168+
\renewcommand{\headrulewidth}{0pt}
169+
}
170+
171+
\fancypagestyle{empty}{
172+
\fancyhf{}
173+
\renewcommand{\headrulewidth}{0pt}
174+
}
175+
164176
% MAIN DOCUMENT
165177
\begin{document}
166178

167-
\pagenumbering{roman}
168-
169179
% TITLE PAGES
180+
\frontmatter
170181
% Uncomment this line when you have your cover ready. An MSWord template is available at that folder.
171182
% You should edit it in MSWord, and then export it into PDF, so we can neatly import it here.
172183
\includepdf[pages={-}]{images/cover.pdf}
173-
% Blank page
174-
%\newpage
175-
%\thispagestyle{empty}
176-
%\mbox{}
184+
% Blank page (Back of Cover)
185+
\newpage\thispagestyle{empty}
186+
187+
\pagestyle{plain}
188+
177189
% Title page
178190
\input{title_page.tex}
179-
% Blank page
180-
\newpage
181-
\thispagestyle{empty}
182-
\mbox{}
183191

184192
% Acknowledgements
185193
\chapter*{Acknowledgments}
186194
\addcontentsline{toc}{chapter}{Acknowledgements}
187195
\input{acknowledgements}
188-
% You can add blank pages here, if you like
189196

190197
% ABSTRACT
191198
\chapter*{Resumo}
192199
\addcontentsline{toc}{chapter}{Resumo}
193200
\input{chapters/resumo}
194-
% And here
195201

196202
\chapter*{Abstract}
197203
\addcontentsline{toc}{chapter}{Abstract}
198204
\input{chapters/abstract}
199-
% And here as well
200-
\newpage\null\thispagestyle{empty}\newpage
201205

202206
% INSPIRATIONAL QUOTE
203207
% Setup
208+
\chapter*{}
204209
\setlength\epigraphwidth{12cm}
205210
\setlength\epigraphrule{0pt}
206211
\makeatletter
@@ -211,39 +216,37 @@ \chapter*{Abstract}
211216
\epigraph{"Intelligence is the ability to avoid doing work, yet getting the work done.”}
212217
{Linus Torvald}
213218
\vspace*{\fill}
214-
\newpage\null\thispagestyle{empty}\newpage
219+
215220
% TABLE OF CONTENTS
216221
\pagestyle{plain}
217222
\tableofcontents
223+
218224
% LIST OF ACRONYMS
219225
\chapter*{List of Acronyms}
220226
\addcontentsline{toc}{chapter}{List of Acronyms}
221227
\input{list_acronyms}
228+
222229
% LIST OF FIGURES
223230
\listoffigures
231+
224232
% LIST OF TABLES
225233
\listoftables
234+
226235
% BODY
227-
\newpage
228-
\thispagestyle{empty}
229-
\mbox{}
230-
\pagenumbering{arabic} % Arabic numbering starts
236+
\mainmatter
231237

238+
%-----------------CHAPTERS--------------------
232239
% For each chapter, you should have a bit of code that looks like this:
233240
% \label allows you to later \ref that chapter.
234241
% \input includes a different .tex file, so that you can have you dissertation
235242
% neatly partitioned into several files. I recommend one file per chapter.
236243

237-
238-
239-
%-----------------CHAPTERS--------------------
240-
241244
%-----CHAPTER1-INTRODUCTION-----
242245
\chapter{Introduction}
243246
\label{chap:introduction}
244247
\input{chapters/introduction}
245248

246-
% Add your necessary chapters
249+
% Add your chapters
247250

248251
%---SAMPLE---
249252
\chapter{Chapter}
@@ -257,12 +260,15 @@ \chapter{Chapter}
257260
\bibliography{bibliography/references.bib}
258261
\titleformat{\chapter}[display] % Return chapter titles to normal, taking up a whole page (cool for appendices)
259262
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
263+
264+
265+
%APPENDIX
260266
\begin{appendix} % Start appendices
261267
\chapter{Sample Appendix} % One chapter per appendix
262268
\label{app: sample appendix}
263269
\input{appendix/sample.tex}
270+
% To include pdf use this
264271
%\includepdf[pages={-}]{path/to/appendix.pdf}
265-
% or
266-
%\input{appendix_file}
272+
267273
\end{appendix}
268274
\end{document}

0 commit comments

Comments
 (0)