7

Since the last update of tabu.sty I get the following error:

! Improper \prevdepth. \tabu@verticalspacing ... tempdimc \t

Here is a MWE

\documentclass[a4paper,12pt]{report}
\usepackage{tabu}
\usepackage{amsmath}
\usepackage{xcolor}  
\newcolumntype{L}{>{\begin{varwidth}{0.91\linewidth}}l<{\end{varwidth}}}

\begin{document}    
\begin{tabu}{Lcc}
$\begin{pmatrix}
1 \\2\\3    
\end{pmatrix}$& 2& 3\\
\end{tabu}

\end{document}

The error occurs, when including pmatrix (or array) in a tabu-environment with a predefined column (using varwidth) AND strangely when including any other of a list of packages (like: color.sty, xcolor.sty, pstricks-add.sty, colortbl.sty, ...) Everything worked fine before the update!

Does anyone know, how to fix this?

Here is the first line of the log file:

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6930 64-bit) (preloaded format=latex 2019.1.13) 20 JAN 2019 12:55 entering extended mode

11

I think this is the correct fix, if it survives some more testing I'll get tabu updated on ctan.

\documentclass[a4paper,12pt]{report}
\usepackage{tabu}
\usepackage{amsmath}
\usepackage{xcolor}  
\newcolumntype{L}{>{\begin{varwidth}{0.91\linewidth}}l<{\end{varwidth}}}

\makeatletter
\def\tabu@verticalmeasure{\everypar{}%
\unless\ifnum\currentgrouptype=14 \let\tabu@currentgrouptype\currentgrouptype\fi
    \ifnum \tabu@currentgrouptype>12         % 14=semi-simple, 15=math shift group
        \setbox\tabu@box =\hbox\bgroup
            \let\tabu@verticalspacing \tabu@verticalsp@lcr
            \d@llarbegin                % after \hbox ...
    \else
        \edef\tabu@temp{\ifnum\tabu@currentgrouptype=5\vtop
                        \else\ifnum\tabu@currentgrouptype=12\vcenter
                        \else\vbox\fi\fi}%
        \setbox\tabu@box \hbox\bgroup$\tabu@temp \bgroup
            \let\tabu@verticalspacing \tabu@verticalsp@pmb
    \fi
}
\makeatother

\begin{document}    
\begin{tabu}{Lcc}
$\begin{pmatrix}
1 \\2\\3    
\end{pmatrix}$& 2& 3\\
\end{tabu}

\end{document}
  • As far as I can test it right now, it works. Although the $ in the line \setbox\tabu@box \hbox\bgroup$\tabu@temp \bgroup confuses my editor, because it sees it as a beginning of a formular. – chris Jan 20 at 13:43
  • 1
    @chris thanks I plan to push 2.10 to ctan now, so it should appear in texlive/miktex later in the week. – David Carlisle Jan 20 at 13:50
  • 1
    Thanks! However, I just found out, the above mentioned problem also occurs (exactly in the same way), when including a table (e.g tabular) in the tabu-environment and is not solved by this solution. (It also worked before the last update!) – chris Jan 20 at 14:06

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.