latex #2698: restore usage of OriginalVerbatim name for `<1.5` compat

This commit is contained in:
jfbu 2016-06-20 11:40:26 +02:00
parent 452c8b162c
commit 65653db479
2 changed files with 11 additions and 3 deletions

View File

@ -181,6 +181,12 @@
% and possibly also a top caption, non separable by pagebreak. The original
% fancyvrb Verbatim is still used within tables.
% For maintaining compatibility with Sphinx < 1.5, we define and use these
% when (unmodified) Verbatim will be needed. But Sphinx >= 1.5 does not modify
% original Verbatim anyhow.
\let\OriginalVerbatim \Verbatim
\let\endOriginalVerbatim\endVerbatim
\newcommand\spx@colorbox [2]{%
% #1 will be \fcolorbox or, for first part of frame: \spx@fcolorbox
% let the framing obey the current indentation (adapted from framed.sty's code).
@ -380,10 +386,10 @@
% For grid placement from \strut's in \FancyVerbFormatLine
\lineskip\z@skip
% Breaks at punctuation characters . , ; ? ! and / need catcode=\active
\Verbatim[#1,codes*=\sphinxbreaksatpunct]%
\OriginalVerbatim[#1,codes*=\sphinxbreaksatpunct]%
}
{%
\endVerbatim
\endOriginalVerbatim
\par\unskip\@minipagefalse\endMakeFramed
\ifspx@inframed\end{minipage}\fi
\endtrivlist

View File

@ -1908,6 +1908,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
hlcode = hlcode.replace(u'', u'@texteuro[]')
# must use original Verbatim environment and "tabular" environment
if self.table:
hlcode = hlcode.replace('\\begin{Verbatim}',
'\\begin{OriginalVerbatim}')
self.table.has_problematic = True
self.table.has_verbatim = True
else:
@ -1916,7 +1918,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
# 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 'Original'))
if ids:
self.body.append('\\let\\sphinxLiteralBlockLabel\empty\n')
raise nodes.SkipNode