Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with \fpeval in p-columntype if array.sty is loaded #1585

Open
u-fischer opened this issue Dec 17, 2024 · 0 comments
Open

error with \fpeval in p-columntype if array.sty is loaded #1585

u-fischer opened this issue Dec 17, 2024 · 0 comments
Labels
bug category firstaid category tools fixed in dev Fixed in development branch, not in stable release

Comments

@u-fischer
Copy link
Member

If \fpeval is used (directly or indirectly through a command) in a p-column this can error in some tabular preambles. Two examples are below.

\RequirePackage{latexbug}
\documentclass{article}
\usepackage{array}
\begin{document}
\begin{tabular}{p{\fpeval{15}pt}p{\fpeval{15}pt}p{\fpeval{15}pt}p{\fpeval{15}pt}}
a
\end{tabular}


\begin{tabular}{p{\fpeval{15}pt}lll}
a
\end{tabular}

\end{document}
! Extra \or.
\@mkpream ...ss }\ifcase \@lastchclass \@acol \or 
                                                  \or \@acol \or \@preamerr ...
l.33 ...al{15}pt}p{\fpeval{15}pt}p{\fpeval{15}pt}}

Log file (required) and possibly PDF file

test-utf8.log

A suggested fix is to add a \dimexpr (this would also allow direct calculations in the p-columntype, but must be checked for compability with the calc package.

\def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue
   \let\@sharp\relax
   \def\@startpbox##1{\unexpanded\expandafter{\expandafter
                      \@startpbox\expandafter{\expandafter\dimexpr##1}}}\let\@endpbox\relax %<-----------
   \let\do@row@strut\relax
   \let\ar@align@mcell\relax
   \@temptokena{#1}\@tempswatrue
   \@whilesw\if@tempswa\fi{\@tempswafalse\the\NC@list}%
   \count@\m@ne
   \let\the@toks\relax
   \prepnext@tok
   \expandafter \@tfor \expandafter \@nextchar
    \expandafter :\expandafter =\the\@temptokena \do
   {\@testpach
   \ifcase \@chclass \@classz \or \@classi \or \@classii
     \or \save@decl \or \or \@classv \or \@classvi
     \or \@classvii \or \@classviii
     \or \@classx
     \or \@classx \fi
   \@lastchclass\@chclass}%
   \ifcase\@lastchclass
   \@acol \or
   \or
   \@acol \or
   \@preamerr \thr@@ \or
   \@preamerr \tw@ \@addtopreamble\@sharp \or
   \or
   \else  \@preamerr \@ne \fi
   \def\the@toks{\the\toks}}
@github-project-automation github-project-automation bot moved this to Pool (unscheduled issues) in upcoming LaTeX2e releases Dec 17, 2024
@FrankMittelbach FrankMittelbach added this to the Release 2025 Spring milestone Dec 17, 2024
FrankMittelbach added a commit that referenced this issue Dec 17, 2024
@FrankMittelbach FrankMittelbach moved this from Pool (unscheduled issues) to Done in dev in upcoming LaTeX2e releases Dec 27, 2024
FrankMittelbach added a commit that referenced this issue Dec 28, 2024
* fix for #1585

* not sure why that changed, needs investigation

* forgot to upload ltnews41

* WIP

* adjust longtable to array change

* some docu fixes, suggested by @Skillmon

* docu fix for #1418
@FrankMittelbach FrankMittelbach added fixed in dev Fixed in development branch, not in stable release and removed fixed in branch labels Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug category firstaid category tools fixed in dev Fixed in development branch, not in stable release
Projects
Status: Done in dev
Development

No branches or pull requests

2 participants