2

Finally MiKTeX provide version 2022A! So, I make some tests if in this new version (2022A) can be used \verb command in caption, note and remark. Unfortunately, as at old version, not (as least as I try):

\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\SetTblrStyle{note}{font=\footnotesize, 
                         verbr}  % <--- doesn't help ...

\begin{document}
    \begin{table}[!htb]
    \centering
\begin{talltblr}[
%caption = {Caption of table where verb doesn't \verb+works+.},
  label = {tab: test},
note{1} = {A footnote with verbatim doesn't \verb+work+.},
                ]{colspec={ll},
                  verb} % work in table body
    \toprule
column 1    & column 2  \\
    \midrule
row1        & value 11\TblrNote{1} . Here verbatim \verb+works+   \\
    \bottomrule
    \end{talltblr}
\end{table}
\end{document}

which gives (expected) error:

! Missing } inserted.
<inserted text> 
                }
l.21     \end
             {talltblr}
? x

Forcing compilation gives the following result:

enter image description here

So I wonder, is there a way to use verb as as aforementioned? For example as this problem is solved by use of the cprotect package in caption outsize talltblr or longtblr environments or use verb in their table bodies?

2
  • just don't use verb in the argument of another command, it's sometimes possible for individual commands to make some approximation work but that way lies madness. use \texttt{word} Commented Mar 8, 2022 at 12:10
  • 2
    @Zarko I will try to add outer specification verb to the package later. Then you will be able to use \verb command in the header and footer of the table.
    – L.J.R.
    Commented Mar 9, 2022 at 0:45

1 Answer 1

1

According to the tabularray documentation v2023A, the verb option is deprecated and the recommended way to include verbatim content is with the \fakeverb command of the codehigh package. The \ (excluding commands), {, }, #, ^, (space), and % characters must be escaped with a backslash.

\documentclass{article}
\usepackage{tabularray}
\usepackage{codehigh}
\UseTblrLibrary{booktabs}
\SetTblrStyle{note}{font=\footnotesize}

\begin{document}
    \begin{table}[!htb]
    \centering
\begin{talltblr}[
%caption = {Caption of table where verb doesn't \verb+works+.},
  label = {tab: test},
note{1} = {A footnote with (fake) verbatim does \fakeverb{work\%$^_&\cmd}.},
                ]{colspec={ll},
                  verb} % work in table body
    \toprule
column 1    & column 2  \\
    \midrule
row1        & value 11\TblrNote{1} . Here verbatim \verb+works+   \\
    \bottomrule
    \end{talltblr}
\end{table}
\end{document}

table

1
  • Thank you very much for answer (+1). I need a some time to read codehigh package documentation, and mentioned section in the tabularray package.
    – Zarko
    Commented Dec 4, 2023 at 7:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .