|
From: <mi...@us...> - 2019-09-11 20:02:53
|
Revision: 8390
http://sourceforge.net/p/docutils/code/8390
Author: milde
Date: 2019-09-11 20:02:51 +0000 (Wed, 11 Sep 2019)
Log Message:
-----------
Fix informal titles
Fix Topic subtitle.
Use class value "sidebar" instead of "title" for the title in a side bar.
Do not center a rubric.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/test/functional/expected/standalone_rst_latex.tex
trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
trunk/docutils/test/test_writers/test_latex2e.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-09-11 11:39:13 UTC (rev 8389)
+++ trunk/docutils/HISTORY.txt 2019-09-11 20:02:51 UTC (rev 8390)
@@ -21,6 +21,8 @@
* General
- Dropped support for Python 2.6, 3.3 and 3.4 (work in progress).
+ - Docutils now supports Python 2.7 and Python 3.5+ natively
+ (without conversion by ``2to3``).
- Keep `backslash escapes`__ in the document tree. Backslash characters in
text are be represented by NULL characters in the ``text`` attribute of
Doctree nodes and removed in the writing stage by the node's
@@ -42,6 +44,10 @@
- Patch [ 158 ]: Speed up patterns by saving compiled versions (eric89gxl)
+* docutils/writers/latex2e/__init__.py:
+
+ - Fix topic subtitle, do not center a rubric.
+
* docutils/writers/odf_odt/__init__.py:
- Fix: ElementTree.getchildren deprecated warning
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2019-09-11 11:39:13 UTC (rev 8389)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2019-09-11 20:02:51 UTC (rev 8390)
@@ -641,8 +641,7 @@
PreambleCmds.rubric = r"""
% rubric (informal heading)
-\providecommand*{\DUrubric}[1]{%
- \subsubsection*{\centering\textit{\textmd{#1}}}}"""
+\providecommand*{\DUrubric}[1]{\subsubsection*{\emph{#1}}}"""
PreambleCmds.sidebar = r"""
% sidebar (text outside the main text flow)
@@ -2004,7 +2003,7 @@
if self.title:
title += self.title_labels
if self.subtitle:
- title += [r'\\ % subtitle',
+ title += [r'\\',
r'\DUdocumentsubtitle{%s}' % ''.join(self.subtitle)
] + self.subtitle_labels
self.titledata.append(r'\title{%s}' % '%\n '.join(title))
@@ -2891,7 +2890,7 @@
self.d_class.section(self.section_level + 1))
else:
self.fallbacks['subtitle'] = PreambleCmds.subtitle
- self.out.append('\n\\DUsubtitle[%s]{' % node.parent.tagname)
+ self.out.append('\n\\DUsubtitle{')
def depart_subtitle(self, node):
if isinstance(node.parent, nodes.document):
@@ -3046,7 +3045,7 @@
self.fallbacks['title'] = PreambleCmds.title
classes = ','.join(node.parent['classes'])
if not classes:
- classes = node.tagname
+ classes = node.parent.tagname
self.out.append('\n\\DUtitle[%s]{' % classes)
self.context.append('}\n')
# Table caption
Modified: trunk/docutils/test/functional/expected/standalone_rst_latex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2019-09-11 11:39:13 UTC (rev 8389)
+++ trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2019-09-11 20:02:51 UTC (rev 8390)
@@ -152,8 +152,7 @@
}{}
% rubric (informal heading)
-\providecommand*{\DUrubric}[1]{%
- \subsubsection*{\centering\textit{\textmd{#1}}}}
+\providecommand*{\DUrubric}[1]{\subsubsection*{\emph{#1}}}
% sidebar (text outside the main text flow)
\providecommand{\DUsidebar}[1]{%
@@ -205,7 +204,7 @@
\title{reStructuredText Test Document%
\label{restructuredtext-test-document}%
\label{doctitle}%
- \\ % subtitle%
+ \\%
\DUdocumentsubtitle{Examples of Syntax Constructs}%
\label{examples-of-syntax-constructs}%
\label{subtitle}}
@@ -1203,9 +1202,9 @@
\emph{Sidebars} are like miniature, parallel documents.
\DUsidebar{
-\DUtitle[title]{Sidebar Title}
+\DUtitle[sidebar]{Sidebar Title}
-\DUsubtitle[sidebar]{Optional Subtitle}
+\DUsubtitle{Optional Subtitle}
This is a sidebar. It is for text outside the flow of the main
text.
Modified: trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2019-09-11 11:39:13 UTC (rev 8389)
+++ trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2019-09-11 20:02:51 UTC (rev 8390)
@@ -154,8 +154,7 @@
% rubric (informal heading)
-\providecommand*{\DUrubric}[1]{%
- \subsubsection*{\centering\textit{\textmd{#1}}}}
+\providecommand*{\DUrubric}[1]{\subsubsection*{\emph{#1}}}
% sidebar (text outside the main text flow)
\providecommand{\DUsidebar}[1]{%
@@ -204,7 +203,7 @@
\title{reStructuredText Test Document%
\label{restructuredtext-test-document}%
\label{doctitle}%
- \\ % subtitle%
+ \\%
\DUdocumentsubtitle{Examples of Syntax Constructs}%
\label{examples-of-syntax-constructs}%
\label{subtitle}}
@@ -1205,9 +1204,9 @@
\emph{Sidebars} are like miniature, parallel documents.
\DUsidebar{
-\DUtitle[title]{Sidebar Title}
+\DUtitle[sidebar]{Sidebar Title}
-\DUsubtitle[sidebar]{Optional Subtitle}
+\DUsubtitle{Optional Subtitle}
This is a sidebar. It is for text outside the flow of the main
text.
Modified: trunk/docutils/test/test_writers/test_latex2e.py
===================================================================
--- trunk/docutils/test/test_writers/test_latex2e.py 2019-09-11 11:39:13 UTC (rev 8389)
+++ trunk/docutils/test/test_writers/test_latex2e.py 2019-09-11 20:02:51 UTC (rev 8390)
@@ -929,7 +929,7 @@
}
""", titledata=r"""\title{This is the \emph{Title}%
\label{this-is-the-title}%
- \\ % subtitle%
+ \\%
\DUdocumentsubtitle{This is the \emph{Subtitle}}%
\label{this-is-the-subtitle}}
\author{}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|