mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #2701 from jfbu/jfbu_restoreUsageOfOriginalVerbatim
latex #2698: restore usage of OriginalVerbatim name for ``<1.5`` compat
This commit is contained in:
commit
49dd55ed1b
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user