I'd like to have a shorthand to trigger a table like tabularx, with multipage option like longtable. Neither \newenvironment nor \newcommand I can coax to work
The weird @.. construction at the beginning of the setup of xltabular is for discarding the indentation that is otherwise added. Everything before the actual document takes place in a class file, if that makes a difference. Interpreter needs to be XeLaTex. There does not seem to be a command-version of begin/end xltabular, which is how the problem with environment is solved in tabularx-cases.
M(n)WE:
\documentclass[10pt]{article} \usepackage{xltabular} % mixture of tabularx and longtable %% Either like this (1) %\newenvironment{threetable} %{\begin{xltabular}{\linewidth}{@{} X @{\hspace{20pt}} X @{\hspace{20pt}} X @{}}} {\end{xltabular}} %% Or like this (2) %\newcommand{\startthreetable}{\begin{xltabular}{\linewidth}{@{} X @{\hspace{20pt}} X @{\hspace{20pt}} X @{}}} %\newcommand{\stopthreetable}{\end{xltabular}} \begin{document} \begin{xltabular}{\linewidth}{@{} X @{\hspace{20pt}} X @{\hspace{20pt}} X @{}} Content & content & CONTENT \end{xltabular} %% (1) %\begin{threetable} %Content & content & CONTENT %\end{threetable} %% (2) %\startthreetable %Content & content & CONTENT %\stopthreetable \end{document}
@{..}that is unrelated to xltabular it is basic latex syntax to specify intercolumn material and applies totabularin the core format and has been in latex since the start.