LaTeX forum ⇒ Page Layout ⇒ Formatting of chapter titles

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

Formatting of chapter titles

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'.

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

Johannes_B
Site Moderator
Posts: 3725
Joined: Thu Nov 01, 2012 4:08 pm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Masters/Doctoral Thesis % LaTeX Template% Version 2.5 (27/8/17)%% This template was downloaded from:% <!-- m --><a class="postlink" href="http://www.LaTeXTemplates.com">http://www.LaTeXTemplates.com</a><!-- m -->%% Version 2.x major modifications by:% Vel (vel@latextemplates.com)%% This template is based on a template by:% Steve Gunn (http://users.ecs.soton.ac.uk/srg/softwaretools/document/templates/)% Sunil Patel (http://www.sunilpatel.co.uk/thesis-template/)%% Template license:% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\documentclass[english, % ngerman for Germanchapterinoneline, % Uncomment to place the chapter title next to the number on one line]{MastersDoctoralThesis} % The class file specifying the document structure\usepackage{blindtext}\renewcommand{\chaptermarkformat}{\thechapter\space}\begin{document}\chapter{Wombat}\blindtext[10]\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: 12
Joined: Sat Apr 28, 2018 9:59 pm
@Johannes_B Hero!

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

Johannes_B
Site Moderator
Posts: 3725
Joined: Thu Nov 01, 2012 4:08 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: 12
Joined: Sat Apr 28, 2018 9:59 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?

Johannes_B
Site Moderator
Posts: 3725
Joined: Thu Nov 01, 2012 4:08 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: 12
Joined: Sat Apr 28, 2018 9:59 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?

Johannes_B
Site Moderator
Posts: 3725
Joined: Thu Nov 01, 2012 4:08 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: 12
Joined: Sat Apr 28, 2018 9:59 pm
'The Not So Short Introduction to LaTeX', I will go through that step by step.

Thanks for the support.