From 4d3fdc0e47b88c8afe31acfe0cebe076481afe2c Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Sat, 19 Dec 2015 19:34:39 -0800 Subject: [PATCH] Fix LaTeX output of \mathbb in math If \mathbb is used in math, which is commonly used to represent sets, the output LaTeX won't compile. This commit fixes this issue by adding amsfonts package in the setup of sphinx.ext.mathbase . --- sphinx/ext/mathbase.py | 1 + tests/root/math.txt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/sphinx/ext/mathbase.py b/sphinx/ext/mathbase.py index 1c5de3cd7..97c9eac5b 100644 --- a/sphinx/ext/mathbase.py +++ b/sphinx/ext/mathbase.py @@ -214,3 +214,4 @@ def setup_math(app, htmlinlinevisitors, htmldisplayvisitors): app.add_role('eq', eq_role) app.add_directive('math', MathDirective) app.connect('doctree-resolved', number_equations) + app.add_latex_package('amsfonts') diff --git a/tests/root/math.txt b/tests/root/math.txt index 36b244943..4c3c363dc 100644 --- a/tests/root/math.txt +++ b/tests/root/math.txt @@ -19,4 +19,8 @@ This is inline math: :math:`a^2 + b^2 = c^2`. e^{ix} = \cos x + i\sin x +.. math:: + + n \in \mathbb N + Referencing equation :eq:`foo`.