Theses, Books, Title pagesMasters/Doctoral Thesis- Page numbering, headers and footers

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
aswadson
Posts: 12
Joined: Mon Feb 20, 2017 12:46 pm

Masters/Doctoral Thesis- Page numbering, headers and footers

Post by aswadson »

Hey everyone,
I am writing to you regarding the thesis template MastersDoctoralThesis. Unfortunately, my school (KTH) wants the placement of the numbers to be in the bottom of the page, I tried to do it but failed could you please help me?

The first thing I tried to do was to put the \pagemark in the \ofoot in the above code but it did not work, I did the following:

Code: Select all

\RequirePackage[markcase=used]{scrlayer-scrpage}
\providepairofpagestyles{thesisSimple}{%
\clearpairofpagestyles%
\automark[chapter]{chapter}
\ihead{\headmark}% Inner header
\ohead*{}% Outer header
}
\ifoot{}% Inner footer
\ofoot*{\pagemark}% Outer footer
The next thing was to try to use The Fancyhdr package but failed again because I noticed that the code below prevent Fancyhdr to be used, so naturally, I tried to fix it by commenting it out (the prevention) but due to my lack of knowledge in Latex (as this is my first time using it) I failed again! I am using Overleaf, the version of the template is Version 1.5 (22/11/16). I know that this is not a problem with the template, but I really tried to fix this problem alone but unfortunately have not succeeded yet and are in desperate need for help.

Code: Select all

\RequirePackage[markcase=used]{scrlayer-scrpage}
\providepairofpagestyles{thesisSimple}{%
\clearpairofpagestyles%
\automark[chapter]{chapter}
\ihead{\headmark}% Inner header
\ohead[\pagemark]{\pagemark}% Outer header
}
\ifoot{}% Inner footer
\ofoot{}% Outer footer
\pagestyle{thesisSimple}
\providepairofpagestyles[thesisSimple]{thesis}{%
\automark*[section]{}%
}
\providepairofpagestyles[thesisSimple]{review}{%
\ofoot[\shorttitle/\authorname]{\shorttitle/\authorname}
\ifoot[\today]{\today}
}
\pagestyle{thesis}
\ifbool{headsepline}{\KOMAoption{headsepline}{true}}{}
\PreventPackageFromLoading[\ClassError{\classname}{Package `fancyhdr' is
incompatible\MessageBreak with this class}{The pagesyles are defined 
using package `scrlayer-scrpage', please consult the\MessageBreak 
KOMA-script documentation for details.}]{fancyhdr}


