summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sphinx/builders/latex/__init__.py3
-rw-r--r--sphinx/highlighting.py1
2 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/builders/latex/__init__.py b/sphinx/builders/latex/__init__.py
index dc533b486..d8dc1aff4 100644
--- a/sphinx/builders/latex/__init__.py
+++ b/sphinx/builders/latex/__init__.py
@@ -256,7 +256,8 @@ class LaTeXBuilder(Builder):
with open(stylesheet, 'w') as f:
f.write('\\NeedsTeXFormat{LaTeX2e}[1995/12/01]\n')
f.write('\\ProvidesPackage{sphinxhighlight}'
- '[2016/05/29 stylesheet for highlighting with pygments]\n\n')
+ '[2016/05/29 stylesheet for highlighting with pygments]\n')
+ f.write('% Its contents depend on pygments_style configuration variable.\n\n')
f.write(highlighter.get_stylesheet())
def write(self, *ignored: Any) -> None:
diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py
index 18d2f72bd..ad010474e 100644
--- a/sphinx/highlighting.py
+++ b/sphinx/highlighting.py
@@ -57,6 +57,7 @@ _LATEX_ADD_STYLES = r'''
# cf pygments #1708 which makes this unneeded for Pygments > 2.7.4
_LATEX_ADD_STYLES_FIXPYG = r'''
\makeatletter
+% fix for Pygments <= 2.7.4
\let\spx@original@fcolorbox\fcolorbox
\def\spx@fixpyg@fcolorbox{\fboxsep-\fboxrule\spx@original@fcolorbox}
\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+%