4

Are mode/overlay specifications unsupported by Beamer when used with the starred versions of sectioning commands? I ask, because I have code which (I am pretty, though not completely, sure) did work and now doesn't, but I'm not sure if it just happened to work, though unsupported.

Consider the following MWE:

\documentclass{article}
\usepackage{beamerarticle}
\title{Title}
\author{Author}
\date{Now}
\begin{document}
\begin{frame}
  \titlepage
\end{frame}
\section<1-| beamer:0>{A numbered section in the article}
Something or other
\section*<1-| beamer:0>{An unnumbered section in the article}
Other or something
\end{document}

article output

Obviously, this 'doesn't work' in the sense that my intention was to typeset an unnumbered section heading only in article mode. It was not to typeset the mode/overlay specification literally or to typeset an unformatted heading.

Or, changing the start of the preamble to

\documentclass{beamer}
\mode<article>
{
  \usepackage{beamerarticle}
}

slide output

Likewise, my intention was that the mode/overlay specification would prevent any output in beamer mode and I certainly did not expect a slide containing an attempt to typeset that specification literally.

Note that it is not difficult to work around this issue. For example,

\mode<article>
{%
  \section*{An unnumbered section in the article}
}

works fine. However, it would obviously be more convenient to use an mode/overlay specification with the sectioning macro directly. Is doing so supposed to be supported? Or is this just an inherent limitation of Beamer and either I'm misremembering or it worked purely by happenstance before?

  • 1
    It seems the documentation says explicitly \section<⟨mode speci cation⟩>*{⟨section name⟩} (page 94). I feel like this is the consequence of something being defined by \newcommand<>. – Symbol 1 Mar 4 '18 at 1:35
  • @Symbol1 Thanks. I wonder if this is why I thought it worked. For some reason, I did not think to try that this time - I was just sure * worked before. Although I thought I started from existing code, too. Hmm. – cfr Mar 4 '18 at 4:50
  • 1
    It would be nice if you know where to find ancient beamer code. The existing Github repository suggests that \section was defined by \newcommand<> since the very beginning. But I feel like this is not always how it defines things. For example \alt supports pre- and post-overlay specification. And \tikz@command@path allows you to writhe both \path<>[] and \path[]<>. – Symbol 1 Mar 4 '18 at 5:01
3

Seems that the addition of the extra <> options in section command had become with \@ifnextchar or similar way, before the old section start to read its real options, and the star has to follow this option:

\documentclass{article}
\usepackage{beamerarticle}
\title{Title}
\author{Author}
\date{Now}
\begin{document}
\begin{frame}
  \titlepage
\end{frame}
\section<1-| beamer:0>{A numbered section in the article}
Something or other
%Star after <>
\section<1-| beamer:0>*{An unnumbered section in the article}
Other or something
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.