jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
191 stars 61 forks source link

Add support for setting citation and bibliography style #1462

Open agoose77 opened 1 month ago

agoose77 commented 1 month ago

Currently the citations in the auto-generated bibliography on HTML don't have support for multiple styles. For example, changing between the citation styles of different journals. We should expose this functionality so that authors can choose what style they want.

References

agoose77 commented 1 month ago

@fwkoch is my understanding correct here?

rowanc1 commented 1 month ago

We did do a pass on numbered citations at one point!

agoose77 commented 1 month ago

@rowanc1 I'm thinking along the lines of saying "the bib should use APA format". Does that intersect with the work that you're referring to?

fwkoch commented 1 month ago

Numbered citations (e.g. [1] instead of (Koch, 2012)) are available at the theme level, e.g. https://github.com/jupyter-book/myst-theme/blob/main/themes/book/template.yml#L55-L57

However, @agoose77 your assumptions about bibliography style are correct. It exists as an option in citation-js-utils: https://github.com/jupyter-book/mystmd/blob/main/packages/citation-js-utils/src/index.ts#L290 - but that is not consumed anywhere else in myst. The only place we make that render call is here I think: https://github.com/jupyter-book/mystmd/blob/main/packages/myst-cli/src/transforms/citations.ts#L25