I've used the following macros for this purpose:
\newcommand{\backupbegin}{
\newcounter{framenumberappendix}
\setcounter{framenumberappendix}{\value{framenumber}}
}
\newcommand{\backupend}{
\addtocounter{framenumberappendix}{-\value{framenumber}}
\addtocounter{framenumber}{\value{framenumberappendix}}
}
The bonus slides are then put between the two commands:
\appendix
\backupbegin
\frame{\frametitle{One more thing}}
\backupend
This will get you the desired numbering, too.
In my opinion, the cleanest approach here is to make \AtBeginSection
work in a beamerarticle
. The reason why it doesn't is that the \AtBeginSection
macro works by defining hooks to be executed at the beginning of theses sections. In article mode, however, the \section
macro as defined by the document class is used, so these hooks are never executed.
To overcome this, a redefinition of the \section
macro is necessary. This is a bit complicated because it calls \@startsection
internally, so simply adding the hook to the end of the macro won't work. Instead, a complete "wrapper" around the original command is necessary:
\mode<article>
\usepackage{xparse}
\makeatletter
\expandafter\let\expandafter\originalsection\expandafter=\csname @orig\string\section\endcsname
\RenewDocumentCommand{\section}{ D<>{} s o m }
{
\alt<#1>
{
\IfBooleanTF {#2}
{
\originalsection*{#4}
%\beamer@atbeginsections % breaks because section* is also used e.g. in the TOC
}
{
\IfNoValueTF {#3} { \originalsection{#4} } { \originalsection[#3]{#4} }
\beamer@atbeginsection
}
}
{
\beamer@secgobble
}
}
\makeatother
\mode<all>
Insert this code into the preamble of your document, after having loaded beamerarticle
. What it does is to save the original, beamer
-free meaning of the \section
macro stored in the macro with the "weird" name @orig\section
to \originalsection
. Afterwards, \section
is redefined to execute the original sectioning command and the hook \beamer@atbeginsection
afterwards. As \section
has a starred and non-starred version, an optional argument and an (optional) overlay specification, I used xparse
which allows you to define such macros in a very convenient way.
Now you can use \AtBeginSection
as usual to insert the section start frames. As you probably don't want them to actually show up in article mode, you should use \begin{frame}<article:0>
for these (the frame number is still incremented). Additionally, you need to \def\insertsection{}
because this command is unknown to beamerarticle
and would result in an error otherwise.
Note that using the optional argument of \AtBeginSection
to define a hook for starred sections won't work (the line executing it is commented out in the above code). The reason is that \section*
is also used for the table of contents etc., where such inserts would result in an error message.
Output of your MWE using the above code
In presentation mode (click on the image to see it full-size):
In article mode:
For completeness, the full source that produced the above results can be found on pastebin.com.
Edit: The xparse
package I used to redefine \section
relies on the experimental LaTeX3 kernel. If it is not available, you can use this plain LaTeX2e solution instead:
\mode<article>
\makeatletter
\expandafter\let\expandafter\originalsection\expandafter=\csname @orig\string\section\endcsname
\def\sectionwithhook{\@ifstar\@sectionwithhook\@@sectionwithhook}
\newcommand{\@sectionwithhook}[1]{\originalsection*{#1}}
\newcommand{\@@sectionwithhook}[2][]{\beamer@ifempty{#1}{\originalsection{#2}}{\originalsection[#1]{#2}}\beamer@atbeginsection}
\renewcommand<>{\section}{\alt#1{\sectionwithhook}{\beamer@secgobble}}
\makeatother
\mode<all>
This replaces the whole code given above, achieving the same as the \RenewDocumentCommand
with some helper macros.
Best Answer
The
textpos
package lets you put your text at any position you specify on the page. Inbeamer
class, the package must be loaded with theoverlay
option, this is not the case in other document classes. I also turned on theshowboxes
option just to compare with the perfect center calculated bytikz
. In your final document, you can remove theshowboxes
option, or, add the\textblockrulecolor{white}
command to hide the boxes. The latter command in my experience resulted in a more accurate positioning. But I have no idea why this was the case.