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 and Citeproc APA Citations #9137

Closed
iandol opened this issue Oct 15, 2023 · 0 comments
Closed

Typst Writer and Citeproc APA Citations #9137

iandol opened this issue Oct 15, 2023 · 0 comments
Labels

Comments

@iandol
Copy link
Contributor

iandol commented Oct 15, 2023

When using citeproc to generate a bibliography in the APA style, it uses emphasis for the volume number and (issue) brackets for issue number. However this causes Typst to fail to build the PDF, for example in the first reference below you see 16(7) is rendered as #emph[16](7) but this triggers the #fun[content](expression) pattern. I think the ( and ) following the #code[] expression need to be escaped.

= Bibliography
<bibliography>
#block[
#block[
Barrett, L., & Simmons, W. (2015). Interoceptive predictions in the
brain. #emph[Nature Reviews Neuroscience], #emph[16](7), 419–429.
#link("https://doi.org/10.1038/nrn3950")

] <ref-barrett2015>
#block[
Crivellato, E., & Ribatti, D. (2007). Soul, mind, brain: Greek
philosophy and the birth of neuroscience. #emph[Journal of Anatomy],
#emph[71](4), 327–336.
#link("https://doi.org/10.1016/j.brainresbull.2006.09.020")

] <ref-crivellato2007>
#block[
Hoffman, D. D., & Prakash, C. (2014). Objects of consciousness.
#emph[Frontiers in Psychology], #emph[5], 577.
#link("https://doi.org/10.3389/fpsyg.2014.00577")

] <ref-hoffman2014>
] <refs>

error: expected function, found content
    ┌─ toPdfViaTempFile23827-0.html:470:44
    │
470 │ brain. #emph[Nature Reviews Neuroscience], #emph[16](7), 419–429.
    │                                             ^^^^^^^^


Error producing PDF.

If I use a CSL file that doesn't use vol+issue or doesn't emphasise vol then the PDF is generated without issue.

@iandol iandol added the bug label Oct 15, 2023
@jgm jgm closed this as completed in 802c610 Oct 17, 2023
jgm added a commit that referenced this issue Jan 29, 2024
We no longer escape `(`. The reason we did this before (#9137)
has been addressed in another way (#9252).

We only escape `=`, `+`, `-` at the beginning of a line.

We now also escape `/` at the beginning of a line.

This should reduce unnecessary escapes.

Closes #9386.
jgm added a commit that referenced this issue Jan 29, 2024
We no longer escape `(`. The reason we did this before (#9137)
has been addressed in another way (#9252).

We only escape `=`, `+`, `-` at the beginning of a line.

We now also escape `/` at the beginning of a line.

This should reduce unnecessary escapes.

Closes #9386.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant