-
DescriptionHi all,
Previously I was using LaTeX as engine there I could insert LaTeX Code with Markdown and it worked: Question:
Thanks in advance! I'll appreciate any tipps and workarounds. Simon |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Could you properly format your post using code blocks for code and terminal outputs? Thanks. Also, please ensure your example is fully reproducible and has external resource only if required. |
Beta Was this translation helpful? Give feedback.
-
Just to add a bit more context on how to make your original example works.
As you are trying to use that from computation cell, you need to output raw markdown. And this is where it is tricky ---
title: "Template Report"
subtitle: "July 2025"
author: "Fictive Company"
echo: False
format: typst
jupyter: python3
keep-md: true
---
```{python}
#| output: asis
from IPython.display import Markdown, display
machines = [1, 2, 3, 4, 5]
for machine_id in machines:
display(Markdown(f"\n## Machine {machine_id} - Performance Overview"))
display(Markdown("{{< pagebreak >}}"))
```
This above will work because I added
Why do you need Because you are using a for-loop to output some Markdown content. If you were using only a single output and no for loop that would be ok. ```{python}
from IPython.display import Markdown, display
machines = [1, 2, 3, 4, 5]
Markdown(f"\n## Machine {machines[1]} - Performance Overview\n\n{{{{< pagebreak >}}}}\n")
``` For loop requires Doc is here about how to create raw output: https://quarto.org/docs/computations/execution-options.html#raw-output
About this error from typst, this is because without ::: {.cell-output .cell-output-display .cell-output-markdown}
{{< pagebreak >}}
:: Which will wrap the typst code in a block... #block[
#pagebreak()
] And this is not supported in typst syntax. I wonder if this should be considered an improvement in Quarto 🤔 Not sure because afterall Hope it helps understand. |
Beta Was this translation helpful? Give feedback.
That's a Typst error. It's not a Quarto error.
Use
keep-md: true
to look at the intermediate markdown andkeep-typ: true
to look at the Typst file.Then see what is wrong.
Note that in this particular case, Typst tells you exactly what to do.