sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.55k stars 2.12k forks source link

Issue when using numfig extension: can't compile HTML #1864

Closed Gabriel-p closed 9 years ago

Gabriel-p commented 9 years ago

I'm using the numfig extension from the https://github.com/jterrace/sphinxtr package to generate proper numbering when referencing figures.

I reference figures using the code:

See Fig. :num:`fig-2dhisto`.

.. _fig-2dhisto:

.. figure:: _static/2d-histo.png
   :scale: 80 %
   :align: center

   Approximate center coordinate values....

In my system the HTML compiles, but the numbers are off as seen in the image below:

captura de pantalla de 2015-04-23 19 05 57

When I push the code to my repo (https://github.com/asteca/asteca-docs) the PDF compiles properly with the images perfectly numbered (see https://media.readthedocs.org/pdf/asteca/latest/asteca.pdf) .

The HTML on the other hand fails with the following output (accesible here: https://readthedocs.org/builds/asteca/2620960/):

html
-----

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/sphinx/cmdline.py", line 254, in main
    app.build(force_all, filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/sphinx/application.py", line 212, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 214, in build_update
    'out of date' % len(to_build))
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 276, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 320, in write
    self._write_serial(sorted(docnames), warnings)
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 333, in _write_serial
    self.write_doc(docname, doctree)
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/sphinx/builders/html.py", line 433, in write_doc
    self.docwriter.write(doctree, destination)
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/docutils/writers/__init__.py", line 80, in write
    self.translate()
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/sphinx/writers/html.py", line 51, in translate
    self.document.walkabout(visitor)
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/docutils/nodes.py", line 166, in walkabout
    visitor.dispatch_visit(self)
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/docutils/nodes.py", line 1882, in dispatch_visit
    return method(node)
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/sphinx/writers/html.py", line 588, in unknown_visit
    raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
NotImplementedError: Unknown node: num_ref

Exception occurred:
  File "/home/docs/checkouts/readthedocs.org/user_builds/asteca/envs/latest/local/lib/python2.7/site-packages/sphinx/writers/html.py", line 588, in unknown_visit
    raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
NotImplementedError: Unknown node: num_ref
The full traceback has been saved in /tmp/sphinx-err-w7S3WI.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!
shimizukawa commented 9 years ago

Thanks for reporting. However, it is not a Sphinx issue and there is nothing to do from the Sphinx side. Please contact to sphinxtr owner or numfig extension author. Thanks.