LaTeX forum ⇒ Page LayoutFormatting of chapter titles

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm

Formatting of chapter titles

Postby Seanshine » Sat May 12, 2018 1:03 pm

Dear Readers,

I've got a questions with regards to the MastersDoctoralThesis.cls file. Namely, I would like the prefix 'Chapter X' removed and only show the chapter name instead. For example, 'Chapter 1; Introduction' -> '1 Introduction'.

Thanks in advance.

PS. I've tried to use,
  1. \addchap{Introduction}
, however it messes up the chapter numbering.

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

Postby Johannes_B » Sat May 12, 2018 1:30 pm

  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. % Masters/Doctoral Thesis
  3. % LaTeX Template
  4. % Version 2.5 (27/8/17)
  5. %
  6. % This template was downloaded from:
  7. % <!-- m --><a class="postlink" href="http://www.LaTeXTemplates.com">http://www.LaTeXTemplates.com</a><!-- m -->
  8. %
  9. % Version 2.x major modifications by:
  10. % Vel (vel@latextemplates.com)
  11. %
  12. % This template is based on a template by:
  13. % Steve Gunn (http://users.ecs.soton.ac.uk/srg/softwaretools/document/templates/)
  14. % Sunil Patel (http://www.sunilpatel.co.uk/thesis-template/)
  15. %
  16. % Template license:
  17. % CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
  18. %
  19. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  20. \documentclass[
  21. english, % ngerman for German
  22. chapterinoneline, % Uncomment to place the chapter title next to the number on one line
  23. ]{MastersDoctoralThesis} % The class file specifying the document structure
  24. \usepackage{blindtext}
  25. \renewcommand{\chaptermarkformat}{\thechapter\space}
  26. \begin{document}
  27. \chapter{Wombat}
  28. \blindtext[10]
  29. \end{document}


Package scrlayer-scrpage is used to define the headers and footers.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm

Postby Seanshine » Sat May 12, 2018 4:07 pm

@Johannes_B Hero!

One more question: where would one place \renewcommand{\chaptermarkformat}{\thechapter\space}? And what is its use?

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

Postby Johannes_B » Sat May 12, 2018 4:12 pm

In the document preamble as shown.

It's use? It formats the chapter mark to what you want.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm

Postby Seanshine » Sat May 12, 2018 4:23 pm

Ah. Great.

I was in doubt whether to change the .cls file or the main.tex whenever one wants to make any changes. But from my understanding one has to make adaptions only in the main.tex, correct?

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

Postby Johannes_B » Sat May 12, 2018 4:26 pm

Yes, this is correct. There is no need to change the class file at all. This is by design in LaTeX.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm

Postby Seanshine » Sat May 12, 2018 4:33 pm

Finally I understand. So when I want to change the header to '1 Introduction Author p. X', what code would one insert and where within the main.tex?

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

Postby Johannes_B » Sat May 12, 2018 4:47 pm

\ihead{\headmark\space Author p. X} in the preamble.

All customization is done in the preamble.

You need to read an introduction to learn LaTeX which is needed to use the template.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm

Postby Seanshine » Sat May 12, 2018 4:58 pm

'The Not So Short Introduction to LaTeX', I will go through that step by step.

Thanks for the support.


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 4 guests