LaTeX forum ⇒ Theses, Books, Title pagesMasters/Doctoral Thesis- Page numbering, headers and footers Topic is solved

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

Masters/Doctoral Thesis- Page numbering, headers and footers  Topic is solved

Postby aswadson » Mon Feb 20, 2017 3:35 pm

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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \RequirePackage[markcase=used]{scrlayer-scrpage}
  2. \providepairofpagestyles{thesisSimple}{%
  3. \clearpairofpagestyles%
  4. \automark[chapter]{chapter}
  5. \ihead{\headmark}% Inner header
  6. \ohead*{}% Outer header
  7. }
  8. \ifoot{}% Inner footer
  9. \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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \RequirePackage[markcase=used]{scrlayer-scrpage}
  2. \providepairofpagestyles{thesisSimple}{%
  3. \clearpairofpagestyles%
  4. \automark[chapter]{chapter}
  5. \ihead{\headmark}% Inner header
  6. \ohead[\pagemark]{\pagemark}% Outer header
  7. }
  8. \ifoot{}% Inner footer
  9. \ofoot{}% Outer footer
  10. \pagestyle{thesisSimple}
  11. \providepairofpagestyles[thesisSimple]{thesis}{%
  12. \automark*[section]{}%
  13. }
  14. \providepairofpagestyles[thesisSimple]{review}{%
  15. \ofoot[\shorttitle/\authorname]{\shorttitle/\authorname}
  16. \ifoot[\today]{\today}
  17. }
  18. \pagestyle{thesis}
  19. \ifbool{headsepline}{\KOMAoption{headsepline}{true}}{}
  20. \PreventPackageFromLoading[\ClassError{\classname}{Package `fancyhdr' is
  21. incompatible\MessageBreak with this class}{The pagesyles are defined
  22. using package `scrlayer-scrpage', please consult the\MessageBreak
  23. KOMA-script documentation for details.}]{fancyhdr}
  24.  
  25.  
  26. \NewDocumentCommand{\blank@p@gestyle}{}{empty}
  27. \NewDocumentCommand{\blankpagestyle}{ m }{%
  28. \ClassWarning{\classname}{\string\blankpagestyle\space is
  29. obsolete,\MessageBreak use \string\setblankpagestyle \space instead}\DeclareDocumentCommand{\blank@p@gestyle}{}{#1}
  30. }
  31. \NewDocumentCommand{\setblankpagestyle}{ m }{\DeclareDocumentCommand{\blank@p@gestyle}{}{#1}}
  32.  
  33. \DeclareDocumentCommand\cleardoublepage{}{\clearpage\if@twoside \ifodd\c@page\else
  34. \hbox{}
  35. \thispagestyle{\blank@p@gestyle}
  36. \newpage
  37. \if@twocolumn\hbox{}\newpage\fi\fi\fi%
  38. }

Best Regards,

Haider Aswad

Tags:

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

Postby Johannes_B » Mon Feb 20, 2017 3:44 pm

After \mainmatter, use:
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \ohead*{}
  2. \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

Postby aswadson » Mon Feb 20, 2017 3:52 pm

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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \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: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Feb 20, 2017 7:17 pm

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

Postby aswadson » Mon Feb 20, 2017 8:04 pm

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

Postby Johannes_B » Mon Feb 20, 2017 8:11 pm

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

Postby aswadson » Mon Feb 20, 2017 8:19 pm

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

Postby Nafees » Thu May 23, 2019 6:38 pm

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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \providepairofpagestyles[thesisSimple]{thesis}{%
  2. \automark*[section]{}%
  3. }
  4. \providepairofpagestyles[thesisSimple]{review}{%
  5. \ofoot[\shorttitle/\authorname]{\shorttitle/\authorname}
  6. \ifoot[\today]{\today}
  7. }
  8. \pagestyle{thesis}
  9. \ifbool{headsepline}{\KOMAoption{headsepline}{true}}{}
  10. \PreventPackageFromLoading[\ClassError{\classname}{Package `fancyhdr' is
  11. incompatible\MessageBreak with this class}{The pagesyles are defined
  12. using package `scrlayer-scrpage', please consult the\MessageBreak
  13. KOMA-script documentation for details.}]{fancyhdr}
  14.  
  15.  
  16. \newcommand{\blank@p@gestyle}{empty}
  17. \newcommand{\chapter@p@gestyle}{plain}
  18. \NewDocumentCommand{\blankpagestyle}{ m }{%
  19. \ClassWarning{\classname}{\string\blankpagestyle\space is
  20. obsolete,\MessageBreak use \string\setblankpagestyle \space instead}\renewcommand{\blank@p@gestyle}{}{#1}
  21. }
  22. \NewDocumentCommand{\setblankpagestyle}{ m }{\renewcommand{\blank@p@gestyle}{#1}}
  23. \NewDocumentCommand{\setchapterpagestyle}{ m }{\renewcommand{\chapter@p@gestyle}{#1}}
  24.  
  25. \DeclareDocumentCommand\cleardoublepage{}{\clearpage\if@twoside \ifodd\c@page\else
  26. \hbox{}
  27. \thispagestyle{\blank@p@gestyle}
  28. \newpage
  29. \if@twocolumn\hbox{}\newpage\fi\fi\fi%
  30. }


I need to add the following characters given in the picture in my header:
Header.png
Header.png (38.34 KiB) Viewed 1692 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 1692 times

For this the following code I have used, but it could not work:
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \pagestyle{fancy} % all pages will follow same fancy header and footer style except title page
  2. \fancyhf{} % Clear header and footer
  3. \fancyhead[C]
  4. {\begin{CJK*}{UTF8}{gkai}
  5. \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*}}
  6. \fancyfoot[C]{\thepage}
  7. \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

Postby vides » Sun Aug 25, 2019 4:11 pm

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: 120
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Sun Aug 25, 2019 4:46 pm

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

However, try the optional argument of \chapter.


Return to “Theses, Books, Title pages”

Who is online

Users browsing this forum: No registered users and 3 guests