You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\documentclass{article}
\usepackage{tabularray}
\usepackage{fancyvrb}
\begin{document}
\begin{tblr}{verb}
\verb|a|\\\verb|%|\\% This line doesn't work and will cause an error\verb|\%| % This line works\end{tblr}\par\begin{tblr}{columns = {appto={|}, preto={\Verb|}}}
a \\% \\ % This line is considered commented\%% This line outputs %, not \%\end{tblr}\par\verb|%|
\end{document}
The error which \verb|%| gives is
! LaTeX Error: \verb ended by end of line.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.6 \end
{tblr}
? x
The text was updated successfully, but these errors were encountered:
The % and characters after it are removed by TeX before tabularray or tabularx sees them. You need to change the catcode of % character to make TeX treat it as a normal character.
\documentclass{article}
\usepackage{tabularray}
\usepackage{tabularx}
\usepackage{fancyvrb}
\begin{document}
For \texttt{tabularray}:
\begingroup\catcode`\%=12\begin{tblr}{verb}
\verb|a| \\\verb|%| \\\verb|\%|
\end{tblr}
\quad\begin{tblr}{verb,columns={preto={\Verb|},appto={|}}}
a \\% \\\%\end{tblr}
\endgroup
For \texttt{tabularx}:
\begingroup\catcode`\%=12\begin{tabularx}{\linewidth}{X}
\verb|a|\\
\verb|%|\\
\verb|\%|
\end{tabularx}
\endgroup\end{document}
Here is my mwe:
The error which
\verb|%|
gives isThe text was updated successfully, but these errors were encountered: