# \verbatimInput prints unnecessary lines at the end

test.tex contains the following code

\begin{itemize}[(i)]
\item One
\item Two
\item Three
\end{itemize}


When I use this file using \verbatimInput it prints c@FancyVerbLi as the final line.

\documentclass[11pt]{beamer}
\usepackage{fancyvrb}
\begin{document}
\begin{frame}
\fvset{fontsize=\small,frame=single, numbers=left,numbersep=3pt}
\VerbatimInput{test.tex}
\end{frame}
\end{document}


How can I remove it from the output?

Edit: The output that I get is

• I don't get the additional line. Which beamer version are you using? Which engine? – user36296 May 7 '18 at 9:04
• @samcarter I have updated the post. I am using Beamer 3.50 – S.Perera May 7 '18 at 9:11
• I'm also using 3.50: i.stack.imgur.com/WjWR4.png Which engine do you use? pdflatex or something else? – user36296 May 7 '18 at 9:13
• It is pdflatex. – S.Perera May 7 '18 at 9:17
• Can you add your .log file? – user36296 May 7 '18 at 9:17

The quick fix is to leave an empty line in your input file test.tex, like so:

test.tex

\begin{itemize}[(i)]
\item One
\item Two
\item Three
\end{itemize}



main.tex

\documentclass{article}
\usepackage{fancyvrb}
\begin{document}
\fvset{fontsize=\small,frame=single, numbers=left,numbersep=3pt}
\VerbatimInput{test.tex}
\end{document}


will give, as desired:

It does seem like a bug though. I'll leave this here if anyone is able to debug: If we try

\begin{itemize}[(i)]
\item One
\item Two
\item Three
\end{itemize}
four


then the result is

and with

\begin{itemize}[(i)]
\item One
\item Two
\item Three
\end{itemize}
a very long phrase zz


so the only reason why leaving a new line works is because there's 0 characters on that line. As far as I can see anyway.