|
From: <mi...@us...> - 2017-08-08 21:39:23
|
Revision: 8161
http://sourceforge.net/p/docutils/code/8161
Author: milde
Date: 2017-08-08 21:39:19 +0000 (Tue, 08 Aug 2017)
Log Message:
-----------
Fix [ 323 ]: do not add ``\\\\phantomsection`` and whitespace to ``parts["title"].
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/docutils/writers/latex2e/default.tex
trunk/docutils/test/functional/expected/cyrillic.tex
trunk/docutils/test/functional/expected/latex_babel.tex
trunk/docutils/test/functional/expected/latex_cornercases.tex
trunk/docutils/test/functional/expected/latex_docinfo.tex
trunk/docutils/test/functional/expected/standalone_rst_latex.tex
trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
trunk/docutils/test/functional/expected/xetex-cyrillic.tex
trunk/docutils/test/test_writers/test_latex2e.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2017-08-08 20:26:12 UTC (rev 8160)
+++ trunk/docutils/HISTORY.txt 2017-08-08 21:39:19 UTC (rev 8161)
@@ -16,13 +16,19 @@
Changes Since 0.14
==================
-* infrastructure automatisms
+* General
+ - infrastructure automatisms.
+
+* docutils/writers/latex2e/__init__.py
+
+ - Fix [ 323 ] don't add ``\phantomsection`` and whitespace to
+ ``parts['title'].
+
+
Release 0.14 (2017-08-03)
=========================
-As rc2.
-
* docs/ref/docutils.dtd:
- Enable validation of Docutils XML documents against the DTD:
@@ -117,7 +123,7 @@
documents.
- The heading/title of admonitions now reflects the language
specified by the ``language`` setting.
- - Fixed [ 306 ] only first of multiple "image" directives with the same URL
+ - Fixed [ 306 ] only first of multiple "image" directives with the same URL
shown in output.
- Fixed [ 282 ] python3: AttributeError.
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2017-08-08 20:26:12 UTC (rev 8160)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2017-08-08 21:39:19 UTC (rev 8161)
@@ -217,9 +217,9 @@
config_section_dependencies = ('writers',)
head_parts = ('head_prefix', 'requirements', 'latex_preamble',
- 'stylesheet', 'fallbacks', 'pdfsetup',
- 'title', 'subtitle', 'titledata')
- visitor_attributes = head_parts + ('body_pre_docinfo', 'docinfo',
+ 'stylesheet', 'fallbacks', 'pdfsetup', 'titledata')
+ visitor_attributes = head_parts + ('title', 'subtitle',
+ 'body_pre_docinfo', 'docinfo',
'dedication', 'abstract', 'body')
output = None
@@ -596,8 +596,7 @@
}{}"""
# PreambleCmds.lineblock._depends = 'providelength'
-PreambleCmds.linking = r"""
-%% hyperlinks:
+PreambleCmds.linking = r"""%% hyperlinks:
\ifthenelse{\isundefined{\hypersetup}}{
\usepackage[%s]{hyperref}
\usepackage{bookmark}
@@ -1687,6 +1686,7 @@
self.out.append('}\n')
def visit_author(self, node):
+ self.pdfauthor.append(self.attval(node.astext()))
self.visit_docinfo_item(node, 'author')
def depart_author(self, node):
@@ -1922,8 +1922,6 @@
'\\end{center}\n')
def visit_docinfo_item(self, node, name):
- if name == 'author':
- self.pdfauthor.append(self.attval(node.astext()))
if self.use_latex_docinfo:
if name in ('author', 'organization', 'contact', 'address'):
# We attach these to the last author. If any of them precedes
@@ -1989,12 +1987,10 @@
# 'author', 'organization', 'contact', 'address' and 'date')
if self.title or (
self.use_latex_docinfo and (self.author_stack or self.date)):
- # with the default template, titledata is written to the preamble
- self.titledata.append('%%% Title Data')
# \title (empty \title prevents error with \maketitle)
+ title = [''.join(self.title)]
if self.title:
- self.title.insert(0, '\\phantomsection%\n ')
- title = [''.join(self.title)] + self.title_labels
+ title += self.title_labels
if self.subtitle:
title += [r'\\ % subtitle',
r'\DUdocumentsubtitle{%s}' % ''.join(self.subtitle)
Modified: trunk/docutils/docutils/writers/latex2e/default.tex
===================================================================
--- trunk/docutils/docutils/writers/latex2e/default.tex 2017-08-08 20:26:12 UTC (rev 8160)
+++ trunk/docutils/docutils/writers/latex2e/default.tex 2017-08-08 21:39:19 UTC (rev 8161)
@@ -6,9 +6,9 @@
%%% User specified packages and stylesheets
$stylesheet
%%% Fallback definitions for Docutils-specific commands
-$fallbacks$pdfsetup
-$titledata
+$fallbacks
+$pdfsetup
%%% Body
\begin{document}
-$body_pre_docinfo$docinfo$dedication$abstract$body
+$titledata$body_pre_docinfo$docinfo$dedication$abstract$body
\end{document}
Modified: trunk/docutils/test/functional/expected/cyrillic.tex
===================================================================
--- trunk/docutils/test/functional/expected/cyrillic.tex 2017-08-08 20:26:12 UTC (rev 8160)
+++ trunk/docutils/test/functional/expected/cyrillic.tex 2017-08-08 21:39:19 UTC (rev 8161)
@@ -28,7 +28,6 @@
\urlstyle{same} % normal text font (alternatives: tt, rm, sf)
}{}
-
%%% Body
\begin{document}
Modified: trunk/docutils/test/functional/expected/latex_babel.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_babel.tex 2017-08-08 20:26:12 UTC (rev 8160)
+++ trunk/docutils/test/functional/expected/latex_babel.tex 2017-08-08 21:39:19 UTC (rev 8161)
@@ -31,7 +31,6 @@
\urlstyle{same} % normal text font (alternatives: tt, rm, sf)
}{}
-
%%% Body
\begin{document}
Modified: trunk/docutils/test/functional/expected/latex_cornercases.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_cornercases.tex 2017-08-08 20:26:12 UTC (rev 8160)
+++ trunk/docutils/test/functional/expected/latex_cornercases.tex 2017-08-08 21:39:19 UTC (rev 8161)
@@ -37,15 +37,12 @@
pdftitle={Some Tests for the LaTeX Writer},
}
-%%% Title Data
-\title{\phantomsection%
- Some Tests for the LaTeX Writer%
+%%% Body
+\begin{document}
+\title{Some Tests for the LaTeX Writer%
\label{some-tests-for-the-latex-writer}}
\author{}
\date{}
-
-%%% Body
-\begin{document}
\maketitle
These tests contain unusual combinations of syntax elements which may cause
Modified: trunk/docutils/test/functional/expected/latex_docinfo.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_docinfo.tex 2017-08-08 20:26:12 UTC (rev 8160)
+++ trunk/docutils/test/functional/expected/latex_docinfo.tex 2017-08-08 21:39:19 UTC (rev 8161)
@@ -25,7 +25,8 @@
pdfauthor={Foo Fred;Bar Barney}
}
-%%% Title Data
+%%% Body
+\begin{document}
\title{}
\author{Foo Fred\\
Food Foomatics \& Friends\\
@@ -38,9 +39,6 @@
Barbara St 16\\
South Barwell}
\date{}
-
-%%% Body
-\begin{document}
\maketitle
\end{document}
Modified: trunk/docutils/test/functional/expected/standalone_rst_latex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2017-08-08 20:26:12 UTC (rev 8160)
+++ trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2017-08-08 21:39:19 UTC (rev 8161)
@@ -196,9 +196,9 @@
pdfauthor={David Goodger;Me;Myself;I}
}
-%%% Title Data
-\title{\phantomsection%
- reStructuredText Test Document%
+%%% Body
+\begin{document}
+\title{reStructuredText Test Document%
\label{restructuredtext-test-document}%
\label{doctitle}%
\\ % subtitle%
@@ -207,9 +207,6 @@
\label{subtitle}}
\author{}
\date{}
-
-%%% Body
-\begin{document}
\maketitle
% Docinfo
Modified: trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2017-08-08 20:26:12 UTC (rev 8160)
+++ trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2017-08-08 21:39:19 UTC (rev 8161)
@@ -186,7 +186,6 @@
\hspace*{\fill}\hrulefill\hspace*{\fill}
\vskip 0.5\baselineskip
}
-
% hyperlinks:
\ifthenelse{\isundefined{\hypersetup}}{
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
@@ -198,9 +197,7 @@
pdfauthor={David Goodger;Me;Myself;I}
}
-%%% Title Data
-\title{\phantomsection%
- reStructuredText Test Document%
+\title{reStructuredText Test Document%
\label{restructuredtext-test-document}%
\label{doctitle}%
\\ % subtitle%
Modified: trunk/docutils/test/functional/expected/xetex-cyrillic.tex
===================================================================
--- trunk/docutils/test/functional/expected/xetex-cyrillic.tex 2017-08-08 20:26:12 UTC (rev 8160)
+++ trunk/docutils/test/functional/expected/xetex-cyrillic.tex 2017-08-08 21:39:19 UTC (rev 8161)
@@ -26,7 +26,6 @@
% titlereference role
\providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
-
% hyperlinks:
\ifthenelse{\isundefined{\hypersetup}}{
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue,unicode=false]{hyperref}
Modified: trunk/docutils/test/test_writers/test_latex2e.py
===================================================================
--- trunk/docutils/test/test_writers/test_latex2e.py 2017-08-08 20:26:12 UTC (rev 8160)
+++ trunk/docutils/test/test_writers/test_latex2e.py 2017-08-08 21:39:19 UTC (rev 8161)
@@ -45,10 +45,9 @@
$stylesheet
%%% Fallback definitions for Docutils-specific commands
$fallbacks$pdfsetup
-$titledata
%%% Body
\begin{document}
-""")
+$titledata""")
parts = dict(
head_prefix = r"""\documentclass[a4paper]{article}
@@ -899,9 +898,7 @@
pdfsetup=parts['pdfsetup'] + r"""\hypersetup{
pdftitle={This is the Title},
}
-""", titledata=r"""%%% Title Data
-\title{\phantomsection%
- This is the \emph{Title}%
+""", titledata=r"""\title{This is the \emph{Title}%
\label{this-is-the-title}%
\\ % subtitle%
\DUdocumentsubtitle{This is the \emph{Subtitle}}%
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|