5

I've been wrestling with longtables/longtabu for a while now, and I have it almost working the way I want. The last thing that I want to be able to do is have a \hline inserted for every row.

Here's what I'm trying:

\documentclass{article}
\usepackage{longtable}
\usepackage{tabu}

\begin{document}

\everyrow{\hline} % If I comment out this, or use anything but \hline it works
\begin{longtabu}{|X|X|X|}
First & First & First \\
\endfirsthead
Rest & Rest & Rest \\
\endhead
Foot & Foot & Foot \\
\endfoot
Last & Last & Last \\
\endlastfoot
hello & banana & world
\end{longtabu}

\end{document}

The error I'm getting is:

! Misplaced \omit.
\multispan ->\omit 
                   \@multispan 
l.18 \end{longtabu}

Any help would be great!

4
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
    – Speravir
    Commented Jan 24, 2014 at 21:42
  • 1
    Seems like a bug in tabu. It works with \everyrow{\tabucline-}. Do not expect, that the author fixes this supposed bug.
    – Speravir
    Commented Jan 24, 2014 at 21:42
  • Related to my latest comment: groups.google.com/d/msg/comp.text.tex/xRGJTC74uCI/jkNlDkpG5cMJ (GL is Florent Chervet, the writer of package tabu).
    – Speravir
    Commented Jan 24, 2014 at 21:59
  • 2
    rather than mess with \every... why not just end each row with \mycr defined as \newcommand\mycr{\\\hline} Commented Jan 24, 2014 at 23:21

1 Answer 1

4

Rather than use the \every.. hooks it is simpler to use \mycr rather than \\ to end the table rows, defined as

 \newcommand\mycr{\\\hline}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .