Fragile frames #18
Replies: 6 comments 33 replies
-
I think the most common use case for fragile aren't frames with verbatim, but to avoid various problems with the current handling of frame content and tikz pictures. If the speed is the only disadvantage of fragile frames, I think switching it on globally would work. If it causes other limitations, like in beamer, being able to select it on a per frame basis would be more flexible. Throwing another idea in: How about a dedicated environment for fragile frames instead of a frame option? This would also avoid problems of having |
Beta Was this translation helpful? Give feedback.
-
Could you allow both? That is, either set it globally or for a particular frame? If it is global, pass it to every frame? |
Beta Was this translation helpful? Give feedback.
-
I now have a prototype that I think would work for 'all frames can contain verbatim': \DocumentMetadata{tagging = on}
\documentclass{xbeamer}
\usepackage{fancyvrb}
\EditInstance{hidden}{std}{opacity = 0.15}
\ExplSyntaxOn
\RenewDocumentEnvironment { frame } { D <> { all } O { } c }
{
\keys_set:nn { xbeamer / frame } {#2}
\__xbeamer_mode:nT {#1}
{ \__xbeamer_frame_process:n {#3} }
}
{ }
\group_begin:
\char_set_catcode_other:n { `\^^M }%
\cs_gset_protected:Npn \__xbeamer_slide_setup:Nn #1#2%
{%
\group_begin:%
\cs_set:Npn \obeyedline { ^^M }%
\tl_set:Ne #1 {#2}%
\exp_args:NNNV \group_end:%
\tl_set:Nn #1 #1%
}%
\group_end:%
\cs_gset_protected:Npn \__xbeamer_slide:n #1
{
\group_begin:
\int_gzero:N \g__xbeamer_slide_int
\RenewCommandCopy \frame \__xbeamer_latexe_frame:n
\bool_do_while:Nn \g__xbeamer_slide_continue_bool
{
\__xbeamer_slide_begin:
\__xbeamer_slide_setup:Nn \l__xbeamer_tmp_tl {#1}
\int_set:Nn \tex_newlinechar:D { 13 }
\tex_scantokens:D \exp_after:wN { \l__xbeamer_tmp_tl }
\__xbeamer_slide_end:
}
\group_end:
}
\ExplSyntaxOff
\begin{document}
\begin{frame}<all>
\frametitle{Foo}
\emph{foo}
\begin{block}<2-|alert@2>
\begin{Verbatim}[gobble = 6]
Some content
%$_\
XXX
\end{Verbatim}
\end{block}
\uncover<3->{More text}
\end{frame}
\end{document} At present, there is an issue if you don't have one of the optional arguments to the If this approach looks viable, I'd like to trial it as part of the development work: probably at the moment with a global switch which I can set as opt out (so we get testing). If that then looks good, a bit of Thoughts? |
Beta Was this translation helpful? Give feedback.
-
What if we drop the notion of a |
Beta Was this translation helpful? Give feedback.
-
As I've noted somewhere, using an 'all fragile' approach raises the issue that it doesn't work in say command hooks, so makes the equivalent of \AtBeginSection{
\begin{frame}
\tableofcontents[currentsection]
\end{frame}
} problematic. I wonder though as you couldn't have verb-like content here anyway whether one might flip things around, somewhat based on @skillmon's suggestion in another thread. We could have standard frames 'fragile-safe' and have an alternative 'for use in arguments' environment, say \AddToHook{section/begin}{
\begin{frame*}
\tableofcontents[currentsection]
\end{frame*}
} Or of course if we want to stick to opt-in for verbatim material, we could use |
Beta Was this translation helpful? Give feedback.
-
I've gone with an approach based on |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I wonder if rather than have individual frames as fragile, this should be a global setting. Most presentations don't need verbatim at all, so would stay 'fast', but for those people who do need verbatim content, it would be a one-shot - so easier setup for the frame environment, etc. (A one-shot branching in the preamble.)
Beta Was this translation helpful? Give feedback.
All reactions