SF.net SVN: docutils:[9556] trunk/docutils
milde--- via Docutils-checkins <[email protected]>
| Newsgroups | gmane.text.docutils.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 9556
http://sourceforge.net/p/docutils/code/9556
Author: milde
Date: 2024-03-11 17:48:33 +0000 (Mon, 11 Mar 2024)
Log Message:
-----------
More compact option-lists with "latex" writers. Fix "leavevmode" test.
Drop the empty line between option list items in LaTeX output.
Fix examples for enumerated list nested in option list
and description term with classifier in "latex_leavevmode" functional
test sample.
Modified Paths:
--------------
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/test/functional/expected/latex_cornercases.tex
trunk/docutils/test/functional/expected/latex_leavevmode.tex
trunk/docutils/test/functional/expected/latex_memoir.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_leavevmode.txt
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2024-03-11 14:55:04 UTC (rev 9555)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2024-03-11 17:48:33 UTC (rev 9556)
@@ -2707,7 +2707,7 @@
pass
def visit_option_group(self, node):
- self.out.append('\n\\item[')
+ self.out.append('\\item[')
# flag for first option
self.context.append(0)
@@ -2720,7 +2720,7 @@
self.fallbacks['_providelength'] = PreambleCmds.providelength
self.fallbacks['optionlist'] = PreambleCmds.optionlist
self.duclass_open(node)
- self.out.append('\\begin{DUoptionlist}')
+ self.out.append('\\begin{DUoptionlist}\n')
def depart_option_list(self, node):
self.out.append('\\end{DUoptionlist}\n')
Modified: trunk/docutils/test/functional/expected/latex_cornercases.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_cornercases.tex 2024-03-11 14:55:04 UTC (rev 9555)
+++ trunk/docutils/test/functional/expected/latex_cornercases.tex 2024-03-11 17:48:33 UTC (rev 9556)
@@ -241,7 +241,6 @@
\begin{quote}
\begin{DUoptionlist}
\item[-{}-help] show help
-
\item[-v] verbose
\end{DUoptionlist}
\end{quote}
@@ -250,7 +249,6 @@
\item[{In a definition list:}] \leavevmode
\begin{DUoptionlist}
\item[-{}-help] show help
-
\item[-v] verbose
\end{DUoptionlist}
\end{description}
Modified: trunk/docutils/test/functional/expected/latex_leavevmode.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_leavevmode.tex 2024-03-11 14:55:04 UTC (rev 9555)
+++ trunk/docutils/test/functional/expected/latex_leavevmode.tex 2024-03-11 17:48:33 UTC (rev 9556)
@@ -232,11 +232,14 @@
\item[{Option List}] \leavevmode
\begin{DUoptionlist}
\item[-h] Show help
-
\item[-v] Be verbose
+\item[-{}-rare]
+\begin{enumerate}
+\renewcommand{\labelenumi}{\alph{enumi})}
+\item This description starts with an enumeration
-\item[-{}-rare] a) This description starts with an enumeration
-c) but does not need \texttt{\textbackslash{}leavevmode}.
+\item but does not need \texttt{\textbackslash{}leavevmode}.
+\end{enumerate}
\end{DUoptionlist}
\item[{Literal Block}] \leavevmode
@@ -335,11 +338,11 @@
paragraph automatically, with or without \texttt{\textbackslash{}leavevmode}, so
\texttt{\textbackslash{}leavevmode} isn’t needed.
-\item[{Term with Classifier: classifier}] \leavevmode
+\item[{Term with Classifier}] (\textbf{classifier})
\begin{itemize}
-\item After a \emph{classifier}, \texttt{\textbackslash{}leavevmode} is not required.
+\item After a \emph{classifier}, \texttt{\textbackslash{}leavevmode} is not required
-\item This holds for all elements that normally need \texttt{\textbackslash{}leavevmode}.
+\item because the classifier is added (in parentheses) after the term.
\end{itemize}
\end{description}
Modified: trunk/docutils/test/functional/expected/latex_memoir.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_memoir.tex 2024-03-11 14:55:04 UTC (rev 9555)
+++ trunk/docutils/test/functional/expected/latex_memoir.tex 2024-03-11 17:48:33 UTC (rev 9556)
@@ -506,30 +506,20 @@
\begin{DUoptionlist}
\item[-a] command-line option \textquotedbl{}a\textquotedbl{}
-
\item[-b file] options can have arguments
and long descriptions
-
\item[-{}-long] options can be long, too
-
\item[-{}-input=file] long options can also have arguments
-
\item[/V] DOS/VMS-style option
-
\item[-{}-very-long-option] The description can also start on the next line.
The description may contain multiple body elements,
regardless of where it starts.
-
\item[-x, -y, -z] Multiple options are an \textquotedbl{}option group\textquotedbl{}.
-
\item[-v, -{}-verbose] Commonly-seen: short \& long options.
-
\item[-1 file, -{}-one=file, -{}-two file] Multiple options with arguments.
-
\item[-f <{[}path{]}file>] Option argumens must start with a letter
or be wrapped in angle brackets.
-
\item[-d <src dest>] Angle brackets are also required if an
option expects more than one argument.
\end{DUoptionlist}
Modified: trunk/docutils/test/functional/expected/standalone_rst_latex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2024-03-11 14:55:04 UTC (rev 9555)
+++ trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2024-03-11 17:48:33 UTC (rev 9556)
@@ -507,30 +507,20 @@
\begin{DUoptionlist}
\item[-a] command-line option “a”
-
\item[-b file] options can have arguments
and long descriptions
-
\item[-{}-long] options can be long, too
-
\item[-{}-input=file] long options can also have arguments
-
\item[/V] DOS/VMS-style option
-
\item[-{}-very-long-option] The description can also start on the next line.
The description may contain multiple body elements,
regardless of where it starts.
-
\item[-x, -y, -z] Multiple options are an “option group”.
-
\item[-v, -{}-verbose] Commonly-seen: short \& long options.
-
\item[-1 file, -{}-one=file, -{}-two file] Multiple options with arguments.
-
\item[-f <{[}path{]}file>] Option argumens must start with a letter
or be wrapped in angle brackets.
-
\item[-d <src dest>] Angle brackets are also required if an
option expects more than one argument.
\end{DUoptionlist}
Modified: trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2024-03-11 14:55:04 UTC (rev 9555)
+++ trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2024-03-11 17:48:33 UTC (rev 9556)
@@ -509,30 +509,20 @@
\begin{DUoptionlist}
\item[-a] command-line option “a”
-
\item[-b file] options can have arguments
and long descriptions
-
\item[--long] options can be long, too
-
\item[--input=file] long options can also have arguments
-
\item[/V] DOS/VMS-style option
-
\item[--very-long-option] The description can also start on the next line.
The description may contain multiple body elements,
regardless of where it starts.
-
\item[-x, -y, -z] Multiple options are an “option group”.
-
\item[-v, --verbose] Commonly-seen: short \& long options.
-
\item[-1 file, --one=file, --two file] Multiple options with arguments.
-
\item[-f <{[}path{]}file>] Option argumens must start with a letter
or be wrapped in angle brackets.
-
\item[-d <src dest>] Angle brackets are also required if an
option expects more than one argument.
\end{DUoptionlist}
Modified: trunk/docutils/test/functional/input/latex_leavevmode.txt
===================================================================
--- trunk/docutils/test/functional/input/latex_leavevmode.txt 2024-03-11 14:55:04 UTC (rev 9555)
+++ trunk/docutils/test/functional/input/latex_leavevmode.txt 2024-03-11 17:48:33 UTC (rev 9556)
@@ -42,7 +42,7 @@
-h Show help
-v Be verbose
--rare a) This description starts with an enumeration
- c) but does not need ``\leavevmode``.
+ b) but does not need ``\leavevmode``.
Literal Block
::
@@ -109,9 +109,9 @@
paragraph automatically, with or without ``\leavevmode``, so
``\leavevmode`` isn't needed.
-Term with Classifier: classifier
- - After a *classifier*, ``\leavevmode`` is not required.
- - This holds for all elements that normally need ``\leavevmode``.
+Term with Classifier : classifier
+ - After a *classifier*, ``\leavevmode`` is not required
+ - because the classifier is added (in parentheses) after the term.
Ambiguous cases
***************
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
_______________________________________________
Docutils-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-checkins