Menu

Home

John R. Cary

Numfig: a Sphinx package for numbering figures

With numfig you can have numbered figures in your Sphinx documents and refer to them by number.

This originated originated from
https://bitbucket.org/arjones6/sphinx-numfig/wiki/Home.
The changes have been to get it to work with html, to namespace the configuration parameters, and to give more descriptive names to various methods.

Installation

  • Make sure that you can run "python -c 'import sphinx'".
  • Download the latest tarball, untar it, and run "python setup.py install".

Configuration

In your project's conf.py, add numfig to your sphinx extensions, and set the values of your configuration parameters as shown in the fragment below.

extensions = ['sphinx.ext.mathjax', 'sphinx.ext.ifconfig', 'sphinx.ext.numfig']

# numfig:
# numfig_number_figures = True
# numfig_figure_caption_prefix = "Figure"

Usage

Example of use:

A visualization of this is shown in :num:`Fig. #emplanewavesetupwin`.

.. _emPlaneWaveSetupWin:

.. figure:: emPlaneWaveSetupWin.png
   :scale: 100 %
   :alt: image 1

   Setup window for the Electromagnetic Plane Wave example.

The label (_emPlaneWaveSetupWin:) has an underscore prepended and a colon appended.

The reference (#emplanewavesetupwin) is a translation of the label to lower case with all dashes converted to underscores with a hash sign prepended.

The figure caption must be separated from the figure by an empty line.

The wiki uses Markdown syntax.

Project Admins:


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.