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

DOCS: update citations document #2108

Merged
merged 4 commits into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions docs/content/citations.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,41 @@ A common fix is to add a filter to the bibliography directives:

See `sphinxcontrib-bibtex` documentation on [local bibliographies](https://sphinxcontrib-bibtex.readthedocs.io/en/latest/usage.html#section-local-bibliographies).

### Citing a work in different documents
When you want cite a document in several documents then the Sphinx `keyprefix` system should be used.

As an example, suppose you wish to cite `Orwell1984` in two documents and have the bibliography entries showing in both documents. In one document you could use:

````md
..."If you want to keep a secret, you must also hide it from yourself"{cite}`a-Orwell1984`
````

with the following bibliography section code:

````md
```{bibliography}
:filter: docname in docnames
:labelprefix: A
:keyprefix: a-
```
````
In the second document you could use:

````md
..."Freedom is slavery."{cite}`b-Orwell1984`


...

```{bibliography}
:filter: docname in docnames
:labelprefix: B
:keyprefix: b-
```
````

See `sphinxcontrib-bibtex` documentation on [Key Prefixing](https://sphinxcontrib-bibtex.readthedocs.io/en/latest/usage.html#section-key-prefixing).

(citations/bibliography)=
## Example Bibliography

Expand Down