From: David A. <da...@bo...> - 2003-03-19 16:12:31
|
I had to make the following patch in order to get LaTeX to accept the results of using latex2e.py on my ReST. The problem is that otherwise my :abstract: section comes out looking like: \begin{center} \subsection*{abstract} \end{center} and for some reason LaTeX chokes on that, citing a missing \item. Since I don't know much about what's good LaTeX, I thought I should post the patch here in lieu of checking it in that way. Index: docutils/docutils/writers/latex2e.py =================================================================== RCS file: /cvsroot/docutils/docutils/docutils/writers/latex2e.py,v retrieving revision 1.7 diff -w -u -r1.7 latex2e.py --- docutils/docutils/writers/latex2e.py 18 Mar 2003 12:38:18 -0000 1.7 +++ docutils/docutils/writers/latex2e.py 19 Mar 2003 16:09:17 -0000 @@ -1239,8 +1239,8 @@ # 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') - self.context.append('\\end{center}\n') +# self.body.append('\\begin{center}\n') +# self.context.append('\\end{center}\n') ## should this be section subsection or self.body.append('\\subsection*{') self.context.append('}\n') @@ -1275,8 +1275,8 @@ def depart_title(self, node): self.body.append(self.context.pop()) - if isinstance(node.parent, nodes.topic): - 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 -- Dave Abrahams Boost Consulting www.boost-consulting.com |