summaryrefslogtreecommitdiff
path: root/docutils/test/functional
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2019-09-14 12:32:44 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2019-09-14 12:32:44 +0000
commit3cd891abd7a467ec20f33692cb7a0cecdf63f1bf (patch)
treeda16d79e45bc203f6b971512abd37b4e120fc83e /docutils/test/functional
parente5f74337332641a5f82fe45efc5bebbf15493c05 (diff)
downloaddocutils-3cd891abd7a467ec20f33692cb7a0cecdf63f1bf.tar.gz
Fix [ 339 ] don't use "alltt" in admonitions and footnotes.
Includes some other minor cleanups for the LaTeX writer. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8391 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/functional')
-rw-r--r--docutils/test/functional/expected/latex_literal_block.tex46
-rw-r--r--docutils/test/functional/expected/latex_literal_block_fancyvrb.tex46
-rw-r--r--docutils/test/functional/expected/latex_literal_block_listings.tex46
-rw-r--r--docutils/test/functional/expected/latex_literal_block_verbatim.tex46
-rw-r--r--docutils/test/functional/expected/latex_literal_block_verbatimtab.tex46
-rw-r--r--docutils/test/functional/expected/standalone_rst_latex.tex2
-rw-r--r--docutils/test/functional/expected/standalone_rst_xetex.tex2
-rw-r--r--docutils/test/functional/input/latex_literal_block.txt19
8 files changed, 238 insertions, 15 deletions
diff --git a/docutils/test/functional/expected/latex_literal_block.tex b/docutils/test/functional/expected/latex_literal_block.tex
index 8b643924f..cdf5e4deb 100644
--- a/docutils/test/functional/expected/latex_literal_block.tex
+++ b/docutils/test/functional/expected/latex_literal_block.tex
@@ -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,8 +104,10 @@
\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}
@@ -142,6 +166,17 @@ test &
\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 @@ maths~$\sin^2(x)$,\\
%
\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.
diff --git a/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex b/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
index ed609e8d6..74ed27872 100644
--- a/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
+++ b/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
@@ -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,8 +104,10 @@
\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}
@@ -142,6 +166,17 @@ test &
\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 @@ maths~$\sin^2(x)$,\\
%
\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.
diff --git a/docutils/test/functional/expected/latex_literal_block_listings.tex b/docutils/test/functional/expected/latex_literal_block_listings.tex
index acf3b7ad2..5142b5667 100644
--- a/docutils/test/functional/expected/latex_literal_block_listings.tex
+++ b/docutils/test/functional/expected/latex_literal_block_listings.tex
@@ -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,8 +110,10 @@
\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 @@ test &
\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 @@ maths~$\sin^2(x)$,\\
%
\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.
diff --git a/docutils/test/functional/expected/latex_literal_block_verbatim.tex b/docutils/test/functional/expected/latex_literal_block_verbatim.tex
index d8dc9d06d..b77262626 100644
--- a/docutils/test/functional/expected/latex_literal_block_verbatim.tex
+++ b/docutils/test/functional/expected/latex_literal_block_verbatim.tex
@@ -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,8 +103,10 @@
\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}
@@ -141,6 +165,17 @@ test &
\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 @@ maths~$\sin^2(x)$,\\
%
\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.
diff --git a/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex b/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
index 69eec6217..57ea0aaee 100644
--- a/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
+++ b/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
@@ -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,8 +104,10 @@
\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}
@@ -142,6 +166,17 @@ test &
\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 @@ maths~$\sin^2(x)$,\\
%
\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.
diff --git a/docutils/test/functional/expected/standalone_rst_latex.tex b/docutils/test/functional/expected/standalone_rst_latex.tex
index 73cbbf004..280e3b21e 100644
--- a/docutils/test/functional/expected/standalone_rst_latex.tex
+++ b/docutils/test/functional/expected/standalone_rst_latex.tex
@@ -161,7 +161,7 @@
\end{center}
}
-% subtitle (for topic/sidebar)
+% subtitle (for sidebar)
\providecommand*{\DUsubtitle}[1]{\par\emph{#1}\smallskip}
% text mode subscript
diff --git a/docutils/test/functional/expected/standalone_rst_xetex.tex b/docutils/test/functional/expected/standalone_rst_xetex.tex
index 99ea92ef8..4dcf6e2c2 100644
--- a/docutils/test/functional/expected/standalone_rst_xetex.tex
+++ b/docutils/test/functional/expected/standalone_rst_xetex.tex
@@ -163,7 +163,7 @@
\end{center}
}
-% subtitle (for topic/sidebar)
+% subtitle (for sidebar)
\providecommand*{\DUsubtitle}[1]{\par\emph{#1}\smallskip}
% text mode subscript
diff --git a/docutils/test/functional/input/latex_literal_block.txt b/docutils/test/functional/input/latex_literal_block.txt
index f91ccd494..9c7b84c9c 100644
--- a/docutils/test/functional/input/latex_literal_block.txt
+++ b/docutils/test/functional/input/latex_literal_block.txt
@@ -1,6 +1,8 @@
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 @@ A literal block in a table with auto-width columns:
\sin^2 x
==== =========== ====
+.. note:: A literal block in an admonition::
+
+ \sin^2 x
+
.. role:: custom
.. role:: custom-role
@@ -63,7 +69,14 @@ Parsed literal block with inline markup and leading whitespace:
: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