Macro \verb inside tabu environment

With the starrred version of the tabu environment (from the tabu package), the document compiles without warnings or errors.

\documentclass{article}

\usepackage{tabu}

\begin{document}

\begin{tabu*}{lll}
a & \verb|\wedge| & b\\
c & d             & e
\end{tabu*}

\end{document}

output

See the top of page 7 of the documentation.


The verbatimbox package puts verbatim in a box so that it can be used in, for example, tables later on. [EDITED to show multiple instances of verbatim text in table.]

RE-EDITED 31-JUL-13 to show space-saving use of myverbbox environment. I leave the blank optional arguments there only to show that myverbbox can take optional arguments.

\documentclass{article}
\usepackage{verbatimbox}
\usepackage{tabu}
\begin{document}
\begin{myverbbox}[]{\wedgebox}
\wedge
\end{myverbbox}
\begin{myverbbox}[]{\simbox}
\sim
\end{myverbbox}
\begin{tabu}{lll}
a & \wedgebox & b\\
c & \simbox & e\\
\end{tabu}
\end{document}

enter image description here

Tags:

Verbatim

Tabu