#371: fix LaTeX output generated for return annotations.

This commit is contained in:
Georg Brandl 2010-04-04 18:56:56 +02:00
parent 71a985c06c
commit f470bd38e6
2 changed files with 7 additions and 7 deletions

View File

@ -227,14 +227,14 @@
{\textnormal{\Large[}}{#1}\hspace{0.5mm}{\textnormal{\Large]}}}
\newlength{\py@argswidth}
\newcommand{\py@sigparams}[1]{%
\parbox[t]{\py@argswidth}{#1\code{)}}}
\newcommand{\py@sigparams}[2]{%
\parbox[t]{\py@argswidth}{#1\code{)}#2}}
\newcommand{\pysigline}[1]{\item[#1]\nopagebreak}
\newcommand{\pysiglinewithargs}[2]{%
\newcommand{\pysiglinewithargsret}[3]{%
\settowidth{\py@argswidth}{#1\code{(}}%
\addtolength{\py@argswidth}{-2\py@argswidth}%
\addtolength{\py@argswidth}{\textwidth}%
\item[#1\code{(}\py@sigparams{#2}]}
\item[#1\code{(}\py@sigparams{#2}{#3}]}
% This version is being checked in for the historical record; it shows
% how I've managed to get some aspects of this to work. It will not

View File

@ -483,12 +483,12 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.body.append(hyper)
for child in node:
if isinstance(child, addnodes.desc_parameterlist):
self.body.append(r'\pysiglinewithargs{')
self.body.append(r'\pysiglinewithargsret{')
break
else:
self.body.append(r'\pysigline{')
def depart_desc_signature(self, node):
self.body.append('}')
self.body.append('}{}')
def visit_desc_addname(self, node):
self.body.append(r'\code{')
@ -503,7 +503,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
pass
def visit_desc_returns(self, node):
self.body.append(r' $\rightarrow$ ')
self.body.append(r'}{ $\rightarrow$ ')
def depart_desc_returns(self, node):
pass