summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docutils/HISTORY.txt6
-rw-r--r--docutils/docutils/writers/latex2e/__init__.py9
-rw-r--r--docutils/test/functional/expected/standalone_rst_latex.tex9
-rw-r--r--docutils/test/functional/expected/standalone_rst_xetex.tex9
-rwxr-xr-xdocutils/test/test_writers/test_latex2e.py2
5 files changed, 19 insertions, 16 deletions
diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt
index 70bac5fa4..d7b6c2a44 100644
--- a/docutils/HISTORY.txt
+++ b/docutils/HISTORY.txt
@@ -21,6 +21,8 @@ Changes Since 0.15
* 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 @@ Changes Since 0.15
- 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
diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py
index d3ad87f31..a35142aa1 100644
--- a/docutils/docutils/writers/latex2e/__init__.py
+++ b/docutils/docutils/writers/latex2e/__init__.py
@@ -641,8 +641,7 @@ PreambleCmds.providelength = r"""
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 @@ class LaTeXTranslator(nodes.NodeVisitor):
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 @@ class LaTeXTranslator(nodes.NodeVisitor):
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 @@ class LaTeXTranslator(nodes.NodeVisitor):
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
diff --git a/docutils/test/functional/expected/standalone_rst_latex.tex b/docutils/test/functional/expected/standalone_rst_latex.tex
index ab1402f9c..73cbbf004 100644
--- a/docutils/test/functional/expected/standalone_rst_latex.tex
+++ b/docutils/test/functional/expected/standalone_rst_latex.tex
@@ -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 @@ You can make up your own admonition too.
\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.
diff --git a/docutils/test/functional/expected/standalone_rst_xetex.tex b/docutils/test/functional/expected/standalone_rst_xetex.tex
index 18e148bd9..99ea92ef8 100644
--- a/docutils/test/functional/expected/standalone_rst_xetex.tex
+++ b/docutils/test/functional/expected/standalone_rst_xetex.tex
@@ -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 @@ You can make up your own admonition too.
\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.
diff --git a/docutils/test/test_writers/test_latex2e.py b/docutils/test/test_writers/test_latex2e.py
index 1c705feb7..9208bb73e 100755
--- a/docutils/test/test_writers/test_latex2e.py
+++ b/docutils/test/test_writers/test_latex2e.py
@@ -929,7 +929,7 @@ head_template.substitute(dict(parts,
}
""", 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{}