Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account regrouping rows #882

giovanni111 opened this issue Oct 25, 2017 · 1 comment
Closed regrouping rows #882

giovanni111 opened this issue Oct 25, 2017 · 1 comment


Copy link

When processing

  \multirow{2}{*}{H} & H \\
                     & H \\}
  B & \\

the table head becomes lost, i.e. it is shifted to the body. The following change seems to help; please check that it does no damage:

diff --git a/lib/LaTeXML/Core/ b/lib/LaTeXML/Core/
index eab3c1a..3055dc2 100644
--- a/lib/LaTeXML/Core/
+++ b/lib/LaTeXML/Core/
@@ -551,8 +551,8 @@ sub alignment_regroup_rows {
     my @cells = $document->findnodes('ltx:td', $rows[0]);
     # Non header cells, done.
     last if scalar(grep { (!$_->getAttribute('thead')) } @cells);
-    push(@heads, shift(@rows));
     my $line = scalar(@heads);
+    push(@heads, shift(@rows));
     $maxreach = max($maxreach, map { ($_->getAttribute('rowspan') || 0) + $line } @cells); }
   if ($maxreach > scalar(@heads)) {    # rowspan crossed over thead boundary!
     unshift(@rows, @heads); @heads = (); }
Copy link

Seems like the right thing, but dayum, how'd you figure that out! I'm impressed!! Thanks and committed.

@dginev dginev added this to the LaTeXML-0.8.3 milestone Jan 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

3 participants