5

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

enter image description here

  • 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
6

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:

enter image description here


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

enter image description here

and with

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

enter image description here

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.

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.