Skip to content

New environment with xltabular does not reach end statements #15

@lrkrol

Description

@lrkrol

I have come across an issue that, as far as I could see, appears to be related to xltabular. When I begin an xltabular environment within a newly defined custom environment, this custom environment does not reach its end statements. Below is an MWE.

\documentclass{article}

    \usepackage{xltabular}
    
    \newenvironment{tx}[0]%
        {%
            \tabularx{\textwidth}{XXX}%
        }{%
            final row & final row & final row \\%
            \endtabularx%
            \asdf%
        }
    
    \newenvironment{xlt}[0]%
        {%
            \xltabular{\textwidth}{XXX}%
        }{%
            final row & final row & final row \\%
            \endxltabular%
            \asdf%
        }
    
\begin{document}

    \begin{tx}
        tabularx & 2 & 3 \\
    \end{tx}
    
    \begin{xlt}
        xltabular & 2 & 3 \\
    \end{xlt}

\end{document}

In the MWE, two custom environments are defined, tx and xlt. These environments either use tabularx or xltabular to open a tabular environment; they are otherwise identical. When ending the custom environments, they add one final row, close the tabular environment, and execute a nonexistent asdf command.

Compiling this (in my case, with pdfLaTeX in TeX Live 2020; output attached), no final row is added in the environment using xltabular. Also, an error is generated for the undefined control sequence at the end of the tx environment, but not for the same command at the end of the xlt environment. It simply appears to never reach this point.

Can I use xltabular within a custom environment, and have that custom environment execute the specified commands at its end?

xltabular_mwe.log
xltabular_mwe.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions