[luatex] How to redefine command with optional argument using expl3?

Alexander Kozlovskiy k.sasha1994 at yandex.ru
Thu Nov 5 05:00:00 CET 2020

Hello everybody. I want to redefine \table/tabular environments,to do 
autotagging of this environments. I know,what \tabular have one 
mandatory argument,and one optional,and optional argument use in 
\maketitle command. Please,help me redefine \tabular command,to fix 
error,which happens during compilation in latex.

! LaTeX Error: Illegal character in array arg.

I know,what this error happens because according to debug,first 
argument,which optional, [t] separate to three arguments: [ t and ],but 
i dont know,how to solve this issue. Also i know,what for different 
packages optional argument can be different,but how it handle using 
expl3,i haven't any idea. Thanks everybody very much for any 
help,because i dont know,how to solve this.



\prop_map_inline:Nn \g__tables_prop{
{0} %somethin with \begin,e.g \begin{tabular}
\cs_new_protected:Npn \l__tab_char: {
\char_set_active_eq:NN \& \l__tab_char:
\char_set_catcode_active:N \&
{1} %somethin with \end,e.g \end{tabular}
\author{Alexandr Kozlovskiy}
\maketitle{} %error
%this code works ok.

More information about the luatex mailing list.