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

New environment with xltabular does not reach end statements #15

Open
lrkrol opened this issue May 1, 2021 · 5 comments
Open

New environment with xltabular does not reach end statements #15

lrkrol opened this issue May 1, 2021 · 5 comments

Comments

@lrkrol
Copy link

lrkrol commented May 1, 2021

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

@hvoss49
Copy link
Collaborator

hvoss49 commented May 1, 2021 via email

@lrkrol
Copy link
Author

lrkrol commented May 1, 2021

Thanks for the reply, Herbert! In your example however, the issue is not solved. If the command endxltabular in the xlt environment is replaced by asdfasdf, or anything else for that matter, the document still compiles in exactly the same way. It appears these ending statements are simply never reached, which is the problem: I want to define an environment with some additional, custom closing commands.

@lrkrol
Copy link
Author

lrkrol commented May 30, 2021

I apologise for the bump, but any ideas how to solve this issue?

@hvoss49
Copy link
Collaborator

hvoss49 commented May 31, 2021 via email

@lrkrol
Copy link
Author

lrkrol commented May 31, 2021

Thanks again for your response, Herbert -- although I didn't quite get what causes the issue. Are you saying xltabular already calls \endtabularx somewhere before reaching the new custom environment's end statements, and thefeore ignores them?

Either way, I guess I'll have to see if I can use longtable directly, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants