-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Smart Quotation Marks in Formattable Strings. #99
base: main
Are you sure you want to change the base?
Conversation
Should this also work for single quotes? The |
There is no need for that, and it might even produce problems.
So long as double quotes are part of the spec, I think it should be fine. |
If I'm reading your code correctly, BibTeX' normal chunks will continue to yield regular quotes. I think that we should parse BibTeX normal chunks to also emit the quote chunk so that both formats behave more similarly. |
That would be good but how do we want this to work? In Bib(la)TeX, you don't use The best way I see to do this is to make another |
Another thing: I do think we will run into issues at some point by just parsing everything between I think we should add support for simple typst commands like |
Ultimately, smart quotes are a heuristic. Typst implements it here: https://github.com/typst/typst/blob/c20b6ec6e157b753e90aa60ccd5b50f6f31cb7f6/crates/typst/src/text/smartquote.rs#L91. This handles something like quotes between numbers (e.g. for measurements in inches). It could be worthwhile to extract this into a crate and use the same code here and there. Additionally, I would propose to tokenize only the quote inside a chunk instead of the complete citation it wraps and approach this as purely string replacement instead of semantic. Adding a non-standard chunk to |
Close #70.
I implemented a couple of changes to enable hayagriva to better render quotation marks in titles or other formattable strings.
The changes are
ChunkKind
for quotes."
, are used as delimiters for this newChunkKind
.An alternative solution would be to allow some Typst functions in Hayagriva, e.g.,quote
andsmallcaps
.Todo:
\enquote
,\mkbibquote
) in from bib(la)tex.