From 451cc35094881673dd2867bcfdcbfc8c112cd0ba Mon Sep 17 00:00:00 2001 From: grubert Date: Fri, 21 Mar 2003 14:00:15 +0000 Subject: [PATCH] exchange the empty list hack for centering titles with hfill. git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk/docutils@1224 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/writers/latex2e.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/docutils/writers/latex2e.py b/docutils/writers/latex2e.py index 5f115dfe9..fbf259ee5 100644 --- a/docutils/writers/latex2e.py +++ b/docutils/writers/latex2e.py @@ -1228,18 +1228,11 @@ class LaTeXTranslator(nodes.NodeVisitor): # section titles before the table of contents. if node.parent.hasattr('id'): self.body.append('\\hypertarget{%s}{}' % node.parent['id']) - self.body.append('\\begin{center}\n') - # BUG: latex chokes: perhaps a missing item. - self.context.append('% HACK: latex chokes: -- perhaps a missing item.\n' - '\\begin{list}{ }{' - '\\setlength{\\topsep}{0pt}' - '\\setlength{\\itemsep}{-1cm}}' - '\\item \\item \\end{list}\n' - '\\end{center}\n') - ## should this be section subsection or - self.body.append('\\subsection*{') + # BUG: latex chokes on center environment with "perhaps a missing item". + # so we use hfill. + self.body.append('\\subsection*{~\\hfill ') # the closing brace for subsection. - self.context.append('}\n') + self.context.append('\\hfill ~}\n') elif self.section_level == 0: # document title self.title = self.encode(node.astext()) @@ -1271,8 +1264,6 @@ class LaTeXTranslator(nodes.NodeVisitor): def depart_title(self, node): self.body.append(self.context.pop()) - if isinstance(node.parent, nodes.topic): - self.body.append(self.context.pop()) # BUG level depends on style. if node.parent.hasattr('id') and not self.use_latex_toc: # pdflatex allows level 0 to 3 -- 2.11.4.GIT