I need to put Verbatim text in tabular cell, which works fine, except when I want to extend the cell to all the columns, then I get an error
File ended while scanning use of \FancyVerbGetLine.
Here is MWE which works, then will show the one that gives the error
\documentclass{article}
\usepackage{fancyvrb}
\begin{document}
\begin{tabular}{|p{2in}|p{2in}|} \hline
text & text \\\hline
%
\begin{Verbatim}
verbatim text here
\end{Verbatim}
&
\\\hline
%
text & text \\\hline
\end{tabular}
\end{document}
But the actual cell I have is long and has Verbatim in it and I needed to extend it over all columns.
\documentclass{article}
\usepackage{fancyvrb}
\begin{document}
\begin{tabular}{|p{2in}|p{2in}|} \hline
text & text \\\hline
%
\multicolumn{2}{|p{4in}|}
{
\begin{Verbatim}
verbatim text here
\end{Verbatim}
}
\\\hline
%
text & text \\\hline
\end{tabular}
\end{document}
Now
pdflatex foo.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014)
restricted \write18 enabled.
entering extended mode
(./foo.tex
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2014/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix
<2008/02/07> (tvz)
(/usr/local/texlive/2014/texmf-dist/tex/latex/graphics/keyval.sty)) (./foo.aux)
! FancyVerb Error:
Extraneous input `long text here \end {Verbatim} \@endpbox \hskip \tabcolsep
\hskip -.5\arrayrulewidth \vrule width\arrayrulewidth \hskip -.5\arrayrulewidth
\hbox {}\endgroup \ignorespaces ' between \begin{Verbatim}[<key=value>] and li
ne end
.
\FV@Error ... {FancyVerb Error:
\space \space #1
}
l.13 }
This sounds like another one of those environment not allowed inside another environment type issues, which I need help resolving since I do not know how to fix this.