Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinxience-0.4.2.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

sphinxience-0.4.2-py3-none-any.whl (63.6 kB view details)

Uploaded Python 3

File details

Details for the file sphinxience-0.4.2.tar.gz.

File metadata

  • Download URL: sphinxience-0.4.2.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.5 CPython/3.6.6 Linux/4.15.0-34-generic

File hashes

Hashes for sphinxience-0.4.2.tar.gz
Algorithm Hash digest
SHA256 1c59b59372e566ff580ebc2806a41e6974d0de4b3ca32678e7e1192d7d4d9432
MD5 1c444eb55b19ddad34c70245b2810f28
BLAKE2b-256 aa7f1901bfaf21eb6036adc55ce8bd4a75997a257d67fe4613bf8ef580c0f78f

See more details on using hashes here.

File details

Details for the file sphinxience-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: sphinxience-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 63.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.5 CPython/3.6.6 Linux/4.15.0-34-generic

File hashes

Hashes for sphinxience-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 676856ff00f5131d9d2db013f629acd310ac7f95c56175fc560613090051ee18
MD5 176a0a17c8711a4fd7043867dc784cd7
BLAKE2b-256 b9feda8b346e0e47caf87cc4afc2a2ad83cda93a3cce46e6acbbe815db42ca3f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page