quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.92k stars 322 forks source link

Cannot insert funding meta tag in document. #8086

Closed sebastianrowan closed 10 months ago

sebastianrowan commented 10 months ago

I have included my funding source information in my document's yaml header, and I am trying to use the {{< meta funding >}} tag to insert this text in my appendix. quarto render manuscript.qmd runs without error, however the text included in the funding variable is not shown.

The issue seems to be specifically related to using the "funding" meta variable, as I have been able to get my desired outcome by simply changing the variable name to "support" and adding {{< meta support >}} to my appendix. While this works for me in this instance, this workaround would break any processes that specifically look for the funding variable.

Is this a bug or is there a reason this doesn't work, and what would be the solution?

The issue persists when rendering to docx, pdf, and html.

dragonstyle commented 10 months ago

Quarto has a set of special front matter that is normalized into a standard schema (this is so authors of Quarto templates can refer to a single standard schema rather than each building their own). Funding is normalized as a part of this. More about this normalization here:

https://quarto.org/docs/authoring/front-matter.html#funding

We currently make this pretty hard on you because we normalize funding into a List (e.g. an array of funding sources, each with a statement and corresponding metadata) and the meta shortcake doesn't really deal with arrays/lists very well at all.

Are you adding the funding metadata to the HTML appendix, or hoping to add it to other document formats as well? (adding it to the HTML appendix within Quarto is a nice suggestion and pretty straightforward, while fixing the meta array limitation is likely to be trickier)...

sebastianrowan commented 10 months ago

I was trying to add the funding statement as an appendix in a docx using this code:

# Funding {.appendix}
:::{custom-style="Funding"}

{{< meta funding >}}

:::
dragonstyle commented 10 months ago

Ok docx is tougher - we really need to address the issue with support for arrays/lists in the meta shortcode to properly enable this...

I don't have a great workaround for you right now other than to duplicate the contents of the funding field (e.g. just place it inline in the appendix or provide both a funding and support key) :(.

I'll see whether better support for arrays is something we could squeeze into Quarto 1.4, but I think it is much more likely to fall into Quarto 1.5.

mcanouil commented 10 months ago

FYI: