6

I am currently setting up a fresh LaTeX environment and trying to incorporate all my old files. They use the tabu package a lot. Since it is very outdated, giving errors etc. I decided to replace it with a similar, but updated package.

Question 1: Is there a current package out there that provides the same features as tabu? I saw some latex-table-package-overviews, but most of them list tabu as "all-rounder" with the comment: don't use it, but without advice for a replacement.

Question 2: We have a lot of tabus, thousands of them. It would take weeks to go through all the documents and replace them all. Can you imagine a possibility to create a self-made tabu-environment based on a possible package (from Question 1). Ideally I will be able to define this globally and the files with tabus will still be working and the tables appear as close as possible to the old one.

Edit:

The features we use mostly are

  • the "to"-specifier for a given width of the tabu
  • the horizontal adjustment properties. Mentionable are the "standard" X[1c], the semi-automatic X[-1c] and the math-mode-included versions as X[-1c$]; all also in combination with the syntax for a number n of those, like n*{X[-1c$]}
  • extrarowsep=.. as vertical alignment
  • \tabucline{-} and \tabucline{X-Y}

I guess that would be our main uses of the tabu-features. There are also some longtabus in our works, but only just a few. I also have prepared an MWE (at least I tried as well as I can) for some of the mentioned features:

    \documentclass[a4paper]{article}
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage{amsmath}
    \usepackage{tabu}

    \begin{document}
    \begin{center} 
    \begin{tabu}to 0.8\linewidth{|X[-1c]|X[-1c]|X[-1c]|} 
    \tabucline{-}
    Test & X & Y \\\tabucline{-}
    Test & Z & A \\\tabucline{-}
    \end{tabu}
    \end{center}

    \begin{center}
    {\extrarowsep=5pt
    \begin{tabu}to 0.7\linewidth{*4{|X[-1c$]}|}
    \alpha & \beta & \gamma & \delta \\\tabucline{2-3}
    \alpha & \beta & \gamma & \delta
    \end{tabu}}
    \end{center}
    \end{document}

Edit 2:

The fact that there is no solution conveys the impression that this (at least the general tabu features replacement) might be of some interest and something worth taking a deeper look. So for the first step I want to construct some tables with the same features and results but without using the tabu-package. As it might be the wrong place to expand this question any further, I started a new one here: Tabularx with calculated column widths that use the whole table width

3
  • 2
    Maybe you should clarify which features of tabu your files use. Then it may be easier to find a replacement. Maybe it is possible to define a pseudo-tabu packages based on another tabular package that provides just the required features
    – gernot
    Dec 11, 2020 at 11:29
  • 3
    I'm not aware of a direct replacement. If and how easily it is possible to define a self-made tabu depends a lot on which features you actually used. Dec 11, 2020 at 11:31
  • you are right. I mentioned the main features and gave a MWE in my edit.
    – buecki
    Dec 13, 2020 at 9:35

1 Answer 1

1

The new LaTeX3 package tabularray is an alternative for the outdated tabu package:

\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{width=0.8\linewidth,colspec={|*{3}{X[2,l]|X[-2,r]|}},rowsep=4pt}
\hline[1pt]
 1     & 2    & 3     & 4     & 5       & 6    \\
\cline{1-3}
 alpha & beta & gamma & delta & epsilon & zeta \\
\cline[dashed]{-}
 1     & 2    & 3     & 4     & 5       & 6    \\
\cline{1,3,5}
 alpha & beta & gamma & delta & epsilon & zeta \\
\hline[1pt]
\end{tblr}
\end{document} 

enter image description here

You must log in to answer this question.

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