# longtabu problem: what have I missed?

Can someone check the reproducibility of this non-compilation?

Here is the LaTeX file:

\documentclass{revtex4}
\usepackage{longtable,tabu}

\include{defs}

\begin{document}

\begin{table}
\underline{Directives}\\[5mm]
\begin{longtabu}to \linewidth{X|XXX}
{\em Type} & {\em Form}      & {\em Example} & Function \\
\hline
{\em Type} & {\em Form}      & {\em Example} & Function \\
\hline
{\em Type} & {\em Form}      & {\em Example} & Function \\
\hline
\endfoot
{\em Type} & {\em Form}      & {\em Example} & Function \\
\hline
\endlastfoot
reaction   & millibarns      & {\tt millibarns}      & All total cross
sections for the reaction are in millibarns.\\
& sigma(n1,n2)    & {\tt sigma(.5,1)}     & \\
\hline
energy     & fractional error& {\tt fractional error}& The error for the
total cross section is multiplied by the total cross
section. \\
& per cent error  & {\tt per cent error}  & The error for the
total cross section is multiplied by $0.01\sigma$. \\
& shift           & {\tt shift smith77}   & The blank delimited
characters comprise the energy shift identifier.\\
& variable energy\newline free energy & {\tt variable energy
= engy7} & The blank delimited characters identify the energy
as free to vary. \\
& reverse particles & {\tt reverse particles} & The order
of the initial particles is reversed. \\
& points & {\tt 5 points} & The data is energy-averaged
over 5 points. \\
& resolution & {\tt resolution = .05} & Resolution is
half the width in MeV of the experimental energy resolution
for the energy-averaged.{\bf [CHECK!]} \\
& Gaussian & {\tt gaussian} & Data is energy-averaged
assuming Gaussian energy distribution. \\
\hline
observable & label\newline header & {\tt label = Smith Ayy} & This is
the label printed with the observable. Only 56 characters are
printed. No directive is allowed on the line after the
label. \\
& reference & {\tt reference = np(1963)} & If a reference
is given it is printed on the output after label. No
directive is allowed on the line after reference.\\
& operators & {\tt operators xy 1 1 lz} & Listed in order
of particles. The character 1' is necessary to denote the
unit matrix. The literal l' denotes lab angle
dependence. \\
&           & {\tt operators (xy,1)lz} & Listed in order
2(1,3)4. The character 1' is not necessary to denote the
unit matrix. \\
& constant multiplier factor & {\tt factor = 2.0} &
Multiplies operator. \\
& squared multiplier & {\tt squared = 3.0} & Square root of
the number multiplies the operator. \\
& type\newline denominator & {\tt type = 2} & {\tt type =
0} for cross sections \newline {\tt type = 1} for
obs = $\frac{\tr AO_iA^\dag O_f}{\tr AA^\dag}$
\newline {\tt type = 2} for obs = $\frac{\tr AO_i A^\dag O_f}{\tr AO_iA^\dag}$ \newline For cross sections default
{\tt type = 0} \newline For other obs default {\tt type =
1}. \\
\end{longtabu}
\end{table}
\end{document}


And here is the attempted compilation:

