beamer icon indicating copy to clipboard operation
beamer copied to clipboard

Custom modes

Open dbitouze opened this issue 5 years ago • 4 comments

It would be nice to be able to extend the current available modes to customized ones, just as asked in this question.

dbitouze avatar Dec 16 '19 14:12 dbitouze

Adding custom modes is not the problem:

\documentclass{beamer}

\makeatletter
\gdef\beamer@currentmode{foo} % comment/uncomment this line 
\makeatother

\begin{document}
	
\begin{frame}
	abc
	\only<foo>{test}
\end{frame}	
	
\end{document}

Just trying to add them as documentclass options is tricky...

samcarter avatar Dec 16 '19 15:12 samcarter

For the use-case decribed in the question, about creating two different versions of the same mode, I would suggest the beameraudience package:

\documentclass[handout]{beamer}

\usepackage[
	audience=exthandout	
]{beameraudience}

\begin{document}
	
\begin{frame}
	abc
	\only<handout>{all \showcontentfor{exthandout}{ext}}
\end{frame}	

\end{document}

samcarter avatar Dec 16 '19 15:12 samcarter

@samcarter:

  • I would love to be able to declare the foo mode at \documentclass's level! :)

  • I wasn't aware of the beameraudience package: thanks! Would be nice if its features could be added to beamer.

dbitouze avatar Dec 16 '19 15:12 dbitouze

This feature seems easy to be added---just add the following to beamer.cls:

\DeclareOptionBeamer{custommode}{%
  \def\beamer@custommode{#1}%
  \def\beamer@articlemode{article}%
  \def\beamer@secondmode{second}%
  \ifx\beamer@custommode\@empty\else%
    \ifx\beamer@custommode\beamer@articlemode\else%
      \ifx\beamer@custommode\beamer@secondmode\else%
        \xdef\beamer@currentmode{\beamer@custommode}%
      \fi%
    \fi%
  \fi%
}

All the custom modes are treated as presentation. This option is also valid for predefined modes like handout and trans.

louisstuart96 avatar Dec 18 '19 05:12 louisstuart96