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

fix for #1468 #1473

Merged
merged 3 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions base/doc/ltnews40.tex
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,18 @@ \subsection{\pkg{longtable}: Extend caption type}
{\endlongtable}
\end{verbatim}


\subsection{\pkg{array}: Improve \texttt{>\{...\}} specifier}

If the argument of \texttt{>\{...\}} ended with a command accepting a
trailing optional argument, e.g., defined for example with
\verb=\NewDocumentCommand\foo{o}{...}=, one could get low-level
parsing errors. This has now been corrected.
%
\githubissue{1468}



%\section{Changes to files in the \pkg{cyrillic} category}

\begin{thebibliography}{9}\frenchspacing
Expand Down
13 changes: 10 additions & 3 deletions required/tools/array.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
% \begin{macrocode}
%<+package>\NeedsTeXFormat{LaTeX2e}[2024/06/01]
%<+package>\ProvidesPackage{array}
%<+package> [2024/07/13 v2.6e Tabular extension package (FMi)]
%<+package> [2024/09/17 v2.6f Tabular extension package (FMi)]
%
% \fi
%
Expand Down Expand Up @@ -1387,8 +1387,12 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% \end{macrocode}
% Here, we assume that the \textsf{count} register
% =\@tempcnta= has saved the value $=\count@= - 1$.
%
% We end with \cs{relax} to stop any parsing for optional
% arguments out of \verb=>{...}= at this point.
% \changes{v2.6f}{2024/09/13}{Stop parsing for optional argument (gh/1468)}
% \begin{macrocode}
\the@toks \the \@tempcnta
\the@toks \the \@tempcnta \relax
% \end{macrocode}
% Next follows the =#= sign which specifies the place
% where the text of the column shall be inserted. To avoid
Expand Down Expand Up @@ -1442,7 +1446,10 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% \begin{macrocode}
\def\insert@pcolumn{%
\UseTaggingSocket{tbl/pcell/begin}%
\the@toks \the \@tempcnta
% \end{macrocode}
% \changes{v2.6f}{2024/09/13}{Stop parsing for optional argument (gh/1468)}
% \begin{macrocode}
\the@toks \the \@tempcnta \relax
\ignorespaces \@sharp \unskip
\the@toks \the \count@ \relax
\UseTaggingSocket{tbl/pcell/end}%
Expand Down
6 changes: 6 additions & 0 deletions required/tools/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
=======================================================================

2024-09-18 Frank Mittelbach <[email protected]>

* array.dtx (section{The insertion of declarations ...}):
Stop parsing too far for an optional argument if >{...} ends in a command
with a trailing optional arg (gh/1468)

2024-09-17 Ulrike Fischer <[email protected]>
* multicol.dtx: add tagging support (tagging/705)

Expand Down
28 changes: 28 additions & 0 deletions required/tools/testfiles/github-1468.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
% https://github.com/latex3/latex2e/issues/1468

\documentclass{article}
\usepackage{array}

\input{test2e}


\begin{document}

$x$ % init fonts

\START

\newcommand\foo[1][]{x}

\begin{tabular}{>{\foo}l<{\foo}>{\foo}p{2cm}<{\foo}}
Foo & Bar \\
\end{tabular}

\RenewDocumentCommand\foo{o}{x}

\begin{tabular}{>{\foo}l<{\foo}>{\foo}p{2cm}<{\foo}}
Foo & Bar \\
\end{tabular}

\end{document}

4 changes: 4 additions & 0 deletions required/tools/testfiles/github-1468.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
[1
] (github-1468.aux)