\$ latex test-longtabu.tex
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
(./test-longtabu.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
(/usr/share/texmf-texlive/tex/latex/revtex4/revtex4.cls
Document Class: revtex4 2001/08/02 v4.0 (http://publish.aps.org/revtex4/ for do
cumentation)
ltxutil: portions licensed from W. E. Baxter (web@superscript.com)
ltxgrid: portions licensed from W. E. Baxter (web@superscript.com)
(/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty)
(/usr/share/texmf-texlive/tex/latex/natbib/natbib.sty)
(/usr/share/texmf-texlive/tex/latex/revtex4/revsymb.sty))

Class revtex4 Warning: No Society specified, using generic APS style.

(/usr/share/texmf-texlive/tex/latex/revtex4/aps.rtx)
(/usr/share/texmf-texlive/tex/latex/revtex4/10pt.rtx)
(/usr/share/texmf-texlive/tex/latex/tools/longtable.sty)
(/usr/share/texmf-texlive/tex/latex/tabu/tabu.sty
(/usr/share/texmf-texlive/tex/latex/tools/array.sty)
(/usr/share/texmf-texlive/tex/latex/varwidth/varwidth.sty))
\@input{defs.aux}
(./defs.tex) (./test-longtabu.aux)
Underfull \hbox (badness 10000) in paragraph at lines 72--72
[]\OT1/cmr/m/n/9 Data is energy-averaged

Underfull \hbox (badness 10000) in paragraph at lines 72--72
\OT1/cmr/m/n/9 as-sum-ing Gaus-sian en-ergy

Underfull \hbox (badness 1019) in paragraph at lines 72--72
[]\OT1/cmr/m/n/9 Listed in or-der of par-ti-cles.

Underfull \hbox (badness 1715) in paragraph at lines 72--72
\OT1/cmr/m/n/9 lit-eral l' de-notes lab an-gle

Underfull \hbox (badness 1715) in paragraph at lines 72--72
[]\OT1/cmr/m/n/9 Square root of the num-ber

Underfull \hbox (badness 10000) in paragraph at lines 72--72
\OT1/cmtt/m/n/9 type = 1 \OT1/cmr/m/n/9 for obs =

Underfull \hbox (badness 10000) in paragraph at lines 72--72
\OT1/cmtt/m/n/9 type = 2 \OT1/cmr/m/n/9 for obs =

Package longtable Warning: Column widths have changed
(longtable)                in table I on input line 72.

! Undefined control sequence.
\tabu@cleanup ...bu@naturalX =\tabu@naturalX@save
\let \tabu@naturalXmax \ta...
l.72 \end{longtabu}


Here is the .log file:

This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=latex 2012.1.12)  28 MAR 2012 12:01
entering extended mode
%&-line parsing enabled.
**test-longtabu.tex
(./test-longtabu.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
(/usr/share/texmf-texlive/tex/latex/revtex4/revtex4.cls
Document Class: revtex4 2001/08/02 v4.0 (http://publish.aps.org/revtex4/ for do
cumentation)
Copyright (c) 2001 The American Physical Society.
mailto:revtex@aps.org
http://www.ctan.org/tex-archive/macros/latex/base/lppl.txt
Arthur Ogawa <ogawa@teleport.com>
Based on work by David Carlisle <david@dcarlisle.demon.co.uk>.
ltxutil: portions licensed from W. E. Baxter (web@superscript.com)
Class revtex4 Info: Repairing broken LateX \@sect on input line 596.
\intertabularlinepenalty=\count79
\@tbpen=\count80
\@arstrutbox@hline=\box26
Class revtex4 Info: Repairing broken LaTeX \@xbitor on input line 1610.
ltxgrid: portions licensed from W. E. Baxter (web@superscript.com)
\c@linecount=\count81
\output=\toks14
\@protection@box=\box27
\@topmark@saved=\toks15
\footins@saved=\box28
\pagesofar=\box29
\footbox=\box30
\pagegrid@col=\count82
Class revtex4 Info: Incorporating package {textcase}  [1998/11/12 v0.06 Text on
ly upper/lower case changing (DPC)]. on input line 3682.
(/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty
\Urlmuskip=\muskip10
Package: url 2006/04/12  ver 3.3  Verb mode for urls, etc.
)
\c@affil=\count83
\absbox=\box31
\c@part=\count84
\c@section=\count85
\c@subsection=\count86
\c@subsubsection=\count87
\c@paragraph=\count88
\c@subparagraph=\count89
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\c@figure=\count90
\c@table=\count91

(/usr/share/texmf-texlive/tex/latex/natbib/natbib.sty
Package: natbib 2009/07/16 8.31 (PWD, AO)
\bibhang=\skip43
\bibsep=\skip44
LaTeX Info: Redefining \cite on input line 694.
\c@NAT@ctr=\count92
)
\widetext@top=\box32
\widetext@bot=\box33

(/usr/share/texmf-texlive/tex/latex/revtex4/revsymb.sty
Package: revsymb 2001/08/02 v4.0 (http://publish.aps.org/revtex4/ for documenta
tion)
LaTeX Info: Redefining \REV@mathfrak on input line 118.
))

Class revtex4 Warning: No Society specified, using generic APS style.

(/usr/share/texmf-texlive/tex/latex/revtex4/aps.rtx
File: aps.rtx 2001/08/02 v4.0 (http://publish.aps.org/revtex4/ for documentatio
n)
)
(/usr/share/texmf-texlive/tex/latex/revtex4/10pt.rtx
File: 10pt.rtx 2001/08/02 v4.0 (http://publish.aps.org/revtex4/ for documentati
on)
)
(/usr/share/texmf-texlive/tex/latex/tools/longtable.sty
Package: longtable 2004/02/01 v4.11 Multi-page Table package (DPC)
\LTleft=\skip45
\LTright=\skip46
\LTpre=\skip47
\LTpost=\skip48
\LTchunksize=\count93
\LTcapwidth=\dimen102
\LT@foot=\box36
\LT@lastfoot=\box37
\LT@cols=\count94
\LT@rows=\count95
\c@LT@tables=\count96
\c@LT@chunks=\count97
\LT@p@ftn=\toks16
)
(/usr/share/texmf-texlive/tex/latex/tabu/tabu.sty
Package: tabu 2011/02/26 v2.8 - flexible LaTeX tabulars (FC)

(/usr/share/texmf-texlive/tex/latex/tools/array.sty
Package: array 2008/09/09 v2.4c Tabular extension package (FMi)
\col@sep=\dimen103
\extrarowheight=\dimen104
\NC@list=\toks17
\extratabsurround=\skip49
\backup@length=\skip50
)
(/usr/share/texmf-texlive/tex/latex/varwidth/varwidth.sty
Package: varwidth 2009/03/30 ver 0.92;  Variable-width minipages
\@vwid@box=\box38
\sift@deathcycles=\count98
\@vwid@loff=\dimen105
\@vwid@roff=\dimen106
)
\c@taburow=\count99
\tabu@nbcols=\count100
\tabu@cnt=\count101
\tabu@Xcol=\count102
\tabu@alloc=\count103
\tabu@nested=\count104
\tabu@target=\dimen107
\tabu@naturalX=\dimen109
\tabucolX=\dimen110
\tabu@Xsum=\dimen111
\extrarowdepth=\dimen112
\abovetabulinesep=\dimen113
\belowtabulinesep=\dimen114
\tabustrutrule=\dimen115
\tabu@thebody=\toks18
\tabu@footnotes=\toks19
\tabu@box=\box39
\tabu@arstrutbox=\box40
\tabu@cellskip=\skip51
)
\@input{defs.aux}
\openout2 = defs.aux'.

(./defs.tex
\wdo=\skip52
) (./test-longtabu.aux)
\openout1 = test-longtabu.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
Class revtex4 Info: Patching array package. on input line 6.
Class revtex4 Info: Patching unrecognized longtable package. (Proceeding with f
ingers crossed) on input line 6.
Class revtex4 Info: cite was not loaded (OK!) on input line 6.
Class revtex4 Info: multicol was not loaded (OK!) on input line 6.
LaTeX Font Info:    External font cmex10' loaded for size
(Font)              <9> on input line 9.
LaTeX Font Info:    External font cmex10' loaded for size
(Font)              <6> on input line 9.
LaTeX Font Info:    External font cmex10' loaded for size
(Font)              <5> on input line 9.

Underfull \hbox (badness 10000) in paragraph at lines 72--72
[]\OT1/cmr/m/n/9 Data is energy-averaged
[]

Underfull \hbox (badness 10000) in paragraph at lines 72--72
\OT1/cmr/m/n/9 as-sum-ing Gaus-sian en-ergy
[]

Underfull \hbox (badness 1019) in paragraph at lines 72--72
[]\OT1/cmr/m/n/9 Listed in or-der of par-ti-cles.
[]

Underfull \hbox (badness 1715) in paragraph at lines 72--72
\OT1/cmr/m/n/9 lit-eral l' de-notes lab an-gle
[]

Underfull \hbox (badness 1715) in paragraph at lines 72--72
[]\OT1/cmr/m/n/9 Square root of the num-ber
[]

Underfull \hbox (badness 10000) in paragraph at lines 72--72
\OT1/cmtt/m/n/9 type = 1 \OT1/cmr/m/n/9 for obs =
[]

Underfull \hbox (badness 10000) in paragraph at lines 72--72
\OT1/cmtt/m/n/9 type = 2 \OT1/cmr/m/n/9 for obs =
[]

Package longtable Warning: Column widths have changed
(longtable)                in table I on input line 72.

! Undefined control sequence.
\tabu@cleanup ...bu@naturalX =\tabu@naturalX@save
\let \tabu@naturalXmax \ta...
l.72 \end{longtabu}

? x

Here is how much of TeX's memory you used:
3216 strings out of 495062
35700 string characters out of 1182644
111360 words of memory out of 3000000
6441 multiletter control sequences out of 15000+50000
6283 words of font info for 23 fonts, out of 3000000 for 9000
28 hyphenation exceptions out of 8191
25i,13n,23p,208b,506s stack positions out of 5000i,500n,10000p,200000b,50000s
No pages of output.


EDIT: I don't think it's relevant but here is the content of the defs.tex file:

\newcommand{\tr}{\mbox{Tr }}

-
There seem to be a incompatibility between tabu and revtex4. Using the article class makes it compile ok, however the table doesn't get split across pages. Removing the \begin{table} and \end{table} calls around your tabu fixes that. – ArTourter Mar 28 '12 at 18:27
Thanks, ArTourter. And removing \begin{table}...\end{table} takes care of the problem I had with tabularx that drove me to install tabu. I might, however, need tabu in the future -- any ideas on how to make it compatible with revtex4 (other than not using revtex4!)? – MarkWayne Mar 28 '12 at 19:31
Enclosing longtabu in a table environment makes little sense anyway: the contents of table can't be split across pages. The bug is annoying nonetheless. – egreg Mar 28 '12 at 19:41
Agreed, egreg. Had I thought about it... – MarkWayne Mar 28 '12 at 19:48

It's quite difficult to trace the source of the error, but I believe it has to do with the fact that revtex4 redefines tabular and this breaks lontabu.

To begin with your problem, a longtabu or longtable environment should never go in a table environment, which is never split across pages.

Although longtabu doesn't work, you can get what you want by stating explicitly the column widths (load also the calc package):

\begin{longtable}{
p{.25\textwidth-2\tabcolsep-\arrayrulewidth}|
*{3}{p{.25\textwidth-2\tabcolsep}}
}


but with revtex4 you'll get a spurious

Package longtable Warning: Table widths have changed. Rerun LaTeX.


\documentclass{revtex4-1}

Note. The revtex4-1 doesn't cure the longtabu problem.