On Fri, Jan 26 2024, Leo Butler wrote: > On Fri, Jan 26 2024, Ihor Radchenko wrote: > >> Leo Butler writes: >> >>>> Apparently, LaTeX has really hard time processing verbatim code inside >>>> beamer frames. >>> >>> I looked again at the solution here: >>> https://tex.stackexchange.com/questions/140719/verbatim-in-beamer-showing-error-file-ended-while-scanning-use-of-xverbatim >>> >>> and it errors out with a recent version of pdflatex: >>> >>> This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) (preloaded format=pdflatex) >>> >>> This is, apparently, a known problem: >>> >>> https://github.com/josephwright/beamer/issues/360 >>> >>> The end of that issue report includes a work-around that we might apply >>> in org. I have attached a patch for your feedback. The example that >>> stimulated this discussion compiles with the patch and the testsuite >>> shows no errors related to it. >> >> Thanks! >> I have concerns about your approach though. >> >> You are replacing all the frame environments with custom environment >> unconditionally. However, custom environment has downsides. For example, >> \againframe will stop working, as pointed earlier in the linked beamer >> thread >> https://github.com/josephwright/beamer/issues/360#issuecomment-708705250 > > The comment that you are citing shows how to define the custom > environment so that \againframe works correctly. See the attachment > `beamer-example-againframe.tex' and pdf. You can see that \againframe > works with the custom environment. > >> >> Since the problem appears only when the frame contents contains >> \end{frame}, it may be sufficient to replace the standard frame >> environment with the workaround only in such scenario. > > Yes, that might be true. But my feeling is that it would be simpler and > more robust to use the custom frame environment in most cases. Replying to self: Attached is a patch that adds a property, BEAMER_FRAME, that lets the frame environment name be set on a frame-by-frame basis. In addition, it typesets any fragile frame in the `orgframe' environment. I am not sure if the latter is really needed, given the former. Comments? Leo