3

I am writing a thesis and my university requirements are to use 14pt fontsize for the body text with 1.5 line spacing. They require the chapter headings and the word CHAPTER #N to be in ALL CAPS, however the running header should be in Title Format. Here is a picture of what I need:

enter image description here

So far, I was able to accomplish the following:

enter image description here

Now I need the running headers to be in Title Format as given by first picture. The following is the code I wrote to center the chapter headings and change the default running headers of the book class. But I was unsuccessful in getting the running headers as in the first picture.

\documentclass[a4paper,oneside,14pt]{extbook}
\usepackage{newtxtext}
\usepackage{setspace}
\usepackage[top=25mm,bottom=25mm,right=25mm,left=30mm]{geometry}
\usepackage{lipsum}
\renewcommand{\chaptername}{CHAPTER}
\renewcommand{\contentsname}{TABLE OF CONTENTS}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\addtolength{\headheight}{0pt}
\lhead{\itshape  \chaptername ~\thechapter}
\rhead{\itshape  \leftmark}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}} % remove "Chapter N." prefix
\cfoot{\thepage}

%% Center Chapter Headings in both front and main matter.
\makeatletter
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \centering\normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
         \huge\bfseries \@chapapp\space \thechapter
        \par\nobreak
        \vskip 20\p@
      \fi
    \fi
    \interlinepenalty\@M
     \huge \bfseries #1\par\nobreak
    \vskip 40\p@
  }}
\def\@makeschapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \centering
    \normalfont
    \interlinepenalty\@M
    \huge \bfseries  #1\par\nobreak
    \vskip 40\p@
  }}
\makeatother


\begin{document}
\begin{titlepage}
\centering
Some Info here.
\end{titlepage}
\frontmatter
\chapter{DEDICATION}
\chapter{ACKNOWLEDGMENTS}
\chapter{ABSTRACT}
\tableofcontents
\chapter{LIST OF ABBREVIATIONS}
\chapter{LIST OF FIGURES}
\chapter{LIST OF TABLES}

\mainmatter
\onehalfspacing
\chapter{INTRODUCTION}
\section{First Section}
\lipsum[2-16]

\chapter{RECOMMENDATIONS AND FUTURE WORK}

\singlespacing
\begin{thebibliography}{100}
\end{thebibliography}
\end{document} 

I appreciate your suggestions.

  • Ok, I was able to change the lhead to the following: \lhead{\itshape Chapter ~\thechapter}. Now what about the rhead? I add \nouppercase with no effect! – AboAmmar Oct 19 '14 at 0:32
  • Are you sure that you haven't misread something? 14pt and onehalfspacing for the text body will cause nightmares to every typographer in this universe. – Ruben Oct 19 '14 at 1:00
  • Try to use titlesec instead of redefining \@makechapterhead and his little fellow. – Ruben Oct 19 '14 at 1:02
  • @Ruben Yes, I absolutely agree. But this is the thing. And, BTW, they don't use LaTeX, but Office!! – AboAmmar Oct 19 '14 at 1:02
2

textcase is your friend here. I would not hardcode the uppercasing in the titles itself for several reasons. The main reason is that uppercasing them makes it impossible to have no uppercased titles in the header - what you try to achieve. Unfortunately you can't use titlsec because you need to uppercase in the redefinition of the chapter-head (when you don't hardcode the uppercasing in the titles itself!). Here is the code:

\documentclass[a4paper,oneside,14pt]{extbook}
\usepackage{newtxtext}
\usepackage{setspace}
\usepackage[top=25mm,bottom=25mm,right=25mm,left=30mm]{geometry}
%\usepackage{titlesec}
%  \titleformat{\chapter}[display]{\centering\normalfont\huge\bfseries}
%    {\MakeUppercase{\chaptertitlename}\ \thechapter}{20pt}{\huge}
\usepackage{fancyhdr}
  \pagestyle{fancy}
  \fancyhf{}
%  \addtolength{\headheight}{0pt}% obsolete
  \lhead{\itshape  \chaptername~\thechapter}
  \rhead{\itshape  \nouppercase{\leftmark}} %\nouppercase !
  \renewcommand{\chaptermark}[1]{\markboth{#1}{}}
  \cfoot{\thepage}

\usepackage{textcase}

\makeatletter
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \centering\normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
         \huge\bfseries \MakeTextUppercase{\@chapapp}\space \thechapter
        \par\nobreak
        \vskip 20\p@
      \fi
    \fi
    \interlinepenalty\@M
     \huge \bfseries \MakeTextUppercase{#1}\par\nobreak
    \vskip 40\p@
  }}
\def\@makeschapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \centering
    \normalfont
    \interlinepenalty\@M
    \huge \bfseries  \MakeTextUppercase{#1}\par\nobreak
    \vskip 40\p@
  }}
\makeatother

%\renewcommand{\chaptername}{CHAPTER}
%\renewcommand{\contentsname}{TABLE OF CONTENTS}

\usepackage{lipsum}

\begin{document}
\frontmatter

\chapter{Dedication}

\tableofcontents

\chapter{List of Abbreviations}

\mainmatter
  \onehalfspacing
\chapter{Introduction}
\section{First Section}
\lipsum[2-16]

%\singlespacing
%\begin{thebibliography}{100}
%\end{thebibliography}
\end{document}

Note that I included the titlesec attempt as uncommented code lines.

enter image description here

  • 1
    No need for textcase, BTW. We can just use MakeUppercase instead of your MakeTextUppercase and it works fine. – AboAmmar Oct 19 '14 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.