ulyngs / oxforddown

Template for writing an Oxford University thesis in R Markdown; uses the OxThesis LaTeX template and was inspired by thesisdown.
https://ulyngs.github.io/oxforddown/
MIT License
220 stars 81 forks source link

Incorrect section header at top of page in references #63

Closed JanaMuschinski closed 1 year ago

JanaMuschinski commented 1 year ago

I found this issue in my own doc and tested in the most current version on the repository by adding in a bunch of citations to confirm it's an issue there as well.

When the references go across more than one page, the following pages have the faint section header of the previous section ("B. Second Appendix for Fun" in the case of the template) at the top where it should say "References". This wasn't an issue in an earlier version from March, but I can't get that version of the template to work because I was having problems with biblatex and it compiles better with pandoc citations using the newest version. Issue persists if you compile with biblatex citation package.

Would love to include section headers if this can be sorted, but otherwise I'll omit them :)

ulyngs commented 1 year ago

Ah interesting -- not entirely sure I understand correctly, can you add a few screenshots and/or provide a minimal reproducible example?

JanaMuschinski commented 1 year ago

Here you go!

From my own document - see header highlighted; it's showing the name of my last appendix, rather than "References" image

From the template, but with added references so it extends past one page: image

For a reproducible example - if you add further citations to your Oxforddown template so that the references/work cited page extends beyond one page in length you'll be able to see it on any pages after the first reference page.

JanaMuschinski commented 1 year ago

Compared to a previous document made using the template when downloaded in March: image

ulyngs commented 1 year ago

Fixed!

(As per https://tex.stackexchange.com/questions/78088/headers-of-chapters-take-the-headers-of-their-previous-chapter, I have added this to the end of the oxforddown latex template, which sets the right and left hand section headers in the reference section to whatever is provided as the references heading in index.Rmd)

% set the section header to the references heading
\markboth{$params.referenceHeading$}{}

Can you confirm if this fix works for you?

(Apparently this is a long-standing issue with how pandoc handles section headers, where pandoc has avoided an opinionated, hard-coded solution as this could interfere with flexibility some authors might want, see https://github.com/jgm/pandoc/issues/1632 and https://github.com/rstudio/bookdown/issues/1382)

ulyngs commented 1 year ago

I've moved the solution into where the section header is.

The problem is simple -- it's just that you need to manually set the running header markers after unnumbered chapter headings, otherwise they'll show the title of the previous chapter. (And I left a note demonstrating this in the introduction chapter, I'd just forgotten about it!

JanaMuschinski commented 1 year ago

Amazing! Thank you so much. I'll take a look at the changes you've made, test them out and let you know if I'm still having trouble.