From: <mi...@us...> - 2014-02-28 14:16:06
|
Revision: 7745 http://sourceforge.net/p/docutils/code/7745 Author: milde Date: 2014-02-28 14:15:59 +0000 (Fri, 28 Feb 2014) Log Message: ----------- Apply [ 116 ] by Kirill Smelkov. No hardcode \\\\large for subtitle. 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 2014-02-28 11:02:23 UTC (rev 7744) +++ trunk/docutils/HISTORY.txt 2014-02-28 14:15:59 UTC (rev 7745) @@ -19,6 +19,7 @@ * docutils/writers/latex2e/__init__.py - Fix [ 239 ] Latex writer glues paragraphs with figure floats. + - Apply [ 116 ] by Kirill Smelkov. Don't hardcode \large for subtitle. * docutils/writers/odf_odt/__init__.py Modified: trunk/docutils/docutils/writers/latex2e/__init__.py =================================================================== --- trunk/docutils/docutils/writers/latex2e/__init__.py 2014-02-28 11:02:23 UTC (rev 7744) +++ trunk/docutils/docutils/writers/latex2e/__init__.py 2014-02-28 14:15:59 UTC (rev 7745) @@ -658,6 +658,10 @@ % subtitle (for topic/sidebar) \providecommand*{\DUsubtitle}[2][class-arg]{\par\emph{#2}\smallskip}""" +PreambleCmds.documentsubtitle = r""" +% subtitle (in document title) +\providecommand*{\DUdocumentsubtitle}[1]{{\large #1}}""" + PreambleCmds.table = r"""\usepackage{longtable,ltcaption,array} \setlength{\extrarowheight}{2pt} \newlength{\DUtablewidth} % internal use in tables""" @@ -1903,7 +1907,7 @@ title = [''.join(self.title)] + self.title_labels if self.subtitle: title += [r'\\ % subtitle', - r'\large{%s}' % ''.join(self.subtitle) + r'\DUdocumentsubtitle{%s}' % ''.join(self.subtitle) ] + self.subtitle_labels self.titledata.append(r'\title{%s}' % '%\n '.join(title)) # \author (empty \author prevents warning with \maketitle) @@ -2746,6 +2750,7 @@ def visit_subtitle(self, node): if isinstance(node.parent, nodes.document): self.push_output_collector(self.subtitle) + self.fallbacks['documentsubtitle'] = PreambleCmds.documentsubtitle self.subtitle_labels += self.ids_to_labels(node, set_anchor=False) # section subtitle: "starred" (no number, not in ToC) elif isinstance(node.parent, nodes.section): Modified: trunk/docutils/test/functional/expected/standalone_rst_latex.tex =================================================================== --- trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2014-02-28 11:02:23 UTC (rev 7744) +++ trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2014-02-28 14:15:59 UTC (rev 7745) @@ -64,6 +64,9 @@ % docinfo (width of docinfo table) \DUprovidelength{\DUdocinfowidth}{0.9\textwidth} +% subtitle (in document title) +\providecommand*{\DUdocumentsubtitle}[1]{{\large #1}} + % error admonition title \providecommand*{\DUtitleerror}[1]{\DUtitle{\color{red}#1}} @@ -194,7 +197,7 @@ \label{restructuredtext-test-document}% \label{doctitle}% \\ % subtitle% - \large{Examples of Syntax Constructs}% + \DUdocumentsubtitle{Examples of Syntax Constructs}% \label{examples-of-syntax-constructs}% \label{subtitle}} \author{} Modified: trunk/docutils/test/functional/expected/standalone_rst_xetex.tex =================================================================== --- trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2014-02-28 11:02:23 UTC (rev 7744) +++ trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2014-02-28 14:15:59 UTC (rev 7745) @@ -60,6 +60,9 @@ % docinfo (width of docinfo table) \DUprovidelength{\DUdocinfowidth}{0.9\textwidth} +% subtitle (in document title) +\providecommand*{\DUdocumentsubtitle}[1]{{\large #1}} + % error admonition title \providecommand*{\DUtitleerror}[1]{\DUtitle{\color{red}#1}} @@ -193,7 +196,7 @@ \label{restructuredtext-test-document}% \label{doctitle}% \\ % subtitle% - \large{Examples of Syntax Constructs}% + \DUdocumentsubtitle{Examples of Syntax Constructs}% \label{examples-of-syntax-constructs}% \label{subtitle}} \author{} Modified: trunk/docutils/test/test_writers/test_latex2e.py =================================================================== --- trunk/docutils/test/test_writers/test_latex2e.py 2014-02-28 11:02:23 UTC (rev 7744) +++ trunk/docutils/test/test_writers/test_latex2e.py 2014-02-28 14:15:59 UTC (rev 7745) @@ -582,6 +582,10 @@ """, head_template.substitute(dict(parts, requirements=parts['requirements'] + '\\setcounter{secnumdepth}{0}\n', + fallbacks=r""" +% subtitle (in document title) +\providecommand*{\DUdocumentsubtitle}[1]{{\large #1}} +""", pdfsetup=parts['pdfsetup'] + r"""\hypersetup{ pdftitle={This is the Title}, } @@ -590,7 +594,7 @@ This is the \emph{Title}% \label{this-is-the-title}% \\ % subtitle% - \large{This is the \emph{Subtitle}}% + \DUdocumentsubtitle{This is the \emph{Subtitle}}% \label{this-is-the-subtitle}} \author{} \date{} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |