How to add borders to headings in AsciiDoctor-pdf PDF output.
(I am not an English speaker. Ask me if any expressions are difficult to understand).
I am a high school student and I am using AsciiDoctor-PDF to create documents for other students to look at.
https://docs.asciidoctor.org/pdf-converter/latest/theme/heading/#level
I want to put a border around a heading using the border in the URL above.
The border around the heading would look like the image below.
The top text is on level 2 and the bottom text is on level 3 in the image.
What should I do?
heading:
h1_font_size: floor($base_font_size * 2.4)
h2:
font_size: floor($base_font_size * 2.4)
border-width: [0.75, 0, 2, 0]
border-color: 000000
You are close, but I suspect that your impression of the heading level is incorrect.
To demonstrate that adding borders to heading works, here's a simple document:
And here is the content of
pdf-theme.yml:That renders like this:
I suspect that in your document, the heading you are trying to style is a level 3 or level 4 heading, which is why you do not see the border. You have only added the border style for level 2 headings.