merge with trunk

This commit is contained in:
Georg Brandl 2010-01-17 23:26:15 +01:00
commit e982d54109

View File

@ -261,7 +261,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.body.append('\n\\appendix\n')
self.first_document = -1
if node.has_key('docname'):
self.body.append('\\hypertarget{--doc-%s}{}' % node['docname'])
self.body.append('\\hypertarget{--doc-%s}{}' %
self.idescape(node['docname']))
# "- 1" because the level is increased before the title is visited
self.sectionlevel = self.top_sectionlevel - 1
def depart_document(self, node):
@ -275,7 +276,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
# cite_key: underscores must not be escaped
cite_key = bi[0].replace(r"\_", "_")
self.body.append('\\bibitem[%s]{%s}{\hypertarget{%s}{} %s}\n' %
(bi[0], cite_key, cite_key.lower(), bi[1]))
(bi[0], cite_key,
self.idescape(cite_key.lower()), bi[1]))
self.body.append('\\end{thebibliography}\n')
self.bibitems = []
@ -286,7 +288,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
# and also, new footnotes
self.footnotestack.append(self.collect_footnotes(node))
# also add a document target
self.body.append('\\hypertarget{--doc-%s}{}' % node['docname'])
self.body.append('\\hypertarget{--doc-%s}{}' %
self.idescape(node['docname']))
self.curfilestack.append(node['docname'])
def collect_footnotes(self, node):
@ -319,7 +322,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.sectionlevel += 1
self.body.append('\n\n')
if self.next_section_target:
self.body.append(r'\hypertarget{%s}{}' % self.next_section_target)
self.body.append(r'\hypertarget{%s}{}' %
self.idescape(self.next_section_target))
self.next_section_target = None
#if node.get('ids'):
# for id in node['ids']:
@ -756,7 +760,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
def visit_module(self, node):
modname = node['modname']
self.body.append('\n\\hypertarget{module-%s}{}' %
(modname.replace(' ','')))
self.idescape(modname.replace(' ','')))
self.body.append('\n\\declaremodule[%s]{}{%s}' % (
modname.replace('_', ''), self.encode(modname)))
self.body.append('\n\\modulesynopsis{%s}' %
@ -921,7 +925,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
# indexing uses standard LaTeX index markup, so the targets
# will be generated differently
if not id.startswith('index-'):
self.body.append(r'\hypertarget{%s}{}' % id)
self.body.append(r'\hypertarget{%s}{}' % self.idescape(id))
if node.has_key('refid') and node['refid'] not in self.written_ids:
parindex = node.parent.index(node)