You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explain the problem.
When a source file references an external file (in this case an image), Pandoc converts the path to an URI, escaping '' with '%20' and so on. Typst expects a "plain" path and thus chokes on the provided URIs.
Given the following mwe.md Markdown file next to a foo bar.png image:
![](foo bar.png)
Then rendering the file to PDF produces the following error, despite foo bar.png being available:
$ pandoc --pdf-engine=typst mwe.md -o mwe.pdf
error: file not found (searched at /private/tmp/mwe/foo%20bar.png)
┌─ toPdfViaTempFile37815-0.html:97:40
│
97 │ #box(width: 3.8528428093645486pt, image("foo%20bar.png"))
│ ^^^^^^^^^^^^^^^
Error producing PDF.
Unescaping the URI characters fixes the issue.
Pandoc version?
$ pandoc --version
pandoc 3.1.11
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /Users/janis.koenig/.local/share/pandoc
Copyright (C) 2006-2023 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
Installed via Nix on macOS, but I verified with the main branch in the source code. Compare the following for the Typst Writer:
let coreImage ="image"<> parens (doubleQuoted src)
Explain the problem.
' with '
When a source file references an external file (in this case an image), Pandoc converts the path to an URI, escaping '
%20
' and so on. Typst expects a "plain" path and thus chokes on the provided URIs.Given the following
mwe.md
Markdown file next to afoo bar.png
image:Then rendering the file to PDF produces the following error, despite
foo bar.png
being available:Unescaping the URI characters fixes the issue.
Pandoc version?
Installed via Nix on macOS, but I verified with the
main
branch in the source code. Compare the following for the Typst Writer:with the version for LaTeX
which uses
Network.URI (unEscapeString)
to remove the URI characters again.Fix
I currently don't have a Haskell environment here, but I suspect something like this should fix the issue:
The text was updated successfully, but these errors were encountered: