5765: table-lines out of order in complete-individual-report in LaTeX

(patch by Harald Rosemann <rosemann@imkt.uni-hannover.de>)


svn: r19953
This commit is contained in:
Paul Franklin 2012-07-05 13:54:01 +00:00
parent c8c78e5044
commit 15696d64a8

View File

@ -648,7 +648,7 @@ class LaTeXDoc(BaseDoc, TextDoc):
# some additional variables
# ---------------------------------------------------------------
in_table = False
in_multrow_cell = False
in_multrow_cell = False # for tab-strukt: cols of rows
pict = ''
pict_in_table = False
pict_width = 0
@ -703,7 +703,7 @@ class LaTeXDoc(BaseDoc, TextDoc):
elif tab_state == ROW_END:
self.tabrow.addit = text # text: \\hline, \\cline{}
self.tabrow.tail = ''.join(self.textmem) # \\\\ row-termination
if self.in_multrow_cell:
if self.in_multrow_cell: # cols of rows: convert to rows of cols
self.repack_row()
else:
self.tabmem.rows.append(self.tabrow)
@ -721,10 +721,15 @@ class LaTeXDoc(BaseDoc, TextDoc):
def repack_row(self):
"""
Transpose contents contained in a row of mult-row cells
Transpose contents contained in a row of cols of cells
to rows of cells with corresponding contents.
Rows in the mult-row-cell are ended by SEPARATION_PAT
Cols of the mult-row-cell are ended by SEPARATION_PAT
"""
# if last col empty: delete
if self.tabrow.cells[-1].content == '':
del self.tabrow.cells[-1]
self.numcols -= 1
# extract cell.contents
bare_contents = [cell.content.strip(SEPARATION_PAT).replace(
'\n', '').split(SEPARATION_PAT)
@ -1042,7 +1047,7 @@ class LaTeXDoc(BaseDoc, TextDoc):
if self.in_title and ltxstyle.font_beg.find('centering') == -1:
self.in_title = False
self._backend.write('\\vspace{5ex}%\n')
if self.in_table:
if self.in_table: # paragraph in table indicates: cols of rows
self.in_multrow_cell = True
else:
if leader: