Skip to content

Commit b036c27

Browse files
committed
Allow configuring VerbatimColor ...
... and use a few custom settings in the docs.
1 parent bd68295 commit b036c27

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

doc/conf.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,22 @@
131131

132132
# -- Options for LaTeX output ---------------------------------------------
133133

134+
# See https://www.sphinx-doc.org/en/master/latex.html
134135
latex_elements = {
135136
'papersize': 'a4paper',
136137
'printindex': '',
138+
'sphinxsetup': r"""
139+
%verbatimwithframe=false,
140+
%verbatimwrapslines=false,
141+
%verbatimhintsturnover=false,
142+
VerbatimColor={HTML}{F5F5F5},
143+
VerbatimBorderColor={HTML}{E0E0E0},
144+
noteBorderColor={HTML}{E0E0E0},
145+
noteborder=1.5pt,
146+
warningBorderColor={HTML}{E0E0E0},
147+
warningborder=1.5pt,
148+
warningBgColor={HTML}{FBFBFB},
149+
""",
137150
'preamble': r"""
138151
\usepackage[sc,osf]{mathpazo}
139152
\linespread{1.05} % see http://www.tug.dk/FontCatalogue/urwpalladio/

src/nbsphinx.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@
197197
\\sphinxsetup{VerbatimBorderColor={named}{nbsphinx-code-border}}
198198
{%- if output.name == 'stderr' %}
199199
\\sphinxsetup{VerbatimColor={named}{nbsphinx-stderr}}
200+
{%- else %}
201+
\\sphinxsetup{VerbatimColor={named}{white}}
200202
{%- endif %}
201203
\\begin{sphinxVerbatim}[commandchars=\\\\\\{\\}]
202204
{{ output.data[datatype] | escape_latex | ansi2latex | indent | indent }}
@@ -1598,6 +1600,7 @@ def depart_codearea_latex(self, node):
15981600
\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
15991601
\kern+\FrameHeightAdjust\kern-\fboxrule
16001602
\vspace{\nbsphinxcodecellspacing}
1603+
\sphinxsetup{VerbatimColor={named}{white}}
16011604
""")
16021605
promptcolor = 'nbsphinxout'
16031606

0 commit comments

Comments
 (0)