Skip to content
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

Typst Writer should not escape single and double quotes #10271

Closed
cskeeters opened this issue Oct 7, 2024 · 1 comment
Closed

Typst Writer should not escape single and double quotes #10271

cskeeters opened this issue Oct 7, 2024 · 1 comment

Comments

@cskeeters
Copy link

The Typst format doesn't support the smart extension. In general, this is fine since typst has it's own ability to convert strait quotes into curly quotes. Currently, if the input source was read without the smart extension (markdown-smart), the typst writer will use the backslash character to escape both single and double quotes ensuring that they are strait. (\' and \") I propose the Typst Writer be changed to output strait quotes without the backslash escape character.

If I wanted curly quotes in the PDF produced from Typst, it will do that by default. If I want strait quotes, I can modify the template and disable conversion of strait to curly (smart) quotes can be disabled with:

#set smartquote(enabled: false)

Either way, I'd prefer the Typst source not to have escaped quotes, so I propose that change.

@jgm
Copy link
Owner

jgm commented Oct 9, 2024

A ' in a pandoc Str element might have been entered as \' and might be intended to be rendered as a straight quote, so we certainly need to escape it in typst output. (You note thta you can globally affect how ' is treated in typst, but a document might contain some straight quotes and some curly quotes.)

However, I can help with the other thing I took you to be requesting in your original discussion, #10129 . In particular:

Smart Markdown Typst Comment
+smart Don't do it Don’t do it Why not let Typst handle?

IN this case the markdown reader (markdown+smart) will parse the ' as a curly apostrophe; I will change typst so that it renders this as a straight single quote (since typst will interpret that as a curly apostrophe).

For removing the backslash for an actual straight quote (e.g. ' with markdown-smart), we'd need to implement the smart extension for typst; we could then drop the escapes when smart is disabled. (-smart could also trigger something in the default template that would change the global setting for smartquote.)

@jgm jgm closed this as completed in bdb1172 Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants