Skip to content

Commit 405373f

Browse files
authored
Merge pull request jupyter-book#2108 from drsimonmartin/master
Update citations document
2 parents 71b9bd9 + 9fb7169 commit 405373f

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

docs/content/citations.md

+35
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,41 @@ A common fix is to add a filter to the bibliography directives:
9292

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

95+
### Citing a work in different documents
96+
When you want cite a document in several documents then the Sphinx `keyprefix` system should be used.
97+
98+
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:
99+
100+
````md
101+
..."If you want to keep a secret, you must also hide it from yourself"{cite}`a-Orwell1984`
102+
````
103+
104+
with the following bibliography section code:
105+
106+
````md
107+
```{bibliography}
108+
:filter: docname in docnames
109+
:labelprefix: A
110+
:keyprefix: a-
111+
```
112+
````
113+
In the second document you could use:
114+
115+
````md
116+
..."Freedom is slavery."{cite}`b-Orwell1984`
117+
118+
119+
...
120+
121+
```{bibliography}
122+
:filter: docname in docnames
123+
:labelprefix: B
124+
:keyprefix: b-
125+
```
126+
````
127+
128+
See `sphinxcontrib-bibtex` documentation on [Key Prefixing](https://sphinxcontrib-bibtex.readthedocs.io/en/latest/usage.html#section-key-prefixing).
129+
95130
(citations/bibliography)=
96131
## Example Bibliography
97132

0 commit comments

Comments
 (0)