GithubHelp home page GithubHelp logo

Comments (10)

u-fischer avatar u-fischer commented on May 14, 2024

related problems with vertical spaces (the second one can also be seen with tabularx instead of tabu):

https://tex.stackexchange.com/q/429272/87678
https://tex.stackexchange.com/questions/429307/problem-with-new-array-sty-colortbl-sty-and-tabu-sty

from latex2e.

FrankMittelbach avatar FrankMittelbach commented on May 14, 2024

Fix for the issues is most likely

\def\@xargarraycr#1{\unskip\gdef\do@row@strut
 {\@tempdima #1\advance\@tempdima \dp\@arstrutbox
   \vrule \@depth\@tempdima \@width\z@\global\let\do@row@strut\relax}%
   \ifnum\@multicnt >\z@ \do@row@strut \fi\cr}

though that needs a bit more testing.

The colortbl patch as suggested by David in a rush may not be quite right but once done probably also fixes the other two mentioned cases (though not 100% sure of the tabu case yet)

from latex2e.

FrankMittelbach avatar FrankMittelbach commented on May 14, 2024

In addition to what @davidcarlisle already suggested as a patch to colortbl it needs a few more lines:

\def\@classz{\@classx
   \@tempcnta \count@
   \prepnext@tok
\expandafter\CT@extract\the\toks\@tempcnta\columncolor!\@nil
   \@addtopreamble{%
    \setbox\z@\hbox\bgroup\bgroup
      \CT@everycr{}%
      \ifcase \@chnum
      \hskip\stretch{.5}\kern\z@
      \d@llarbegin
      \insert@column
      \d@llarend\do@row@strut\hskip\stretch{.5}\or
      \d@llarbegin \insert@column \d@llarend\do@row@strut \hfill \or
      \hfill\kern\z@ \d@llarbegin \insert@column \d@llarend\do@row@strut \or
%% FMi: replace      
\setbox\ar@mcellbox\vbox
       \@startpbox{\@nextchar}\insert@column \@endpbox
    \ar@align@mcell
    \do@row@strut \or
%    $\vcenter
%   \@startpbox{\@nextchar}\insert@column \@endpbox $\or
    \vtop \@startpbox{\@nextchar}\insert@column \@endpbox
%% FMi add     
    \do@row@strut
    \or
    \vbox \@startpbox{\@nextchar}\insert@column \@endpbox
%% FMi add      
    \do@row@strut
  \fi
 \egroup\egroup
\begingroup
  \CT@setup
  \CT@column@color
  \CT@row@color
  \CT@cell@color
  \CT@do@color
\endgroup
        \@tempdima\ht\z@
        \advance\@tempdima\minrowclearance
        \vrule\@height\@tempdima\@width\z@
        \unhbox\z@}%
  \prepnext@tok}

after that the examples on SX run for me.

from latex2e.

dcpurton avatar dcpurton commented on May 14, 2024

I still get slightly different output for this tabu example:

\documentclass{article}
\usepackage{colortbl}
\usepackage{tabu}
\pagestyle{empty}
\begin{document}
\begin{tabu}{|l|X|}
  \hline
  Row 1 & \\
  \hline
  Row 2 & \\[5mm]
  \hline
  Row 3 & \\[5mm]
  \hline
  Row 4 & \\[5mm]
  \hline
\end{tabu}
\end{document}

With array 2016/10/06 v2.4d and colortbl 2012/02/13 v1.0a I get:

old

With array 2018/04/07 v2.4g including the patch in this thread and colortbl from https://tex.stackexchange.com/q/429272/87678 with the patch from this thread added I get:

new

from latex2e.

u-fischer avatar u-fischer commented on May 14, 2024

This looks as if the new code corrects a bug in tabu. In your first output tabu added 10mm instead of 5mm.

from latex2e.

FrankMittelbach avatar FrankMittelbach commented on May 14, 2024

@dcpurton I think @u-fischer is right: looking into the generated page one sees a rule of with a depth of roughly twice of what is requested (plus roughly a baselineskip). With the new version (including the patches) that is gone. Replacing tabu with tabularx doesn't show that behavior (ie fine in both versions).

from latex2e.

dcpurton avatar dcpurton commented on May 14, 2024

@u-fischer and @FrankMittelbach, I agree, the old behaviour of tabu does seem wrong (and I've even wondered about it before). It's a pity it will break old documents, but maybe that can't be helped. Thanks for dealing with this.

from latex2e.

FrankMittelbach avatar FrankMittelbach commented on May 14, 2024

I just fixed the array part of the problem and will upload that the moment the internet connection is a bit more stable over here. I also arranged for the package to rollback to the 2017 behavior if there is a rollback request so that older documents should still show the wrong (but probably used) behavior with tabu and the like.
In addition colortbl needs changing (as outlined above) so I pass that on to @davidcarlisle.

from latex2e.

davidcarlisle avatar davidcarlisle commented on May 14, 2024

I have updated colortbl, hopefully in a version that works with old or new array package code

davidcarlisle/dpctex@3766c2b

from latex2e.

FrankMittelbach avatar FrankMittelbach commented on May 14, 2024

fixed with the recent updates

from latex2e.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.