Wandmalfarbe / pandoc-latex-template

A pandoc LaTeX template to convert markdown files to PDF or LaTeX.
BSD 3-Clause "New" or "Revised" License
6.09k stars 959 forks source link

Fix headers and footers bug introduced in commit 4b7c6f41e4bda1645eb5… #248

Closed ret2src closed 2 years ago

ret2src commented 3 years ago

Hi,

I think that commit 4b7c6f41e4bda1645eb5b88d9e510348dcf261f3 introduced an unintended side-effect caused by a difference in the syntax of scrlayer-scrpage and fancyhdr.

When building a document with the option oneside set, I still get two different versions of the headers and footers:

image

In my opinion, this should not be the case. Instead, if oneside is set, I should always get the same headers and footers, like this (taken from the version in this pull request):

image

On page 267 of the KOMA-Script manual we can see that scrlayer-scrpage only requires two arguments for plain scrheadings and normal scrheadings, e. g. \ihead*[plain.scrheadings content]{scrheadings content}.

fancyhdr on the other side requires two arguments for even and odd pages, as can be seen on page 45 of the manual:

As you see, if there is an optional parameter, this one applies to the evenpages, whereas the required parameter applies to the odd pages

Previous versions of Eisvogel (i. e. v 2.0.0) had a completely different plain style for headers and footers (a centered page number in a footer without a rule and no header at all):

image

If my suspicions about the author's intentions are correct, we can simply replace the code with two arguments with the star-version - as has been done in this pull request.

By the way - this also has the correct behavior if oneside is not set:

image

ret2src commented 3 years ago

I've just added some additional control over listings when the --listings option is used:

By default, Eisvogel uses the following colorscheme and sets the language to java when the --listings option is used:

image

The first improvement in this pull request lets you set the language to a custom value using the listings-syntax-highlighting-language option, e. g. python (note the color of the comment and some Python-specific keywords):

image

Next, I've introduced variables that let the user change the colors used in listings completely:

image

Additionally, I've added the option listings-disable-font-styling to disable bold and italic font styles in listings:

image

I know this might allow users to create pretty ugly code listings that do not pair well with the overall design of the Eisvogel template.

However, some users might need these options because they have specific requirements. For example, you might be aware of the noraj/OSCP-Exam-Report-Template-Markdown project which makes extensive use of the Eisvogel template. I'm currently using this project to write my report and one of the recommendations by Offensive Security is to highlight commands in blue and important code changes in red. To follow this recommendation, I mix LaTeX with Markdown, set all code listing text colors to black and disable font styling. This allows me to create listings like this:

image

Listings like this allow the reader to instantly grasp important details without being overloaded with styles and colors.

Wandmalfarbe commented 2 years ago

Could you split these two distinct changes into two Pull Requests?

For the second change: I prefer if users can't style the listings on their own. However, the option to change the default language from java to something other is very much appreciated. Could you change the name from listings-syntax-highlighting-language to listings-default-language.