0

I am using a custom .cls file with its own implementation for running text in headers in the corners of all but the first page. The .cls file I am using was taken from this Overleaf template: https://www.overleaf.com/latex/templates/dagstuhl-seminar-report-template/fptyrrjnkpgg

This seems to includes its own custom implementation for running titles in headers (running title on even pages, authors on odd pages), using commands like:

\titlerunning{Running Title}
\authorrunning{Running Authors}

So it does NOT seem to be using custom packages like fancyhdr.

The example on that page recommends using \bibliographystyle{plain}, but that results in numbered citations like [1], [2], etc., and a different formatting of References from what I like. I prefer using apacite, or something similar, as long as it leads to References organised in alphabetical ordering, and with support for in-text citations in the following two formats:

  • (Authors, Year)
  • Authors (Year)

My problem is: when diverting from the recommended \bibliographystyle{plain} (e.g. using \bibliographystyle{apacite}), the running header on the page where References start being listed is replaced with the word "References", whereas I'd prefer to keep the original text (title or authors, depending on whether it is an even or an odd page).


Because the problem seems to be closely related to a specific, custom .cls file, I think the easiest way to share a minimum working example is a link to an Overleaf project, so I prepared this link: https://www.overleaf.com/read/chsbcjbbkzfq . I tweaked the .cls file slightly to get rid of the footer with license, logo and all that, such that I did not have to copy those images over into the MWE.

I can also include the .tex source of the minimum working example here, but it does not include the full .cls file:

\documentclass[a4paper,UKenglish]{dagrep}
\usepackage[utf8]{inputenc}

\usepackage{apacite}
\bibliographystyle{apacite}

\usepackage{lipsum}

\title{Title}
\titlerunning{Running Title}
\author{Author}
\authorrunning{Running Authors}

\begin{document}
\maketitle

\lipsum[1-3]
\newpage
\citeA{article-minimal}.
\newpage
\lipsum[1-3]
\newpage
\lipsum[1-3]
\newpage

\bibliography{xampl}

\end{document}

The intended behaviour would be that the top-left corner of page 5 says "Running Authors" (since it's on an odd page), rather than "References".

Note that if we comment out \usepackage{apacite}, modify the bibliography style to \bibliographystyle{plain}, and change the \citeA{} to \cite, the header on the last page gets fixed, but then I don't have the bibliography style that I want.

1 Answer 1

0

I have not found a "clean" solution, but I did find a "hacky" solution for the particular .cls file used in this project.

In the linked Overleaf project, the running headers are implemented by lines 277-280 of the dagrep.cls file:

    \def\@evenhead{\large\sffamily\bfseries
                   \llap{\hbox to0.5\oddsidemargin{\thepage\hss}}\leftmark\hfil}%
    \def\@oddhead{\large\sffamily\bfseries\rightmark\hfil
                  \rlap{\hbox to0.5\oddsidemargin{\hss\thepage}}}%

Specifically, the \leftmark and \rightmark parts end up producing the text that is printed, and these start turning into the text "References" which is not desired.

The hacky fix is to simply directly replace those two words with the hardcoded running headers that we want. It's ugly since they will no longer cleanly be extracted from the \titlerunning and \authorrunning commands used in the .tex file, but it works. The above lines would then look like:

    \def\@evenhead{\large\sffamily\bfseries
                   \llap{\hbox to0.5\oddsidemargin{\thepage\hss}}Running Title\hfil}%
    \def\@oddhead{\large\sffamily\bfseries Running Authors\hfil
                  \rlap{\hbox to0.5\oddsidemargin{\hss\thepage}}}%

You must log in to answer this question.

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