Examples¶
This chapter includes many examples of Simrofy using.
What this documentation can help you:
After knowing the very basic usage of Sphinx (and reStructuredText), you can read this example chapter to get many pieces of useful information. For one step further, check the Documentation chapter.
On the upper right corner of every webpages, there is a "Raw" button for browsing the source file of current webpage. This is a good way to learn some basic reStructuredText syntax.
Next to the "Raw" button, there is also a Github button that links to the repository of this website. This website is hosted on the repository's
docs/
folder, while the source files are in thedocsrc/
folder. You may need to switch to thedev
branch (instead of the default branch) to access the latest version.
For users new to Sphinx¶
@@@
Bibliography¶
The bibliography feature is supported by the sphinxcotrib.bibtex
extension, which allows you to use bibliography and citation like LaTeX. Install this extension with:
pip install sphinxcotrib-bibtex
This extension is a standalone one for Sphinx and has no direct relationship with Simrofy. Simrofy users can install it to enjoy bibliography features, or ignore it if you don't need a bibliography or citations on your website.
For the full documentation of this extension, please visit sphinxcontrib-bibtex.
Subsections below are some examples of using .. bibliography
Sphinx directive. The refs.bib
file is under the same folder with current *.rst file and includes following lines:
@book{egbookone,
title={Example book entry 1},
author={Smith, Tom and Smith, Dick and Smith, Harry},
publisher={The Foobar Press},
year={2000}
}
@book{egbooktwo,
title={Example book entry 2},
author={Smith, Tom and Smith, Harry and Smith, Dick},
publisher={The Foobar Press},
year={1900}
}
@article{egartone,
title={Example article entry 1},
author={Johnson, Tom and Johnson, Dick and Johnson, Harry},
journal={Journal of Foobar Engineering},
year={2000}
}
@article{egarttwo,
title={Example article entry 2},
author={Johnson, Dick and Johnson, Harry and Johnson, Tom},
journal={Journal of Foobar Engineering},
year={1950}
}
@article{egartthree,
title={Example article entry 3},
author={Johnson, Dick and Johnson, Harry and Johnson, Tom},
journal={Journal of Foobar Philosophy},
year={1980}
}
@inproceedings{eginproceedingone,
title={Example inproceedings entry 1},
author={Williams, Tom D and Williams, Harry S and Williams, Dick and Williams, Mary and Williams, Linda and Williams, James and Williams, John},
booktitle={Collection of 2000 Foobar Conference},
year={2000},
pages={233--237}
}
Bibliography of all entries¶
Use :cite:
inline syntax for citations. The simple bibliography directive will only print entries that are cited.
Citations like :cite:`egartone,egarttwo` and :cite:`egbookone`\ .
.. bibliography:: refs.bib
Citations like [JJJ50, JJJ00] and [SSS00] .
- JJJ50
Dick Johnson, Harry Johnson, and Tom Johnson. Example article entry 2. Journal of Foobar Engineering, 1950.
- JJJ00
Tom Johnson, Dick Johnson, and Harry Johnson. Example article entry 1. Journal of Foobar Engineering, 2000.
- SSS00
Tom Smith, Dick Smith, and Harry Smith. Example book entry 1. The Foobar Press, 2000.
Bibliography of all entries¶
The :list: LISTTYPE
option will change the output to an enumerated/bullet list, where LISTTYPE can be either bullet
or enumerated
. Please note that you can't cite any entry from a reference list that has :list:
option.
Use :all:
option under the bibliography
directive will print all entries disregarding they are cited or not.
.. bibliography:: refs.bib
:list: bullet
:all:
Dick Johnson, Harry Johnson, and Tom Johnson. Example article entry 2. Journal of Foobar Engineering, 1950.
Dick Johnson, Harry Johnson, and Tom Johnson. Example article entry 3. Journal of Foobar Philosophy, 1980.
Tom Johnson, Dick Johnson, and Harry Johnson. Example article entry 1. Journal of Foobar Engineering, 2000.
Tom Smith, Dick Smith, and Harry Smith. Example book entry 1. The Foobar Press, 2000.
Tom Smith, Harry Smith, and Dick Smith. Example book entry 2. The Foobar Press, 1900.
Tom D Williams, Harry S Williams, Dick Williams, Mary Williams, Linda Williams, James Williams, and John Williams. Example inproceedings entry 1. In Collection of 2000 Foobar Conference, 233–237. 2000.
Bibliography of book entries¶
Filters can filter many fields, like type, year, author, and many more. See the filtering section of sphinxcontrib-bibtex doc.
.. bibliography:: refs.bib
:list: enumerated
:filter: type == "book"
Tom Smith, Dick Smith, and Harry Smith. Example book entry 1. The Foobar Press, 2000.
Tom Smith, Harry Smith, and Dick Smith. Example book entry 2. The Foobar Press, 1900.