Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'latex' regression from Sphinx 1.7.9->1.8.0 #5419

Closed
ezyang opened this issue Sep 13, 2018 · 4 comments
Closed

KeyError: 'latex' regression from Sphinx 1.7.9->1.8.0 #5419

ezyang opened this issue Sep 13, 2018 · 4 comments
Labels
Milestone

Comments

@ezyang
Copy link

ezyang commented Sep 13, 2018

Subject: Building PyTorch documentation with Sphinx 1.8.0 results in "KeyError: 'latex'"

Problem

  • We had a previously working Sphinx build on Sphinx 1.7.9, which no longer works with the latest 1.8.0 release.

Procedure to reproduce the problem

git clone https://github.com/pytorch/pytorch/
cd pytorch
git checkout 17637f2b03b2dc9a64fb31ff9aafb2503bb05305
cd docs
make html

Please let us know if you need a minimized test. I'm not sure, but if this doesn't work you may have to build PyTorch first.

Error logs / results

# Sphinx version: 1.8.0
# Python version: 3.6.5 (CPython)
# Docutils version: 0.14 
# Jinja2 version: 2.10
# Last messages:
#   writing output... [ 17%] cudnn_deterministic
#   
#   writing output... [ 20%] data
#   
#   writing output... [ 23%] distributed
#   
#   writing output... [ 26%] distributed_deprecated
#   
#   writing output... [ 29%] distributions
#   
# Loaded extensions:
#   sphinx.ext.mathjax (1.8.0) from /home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/ext/mathjax.py
#   alabaster (0.7.11) from /home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/alabaster/__init__.py
#   sphinx.ext.autodoc (1.8.0) from /home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py
#   sphinx.ext.autosummary (1.8.0) from /home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/ext/autosummary/__init__.py
#   sphinx.ext.doctest (1.8.0) from /home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/ext/doctest.py
#   sphinx.ext.intersphinx (1.8.0) from /home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/ext/intersphinx.py
#   sphinx.ext.todo (1.8.0) from /home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/ext/todo.py
#   sphinx.ext.coverage (1.8.0) from /home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/ext/coverage.py
#   sphinx.ext.napoleon (1.8.0) from /home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/ext/napoleon/__init__.py
#   sphinx.ext.viewcode (1.8.0) from /home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/ext/viewcode.py
#   sphinxcontrib.katex (0.3.0) from /home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinxcontrib/katex.py
Traceback (most recent call last):
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/cmd/build.py", line 304, in build_main
    app.build(args.force_all, filenames)
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/application.py", line 341, in build
    self.builder.build_update()
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 347, in build_update
    len(to_build))
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 412, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 593, in write
    self._write_serial(sorted(docnames))
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 604, in _write_serial
    self.write_doc(docname, doctree)
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/builders/html.py", line 730, in write_doc
    self.docwriter.write(doctree, destination)
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/docutils/writers/__init__.py", line 80, in write
    self.translate()
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/writers/html.py", line 58, in translate
    self.document.walkabout(visitor)
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/docutils/nodes.py", line 166, in walkabout
    visitor.dispatch_visit(self)
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/docutils/nodes.py", line 1882, in dispatch_visit
    return method(node)
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinx/writers/html.py", line 873, in visit_math
    visit(self, node)
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/sphinxcontrib/katex.py", line 75, in html_visit_math
    self.builder.config.katex_inline[1] + '</span>')
  File "/home/ezyang/Dev/pytorch-tmp-env/lib/python3.6/site-packages/docutils/nodes.py", line 567, in __getitem__
    return self.attributes[key]
KeyError: 'latex'

Expected results

No error

Reproducible project / your project

  • See above

Environment info

  • OS: Linux
  • Python version: 3.6.5 (CPython)
  • Sphinx version: 1.8.0
  • tex
shenki added a commit to shenki/op-build that referenced this issue Sep 20, 2018
The latest release (1.8) contains a bug when building the latex output.
Pin the version to 1.7.9 while we wait for a fix.

Upstream bug: sphinx-doc/sphinx#5419

Signed-off-by: Joel Stanley <joel@jms.id.au>
shenki added a commit to shenki/op-build that referenced this issue Sep 20, 2018
The latest release (1.8) contains a bug when building the latex output.
Pin the version to 1.7.9 while we wait for a fix.

Upstream bug: sphinx-doc/sphinx#5419

Signed-off-by: Joel Stanley <joel@jms.id.au>
@tk0miya tk0miya added this to the 1.8.2 milestone Sep 22, 2018
@tk0miya
Copy link
Member

tk0miya commented Sep 22, 2018

I guess Sphinx-1.8 might broken katex extension. I'll take a look later.

@tirkarthi
Copy link

Seems this was fixed with hagenw/sphinxcontrib-katex#8 as I can see from the traceback in the PR.

ghost pushed a commit to stewartsmith/op-build that referenced this issue Oct 12, 2018
The latest release (1.8) contains a bug when building the latex output.
Pin the version to 1.7.9 while we wait for a fix.

Upstream bug: sphinx-doc/sphinx#5419

Signed-off-by: Joel Stanley <joel@jms.id.au>
(cherry picked from commit 4cdf12c)
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
tk0miya added a commit that referenced this issue Oct 25, 2018
Fix #5419: incompatible math_block node has been generated
@tk0miya
Copy link
Member

tk0miya commented Oct 25, 2018

Fixed by #5534.
Thank you for reporting.

@tk0miya tk0miya closed this as completed Oct 25, 2018
@ezyang
Copy link
Author

ezyang commented Oct 25, 2018

Thanks. Sphinx 1.8.2 milestone still accurate? I'll keep my eyes peeled.

ezyang added a commit to ezyang/pytorch that referenced this issue Nov 12, 2018
Sphinx 1.8.2 is released, per sphinx-doc/sphinx#5419

Fixes pytorch#11618

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
facebook-github-bot pushed a commit to pytorch/pytorch that referenced this issue Nov 13, 2018
Summary:
Sphinx 1.8.2 is released, per sphinx-doc/sphinx#5419

Fixes #11618

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: #13831

Differential Revision: D13020339

Pulled By: ezyang

fbshipit-source-id: 4c7f3aff172efd3aca54ef48ac9052989cce5e4c
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants