diff options
author | grubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2007-05-31 14:22:52 +0000 |
---|---|---|
committer | grubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2007-05-31 14:22:52 +0000 |
commit | 75ed55eca78baa47f44e9c5643fb76cdf54b6c8c (patch) | |
tree | 493172154c159349f197235655259a40f7461a15 | |
parent | 72b0f58cfad8030cd8f527936f3d2c0554218512 (diff) | |
download | docutils-75ed55eca78baa47f44e9c5643fb76cdf54b6c8c.tar.gz |
Put leavevmode before longtable to avoid having it moved before sub/pargraph.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils/docutils@5178 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r-- | writers/latex2e/__init__.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/writers/latex2e/__init__.py b/writers/latex2e/__init__.py index 77de55e35..d5f67ffd1 100644 --- a/writers/latex2e/__init__.py +++ b/writers/latex2e/__init__.py @@ -424,7 +424,12 @@ class Table: return '' # horizontal lines are drawn below a row, because we. def get_opening(self): - return '\\begin{%s}[c]' % self._latex_type + if self._latex_type == 'longtable': + # otherwise longtable might move before paragraph and subparagraph + prefix = '\\leavevmode\n' + else: + prefix = '' + return '%s\\begin{%s}[c]' % (prefix, self._latex_type) def get_closing(self): line = "" if self._table_style == 'booktabs': @@ -2085,7 +2090,8 @@ class LaTeXTranslator(nodes.NodeVisitor): section_name = self.d_class.section(self.section_level) self.body.append('\\%s%s{' % (section_name, section_star)) - + # MAYBE postfix paragraph and subparagraph with \leavemode to + # ensure floatables stay in the section and text starts on a new line. self.context.append('}\n') def depart_title(self, node): |