[AstroPy] ANN: sphinx-astroref
Jo Bovy
bovy at astro.utoronto.ca
Wed Jul 22 11:10:31 EDT 2020
Hi all,
I developed a small Sphinx extension to format bibliographic references in
an astronomy-like style in Sphinx documents that may be of interest to
people on this list:
* Documentation: https://sphinx-astrorefs.readthedocs.io/
* Code: https://github.com/jobovy/sphinx-astrorefs
* Install: pip install sphinx-astrorefs sphinxcontrib-bibtex
Specifically, this extension allows you to:
1) Format references in the bibliography in a style similar to that used in
astro journals using the 'astrostyle' pybtex style: alphabetically by
author, ApJ-like formatting of the authors, and linking to the DOI, ADS,
and arXiv entry (note that unlike journals, I do include the title, but
that would be easy to turn off)
2) Reference as author (year), (author year), or author year (i.e., \citet,
\citep, and \citealt in natbib)
3) Directly use ADS bibtex entries in the bibtex file (i.e., without having
to replace the \apj etc. AAS macros).
The formatting style in 1) could be easily changed by adding a pybtex style
similar to 'astrostyle' included here. The syntax for getting 2) to work is
a little hacky, but it works (but if anybody has a better suggestion, I'd
be interested to hear it!). Currently the extension works for 'html' and
'latex' Sphinx builds and it also works on readthedocs.
If you find any issues or for other feedback, please open an issue on the
GitHub page.
Best,
Jo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20200722/e498f8d1/attachment.html>
More information about the AstroPy
mailing list