1

I am using a custom documentclass provided by my school for writing my thesis, which is a modification of the documentclass book. They also give a template, which includes the line

\pagestyle{headings}

When this is activated, each page (that doesn't begin a chapter) has the chapter title across the top, and the page number at the top right. When the chapter title is long, it runs right into the page number, even overlapping it. When this is deactivated, I lose the entire heading, including the chapter title and page number.

I am aware of ways of overriding the documentclass file such as by specifying a different pagestyle (such as plain or fancy), but these also override my header.

I want to keep the chapter titles at the top of the page, but move the page number to the bottom. Do I need to edit the documentclass file, or is there a way to just redefine what "headings" does?

I know nothing about writing documentclass files but my guess is that I can get the desired effect by altering a portion of it that looks like this:

 \def\ps@headings{%
      \let\@oddfoot\@empty\let\@evenfoot\@empty
      \def\@evenhead{\thepage\hfil\slshape\leftmark}%
      \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
      \let\@mkboth\markboth
    \def\chaptermark##1{%
      \markboth {\MakeUppercase{%
        \ifnum \c@secnumdepth >\m@ne
          \if@mainmatter
            \@chapapp\ \thechapter. \ %
          \fi
        \fi
        ##1}}{}}%
    \def\sectionmark##1{%
      \markright {\MakeUppercase{%
        \ifnum \c@secnumdepth >\z@
          \thesection. \ %
        \fi
9
  • 1
    The class that you are using is unknown, but probably there should work an optional argument: \chapter[short title]{full title}.
    – Kola B.
    Dec 17, 2015 at 6:48
  • That does work, and is a great alternative. If it is too involved to move the page numbers I will do this instead.
    – j0equ1nn
    Dec 17, 2015 at 6:50
  • Ooh, one thing I don't like about it though is it also changes the title in my table of contents. I'm okay with abbreviating at the top of a page but I prefer to have the full chapter titles in that.
    – j0equ1nn
    Dec 17, 2015 at 6:51
  • Also the document class is a modification of "book." I will insert this in the question.
    – j0equ1nn
    Dec 17, 2015 at 6:53
  • 1
    Maybe this solution: tex.stackexchange.com/questions/6862/… would be useful for you?
    – Kola B.
    Dec 17, 2015 at 6:54

1 Answer 1

2

There are different ways. You can patch the original code to place the page number at the bottom. Or patch it to wrap longer chapter tites (example at the bottom). Other ways might be to remove the string CHAPTER or to remove all this uppercasing altogether.

All of those are changing the output of the template. Either way, using a package is better than patching low level commands:

\documentclass[11pt,a5paper]{book}
\usepackage{geometry}
\usepackage{blindtext}
\usepackage{scrlayer-scrpage}
\ohead{}
\cfoot{\pagemark}
\begin{document}
\chapter{Wombats are cute and cuddly, just like ducks}
\blindtext[3]
\end{document}

Wrapping the title:

\documentclass[11pt,a5paper]{book}
\usepackage{geometry}
\usepackage{blindtext}
\usepackage{etoolbox}
\tracingpatches
\makeatletter
\patchcmd{\@evenhead}{\leftmark}{\parbox[t]{.9\linewidth}{\leftmark}}{}{}
\makeatother
\begin{document}
\chapter{Wombats are cute and cuddly, just like ducks}
\blindtext[3]
\end{document}

j0eq1nnHeaderFooter

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .