fix(templates/default.typst): wrong syntax for bibliography inclusion#11233
fix(templates/default.typst): wrong syntax for bibliography inclusion#11233
Conversation
| $if(bibliography)$ | ||
|
|
||
| #bibliography($for(bibliography)$"$bibliography$"$sep$,$endfor$$if(full-bibliography)$, full: true$endif$) | ||
| #bibliography(($for(bibliography)$"$bibliography$"$sep$,$endfor$)$if(full-bibliography)$, full: true$endif$) |
There was a problem hiding this comment.
Is this still going to work for the case where there is just one entry?
Don't you need ("mybib",) rather than ("mybib") for it to be treated as an array?
There was a problem hiding this comment.
or maybe it's okay if it isn't treated as an array? In any case, I just want to make sure this has been tested with both one and multiple bib files.
There was a problem hiding this comment.
Double checking this.
There was a problem hiding this comment.
FYI, this issue was found on Quarto CLI initially.
I've double checked and #bibliography(("references.bib")) works in Typst.
So, to me it's pretty safe to always have the array (...) form.
There was a problem hiding this comment.
But I think that in this case it resolves to a string -- however, it works because bibliography can take either an array or a string.
There was a problem hiding this comment.
yes. It also supports "bytes" type. The array should be an array of strings and/or bytes. Thus why I think, it's pretty safe to always use an array.
|
For reference; I've checked the syntax produced with: echo "@book{article-1,\n title = {Article A}\n}" > references.bib
echo "@book{article-2,\n title = {Article B}\n}" > references-1.bib
echo "@article-1 @article-2" | pandoc -f markdown -t typst \
--bibliography references.bib \
--bibliography references-1.bib \
--template default.typst |
#bibliography(...)should be an array when multiple bibliography files are provided (https://typst.app/docs/reference/model/bibliography/#parameters-sources).Currently,
#bibliography("path/one.bib", "path/two.bib")is produced instead of#bibliography(("path/one.bib", "path/two.bib"))