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
4 changes: 4 additions & 0 deletions news/changelog-1.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ All changes included in 1.9:

- ([#13414](https://github.com/quarto-dev/quarto-cli/issues/13414)): Be more forgiving when Confluence server returns malformed JSON response. (author: @m1no)

## Lua API

- ([#13762](https://github.com/quarto-dev/quarto-cli/issues/13762)): Add `quarto.paths.typst()` to Quarto's Lua API to resolve Typst binary path in Lua filters and extensions consistently with Quarto itself. (author: @mcanouil)

## Other fixes and improvements

- ([#13402](https://github.com/quarto-dev/quarto-cli/issues/13402)): `nfpm` (<https://nfpm.goreleaser.com/>) is now used to create the `.deb` package, and new `.rpm` package. Both Linux packages are also now built for `x86_64` (`amd64`) and `aarch64` (`arm64`) architectures.
Expand Down
2 changes: 2 additions & 0 deletions src/command/render/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ import { pythonExec } from "../../core/jupyter/exec.ts";
import { kTocIndent } from "../../config/constants.ts";
import { isWindows } from "../../deno_ral/platform.ts";
import { tinyTexBinDir } from "../../tools/impl/tinytex-info.ts";
import { typstBinaryPath } from "../../core/typst.ts";

const kQuartoParams = "quarto-params";

Expand Down Expand Up @@ -204,6 +205,7 @@ async function quartoEnvironmentParams(_options: PandocOptions) {
"paths": {
"Rscript": await rBinaryPath("Rscript"),
"TinyTexBinDir": tinyTexBinDir(), // will be undefined if no tinytex found and quarto will look in PATH
"Typst": typstBinaryPath(),
},
};
}
Expand Down
8 changes: 8 additions & 0 deletions src/resources/lua-types/quarto/paths.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ Returns the path to the `TinyTeX` bin directory that `quarto install tinytex` in
]]
---@return string|nil # Path to `TinyTeX` bin directory
function quarto.paths.tinytex_bin_dir() end

--[[
Returns the path to the Typst binary that Quarto itself would use for rendering Typst documents.
This will be the value of the QUARTO_TYPST environment variable if set, or the path to the
Typst binary bundled with Quarto.
]]
---@return string # Path to Typst binary
function quarto.paths.typst() end
3 changes: 3 additions & 0 deletions src/resources/pandoc/datadir/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,9 @@ quarto = {
tinytex_bin_dir = function()
return param('quarto-environment', nil).paths.TinyTexBinDir
end,
typst = function()
return param('quarto-environment', nil).paths.Typst
end,
},
json = json,
base64 = base64,
Expand Down
5 changes: 5 additions & 0 deletions tests/docs/smoke-all/2025/12/05/typst-path-api.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function Pandoc(doc)
if quarto.paths.typst() == nil then
crash()
end
end
7 changes: 7 additions & 0 deletions tests/docs/smoke-all/2025/12/05/typst-path-api.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
format: html
filters:
- typst-path-api.lua
---

The Typst path is accessible.
Loading