typst / hayagriva

Rusty bibliography management.
Apache License 2.0
314 stars 47 forks source link

Parse common latex commands in titles #100

Open alxsimon opened 9 months ago

alxsimon commented 9 months ago

Hi, it would be great if latex commands could be parsed in bibtex file titles (and maybe other fields too). My use case is species names.

An example of a citation in bibtex format, autogenerated by better-biblatex Zotero extension:

@article{Simon2022,
  title = {Three New Genome Assemblies of Blue Mussel Lineages: {{North}} and {{South European}} {{{\emph{Mytilus edulis}}}} and {{Mediterranean}} {{{\emph{Mytilus galloprovincialis}}}}},
  shorttitle = {Three New Genome Assemblies of Blue Mussel Lineages},
  author = {Simon, Alexis},
  date = {2022-09-04},
  journaltitle = {bioRxiv},
  doi = {10.1101/2022.09.02.506387},
  langid = {english},
}

Which gives me this result in typst: A. Simon, “Three New Genome Assemblies of Blue Mussel Lineages: North and South European \emph{Mytilus edulis} and Mediterranean \emph{Mytilus galloprovincialis}”, bioRxiv, Sep. 2022, doi: 10.1101/2022.09.02.506387.

Fields that could be parsed \emph, \textit, \textbf

alxsimon commented 9 months ago

related issue pointed out in the discord chat https://github.com/typst/typst/issues/2761 https://github.com/typst/typst/issues/1975

alxsimon commented 9 months ago

Feel free to move this issue to https://github.com/typst/biblatex/issues, I have no idea in which repository it is most relevant sorry.

DerDrodt commented 9 months ago

In this case, the solution concerns multiple crates: biblatex has to parse commands and store that information, hayagriva has to render them correctly.