SF.net SVN: docutils:[9557] trunk/docutils/docutils/writers/latex2e/ __init__.py

milde--- via Docutils-checkins <[email protected]>
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 9557
          http://sourceforge.net/p/docutils/code/9557
Author:   milde
Date:     2024-03-11 17:48:43 +0000 (Mon, 11 Mar 2024)
Log Message:
-----------
Better LaTeX output for definition list item with two terms.

Start a new line for the second "term" (`\item`) in LaTeX source for
a definition list item with two terms (cf. [feature-requests:60]).

Modified Paths:
--------------
    trunk/docutils/docutils/writers/latex2e/__init__.py

Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py	2024-03-11 17:48:33 UTC (rev 9556)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py	2024-03-11 17:48:43 UTC (rev 9557)
@@ -1850,6 +1850,8 @@
 
     def depart_classifier(self, node):
         self.out.append('})')
+        if node.next_node(nodes.term, descend=False, siblings=True):
+            self.out.append('\n')
 
     def visit_colspec(self, node):
         self.active_table.visit_colspec(node)
@@ -3070,7 +3072,9 @@
         # Do we need a \leavevmode (line break if the field body begins
         # with a list or environment)?
         next_node = node.next_node(descend=False, siblings=True)
-        if not isinstance(next_node, nodes.classifier):
+        if isinstance(next_node, nodes.term):
+            self.out.append('\n')
+        elif not isinstance(next_node, nodes.classifier):
             self.out.append(self.term_postfix(next_node))
 
     def visit_tgroup(self, node):

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.