I render a multipart book with Asciidoctor PDF.
In a page’s header, I want to have the current book part and chapter, separated by –
. If there is no book part (e.g. in preface or appendix) there should only be the chapter title.
I tried to use a conditional expression in my theme:
extends: default
header:
height: 33pt
recto: &header
content-margin: [8pt, inherit, inherit, inherit]
right:
content: ifdef::part-title[{part-title} – ] {chapter-title}
verso: *header
However, this just renders ifdef::part-title[ – ]
as-is, without evaluating the conditional expression (while it does evaluate {part-title}
).
How can I fix this to actually evaluate the conditional expression?