-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extra #block[ ]
when translating column-block to typst
#11964
Comments
Thanks for the report. I think the issue lies in how the Panel Layout is built: https://github.com/quarto-dev/quarto-cli/blob/main/src/resources/filters/customnodes/panellayout.lua The extra block is not there if the layout is a cross-ref float for instance. |
If we look at trace for our lua chain we can see an empty Div at the end which is not removed
This block is the result for panel layout process indeed This
is transformed to this custom ast node
And see this part
which leads to empty div, not removed. This should not be produced at all in layout IMO. However, I thought empty div are also supposed to be removed 🤔 but it seems we do it only for LaTex: No class, no id, not attributes on a div means we do like a scaffolded div and we don't return the Div.
So there is two ways to deal with that:
I think the latter should done s we don't want empty block generally in typst |
I think the problem is that when quarto-cli/src/resources/filters/layout/layout.lua Lines 30 to 36 in 1dc41fa
as default are pandoc.List() for both preamble and cell quarto-cli/src/resources/filters/layout/layout.lua Lines 74 to 76 in 1dc41fa
we do construct a div with it
but we only do nothing when it is quarto-cli/src/resources/filters/quarto-pre/panel-layout.lua Lines 39 to 55 in 1dc41fa
|
Bug description
When creating a block with multiple columns using
:::{layout-ncol=2}
, for example, the Typst output uses the Typst functiongrid()
as expected. However, just before thegrid()
, the conversion inserts an empty block and that messes up the spacing in the output. See MWE below.Steps to reproduce
Minimal file that produces the bug:
translating this file to Typst using
quarto render test.md
produces this Typst file:The first
block[ ]
is erroneous and should not be there (its presence introduces spacing there which messes up the rest of the page).Expected behavior
The Typst file should look like this:
Actual behavior
As described above, the Typst file looks like
Your environment
Quarto check output
Quarto 1.7.1 [✓] Checking environment information... Quarto cache location: /home/mmi041/.cache/quarto [✓] Checking versions of quarto binary dependencies... Pandoc version 3.4.0: OK Dart Sass version 1.70.0: OK Deno version 1.46.3: OK Typst version 0.12.0: OK [✓] Checking versions of quarto dependencies......OK [✓] Checking Quarto installation......OK Version: 1.7.1 Path: /opt/quarto/bin [✓] Checking tools....................OK TinyTeX: (not installed) Chromium: (not installed) [✓] Checking LaTeX....................OK Using: Installation From Path Path: /usr/bin Version: 2024 [✓] Checking basic markdown render....OK [✓] Checking Python 3 installation....OK Version: 3.12.2 (Conda) Path: /home/mmi041/miniconda3/bin/python Jupyter: (None) Jupyter is not available in this Python installation. Install with conda install jupyter [✓] Checking R installation...........OK Version: 4.4.1 Path: /usr/lib/R LibPaths: - /home/mmi041/R/x86_64-pc-linux-gnu-library/4.4 - /usr/local/lib/R/site-library - /usr/lib/R/site-library - /usr/lib/R/library knitr: 1.48 rmarkdown: 2.28 [✓] Checking Knitr engine render......OK
The text was updated successfully, but these errors were encountered: