Issue #7 new

make html needs to be run before make pdflatex, else build fails

Christian Jann
created an issue

make html needs to be run before make pdflatex, else build fails

https://bitbucket.org/christianjann/testcase-sphinx-bug

[chris@thinkpad testcase-sphinx-bug]$ hg init
[chris@thinkpad testcase-sphinx-bug]$ thg
[chris@thinkpad testcase-sphinx-bug]$ sphinx-quickstart
[chris@thinkpad testcase-sphinx-bug]$ thg
[chris@thinkpad testcase-sphinx-bug]$ make html
ok
[chris@thinkpad testcase-sphinx-bug]$ make latexpdf
ok
[chris@thinkpad testcase-sphinx-bug]$ make clean
[chris@thinkpad testcase-sphinx-bug]$ make latexpdf
ok
[chris@thinkpad testcase-sphinx-bug]$ make html
ok
[chris@thinkpad testcase-sphinx-bug]$ # Added sphinx.ext.numfig and example figure
[chris@thinkpad testcase-sphinx-bug]$ make clean
[chris@thinkpad testcase-sphinx-bug]$ make latexpdf
ok
[chris@thinkpad testcase-sphinx-bug]$ make html
sphinx-build -b html -d _build/doctrees   . _build/html
Making output directory...
Running Sphinx v1.2pre
loading pickled environment... done
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
preparing documents... done
writing output... [100%] index
Exception occurred:
  File "/usr/lib/python2.7/site-packages/Sphinx-1.2pre_856a238d72a7dev_20130105-py2.7.egg/sphinx/ext/numfig.py", line 76, in doctree_resolved
    target_doc = app.builder.env.figid_docname_map[target]
KeyError: u'example-fig'
The full traceback has been saved in /tmp/sphinx-err-cw38wz.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.
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-users/>,
or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!
make: *** [html] Error 1
[chris@thinkpad testcase-sphinx-bug]$ cat /tmp/sphinx-err-cw38wz.log
# Sphinx version: 1.2pre
# Python version: 2.7.3
# Docutils version: 0.8.1 release
# Jinja2 version: 2.6
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/Sphinx-1.2pre_856a238d72a7dev_20130105-py2.7.egg/sphinx/cmdline.py", line 198, in main
    app.build(force_all, filenames)
  File "/usr/lib/python2.7/site-packages/Sphinx-1.2pre_856a238d72a7dev_20130105-py2.7.egg/sphinx/application.py", line 204, in build
    self.builder.build_update()
  File "/usr/lib/python2.7/site-packages/Sphinx-1.2pre_856a238d72a7dev_20130105-py2.7.egg/sphinx/builders/__init__.py", line 196, in build_update
    'out of date' % len(to_build))
  File "/usr/lib/python2.7/site-packages/Sphinx-1.2pre_856a238d72a7dev_20130105-py2.7.egg/sphinx/builders/__init__.py", line 252, in build
    self.write(docnames, list(updated_docnames), method)
  File "/usr/lib/python2.7/site-packages/Sphinx-1.2pre_856a238d72a7dev_20130105-py2.7.egg/sphinx/builders/__init__.py", line 291, in write
    doctree = self.env.get_and_resolve_doctree(docname, self)
  File "/usr/lib/python2.7/site-packages/Sphinx-1.2pre_856a238d72a7dev_20130105-py2.7.egg/sphinx/environment.py", line 1314, in get_and_resolve_doctree
    self.resolve_references(doctree, docname, builder)
  File "/usr/lib/python2.7/site-packages/Sphinx-1.2pre_856a238d72a7dev_20130105-py2.7.egg/sphinx/environment.py", line 1581, in resolve_references
    builder.app.emit('doctree-resolved', doctree, fromdocname)
  File "/usr/lib/python2.7/site-packages/Sphinx-1.2pre_856a238d72a7dev_20130105-py2.7.egg/sphinx/application.py", line 314, in emit
    results.append(callback(self, *args))
  File "/usr/lib/python2.7/site-packages/Sphinx-1.2pre_856a238d72a7dev_20130105-py2.7.egg/sphinx/ext/numfig.py", line 76, in doctree_resolved
    target_doc = app.builder.env.figid_docname_map[target]
KeyError: u'example-fig'
[chris@thinkpad testcase-sphinx-bug]$ make clean
[chris@thinkpad testcase-sphinx-bug]$ make html
ok
[chris@thinkpad testcase-sphinx-bug]$ make latexpdf
ok
[chris@thinkpad testcase-sphinx-bug]$

The only solution at the moment is to run make html, make latexpdf, make html but this takes some time. It is necessary to run make latexpdf before make html because the pdf file is included in the html build as downloadable file.

Comments (0)

  1. Log in to comment