# [Tex/LaTex] Drawbacks of using fragile frames in beamer

beamer

This is a follow up on beamer's fragile frame as default. What are the drawbacks of setting the default frame to be fragile (or passing the optional fragile argument to all frames). The beamer user guide says

If a frame contains fragile text, different internal mechanisms are
used to typeset the frame to ensure that inside the frame the
character codes can be reset. The price of switching to another
internal mechanism is that either you cannot use overlays or an
external file needs to be written and read back (which is not always
desirable).

Presumably writing and reading a file takes time and so this increases the time it takes to compile, but are there things that do not work in a fragile frame?

As for an MWE:

\documentclass{beamer}
\def\foo{Something that makes the fragile frame fail is: }
\begin{document}
\begin{frame}
\foo
\end{frame}
\begin{frame}[fragile]
\foo
\end{frame}
\end{document}


I am trying to understand what \foo would need to be defined as to cause problems.

there are no important drawbacks. It is also possible to define a new environment with the fragile option:

\documentclass{beamer}

\newenvironment{Foo}[1]
{\begin{frame}[environment=Foo]{#1}}
{\end{frame}}

\newenvironment{FooBar}[1]
{\begin{frame}[fragile,environment=FooBar]{#1}}
{\end{frame}}
\begin{document}

\begin{Foo}{title}
\end{Foo}

\begin{FooBar}{title}
\end{FooBar}

\end{document}


With fragile every contents is written into an external file and read back. Not a big deal but makes compiling slow. However, fragile is needed for verbatim material.