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

CSL Styles that use PMID/PMCID do not work #260

Open
RyanVidegar-Laird opened this issue Dec 13, 2024 · 4 comments
Open

CSL Styles that use PMID/PMCID do not work #260

RyanVidegar-Laird opened this issue Dec 13, 2024 · 4 comments

Comments

@RyanVidegar-Laird
Copy link

Hi,
Some scientific grants require PMCID or PMID fields in citations. They are defined as standard variables in the CSL spec. Zotero provides a nice CSL for NLM grant proposals that works fine creating a bib with its GUI.

However, PMCID/PMIDs are not shown when using the above CSL file in Typst. I've tried in the online app (example: https://typst.app/project/rFgaiSlKEcITlBZVkRVwkD), and locally using Typst version 0.12.0.

Seems related to #91 and #162. My naive take... the respective variables are defined in src/csl/taxonomy.rs, but not in src/interop.rs.

Thanks for all the dev effort! Please let me know if you need any more info.

@Drodt
Copy link
Contributor

Drodt commented Dec 15, 2024

The PMID/PMCID fields are not supported in biblatex (or bibtex). See (§3.14.7 of the biblatex documentation for how you should encode this in biblatex.

Your example works fine if you write a hayagriva file directly.

@RyanVidegar-Laird
Copy link
Author

Thanks for the quick fix and response! I can confirm I'm able to include PMID and PMCIDs when using a haragriva file. To note for you and/or future users:

  • When exporting a bibliography in Zotero, the default BibLaTex and BibTeX options do not place PMIDs in the eprint field. I had to use the Better BibTex extension's 'Better BibLaTex' option. This was part of my issue.
  • NIH training grants (see page 43 in the instructions) prefer PMCIDs over PMIDs when available, but articles with PMCIDs will always also have a PMID.
    • When using a hayagriva file this logic from the above CSL file works if both are included in the serial-number field.
    • AFAICT only one eprint entry is allowed.... which defaults to the PMID when exporting as described above. PMCID remains in its own field, which means it'd be ignored even with the above fix.

TLDR: Both PMID and PMCIDs should be added to serial-number, but I can't see how that's possible without hacking around the specs.

@RyanVidegar-Laird
Copy link
Author

I noticed another small problem. Please let me know if I should rename this issue to something more generic or create a new issue.

In src/csl/rendering/mod.rs, it seems PMID/PMCIDs are automatically turned into hyperlinks (e.g. PMCID: PMC11410365). This feels like something that should be handled by the style sheet, not hard-coded, especially because hypertext is usually not allowed in NIH grant applications.

Okay, hopefully that's all the small pain points! Thanks again, using Typst for my application would be quite nice.

@Drodt
Copy link
Contributor

Drodt commented Dec 16, 2024

Happy to help!

I noticed another small problem. Please let me know if I should rename this issue to something more generic or create a new issue.

In src/csl/rendering/mod.rs, it seems PMID/PMCIDs are automatically turned into hyperlinks (e.g. PMCID: PMC11410365). This feels like something that should be handled by the style sheet, not hard-coded, especially because hypertext is usually not allowed in NIH grant applications.

I think opening a new issue for this would be good. That seems like a more generell issue.

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

No branches or pull requests

2 participants