LaTeX forum ⇒ Theses, Books, Title pagesChapter Header

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
User avatar
Johannes_B
Site Moderator
Posts: 3457
Joined: Thu Nov 01, 2012 4:08 pm

Chapter Header

Postby Johannes_B » Sun Jun 11, 2017 1:46 pm

No Stefan, this won't work. The template does not use a KOMA-script class.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8296
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sun Jun 11, 2017 1:54 pm

In the code snippet of the previous post I saw it starting with 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
Site admin

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

Postby Johannes_B » Sun Jun 11, 2017 2:09 pm

The class never changed, it stayed with book. But some packages of the KOMA-bundle have been included, some commands have been added that resemble KOMA-commands (but do far less of the compicated stuff).

Edit: I should note that \abovechapterskip is defined since versioin 2.4 of the template, dating november 2016.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

vinaykumarn
Posts: 15
Joined: Wed Oct 19, 2016 6:30 am

Postby vinaykumarn » Fri Jun 16, 2017 4:15 pm

Respected sir,

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}

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

Postby Johannes_B » Fri Jun 16, 2017 6:33 pm

This still is not a minimal working example, but nevermind. How should have anyone guessed, that you are using package titlesec? What you are looking for is
\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.
  1. \renewcommand{\abovechapterskip}{}
  2. \renewcommand{\chapterinbetweenskip}{\rule{\linewidth}{.4pt}\par}
  3. \renewcommand{\chapteralign}{\raggedleft}
  4. \renewcommand{\chapterprefixfont}{\huge\bfseries}

Which brings me back a few months.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

vinaykumarn
Posts: 15
Joined: Wed Oct 19, 2016 6:30 am

Postby vinaykumarn » Wed Jun 21, 2017 10:40 am

Respected Sir,

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:

  1. \documentclass[
  2. 12pt, % The default document font size, options: 10pt, 11pt, 12pt
  3. oneside, % Two side (alternating margins) for binding by default, uncomment to switch to one side
  4. english, % ngerman for German
  5. onehalfspacing, % Single line spacing, alternatives: onehalfspacing or doublespacing
  6. %draft, % Uncomment to enable draft mode (no pictures, no links, overfull hboxes indicated)
  7. nolistspacing, % If the document is onehalfspacing or doublespacing, uncomment this to set spacing in lists to single
  8. %liststotoc, % Uncomment to add the list of figures/tables/etc to the table of contents
  9. %toctotoc, % Uncomment to add the main table of contents to the table of contents
  10. parskip, % Uncomment to add space between paragraphs
  11. %nohyperref, % Uncomment to not load the hyperref package
  12. %headsepline, % Uncomment to get a line under the header
  13. ]
  14.  
  15. \usepackage{titlesec}
  16. \titleformat{\chapter}[display]
  17. %{\normalfont\huge\bfseries\raggedleft}{%
  18. %\chaptertitlename\ \thechapter\\[3.5ex]\titlerule}
  19. {\normalfont\huge\bfseries\raggedleft}{\chaptertitlename\ \thechapter \\ \hrulefill}
  20. {24pt}{\Huge}
  21.  
  22. \titlespacing*{\chapter}{0cm}{-2\topskip}{2\baselineskip}[0pt] % TO REMOVE TOP SPACE AND BASELINE SPACE OF CHAPTER, TABLE OF CONTENTS, FIGURES, AND TABLES
  23.  
  24. %----------------------------------------------------------------------------------------
  25. % LIST OF CONTENTS/FIGURES/TABLES PAGES
  26. %----------------------------------------------------------------------------------------
  27.  
  28. \tableofcontents % Prints the main table of contents
  29.  
  30. \listoffigures % Prints the list of figures
  31.  
  32. \listoftables % Prints the list of tables
  33.  
  34.  
  35. \end{document}
Last edited by Stefan Kottwitz on Wed Jun 21, 2017 12:31 pm, edited 1 time in total.
Reason: code marked

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

Postby Johannes_B » Wed Jun 21, 2017 4:08 pm

The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8296
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Wed Jun 21, 2017 4:28 pm

Here is an example:

  1. \documentclass[12pt,oneside,english,onehalfspacing,nolistspacing,parskip]{book}
  2. \usepackage{titlesec}
  3. \titleformat{\chapter}[display]
  4. {\normalfont\huge\bfseries\raggedleft}{\chaptertitlename\ \thechapter \\ \hrulefill}
  5. {24pt}{\Huge}
  6. \titleformat{name=\chapter,numberless}[block]
  7. {\normalfont\huge\bfseries\raggedleft}{}
  8. {24pt}{\Huge}[\hrulefill]
  9. \newcommand*{\NumberingOff}{\setcounter{secnumdepth}{-1}}
  10. \newcommand*{\NumberingOn}{\setcounter{secnumdepth}{2}}
  11. \titlespacing*{\chapter}{0cm}{-2\topskip}{2\baselineskip}[0pt]
  12. \begin{document}
  13. \NumberingOff
  14. \tableofcontents
  15. \listoffigures
  16. \listoftables
  17. \NumberingOn
  18. \chapter{First One}
  19. \end{document}


Stefan
Site admin


Return to “Theses, Books, Title pages”

Who is online

Users browsing this forum: No registered users and 1 guest