Closed black-desk closed 2 months ago
I also have this problem with my email addresses, not sure what is correct in terms of escaping from the yaml to the email field, but I think before the @ was just passed through without problems (at least I previously used Typst and didn't see this but now I do)...
I also have this problem with my email addresses, not sure what is correct in terms of escaping from the yaml to the email field, but I think before the @ was just passed through without problems (at least I previously used Typst and didn't see this but now I do)...
Might related to this commit:
https://github.com/jgm/pandoc/commit/ea9317c73d508d0ce7993db66edb239a3e968cdb
I'm not sure that commit is responsible, if I edit my custom template to use the [$author.email$] or "$author.email$" syntax both get the @ escaped. My internet is very flakey for searching commits, but there were a few recent changes to escape more typst content.
The field is parsed as Markdown, so it turns into Str "XXX@xxx.com"
. This in turn is rendered into typst with an escaped @
(because if we don't escape literal @
s we can get accidental citations and references).
Some possible solutions:
email: <XXX@xxx.com>
(will format as a linked email address)
email: `XXX@xxx.com`
(will format as verbatim text)
email: `XXX@xxx.com`{=typst}
(will just be a plain string without escapes).
In any case: not a bug.
Thanks @jgm.
If I use the link syntax, the link text is still escaped:
email: "#link("mailto:XXX@xxx.com")[XXX\@xxx.com];" ),
...and currently the backticked verbatim / raw inline is causing yaml parse errors:
OK, ` is reserved[1] (didn't it used to work before?), but YAML block literal syntax doesn't cause any YAML errors:
author:
- name: XXX
email: |
`XXX@xxx.com`
... although the typst output gets some extra newlines these don't affect the PDF I think:
authors: (
( name: "XXX",
affiliation: "",
email: "`XXX@xxx.com`
" ),
Yeah, the link idea was not good. And the other idea requires using block syntax or maybe single quotes.
Perhaps we can adjust the escaping so that word-internal @ isn't escaped. I think that would be safe.
No such luck.
my@aoeu.com
in typst.app raises an error because the label aoeu.com
isn't found.
Maybe the solution is to use [..]
instead ".."
in the template.
This works (at least for Typst CLI), using the current pandoc default template:
---
title: XXX
author:
- name: XXX
email: |
`XXX@xxx.com`{=typst}
---
XXX
Explain the problem.
I have a 1.md like this:
Then I run:
I got 1.typ as:
The problem is that
email: "XXX\@xxx.com"
, which make the pdf output of 1.typ looks like this:Note:
https://github.com/jgm/pandoc/blob/c19b44b071810fbad3a9b16e7a3638b231465bbc/src/Text/Pandoc/Writers/Typst.hs#L467
I think we maybe need a new context type like this:
https://github.com/jgm/pandoc/blob/c19b44b071810fbad3a9b16e7a3638b231465bbc/src/Text/Pandoc/Writers/Typst.hs#L476
Pandoc version?