redefine frame environment

184 views
Skip to first unread message

Torwag

unread,
Jul 1, 2014, 5:08:35 AM7/1/14
to beamer...@googlegroups.com
Hi all,

in my challenge to create multiple documents out of a single set of source files, I want to redefine the frame environment to be only valid in the presentation mode. I want to generate a document, which contains the real slides via \includeslide and some more text underneath.
To achieve this, I need to tell LaTeX to not touch the frame environments under article mode. Otherwise, I end up with the actual slide as an image (from \includeslide) and the content of the slide (processed again by latex) in article mode.

The easiest solution would be to define each frame via

\begin{frame}<presentation>
\end{frame}

However, I thought since I already redefined the frame environment (which as I learned is not a real environment) to add a label why not adding the presentation mode

I tried

 
\renewcommand<>{\frame}{%
\beameroriginal{\frame}<presentation> \label{slide\arabic{slidenr}}
\stepcounter{slidenr}
}

This works ok for the counter and LaTeX runs through, however <presentation> seems to be ignored. I receive a lot of errors due to unkown commands and a typeout command within a frame appears in the logs.

\renewenvironment<>{frame}{%
\begin{originalframe}<presentation> \label{slide\arabic{slidenr}}
}
{
\end{originalframe} 
}

This does not work at all, I guess this has something to do with the special nature of the frame environment, but not sure.


I would appreciate any help here. How to redefine the frame environment to set the standard mode to e.g. presentation?


Thanks
 Torsten

Jan Bredereke

unread,
Jul 1, 2014, 5:31:04 AM7/1/14
to beamer...@googlegroups.com
Hi Torsten,

> in my challenge to create multiple documents out of a single set of source
> files, I want to redefine the frame environment to be only valid in the
> presentation mode. I want to generate a document, which contains the real
> slides via \includeslide and some more text underneath.
> To achieve this, I need to tell LaTeX to not touch the frame environments
> under article mode. Otherwise, I end up with the actual slide as an image
> (from \includeslide) and the content of the slide (processed again by
> latex) in article mode.

I am doing similar things.

> The easiest solution would be to define each frame via
>
> \begin{frame}<presentation>
> \end{frame}

This should work.

> However, I thought since I already redefined the frame environment (which
> as I learned is not a real environment) to add a label why not adding the
> presentation mode
>
> I tried
>
>
> \renewcommand<>{\frame}{%
> \beameroriginal{\frame}<presentation> \label{slide\arabic{slidenr}}
> \stepcounter{slidenr}
> }
>
> This works ok for the counter and LaTeX runs through, however
> <presentation> seems to be ignored. I receive a lot of errors due to unkown
> commands and a typeout command within a frame appears in the logs.
>
> \renewenvironment<>{frame}{%
> \begin{originalframe}<presentation> \label{slide\arabic{slidenr}}
> }
> {
> \end{originalframe}
> }
>
> This does not work at all, I guess this has something to do with the
> special nature of the frame environment, but not sure.

Yes, it is special. The reason is that the Beamer package goes into
a kind of gobbling mode when the current "mode" (presentation,
handout, article, ...) is not applicable. It ends the gobbling mode
only when a few special keywords match. Therefore, you cannot
redefine the special ending keywords, because you don't get out of
the gobbling mode anymore.

The manual explains all this, but I do not have the time to look it
up now.

> I would appreciate any help here. How to redefine the frame environment to
> set the standard mode to e.g. presentation?

The standard way of redefining the environment will definitely not
work. Probably, you would have to go into the internals very deeply
to change something. I just live with the first solution you
proposed.

Regards,
Jan

--
Prof. Dr. Jan Bredereke
University of Applied Sciences Bremen, Germany.
http://homepages.hs-bremen.de/~jbredereke GnuPG key available.
Reply all
Reply to author
Forward
0 new messages