Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All changes included in 1.6:

- ([#10168](https://github.com/quarto-dev/quarto-cli/issues/10168)): support `csl` bibliography style.
- ([#10181](https://github.com/quarto-dev/quarto-cli/issues/10181)): Remove workaround for image dimensions which is no longer necessary and mishandled image paths with spaces.
- ([#10217](https://github.com/quarto-dev/quarto-cli/issues/10217)): Explicitly compute units for image dimensions in `typst` format when they're not given.

## Other Fixes and Improvements

Expand Down
10 changes: 10 additions & 0 deletions src/resources/filters/quarto-post/typst.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ function render_typst_fixups()
traverse = "topdown",
Image = function(image)
image = _quarto.modules.mediabag.resolve_image_from_url(image) or image
-- REMINDME 2024-09-01
-- work around until https://github.com/jgm/pandoc/issues/9945 is fixed
local height_as_number = tonumber(image.attributes["height"])
local width_as_number = tonumber(image.attributes["width"])
if image.attributes["height"] ~= nil and type(height_as_number) == "number" then
image.attributes["height"] = tostring(image.attributes["height"] / PANDOC_WRITER_OPTIONS.dpi) .. "in"
end
if image.attributes["width"] ~= nil and type(width_as_number) == "number" then
image.attributes["width"] = tostring(image.attributes["width"] / PANDOC_WRITER_OPTIONS.dpi) .. "in"
end
return image
end,
Div = function(div)
Expand Down
24 changes: 24 additions & 0 deletions tests/docs/smoke-all/2024/07/03/10217.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
format: typst
---


::: {.cell execution_count=1}
``` {.python .cell-code}
from plotnine import ggplot, geom_point, aes, stat_smooth, facet_wrap
from plotnine.data import mtcars

(
ggplot(mtcars, aes("wt", "mpg", color="factor(gear)"))
+ geom_point()
+ stat_smooth(method="lm")
+ facet_wrap("gear")
)
```

::: {.cell-output .cell-output-display}
![](10217_files/figure-typst/cell-2-output-1.png){width=640 height=480}
:::
:::


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.