Theses, Books, Title pages ⇒ Chapter Header
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Chapter Header
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Chapter Header
scrlayer-scrpage
, no class, that was an indication for me.If not, it's an indication that a KOMA-Script based template would really be recommendable.

Not checked if it works with
scrbase
and scrhack
, that was loaded more far above.Stefan
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Chapter Header
Edit: I should note that
\abovechapterskip
is defined since versioin 2.4 of the template, dating november 2016.-
- Posts: 15
- Joined: Wed Oct 19, 2016 6:30 am
Chapter Header
First of all I would like to thank both of you for your kind and sincere suggestion. But, I have updated the .cls file only after changing the name of the class file to "MastersDoctoralThesis_UoM."
Regarding, the last request of removing un-necessary space above contents, list of tables, list of figures and chapter is not yet solved. Please find the small piece of code below and help me out in this regard.
\renewcommand{\abovechapterspace}{\vspace{0pt}}
\usepackage{titlesec}
\titleformat{\chapter}[display]
%{\normalfont\huge\bfseries\raggedleft}{%
%\chaptertitlename\ \thechapter\\[3.5ex]\titlerule}
{\normalfont\huge\bfseries\raggedleft}{\chaptertitlename\ \thechapter \\ \hrulefill}
{24pt}{\Huge}
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Chapter Header
\titlespacing*{\chapter}{0cm}{-\topskip}{2\baselineskip}[0pt]
With an unmodified and up to date version of the template, this can be done with just three (or four) lines of code.
Code: Select all
\renewcommand{\abovechapterskip}{}
\renewcommand{\chapterinbetweenskip}{\rule{\linewidth}{.4pt}\par}
\renewcommand{\chapteralign}{\raggedleft}
\renewcommand{\chapterprefixfont}{\huge\bfseries}
-
- Posts: 15
- Joined: Wed Oct 19, 2016 6:30 am
Chapter Header
Thank you sir, the single line code worked fine.
One more clarification related to heading, we need to add horizontal line below the table of contents, list of figure, and list of tables just similar to chapter title. Please help me out in this regard. The following is the sample code:
Code: Select all
\documentclass[
12pt, % The default document font size, options: 10pt, 11pt, 12pt
oneside, % Two side (alternating margins) for binding by default, uncomment to switch to one side
english, % ngerman for German
onehalfspacing, % Single line spacing, alternatives: onehalfspacing or doublespacing
%draft, % Uncomment to enable draft mode (no pictures, no links, overfull hboxes indicated)
nolistspacing, % If the document is onehalfspacing or doublespacing, uncomment this to set spacing in lists to single
%liststotoc, % Uncomment to add the list of figures/tables/etc to the table of contents
%toctotoc, % Uncomment to add the main table of contents to the table of contents
parskip, % Uncomment to add space between paragraphs
%nohyperref, % Uncomment to not load the hyperref package
%headsepline, % Uncomment to get a line under the header
]
\usepackage{titlesec}
\titleformat{\chapter}[display]
%{\normalfont\huge\bfseries\raggedleft}{%
%\chaptertitlename\ \thechapter\\[3.5ex]\titlerule}
{\normalfont\huge\bfseries\raggedleft}{\chaptertitlename\ \thechapter \\ \hrulefill}
{24pt}{\Huge}
\titlespacing*{\chapter}{0cm}{-2\topskip}{2\baselineskip}[0pt] % TO REMOVE TOP SPACE AND BASELINE SPACE OF CHAPTER, TABLE OF CONTENTS, FIGURES, AND TABLES
%----------------------------------------------------------------------------------------
% LIST OF CONTENTS/FIGURES/TABLES PAGES
%----------------------------------------------------------------------------------------
\tableofcontents % Prints the main table of contents
\listoffigures % Prints the list of figures
\listoftables % Prints the list of tables
\end{document}
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Chapter Header
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Chapter Header
Code: Select all
\documentclass[12pt,oneside,english,onehalfspacing,nolistspacing,parskip]{book}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\raggedleft}{\chaptertitlename\ \thechapter \\ \hrulefill}
{24pt}{\Huge}
\titleformat{name=\chapter,numberless}[block]
{\normalfont\huge\bfseries\raggedleft}{}
{24pt}{\Huge}[\hrulefill]
\newcommand*{\NumberingOff}{\setcounter{secnumdepth}{-1}}
\newcommand*{\NumberingOn}{\setcounter{secnumdepth}{2}}
\titlespacing*{\chapter}{0cm}{-2\topskip}{2\baselineskip}[0pt]
\begin{document}
\NumberingOff
\tableofcontents
\listoffigures
\listoftables
\NumberingOn
\chapter{First One}
\end{document}