6

Is there any way, to get rid of the extra whitespace between the command and the curly braces when using a Verb in a tabu*?

\documentclass{article}
\usepackage{fancyvrb, tabu}
\begin{document}
\begin{tabu*}{XX}
\Verb_\vspace{}_&some Text
\end{tabu*}
\end{document}

Thanks

4

I wouldn't use verb (which is always going to have some issues when used in such places:

\documentclass{article}
\usepackage{fancyvrb, tabu}
\usepackage[T1]{fontenc}
\begin{document}
\begin{tabu*}{XX}
\texttt{\string\vspace\{\}}&some Text
\end{tabu*}
\end{document}
2

You could use verbatimbox instead of fancyvrb. In essence, the \verb is done outside of the tabu environment and placed inside a LaTeX box. Then, once inside the environment, the box is typeset, so that use of \verb is avoided inside the tabu environment even though the typeset box gives the impression that \verb in inside.

\documentclass{article}
\usepackage{tabu}
\usepackage{verbatimbox}
\begin{document}
\begin{verbbox}\vspace{}\end{verbbox}
\begin{tabu*}{XX}
\theverbbox&some Text
\end{tabu*}
\end{document}
  • Thanks for this answer. But David Carlisle ones suits better for me because I allready use fancyvrb and minted packages for verb. If not neccesary I dont want to use a third one. Nonetheless I'll keep verbatimbox in mind. – Rafael Wörner Sep 13 '13 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.