|
| 1 | +# Citing sources |
| 2 | + |
| 3 | +All of the references and sources of the agda-unimath library are managed in a |
| 4 | +[BibLaTeX](https://www.ctan.org/pkg/biblatex) file `references.bib`, and we have |
| 5 | +a custom set of macros to work with them. |
| 6 | + |
| 7 | +The macros are as follows: |
| 8 | + |
| 9 | +<!-- |
| 10 | +We have inserted an invisible whitespace character between the first and second |
| 11 | +opening curly braces in the below examples to block the citation preprocessor |
| 12 | +from detecting them as macros. |
| 13 | +--> |
| 14 | + |
| 15 | +- `{{#cite referenceXYZ}}` will insert a citation to the reference labeled |
| 16 | + `referenceXYZ` (which must be defined in the `references.bib` file) at the |
| 17 | + current location, and add that reference to the current page's bibliography. |
| 18 | +- `{{#reference referenceXYZ}}` will add the reference labeled `referenceXYZ` |
| 19 | + to the current page's bibliography without inserting a citation. |
| 20 | +- `{{#bibliography}}` is a marker for where the bibliography of the current |
| 21 | + page should be inserted. If no such marker is found and the bibliography is |
| 22 | + inhabited, it will be inserted at the bottom of the page in a new section |
| 23 | + titled `References`. |
| 24 | + |
| 25 | +Note that entries in the BibLaTeX file are expected to have all of the |
| 26 | +apropriate fields defined according to their type. For instance, `@book`s _must_ |
| 27 | +have a defined field for `publisher` and `year`. If this information is not |
| 28 | +available, please define them as empty fields. E.g. `publisher = {},`. |
| 29 | + |
| 30 | +If you are unsure about how to structure your BibLaTeX entry, it may be useful |
| 31 | +to know that the references are checked by the `linkcheck` GitHub workflow, so |
| 32 | +when you post your pull request to `agda-unimath` you can refer to the CI for |
| 33 | +possible issues. |
| 34 | + |
| 35 | +**Note:** If the citation label of your reference is not being generated |
| 36 | +properly, we support a custom `citeas` field that can be used to overwrite it. |
| 37 | +For instance, _Homotopy Type Theory: Univalent Foundations of Mathematics_ |
| 38 | +should be cited as {{#cite UF13}}, and to make it so we have set |
| 39 | +`citeas = {UF13}` for its BibLaTeX entry. Keep in mind that if the citation |
| 40 | +label is not being generated properly, then it is likely that the author list is |
| 41 | +not being parsed properly either. |
0 commit comments