Typst format extensions: Appendices and full-width floats #13021
Replies: 2 comments 3 replies
-
Thank you for sharing!
If I understand correctly, you would like to be able to write code cells like this, and then have your extension be able to respond to the
Do I understand that correctly? If so, it is truly a super cool idea that I would love to be able to do. Unfortunately, Quarto doesn't support anything like it (and, sadly, probably will not support it for a long time; it would require very large changes in our architecture). In the meantime, you could use the |
Beta Was this translation helpful? Give feedback.
-
What I had in my mind was something like in RMarkdown's PDF output, where I could specify Using the quarto-r package how you suggest is nice, but then that doesn't generalize to other languages? Also thinking if something like the appendix functionality I showed might work for the default Quarto Typst template? It only needs a custom function in the Typst template, and exposing the function (again using Anyway thanks for the response, and look forward to future developments in the Quarto / Typst space. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Hi all, I wanted to share some quick wins for other Typst extension developers, and possibly for the Quarto team for thinking around the current default Typst template/functionality.
My quarto-preprint extension provides a
preprint-typst
(naming... 😳) output format that aims to support more of Quarto's common YAML front matter variables, and make better use of Typst functionality over and beyond Quarto's standard Typst template. Here's what the front page looks like:(As you can see I'm not a designer and am very open for feedback.)
Appendices
I found it very easy to implement appendices by using Quarto's standard div syntax (
:::{.appendix}
) in combination with the typst-function extension. All I did was implement a very simpleappendix()
function that resets counters etc., and the div syntax nicely translated to an appendix. AFAIK appendices are not that well supported in Typst yet, but using typst-function made including them easy in a Quarto-friendly manner. Here's example output:An additional bonus was that when
citeproc: true
, you can have the references section appear before any appendices.Note that the heading
## Appendix {.appendix}
syntax does not appear to translate so a separate div is required, but that works well in HTML as well.Full-width floats in two-column mode
This was again relatively easy to tackle with the typst-function extension: We can use Quarto's div syntax to target Typst's
place()
function that 'breaks out' of the two columns to provide full width content. In my extension, all you need isand all content (figures, code, text, etc) in that div will span the whole page. I wish I knew how to enable this for Quarto code chunks, but since the div syntax here doesn't affect any other output formats, it's a small price to pay. Here's an example:
Hope someone finds these helpful.
Beta Was this translation helpful? Give feedback.
All reactions