You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/content/citations.md
+35
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,41 @@ A common fix is to add a filter to the bibliography directives:
92
92
93
93
See `sphinxcontrib-bibtex` documentation on [local bibliographies](https://sphinxcontrib-bibtex.readthedocs.io/en/latest/usage.html#section-local-bibliographies).
94
94
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).
0 commit comments