asciidoctor / asciidoctor-pdf

:page_with_curl: Asciidoctor PDF: A native PDF converter for AsciiDoc based on Asciidoctor and Prawn, written entirely in Ruby.
https://docs.asciidoctor.org/pdf-converter/latest/
MIT License
1.14k stars 501 forks source link

Inconsistent border management in header and footer #2419

Closed steingod closed 1 year ago

steingod commented 1 year ago

Using asciidoctor-pdf recently I noticed that my header disappeared from themed documents. I normally use header and footer with relevant document information separated from body with a thin line for both of them. I have run this on Ubuntu 22.04, but have also upgraded both ruby and asciidoctor-pdf to the most recent versions.

The issue I experienced is confirmed using ruby 3.2.2 and asciidoctor-pdf 2.3.7 on Ubuntu 22.04 (using rbenv and gem updates).

The documentation is good informing that if height is not set for header/footer they won't appear. Earlier the border came if I had set border-color or border-style. To remove I had to set the color to background. Now, for the header, the border won't show if border-width is not properly set. I think this is a nice feature and would like this behavior to be consistent across header and footer.

Would it be possible to make the behavior for header and footer consistent?

Thanks for a great tool which I am using extensively.

mojavelinux commented 1 year ago

I'm glad you're finding Asciidoctor PDF a useful tool.

The change you're requesting is not possible. It would reverse the fix for #2134, which was an intentional change. The appearance of the border below the running header can be enabled by setting the border-width property (the border-color is now the optional property). The border width for the periphery should not be tied to the base border width as that is meant to control borders within the content. The appearance and width of borders for the running content are independent.

The reason you don't have to set border-width for the footer when using or extending a built-in theme is because the border width is set by default, hence enabling it, which is a common publishing practice. It's less common for there to be a border in the running header. That's why it's required. I'm happy to emphasize this in the docs.

Ultimately, the defaults in the built-in theme is a stylistic choice. But regardless of what the default is, the theming system gives you the ability to change that default.

Earlier the border came if I had set border-color or border-style.

That predated the 2.0.0 release, which was a very old release. Many aspects of the converter were refined and aligned leading up to the 2.0.0 release, this being one of them.