\NewDocumentCommand{\blank@p@gestyle}{}{empty}
\NewDocumentCommand{\blankpagestyle}{ m }{%
\ClassWarning{\classname}{\string\blankpagestyle\space is
obsolete,\MessageBreak use \string\setblankpagestyle \space instead}\DeclareDocumentCommand{\blank@p@gestyle}{}{#1}
}
\NewDocumentCommand{\setblankpagestyle}{ m }{\DeclareDocumentCommand{\blank@p@gestyle}{}{#1}}

\DeclareDocumentCommand\cleardoublepage{}{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\thispagestyle{\blank@p@gestyle}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi%
}
Best Regards,

Haider Aswad

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

Masters/Doctoral Thesis- Page numbering, headers and footers

Post by Johannes_B »

After \mainmatter, use:

Code: Select all

\ohead*{}
\ofoot*{\pagemark}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
aswadson
Posts: 12
Joined: Mon Feb 20, 2017 12:46 pm

Masters/Doctoral Thesis- Page numbering, headers and footers

Post by aswadson »

Thank you so much it did solve the problem! How can I have it so that the number is in the center of the footer and not in the right or left of the footer?

I tried this:

Code: Select all

\cfoot*{\pagemark}
but it didn't work. Sorry for the inconvenience.

Edit: I tried it again and it did work :D Thank you so much for the fast reply :D
Last edited by aswadson on Mon Feb 20, 2017 8:28 pm, edited 1 time in total.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Masters/Doctoral Thesis- Page numbering, headers and footers

Post by Johannes_B »

Nice to hear that it works.
You can also have a look at the unofficial quick manual, if you like.

By the way, KTH provides own templates, the one on Overleaf seems to provide just the titlepage.

By the way, I added proper code markup in our posts above. ;-)

Off-topic: Professor Seetharaman was a visiting professor in Freiberg/Saxony a few years ago. Very interesting lectures.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
aswadson
Posts: 12
Joined: Mon Feb 20, 2017 12:46 pm

Masters/Doctoral Thesis- Page numbering, headers and footers

Post by aswadson »

Yes, I tried to find a proper KTH Thesis template but I only found a Word template and some guidelines regarding the Latex Template, That is why I didn't bother with it.

I am going to use the Title page template later on. Yes, I noticed that it looks much better now.

Do you study metallurgy?

By the way, I want to Include an A3 pdf in the appendix how is that done?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Masters/Doctoral Thesis- Page numbering, headers and footers

Post by Johannes_B »

Matrials science, but i am also interested in other stuff.

Including a pdf file: New question, new topic ;-)
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
aswadson
Posts: 12
Joined: Mon Feb 20, 2017 12:46 pm

Masters/Doctoral Thesis- Page numbering, headers and footers

Post by aswadson »

haha I knew that I have to post a new question haha but was a bit lazy :D Alright I will post it :D Sounds nice, it is so easy to find a job for people with your background here in Sweden and with good salaries :D I studied Mechanical Engineering :D
Nafees
Posts: 3
Joined: Thu May 23, 2019 6:05 pm

Masters/Doctoral Thesis- Page numbering, headers and footers

Post by Nafees »

Hey! I am using the same MasterDoctrolThesis.cls format to write my thesis. This format shows the chapter name and heading of the current page in the header. I want to add Chinese specific character on each page of my thesis. The code of MasterDoctrolThesis.cls for a header is:

Code: Select all

\providepairofpagestyles[thesisSimple]{thesis}{%
    \automark*[section]{}%
}
\providepairofpagestyles[thesisSimple]{review}{%
    \ofoot[\shorttitle/\authorname]{\shorttitle/\authorname}
    \ifoot[\today]{\today}
}
\pagestyle{thesis}
\ifbool{headsepline}{\KOMAoption{headsepline}{true}}{}
\PreventPackageFromLoading[\ClassError{\classname}{Package `fancyhdr' is
incompatible\MessageBreak with this class}{The pagesyles are defined 
    using package `scrlayer-scrpage', please consult the\MessageBreak 
KOMA-script documentation for details.}]{fancyhdr}


\newcommand{\blank@p@gestyle}{empty}
\newcommand{\chapter@p@gestyle}{plain}
\NewDocumentCommand{\blankpagestyle}{ m }{%
    \ClassWarning{\classname}{\string\blankpagestyle\space is
    obsolete,\MessageBreak use \string\setblankpagestyle \space  instead}\renewcommand{\blank@p@gestyle}{}{#1}
}
\NewDocumentCommand{\setblankpagestyle}{ m }{\renewcommand{\blank@p@gestyle}{#1}}
\NewDocumentCommand{\setchapterpagestyle}{ m }{\renewcommand{\chapter@p@gestyle}{#1}}

\DeclareDocumentCommand\cleardoublepage{}{\clearpage\if@twoside \ifodd\c@page\else
    \hbox{}
    \thispagestyle{\blank@p@gestyle}
    \newpage
    \if@twocolumn\hbox{}\newpage\fi\fi\fi%
}
I need to add the following characters given in the picture in my header:
Header.png
Header.png (38.34 KiB) Viewed 16817 times
and need to put just red line with the page number footer like showing in the below given picture
Footer.png
Footer.png (21.75 KiB) Viewed 16817 times
For this the following code I have used, but it could not work:

Code: Select all

\pagestyle{fancy} % all pages will follow same fancy header and footer style except title page
\fancyhf{} % Clear header and footer
\fancyhead[C]
{\begin{CJK*}{UTF8}{gkai}
        \fontsize{20}{20} \textbf{华\hspace{0.5cm}中\hspace{0.5cm}科\hspace{0.5cm}技\hspace{0.5cm}大\hspace{0.5cm}学\hspace{0.5cm}研\hspace{0.5cm}究\hspace{0.5cm}生\hspace{0.5cm}院} \end{CJK*}}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.7pt} % Line at the header visible
How should I do this? Please help me out to this problem?
vides
Posts: 3
Joined: Sun Aug 25, 2019 3:46 pm

Masters/Doctoral Thesis- Page numbering, headers and footers

Post by vides »

Hi!

I want to know how to shorten the size of the header chapter title because it is very long and step on the page number (@MasterDoctoralThesis Template)

Thanks! :)
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Masters/Doctoral Thesis- Page numbering, headers and footers

Post by Ijon Tichy »

@vides You should ask a new question for this. This thread is already too complex.

However, try the optional argument of \chapter.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply