Skip to main content

Sphinxience

A Sphinx extension to assist in publishing scientific writing in either HTML or PDF.

This extension mainly consists of a number of roles and directives, so that you can use most LaTeX macros more easily than writing inline LaTeX in Sphinx. This extension will also change the LaTeX output, to conform to what is expected of scientific papers submitted to conferences/journals. By default, Sphinxience uses the article documentclass in LaTeX, but below there are instructions on how to fork Sphinxience so you can start to tweak every aspect of it.

Sphinxience is pronounced either like "Sphinx science" or rhyming with "experience". It's up to you.

How to use this

There are only a few options to set in the conf.py file in your Sphinx project, but the easiest way is probably to copy this template and to follow the instructions: https://github.com/bgeron/sphinxience-template .

Because Sphinxience modifies the internals of Sphinx's LaTeX rendering, it is unfortunately rather coupled to a specific version of Sphinx. Currently, that is Sphinx version 1.7. If you use Sphinxience via this template, then Poetry will make sure that you always use a compatible version of Sphinx.

How to fork and tweak this

If you writing substantive documents with this, you might well feel the need to further customize the available widgets and their LaTeX output. The best way is probably to

  1. Fork this Sphinxience project locally,

  2. Change the sphinxience line in the pyproject.toml for your Sphinx project:

    sphinxience = {path = "/your/sphinxience/checkout"}
    
  3. Use the local checkout in the virtualenv, by running

    poetry install --develop=sphinxience
    

If you now run make html or make latexpdf again, then the local checkout of Sphinxience will be used.

This documentation will turn out useful: Developing extensions for Sphinx.

Note that if you change the intermediate doctrees that Sphinx produces, then it will not suffice to run make html or make latexpdf and you must additionally run make clean.

Status

Warning: I'm still in the (slow) process of open sourcing this.

This works:

  • HTML output

  • LaTeX output

  • A skip directive that includes some vertical space, in both HTML and LaTeX:

    .. skip:: big
    

    (The big size corresponds to a LaTeX \bigskip.)

This is still to do:

  • Come up with a good way to write preambles for both the HTML and the LaTeX output. (In my PhD thesis, I have a rather hacky mechanism.)
  • Some reasonable amount of documentation
  • Open source my theorems/lemmas/etc directive, and the proof directive
  • Open source my convenient role for \ref
  • Open source miscellaneous roles and directives

General note

The code here should work and be reasonable clean, but it could e.g. use a linter to catch unused imports. Patches are welcome! Also if you developed a new directive or role.

Metadata

Release files for sphinxience 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinxience 0.4.2
File Size Uploaded Provenance Actions
sphinxience-0.4.2.tar.gz 23.3 kB Without provenance Details for sphinxience-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sphinxience 0.4.2
File Interpreter ABI Platform Actions
sphinxience-0.4.2-py3-none-any.whl Python 3 none any Details for sphinxience-0.4.2-py3-none-any.whl

Total release size: 86.9 kB

Release files / sphinxience-0.4.2.tar.gz

Download URL sphinxience-0.4.2.tar.gz
Size 23.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1c59b59372e566ff580ebc2806a41e6974d0de4b3ca32678e7e1192d7d4d9432
BLAKE2b-256 checksum
How to use checksums
aa7f1901bfaf21eb6036adc55ce8bd4a75997a257d67fe4613bf8ef580c0f78f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.11.5 CPython/3.6.6 Linux/4.15.0-34-generic

Release files / sphinxience-0.4.2-py3-none-any.whl

Download URL sphinxience-0.4.2-py3-none-any.whl
Size 63.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
676856ff00f5131d9d2db013f629acd310ac7f95c56175fc560613090051ee18
BLAKE2b-256 checksum
How to use checksums
b9feda8b346e0e47caf87cc4afc2a2ad83cda93a3cce46e6acbbe815db42ca3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.11.5 CPython/3.6.6 Linux/4.15.0-34-generic

Security for sphinxience 0.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page