Skip To Article

Citations automatically show up in your site, including a references section at the bottom of the page. These citations are able to be clicked on to see more information, like the abstract. There are two different ways to add citations to your documents:

  1. Add a Markdown link to a DOI; and

  2. Add a BibTeX file, which can be exported from any reference manager, and adding a cite role to your content.

Link to any DOI in your Markdown files or Jupyter Notebooks by including a link to the DOI. This will be transformed to a citation with a pop-up panel on hover like this: Cockett, 2022, and the reference information will be added to the reference section at the bottom of the page. Here’s some example syntax:

This is a link in Markdown: [Cockett, 2022](https://doi.org/10.5281/zenodo.6476040).

To automatically insert the citation text, provide a standalone DOI link without link text:

  • [](doi:10.5281/zenodo.6476040)

  • <doi:10.5281/zenodo.6476040>

For example: Cockett (2022).

If the BibTeX file in your project has this DOI, that citation will be used.

If the BibTex file does not have this DOI, the citation data will be downloaded from https://doi.org (and cached to a local file in the _build directory).

Clear the DOI cache with : myst clean --cache.

To modify the style of the inserted citation text: Use the styles in Table 1 (this works with or without a BibTeX file)

Numbered Citations

The default citations are narrative, for numbered citations, these can be set in the site.options.numbered_references in your myst.yml (See Site Options).

myst.yml
site:
  options:
    numbered_references: true

Writing DOIs to BibTeX

If you encounter problems fetching DOIs from https://doi.org, for example the downloaded citation does not include all the data you expect or requests to https://doi.org are failing on an automated continuous integration platform, you may write your DOI citations to file using the MyST command:

myst build --doi-bib

This will generate a BibTeX file myst.doi.bib which you may then rename, edit, and save to your project. On subsequent builds, the DOIs will be loaded from this file rather than fetched remotely.

Including BibTeX

A standard way of including references for LaTeX\LaTeX is using BibTeX, you can include a *.bib file or files in the same directory as your content directory for the project. These will provide the reference keys for that project.

If you want to explicitly reference which BibTeX files to use, as well as what order to resolve them in, you can use the bibliography field in your frontmatter, which is a string array of local or remote files. This will load the files in order specified.

bibliography:
  - my_references.bib
  - https://example.com/my/remote/bibtex.bib

The remote BibTeX can be helpful for working with reference managers that support remote links to your references.

Markdown Citations

You can add citations to any BibTeX entry using the citation key preceded by an @, for example, @author2023. This syntax follows the pandoc citation syntax. Multiple citations can be grouped together with square brackets, separated with semi-colons. It is also possible to add a prefix or suffix to parenthetical citations, for example, [e.g. @author2023, chap. 3; @author1995]. To add a suffix to a narrative citation, follow the citation with the suffix in square brackets, for example, @author2023 [chap. 3]. As with a link to a DOI, you can also use the DOI directly instead of the BibTeX key.

Table 1:Examples of Markdown citations

Markdown

Rendered

Explanation

@cockett2015

Cockett et al. (2015)

Narrative citation

[@cockett2015]

Cockett et al., 2015

Parenthetical citation

[@cockett2015; @heagy2017]

Cockett et al., 2015Heagy et al., 2017

Multiple parenthetical citations

[-@cockett2015]

2015

Show citation year

[e.g. @cockett2015, pg. 22]

e.g. Cockett et al., 2015, pg. 22

Prefix and suffix

@cockett2015 [pg. 22]

Cockett et al. (2015, pg. 22)

Suffix for narrative citations

@10.1093/nar/22.22.4673

Thompson et al. (1994)

Citation using a DOI directly

Citation Roles

MyST also provides a number of roles for compatibility with Sphinx and Jupyter Book V1. To create a citation role in Markdown, use either a parenthetical or textual citation:

This is a parenthetical citation {cite:p}`cockett2015`.
You can also use a narrative citation with {cite:t}`cockett2015`.
You can also use a narrative citation with {cite:p}`cockett2015; heagy2017`.
You can also add prefix and suffix {cite:p}`{see}cockett2015{fig 1}`.

This is the difference between: Cockett et al., 2015 and Cockett et al. (2015). You can have many citation keys in a single role, by separating them with a semicolon, ;, for example: Cockett et al., 2015Heagy et al., 2017. Including a prefix or suffix is displayed as see Cockett et al., 2015, fig 1.

You can also include DOIs in citations (cite, cite:t, and cite:p) which will be linked in the same way as a simple Markdown link, but will match the reference style of the project.

This will be a citation: {cite}`10.1093/nar/22.22.4673`.

This will show as: Thompson et al. (1994).

Footnotes
  1. In this case we can also optionally encode the brackets as %28 and %29. There aren’t too many of these in the wild, so hopefully it isn’t too bad!!

References
  1. Cockett, R. (2022). Future of Research Communication & Collaboration. 10.5281/ZENODO.6476040
  2. PRIESTLEY, C. H. B., & TAYLOR, R. J. (1972). On the Assessment of Surface Heat Flux and Evaporation Using Large-Scale Parameters. Monthly Weather Review, 100(2), 81–92. https://doi.org/10.1175/1520-0493(1972)100<;0081:otaosh>2.3.co;2
  3. Abduallah, Y., Jordanova, V. K., Liu, H., Li, Q., Wang, J. T. L., & Wang, H. (2022). Predicting Solar Energetic Particles Using SDO/HMI Vector Magnetic Data Products and a Bidirectional LSTM Network. The Astrophysical Journal Supplement Series, 260(1), 16. 10.3847/1538-4365/ac5f56
  4. Cockett, R., Kang, S., Heagy, L. J., Pidlisecky, A., & Oldenburg, D. W. (2015). SimPEG: An open source framework for simulation and gradient based parameter estimation in geophysical applications. Computers & Geosciences, 85, 142–154. https://doi.org/10.1016/j.cageo.2015.09.015
  5. Heagy, L. J., Cockett, R., Kang, S., Rosenkjaer, G. K., & Oldenburg, D. W. (2017). A framework for simulation and inversion in electromagnetics. Computers & Geosciences, 107, 1–19. https://doi.org/10.1016/j.cageo.2017.06.018
  6. Thompson, J. D., Higgins, D. G., & Gibson, T. J. (1994). CLUSTAL W: improving the sensitivity of progressive multiple sequence alignment through sequence weighting, position-specific gap penalties and weight matrix choice. Nucleic Acids Research, 22(22), 4673–4680. 10.1093/nar/22.22.4673
MyST MarkdownMyST Markdown
Community-driven tools for the future of technical communication and publication, part of Jupyter.