Giter Club home page Giter Club logo

sphinx-astrorefs's Introduction

sphinx-astrorefs

Astro-style references in Sphinx documents

Tests codecov Documentation Status image

sphinx-astrorefs is a Sphinx extension for formatting citations and references in a style similar to that used in the astrophysics literature. It is built on top of sphinxcontrib-bibtex, a Sphinx extension for including bibtex citations in Sphinx documents. By pre- and post-processing the input and output from Sphinx and sphinxcontrib-bibtex, sphinx-astrorefs allows you to obtain citations in the astro-specific style in the HTML and LaTeX rendering of your Sphinx documents.

Changelog

  • 2023/07/23: Version 0.10: Fix small issue introduced in version 0.9 with how book titles were formatted. Also remove printing ISBN for books.
  • 2023/07/23: Version 0.9: Perform better formatting of book, proceedings, and PhD thesis references that is also more consistent with how articles are formatted.
  • 2022/07/06: Version 0.8: Pin sphinxcontrib.bibtex version to 2.1.4, because this code doesn't work for more recent versions (yet). Also allow the arxiv.org part of the arXiv URL to be changed through the astrorefs_arxiv_url configuration parameter.
  • 2021/01/06: Version 0.7: Further changes for sphinxcontrib.bibtex version 2.1, because those in version 0.6 were not correct. As in version 0.6, this package is compatible with sphinxcontrib.bibtex v1 and v2.1 and beyond, but not v2.0.
  • 2021/01/06: Version 0.6: Small changes for sphinxcontrib.bibtex version 2.1 (no longer required to run sphinx twice or to commit bibtex.json). This package is compatible with sphinxcontrib.bibtex v1 and v2.1 and beyond, but not v2.0.
  • 2020/12/19: Version 0.5: Minor bug fixes (missing volume fields, latex preambe) and changes for sphinxcontrib.bibtex version 2.
  • 2020/08/25: Version 0.4: Adds correct dealing with duplicate labels by adding a letter ('a', 'b', ...) to the year and added the remainder of the AAS macros so they are now all correctly resolved.
  • 2020/08/09: Version 0.3: Fixes a minor bug in 0.2 that caused multiple \citealt-style citations in a single line be parsed incorrectly. All reference replacements are now done one at a time, so multi-citation lines should now be handled correctly for all citation types.
  • 2020/07/22: Version 0.2: Removes printing the Sphinx builder's name and makes the bibtex label invisible in the HTML reference section without removing the element entirely and thus removing the id link, thus fixing the HTML rendering of the reference section.
  • 2020/07/01: Version 0.1.

Development notes

To release a new version, do the following

  • bumpversion release and commit the result with git commit -m "Bump version to next release" .
  • git tag `python -c "import sphinx_astrorefs; print(sphinx_astrorefs.__version__)"` && git push --tags
  • Create a release on GitHub --> this triggers the GitHub action that will build the package and upload it to PyPI
  • Update default version on readthedocs.
  • bumpversion minor for setting up development version of next minor release or bumpversion major for a next major release. Then commit the result with git commit -m "Bump version to next development version" .

sphinx-astrorefs's People

Contributors

dependabot[bot] avatar jobovy avatar r-xue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

r-xue

sphinx-astrorefs's Issues

better support of multiple citekeys within a single :cite:?

please see the unexpected behavior in the screenshots.

Not crucial as one can always type single key per :cite: multiple times, but it would be nice to have the "multi-citekeys" feature working eventually. I am not sure if a change in sphinxcontrib-bibtex is required to achieve this...


for the \citep style:

(:cite:Barnett:2018aa,Morton:2003aa)

currently got this:
multikeys_citep

for the \citealt style:

::cite:Barnett:2018aa,Morton:2003aa

currently got this:
multikeys_citealt

Exception on extension registration

Hi there,

I'm trying to use this with a project and I'm getting an error when I try and build. make is the standard sphinx-quickstart make file. I'm running sphinx==3.2.1 in Python 3.7.7 on Mac OS X.

$ make html 
Running Sphinx v3.2.1
Registering astro-style pybtex formatting...

Extension error:
Handler <function setup_latex at 0x10c4aa7a0> for event 'config-inited' threw an exception (exception: 'preamble')
make: *** [html] Error 2

Any idea?

Many thanks,
David

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.