TransWikia.com

Beamer - ! File ended while scanning use of next

TeX - LaTeX Asked by glitchyme on September 30, 2021

I ran into an issue with the following code

begin{document}


    begin{frame}[fragile] % Start of frame

        begin{columns}[t]

            begin{column}{.02textwidth}end{column} % Empty spacer column

            begin{column}{.465textwidth} % The first column


                begin{block}

                    begin{minted}{c}
                        int main() {
                            return 0;
                        }
                    end{minted}

                end{block}
            end{column}

        end{columns}
    end{frame} % End of frame
end{document}

With the following error

Runaway argument?
! File ended while scanning use of next.
<inserted text> 
            par 

I’m putting my solution here because I wasted hours trying to figure out what went wrong with such a cryptic error message

2 Answers

The fix was 2-part

  • end{frame} can NOT be indented
  • end{frame} cannot have any comments directly after it

Changing this line fixed the error.

Correct answer by glitchyme on September 30, 2021

I got the same error message and the problem was a [fragile] in

begin{frame}[fragile]{Title}
 ...
end{frame}

that I use for frames that contain LaTeX Listings code. I put it there before actually using Listings in that frame.

Answered by Eric on September 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP