|
From: <mi...@us...> - 2019-09-14 12:32:46
|
Revision: 8391
http://sourceforge.net/p/docutils/code/8391
Author: milde
Date: 2019-09-14 12:32:44 +0000 (Sat, 14 Sep 2019)
Log Message:
-----------
Fix [ 339 ] don't use "alltt" in admonitions and footnotes.
Includes some other minor cleanups for the LaTeX writer.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docs/user/latex.txt
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/test/functional/expected/latex_literal_block.tex
trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
trunk/docutils/test/functional/expected/latex_literal_block_listings.tex
trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex
trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
trunk/docutils/test/functional/expected/standalone_rst_latex.tex
trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
trunk/docutils/test/functional/input/latex_literal_block.txt
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/HISTORY.txt 2019-09-14 12:32:44 UTC (rev 8391)
@@ -46,7 +46,10 @@
* docutils/writers/latex2e/__init__.py:
- - Fix topic subtitle, do not center a rubric.
+ - Fix topic subtitle.
+ - Make "rubric" bold-italic and left aligned.
+ - Fix [ 339 ] don't use "alltt" or literal-block-environment
+ in admonitions and footnotes.
* docutils/writers/odf_odt/__init__.py:
@@ -61,7 +64,7 @@
- Fix: 377 ResourceWarning: unclosed file python3.8
Close alltests.out with atexit.
-* test/functional/tests/*
+* test/functional/tests/*
- Fix: 377 ResourceWarning: unclosed file python3.8
Read defaults file with context.
@@ -73,7 +76,7 @@
* test/test_writers/test_odt.py:
- Fix [ 359 ]: Test suite failes on Python 3.8. odt xml sorting.
- Use ElementTree instead of minidom.
+ Use ElementTree instead of minidom.
Release 0.15.1 (2019-07-24)
===========================
Modified: trunk/docutils/docs/user/latex.txt
===================================================================
--- trunk/docutils/docs/user/latex.txt 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/docs/user/latex.txt 2019-09-14 12:32:44 UTC (rev 8391)
@@ -185,7 +185,7 @@
*Block level elements*
are wrapped in "class environments":
``\begin{DUclass}`` calls the optional styling command
- ``\DUCLASSe«classargument»{}``, ``\end{DUclass}`` tries
+ ``\DUCLASS«classargument»{}``, ``\end{DUclass}`` tries
``\endDUCLASS«classargument»``.
Customization is done by defining matching macros or environments.
@@ -196,7 +196,7 @@
*Inline elements*
The LaTeX function ``\textsc`` sets the argument in small caps::
- \newcommand{\DUrolesmallcaps}[1]{\textsc{#1}}
+ \newcommand{\DUrolecustom}[1]{\textsc{#1}}
*Block-level elements*
The LaTeX directive (macro without argument) ``\scshape`` switches to
@@ -215,8 +215,7 @@
{\end{enumerate}}%
}
-Notes
-`````
+.. rubric:: Notes
* Class arguments may contain numbers and hyphens, which need special
treatment in LaTeX command names (see `class directive`_). The commands
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2019-09-14 12:32:44 UTC (rev 8391)
@@ -212,9 +212,11 @@
['--use-bibtex'],
{'default': ''}),
# TODO: implement "latex footnotes" alternative
- ('Footnotes with numbers/symbols by Docutils. (currently ignored)',
+ ('Footnotes with numbers/symbols by Docutils. (default) '
+ '(The alternative, --latex-footnotes, is not implemented yet.)',
['--docutils-footnotes'],
- {'default': True, 'action': 'store_true',
+ {'default': True,
+ 'action': 'store_true',
'validator': frontend.validate_boolean}),
),)
@@ -652,7 +654,7 @@
}"""
PreambleCmds.subtitle = r"""
-% subtitle (for topic/sidebar)
+% subtitle (for sidebar)
\providecommand*{\DUsubtitle}[1]{\par\emph{#1}\smallskip}"""
PreambleCmds.documentsubtitle = r"""
@@ -1695,7 +1697,7 @@
if cls != 'admonition']
self.out.append('\n\\DUadmonition[%s]{' % ','.join(node['classes']))
- def depart_admonition(self, node=None):
+ def depart_admonition(self, node):
self.out.append('}\n')
def visit_author(self, node):
@@ -1773,7 +1775,6 @@
self.out.append( '}' )
def visit_citation(self, node):
- # TODO maybe use cite bibitems
if self._use_latex_citations:
self.push_output_collector([])
else:
@@ -1784,6 +1785,7 @@
def depart_citation(self, node):
if self._use_latex_citations:
+ # TODO: normalize label
label = self.out[0]
text = ''.join(self.out[1:])
self._bibitems.append([label, text])
@@ -1813,7 +1815,7 @@
followup_citation = False
# check for a following citation separated by a space or newline
sibling = node.next_node(descend=False, siblings=True)
- if (isinstance(sibling, nodes.Text)
+ if (isinstance(sibling, nodes.Text)
and sibling.astext() in (' ', '\n')):
sibling2 = sibling.next_node(descend=False, siblings=True)
if isinstance(sibling2, nodes.citation_reference):
@@ -2188,12 +2190,11 @@
self._enumeration_counters.pop()
def visit_field(self, node):
- # real output is done in siblings: _argument, _body, _name
+ # output is done in field_argument, field_body, field_name
pass
def depart_field(self, node):
pass
- ##self.out.append('%[depart_field]\n')
def visit_field_body(self, node):
pass
@@ -2497,7 +2498,7 @@
#
# In both cases, we want to use a typewriter/monospaced typeface.
# For "real" literal-blocks, we can use \verbatim, while for all
- # the others we must use \mbox or \alltt.
+ # the others we must use \ttfamily and \raggedright.
#
# We can distinguish between the two kinds by the number of
# siblings that compose this node: if it is composed by a
@@ -2520,27 +2521,31 @@
'Verbatim': r'\usepackage{fancyvrb}',
'verbatimtab': r'\usepackage{moreverb}'}
- environment = self.literal_block_env
+ literal_env = self.literal_block_env
+
+ # Check, if it is possible to use a literal-block environment
+ _plaintext = self.is_plaintext(node)
_in_table = self.active_table.is_open()
# TODO: fails if normal text precedes the literal block.
# Check parent node instead?
_autowidth_table = _in_table and self.active_table.colwidths_auto
- _plaintext = self.is_plaintext(node)
- _listings = (environment == 'lstlisting') and _plaintext
+ _use_env = _plaintext and not isinstance(node.parent,
+ (nodes.footnote, nodes.admonition))
+ _use_listings = (literal_env == 'lstlisting') and _use_env
# Labels and classes:
if node.get('ids'):
self.out += ['\n'] + self.ids_to_labels(node)
self.duclass_open(node)
+ # Highlight code?
if (not _plaintext and 'code' in node['classes']
and self.settings.syntax_highlight != 'none'):
self.requirements['color'] = PreambleCmds.color
self.fallbacks['code'] = PreambleCmds.highlight_rules
-
- # Wrapper?
- if _in_table and _plaintext and not _autowidth_table:
- # minipage prevents extra vertical space with alltt
- # and verbatim-like environments
+ # Wrap?
+ if _in_table and _use_env and not _autowidth_table:
+ # Wrap in minipage to prevent extra vertical space
+ # with alltt and verbatim-like environments:
self.fallbacks['ttem'] = '\n'.join(['',
r'% character width in monospaced font',
r'\newlength{\ttemwidth}',
@@ -2548,8 +2553,8 @@
self.out.append('\\begin{minipage}{%d\\ttemwidth}\n' %
(max(len(line) for line in node.astext().split('\n'))))
self.context.append('\n\\end{minipage}\n')
- elif not _in_table and not _listings:
- # wrap in quote to set off vertically and indent
+ elif not _in_table and not _use_listings:
+ # Wrap in quote to set off vertically and indent
self.out.append('\\begin{quote}\n')
self.context.append('\n\\end{quote}\n')
else:
@@ -2556,18 +2561,20 @@
self.context.append('\n')
# Use verbatim-like environment, if defined and possible
- if environment and _plaintext and (not _autowidth_table or _listings):
+ # (in an auto-width table, only listings works):
+ if literal_env and _use_env and (not _autowidth_table
+ or _use_listings):
try:
- self.requirements['literal_block'] = packages[environment]
+ self.requirements['literal_block'] = packages[literal_env]
except KeyError:
pass
self.verbatim = True
- if _in_table and _listings:
+ if _in_table and _use_listings:
self.out.append('\\lstset{xleftmargin=0pt}\n')
self.out.append('\\begin{%s}%s\n' %
- (environment, self.literal_block_options))
- self.context.append('\n\\end{%s}' % environment)
- elif _plaintext and not _autowidth_table:
+ (literal_env, self.literal_block_options))
+ self.context.append('\n\\end{%s}' % literal_env)
+ elif _use_env and not _autowidth_table:
self.alltt = True
self.requirements['alltt'] = r'\usepackage{alltt}'
self.out.append('\\begin{alltt}\n')
@@ -2922,7 +2929,7 @@
def depart_system_message(self, node):
self.out.append(self.context.pop())
- self.depart_admonition()
+ self.depart_admonition(node)
def visit_table(self, node):
self.requirements['table'] = PreambleCmds.table
@@ -2974,8 +2981,7 @@
return
self.out.append('%\n')
# do we need an anchor (\phantomsection)?
- set_anchor = not(isinstance(node.parent, nodes.caption) or
- isinstance(node.parent, nodes.title))
+ set_anchor = not isinstance(node.parent, (nodes.caption, nodes.title))
# TODO: where else can/must we omit the \phantomsection?
self.out += self.ids_to_labels(node, set_anchor)
Modified: trunk/docutils/test/functional/expected/latex_literal_block.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/latex_literal_block.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -30,6 +30,18 @@
\csname \DocutilsClassFunctionName \endcsname}%
{\csname end\DocutilsClassFunctionName \endcsname}%
\fi
+
+% admonition (specially marked topic)
+\providecommand{\DUadmonition}[2][class-arg]{%
+ % try \DUadmonition#1{#2}:
+ \ifcsname DUadmonition#1\endcsname%
+ \csname DUadmonition#1\endcsname{#2}%
+ \else
+ \begin{center}
+ \fbox{\parbox{0.9\linewidth}{#2}}
+ \end{center}
+ \fi
+}
% numeric or symbol footnotes with hyperlinks
\providecommand*{\DUfootnotemark}[3]{%
\raisebox{1em}{\hypertarget{#1}{}}%
@@ -64,6 +76,16 @@
\usepackage{fixltx2e} % since 2015 loaded by default
\fi
+% title for topics, admonitions, unsupported section levels, and sidebar
+\providecommand*{\DUtitle}[2][class-arg]{%
+ % call \DUtitle#1{#2} if it exists:
+ \ifcsname DUtitle#1\endcsname%
+ \csname DUtitle#1\endcsname{#2}%
+ \else
+ \smallskip\noindent\textbf{#2}\smallskip%
+ \fi
+}
+
% titlereference role
\providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
@@ -82,9 +104,11 @@
\begin{document}
In LaTeX, literal blocks can be customized with the \textquotedbl{}literal-block-env\textquotedbl{}
-setting. This test file exists to check the latex writer output compiles and
-looks as expected. Start with a plain literal block:
+setting. This test file exists to check if the LaTeX writer output compiles
+and looks as expected.
+Start with a plain literal block:
+
\begin{quote}
\begin{alltt}
$\textbackslash{}sin^2(x)$ and $\textbackslash{}cos^2(x)$ equals one:
@@ -142,6 +166,17 @@
\hline
\end{longtable*}
+\DUadmonition[note]{
+\DUtitle[note]{Note}
+
+A literal block in an admonition:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
+}
+
Parsed literal block with inline markup and leading whitespace:
\begin{quote}
@@ -168,6 +203,13 @@
%
\DUfootnotetext{id3}{id1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
+
+It contains a literal block:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
}
\begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
Sample Citation, 2017.
Modified: trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -30,6 +30,18 @@
\csname \DocutilsClassFunctionName \endcsname}%
{\csname end\DocutilsClassFunctionName \endcsname}%
\fi
+
+% admonition (specially marked topic)
+\providecommand{\DUadmonition}[2][class-arg]{%
+ % try \DUadmonition#1{#2}:
+ \ifcsname DUadmonition#1\endcsname%
+ \csname DUadmonition#1\endcsname{#2}%
+ \else
+ \begin{center}
+ \fbox{\parbox{0.9\linewidth}{#2}}
+ \end{center}
+ \fi
+}
% numeric or symbol footnotes with hyperlinks
\providecommand*{\DUfootnotemark}[3]{%
\raisebox{1em}{\hypertarget{#1}{}}%
@@ -64,6 +76,16 @@
\usepackage{fixltx2e} % since 2015 loaded by default
\fi
+% title for topics, admonitions, unsupported section levels, and sidebar
+\providecommand*{\DUtitle}[2][class-arg]{%
+ % call \DUtitle#1{#2} if it exists:
+ \ifcsname DUtitle#1\endcsname%
+ \csname DUtitle#1\endcsname{#2}%
+ \else
+ \smallskip\noindent\textbf{#2}\smallskip%
+ \fi
+}
+
% titlereference role
\providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
@@ -82,9 +104,11 @@
\begin{document}
In LaTeX, literal blocks can be customized with the \textquotedbl{}literal-block-env\textquotedbl{}
-setting. This test file exists to check the latex writer output compiles and
-looks as expected. Start with a plain literal block:
+setting. This test file exists to check if the LaTeX writer output compiles
+and looks as expected.
+Start with a plain literal block:
+
\begin{quote}
\begin{Verbatim}
$\sin^2(x)$ and $\cos^2(x)$ equals one:
@@ -142,6 +166,17 @@
\hline
\end{longtable*}
+\DUadmonition[note]{
+\DUtitle[note]{Note}
+
+A literal block in an admonition:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
+}
+
Parsed literal block with inline markup and leading whitespace:
\begin{quote}
@@ -168,6 +203,13 @@
%
\DUfootnotetext{id3}{id1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
+
+It contains a literal block:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
}
\begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
Sample Citation, 2017.
Modified: trunk/docutils/test/functional/expected/latex_literal_block_listings.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_listings.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/latex_literal_block_listings.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -36,6 +36,18 @@
\csname \DocutilsClassFunctionName \endcsname}%
{\csname end\DocutilsClassFunctionName \endcsname}%
\fi
+
+% admonition (specially marked topic)
+\providecommand{\DUadmonition}[2][class-arg]{%
+ % try \DUadmonition#1{#2}:
+ \ifcsname DUadmonition#1\endcsname%
+ \csname DUadmonition#1\endcsname{#2}%
+ \else
+ \begin{center}
+ \fbox{\parbox{0.9\linewidth}{#2}}
+ \end{center}
+ \fi
+}
% numeric or symbol footnotes with hyperlinks
\providecommand*{\DUfootnotemark}[3]{%
\raisebox{1em}{\hypertarget{#1}{}}%
@@ -70,6 +82,16 @@
\usepackage{fixltx2e} % since 2015 loaded by default
\fi
+% title for topics, admonitions, unsupported section levels, and sidebar
+\providecommand*{\DUtitle}[2][class-arg]{%
+ % call \DUtitle#1{#2} if it exists:
+ \ifcsname DUtitle#1\endcsname%
+ \csname DUtitle#1\endcsname{#2}%
+ \else
+ \smallskip\noindent\textbf{#2}\smallskip%
+ \fi
+}
+
% titlereference role
\providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
@@ -88,9 +110,11 @@
\begin{document}
In LaTeX, literal blocks can be customized with the \textquotedbl{}literal-block-env\textquotedbl{}
-setting. This test file exists to check the latex writer output compiles and
-looks as expected. Start with a plain literal block:
+setting. This test file exists to check if the LaTeX writer output compiles
+and looks as expected.
+Start with a plain literal block:
+
\begin{lstlisting}
$\sin^2(x)$ and $\cos^2(x)$ equals one:
@@ -147,6 +171,17 @@
\hline
\end{longtable*}
+\DUadmonition[note]{
+\DUtitle[note]{Note}
+
+A literal block in an admonition:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
+}
+
Parsed literal block with inline markup and leading whitespace:
\begin{quote}
@@ -173,6 +208,13 @@
%
\DUfootnotetext{id3}{id1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
+
+It contains a literal block:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
}
\begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
Sample Citation, 2017.
Modified: trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/latex_literal_block_verbatim.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -29,6 +29,18 @@
\csname \DocutilsClassFunctionName \endcsname}%
{\csname end\DocutilsClassFunctionName \endcsname}%
\fi
+
+% admonition (specially marked topic)
+\providecommand{\DUadmonition}[2][class-arg]{%
+ % try \DUadmonition#1{#2}:
+ \ifcsname DUadmonition#1\endcsname%
+ \csname DUadmonition#1\endcsname{#2}%
+ \else
+ \begin{center}
+ \fbox{\parbox{0.9\linewidth}{#2}}
+ \end{center}
+ \fi
+}
% numeric or symbol footnotes with hyperlinks
\providecommand*{\DUfootnotemark}[3]{%
\raisebox{1em}{\hypertarget{#1}{}}%
@@ -63,6 +75,16 @@
\usepackage{fixltx2e} % since 2015 loaded by default
\fi
+% title for topics, admonitions, unsupported section levels, and sidebar
+\providecommand*{\DUtitle}[2][class-arg]{%
+ % call \DUtitle#1{#2} if it exists:
+ \ifcsname DUtitle#1\endcsname%
+ \csname DUtitle#1\endcsname{#2}%
+ \else
+ \smallskip\noindent\textbf{#2}\smallskip%
+ \fi
+}
+
% titlereference role
\providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
@@ -81,9 +103,11 @@
\begin{document}
In LaTeX, literal blocks can be customized with the \textquotedbl{}literal-block-env\textquotedbl{}
-setting. This test file exists to check the latex writer output compiles and
-looks as expected. Start with a plain literal block:
+setting. This test file exists to check if the LaTeX writer output compiles
+and looks as expected.
+Start with a plain literal block:
+
\begin{quote}
\begin{verbatim}
$\sin^2(x)$ and $\cos^2(x)$ equals one:
@@ -141,6 +165,17 @@
\hline
\end{longtable*}
+\DUadmonition[note]{
+\DUtitle[note]{Note}
+
+A literal block in an admonition:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
+}
+
Parsed literal block with inline markup and leading whitespace:
\begin{quote}
@@ -167,6 +202,13 @@
%
\DUfootnotetext{id3}{id1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
+
+It contains a literal block:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
}
\begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
Sample Citation, 2017.
Modified: trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -30,6 +30,18 @@
\csname \DocutilsClassFunctionName \endcsname}%
{\csname end\DocutilsClassFunctionName \endcsname}%
\fi
+
+% admonition (specially marked topic)
+\providecommand{\DUadmonition}[2][class-arg]{%
+ % try \DUadmonition#1{#2}:
+ \ifcsname DUadmonition#1\endcsname%
+ \csname DUadmonition#1\endcsname{#2}%
+ \else
+ \begin{center}
+ \fbox{\parbox{0.9\linewidth}{#2}}
+ \end{center}
+ \fi
+}
% numeric or symbol footnotes with hyperlinks
\providecommand*{\DUfootnotemark}[3]{%
\raisebox{1em}{\hypertarget{#1}{}}%
@@ -64,6 +76,16 @@
\usepackage{fixltx2e} % since 2015 loaded by default
\fi
+% title for topics, admonitions, unsupported section levels, and sidebar
+\providecommand*{\DUtitle}[2][class-arg]{%
+ % call \DUtitle#1{#2} if it exists:
+ \ifcsname DUtitle#1\endcsname%
+ \csname DUtitle#1\endcsname{#2}%
+ \else
+ \smallskip\noindent\textbf{#2}\smallskip%
+ \fi
+}
+
% titlereference role
\providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
@@ -82,9 +104,11 @@
\begin{document}
In LaTeX, literal blocks can be customized with the \textquotedbl{}literal-block-env\textquotedbl{}
-setting. This test file exists to check the latex writer output compiles and
-looks as expected. Start with a plain literal block:
+setting. This test file exists to check if the LaTeX writer output compiles
+and looks as expected.
+Start with a plain literal block:
+
\begin{quote}
\begin{verbatimtab}
$\sin^2(x)$ and $\cos^2(x)$ equals one:
@@ -142,6 +166,17 @@
\hline
\end{longtable*}
+\DUadmonition[note]{
+\DUtitle[note]{Note}
+
+A literal block in an admonition:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
+}
+
Parsed literal block with inline markup and leading whitespace:
\begin{quote}
@@ -168,6 +203,13 @@
%
\DUfootnotetext{id3}{id1}{*}{%
This footnote is referenced in a \DUroletitlereference{parsed literal} block.
+
+It contains a literal block:
+
+\begin{quote}
+\ttfamily\raggedright
+\textbackslash{}sin\textasciicircum{}2~x
+\end{quote}
}
\begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
Sample Citation, 2017.
Modified: trunk/docutils/test/functional/expected/standalone_rst_latex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -161,7 +161,7 @@
\end{center}
}
-% subtitle (for topic/sidebar)
+% subtitle (for sidebar)
\providecommand*{\DUsubtitle}[1]{\par\emph{#1}\smallskip}
% text mode subscript
Modified: trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2019-09-14 12:32:44 UTC (rev 8391)
@@ -163,7 +163,7 @@
\end{center}
}
-% subtitle (for topic/sidebar)
+% subtitle (for sidebar)
\providecommand*{\DUsubtitle}[1]{\par\emph{#1}\smallskip}
% text mode subscript
Modified: trunk/docutils/test/functional/input/latex_literal_block.txt
===================================================================
--- trunk/docutils/test/functional/input/latex_literal_block.txt 2019-09-11 20:02:51 UTC (rev 8390)
+++ trunk/docutils/test/functional/input/latex_literal_block.txt 2019-09-14 12:32:44 UTC (rev 8391)
@@ -1,7 +1,9 @@
In LaTeX, literal blocks can be customized with the "literal-block-env"
-setting. This test file exists to check the latex writer output compiles and
-looks as expected. Start with a plain literal block::
+setting. This test file exists to check if the LaTeX writer output compiles
+and looks as expected.
+Start with a plain literal block::
+
$\sin^2(x)$ and $\cos^2(x)$ equals one:
\[
@@ -38,6 +40,10 @@
\sin^2 x
==== =========== ====
+.. note:: A literal block in an admonition::
+
+ \sin^2 x
+
.. role:: custom
.. role:: custom-role
@@ -63,7 +69,14 @@
:custom:`custom` :custom-role:`roles`, and explicit roles for
:title:`Docutils`' :emphasis:`standard` :strong:`inline` :literal:`markup`.
-.. [*] This footnote is referenced in a `parsed literal` block.
+.. [*] This footnote is referenced in a `parsed literal` block.
+
+ It contains a literal block::
+
+ \sin^2 x
+
.. [CIT2002] Sample Citation, 2017.
+
.. _external: http://www.python.org/
+
.. |EXAMPLE| image:: ../../../docs/user/rst/images/biohazard.png
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|