Open anielsen001 opened 1 year ago
abstract-title
is not a pdf
format option thus it has no effect, see https://quarto.org/docs/reference/formats/pdf.html.
You can look at the LaTeX template used by Quarto (which is mostly the one from Pandoc): https://quarto.org/docs/journals/templates.html#latex-partials
For short, your "workaround" is not a workaround but the actual solution you want.
From a UI standpoint, it makes sense that a yaml option at the top level would apply to all the lower levels, which is what I assumed to be the case, but I will have to be more careful now.
Always double check the reference pages for valid options.
This being said, the template could be modified to make this option also work for LaTeX/PDF (note that the option is currently only defined in HTML format).
@anielsen001 Could you change the title to be more as a feature request, i.e., "allow abstract-title
in pdf
format"?
Meanwhile, I am going to label this as en enhancement.
I edited the title.
One thing I'm really keen on is reuse of the same qmd file as much as possible for different outputs. If I can make a webpage and a pdf using essentially the same front matter, that's a big plus for me. This particular abstract-title example came up in the context of creating a report for a sponsor. In other cases, when I'm teaching, I try to use the same source files to generate revealjs slides, a web page and pdf. This makes it really simple to keep slides, exercises and other information in sync if I make a change to the content somewhere.
You can already have one YAML front matter.
If by "one" you mean without format specific options then it becomes unlikely (you are already using documentclass: article
which has no equivalent in the html
format).
What's the issue with:
---
title: "quarto-abstract"
abstract: "Read the executive summary."
format:
pdf:
documentclass: article
include-in-header:
- text: |
\renewcommand{\abstractname}{Executive Summary}
html:
abstract-title: "Executive summary"
---
Bug description
When setting the
abstract-title
keyword in the front matter yaml, the abstract title is not actually changed in pdf output.There is a work-around, which is redefine the name in the latex header using:
Steps to reproduce
Rendering the following quarto document creates a pdf with the abstract title set to "Abstract"
Expected behavior
The abstract title would be set to the keyword value in the front matter yaml, in this case "Executive Summary".
Actual behavior
The abstract title is set to "Abstract"
Your environment
Quarto check output