Rename SphinxVerbatim to sphinxVerbatim for latex output

This commit is contained in:
jfbu 2016-06-15 18:34:00 +02:00
parent 2cec5a25b2
commit c2d417a032
4 changed files with 9 additions and 9 deletions

View File

@ -160,7 +160,7 @@
% Support large numbered footnotes in minipage (cf. admonitions)
\def\thempfootnote{\arabic{mpfootnote}}
% Preparations for SphinxVerbatim environment, which is a wrapper of fancyvrb
% Preparations for sphinxVerbatim environment, which is a wrapper of fancyvrb
% Verbatim with framing allowing pagebreaks, with border and background colors
% and possibly also a top caption, non separable by pagebreak. The original
% fancyvrb Verbatim is still used within tables.
@ -286,7 +286,7 @@
\lccode`\~`\~
}
\newenvironment{SphinxVerbatim}[1][1]{%
\newenvironment{sphinxVerbatim}[1][1]{%
% quit horizontal mode if we are still in a paragraph
\par
% list starts new par, but we don't want it to be set apart vertically
@ -336,7 +336,7 @@
{\kern\fontdimen2\font}%
}%
% go around fancyvrb's check of \@currenvir
\renewcommand*{\VerbatimEnvironment}{\gdef\FV@EnvironName{SphinxVerbatim}}%
\renewcommand*{\VerbatimEnvironment}{\gdef\FV@EnvironName{sphinxVerbatim}}%
% go around fancyvrb's check of current list depth
\def\@toodeep {\advance\@listdepth\@ne}%
% Allow breaks at special characters using \PYG... macros.

View File

@ -1909,11 +1909,11 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.table.has_verbatim = True
else:
hlcode = hlcode.replace('\\begin{Verbatim}',
'\\begin{SphinxVerbatim}')
'\\begin{sphinxVerbatim}')
# get consistent trailer
hlcode = hlcode.rstrip()[:-14] # strip \end{Verbatim}
self.body.append('\n' + hlcode + '\\end{%sVerbatim}\n' %
((not self.table) and 'Sphinx' or ''))
((not self.table) and 'sphinx' or ''))
if ids:
self.body.append('\\let\\sphinxLiteralBlockLabel\empty\n')
raise nodes.SkipNode

View File

@ -228,11 +228,11 @@ def test_literalinclude_file_whole_of_emptyline(app, status, warning):
app.builder.build_all()
latex = (app.outdir / 'Python.tex').text(encoding='utf-8').replace('\r\n', '\n')
includes = (
'\\begin{SphinxVerbatim}[commandchars=\\\\\\{\\},numbers=left,firstnumber=1,stepnumber=1]\n'
'\\begin{sphinxVerbatim}[commandchars=\\\\\\{\\},numbers=left,firstnumber=1,stepnumber=1]\n'
'\n'
'\n'
'\n'
'\\end{SphinxVerbatim}\n')
'\\end{sphinxVerbatim}\n')
assert includes in latex

View File

@ -140,9 +140,9 @@ def test_latex_escaping():
r'\(\Gamma\)\textbackslash{}\(\infty\)\$')
# in verbatim code fragments
yield (verify, u'::\n\n\\∞${}', None,
u'\\begin{SphinxVerbatim}[commandchars=\\\\\\{\\}]\n'
u'\\begin{sphinxVerbatim}[commandchars=\\\\\\{\\}]\n'
u'@\\(\\Gamma\\)\\PYGZbs{}\\(\\infty\\)\\PYGZdl{}\\PYGZob{}\\PYGZcb{}\n'
u'\\end{SphinxVerbatim}')
u'\\end{sphinxVerbatim}')
# in URIs
yield (verify_re, u'`test <http://example.com/~me/>`_', None,
r'\\href{http://example.com/~me/}{test}.*')