josephwright / beamer

A LaTeX class for producing presentations and slides
Other
1.41k stars 142 forks source link

Please enable Beamer notes (including the "show only notes" beamer option) in article mode. #902

Open krivit opened 3 months ago

krivit commented 3 months ago

My use case is slides for mathematical lecture notes, with proofs to be done on the board. I'd like to have a cheat sheet with proof notes embedded in the LaTeX source, but the proof notes often don't fit on a single slide. I'd therefore like to be able to export them (and only them) in the article mode.

samcarter commented 3 months ago

You could use https://tex.stackexchange.com/a/51018/36296 to display notes in the article:

\documentclass{article}
\usepackage{beamerarticle}

\newif\ifshowonlynotes
\showonlynotestrue

\makeatletter
\newif\ifbeamer@inlecture\beamer@inlecturetrue
\def\beamer@currentmode{beamer}
\input{beamerbasenotes.sty}
\def\beamer@currentmode{article}

\renewcommand\beamer@outsideframenote[2][]{%
  \def\beamer@noteenvstart{}%
  \def\beamer@noteenvend{}%
  \setkeys{beamernotes}{#1}%
  \par
  \beamer@noteenvstart#2\beamer@noteenvend%
  \par
}

\setbeamertemplate{frame begin}{\beamer@framenotesbegin}
\setbeamertemplate{frame end}{\beamer@setupnote\beamer@notesactions}

\ifshowonlynotes
  \let\beamer@dosingleframe=\beamer@donoframe
  \g@addto@macro\beamer@endframe{\usebeamertemplate{frame end}}
\fi
\makeatother

\begin{document}
\begin{frame}
slide
\note{note text}
\end{frame}
\end{document}
krivit commented 3 months ago

@samcarter, thank you very much, that's exactly what I am looking for! I suppose I didn't find the right search keywords.

I think it might still be good to include this as a switch, perhaps activated by \setbeameroption{show only notes} in beamerarticle mode.