There are two problems here.
- The first one is that
beamercolorbox
apparently doesn't like to
have spacing instructions passed ad options. Those should be placed
before the \begin
.
- The second one is in the definition of
\tikzmarkaligned
. I will address it out of this bullet list.
Let us recollect part of the preamble:
\newcommand{\mth}[2]{
\setnotewidth{#2}
\mathmakebox[0.100\notewidth]{#1}
}
\NewDocumentCommand{\tikzmarkaligned}{r<> o m m}{
\phantom{\mth{#3}{#4}}
\tikzmarkin<#1>[#2]{#3}#3\tikzmarkend{#3}
\phantom{\mth{#3}{#4}}
}
Now I don't know exactly what the \tikzmarkin
and \tikzmarkend
macros do. According to the hf-tikz
documentation, they insert the delimiters for the colored region. However, they seem not to like greek letters inside them. So feeding #3
into both is looking for trouble, since #3
is what is supposed to be colored. The best thing, seen as it is #4
that is used to set the width for the coloring while #3
is typeset, would be to feed #4
to those two macros and then fill it with a random foobarbaz
type string that causes no trouble and has roughly the correct width, i.e. the same width as #3
.
So the code can be amended to:
\documentclass{beamer}
\usefonttheme{professionalfonts}
\usefonttheme{serif}
\usefonttheme{structuresmallcapsserif}
\usepackage{amsmath, amssymb}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[beamer,markings]{hf-tikz}
\usepackage{mathtools,xparse} % texted arrows
\NewDocumentCommand{\annotate}{r<>O{}m}{
\onslide#1{
\tikz[remember picture,overlay]\node[#2,use marker id] at (0,0){#3};
}
}
\newlength{\notewidth}
\newcommand{\setnotewidth}[1]{%
\settowidth{\notewidth}{$#1$}%
}
\newcommand{\mth}[2]{
\setnotewidth{#2}
\mathmakebox[0.100\notewidth]{#1}
}
\NewDocumentCommand{\tikzmarkaligned}{r<> o m m}{
\phantom{\mth{#3}{#4}}
\tikzmarkin<#1>[#2]{#4}#3\tikzmarkend{#4}
\phantom{\mth{#3}{#4}}
}
\def\savepointas#1#2{%
\expandafter\gdef\csname save@pt@#1\endcsname{#2}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\indentdisplays[1]{%
\everydisplay{\addtolength\displayindent{#1}%
\addtolength\displaywidth{-#1}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{footline}[frame number]
\setbeamertemplate{navigation symbols}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{frame}
\transwipe
\begin{itemize}
\item<1->[]{ \indentdisplays{-3em} \begin{equation} \mathbf{pb_{i,\,t}} = \underbrace{\gamma_{i}~\{~+\delta_{t}\}}_{\textrm{fixed effects}} + \alpha \cdot pb_{i,\,t-1} +
\tikzmarkaligned<1->[mark at=0.825]{\beta_{0 (t)}}{foobarbaz}
\annotate<1->[below,black,font=\scriptsize]{$\beta_{0\,(t)} \gg 0$}~\cdot~d_{i,\,t-1} \mathbf{\vartheta_{i,\,t}}, \end{equation} }
\begin{itemize}
\item<1->{$ pb_{i,\,t} = \tau_{i,\,t} - g_{i,\,t} - ir_{i,\,t}$}
\item<2->{}
\item<2->[]{ \setbeamercolor{postit}{fg=black,bg=gray!10} \vskip -1.35em \hskip 0.0em \begin{beamercolorbox}[wd=\linewidth,rounded=true,shadow=true]{postit} {\textbf{\emph{Sufficient}} but not necessary condition} \end{beamercolorbox}}
\end{itemize}
\end{itemize}
\end{frame}
\end{document}
This compiles fine, and gives:

Unfortunately I am no longer sure this is what was desired, since the comment I posted had a wrong url giving this image instead, which comes from Claudio Fiandrino's answer here, as the code in the OP's MWE.
Note that to adjust the box it is necessary to compile twice.
In a comment above, I stated I had gotten a:
Package pgf error: no marker shape "marker unit vector-1" is known
error. I have no idea where that came from or how to solve it. All I noticed was that eliminating marker id
from the definition of \annotate
the error vanished.
Update
I saw that something was wrong with the equation. I realized there was an extra 1-
. Having changed the definition of \annotate
from OP's code to:
\NewDocumentCommand{\annotate}{r<>O{}m}{
\onslide#1{
\tikz[remember picture,overlay]\node[#2,use marker id] at (0,0){#3}
}
}
produced \onslide1-
, which caused \onslide
to do nothing, and the 1-
to be typeset. My bad. Reverting to:
\newcommand<>{\annotate}[2][]{
\onslide#3{
\tikz[remember picture,overlay]\node[#1,use marker id] at (0,0){#2};
}
}
fixes this. I don't know why though. I have never seen \newcommand<>
. Apparently, this is a trick to define a command taking an argument wrapped in <>
as #3
and then parsing what follows as a normal \newcommand
would. So \annotate<1->[…]{……}
has 1-
as #3
, …
as #1
and ……
as #2
.
Update on \savepointas
As I said in comments, I think it is plain useless, as it is never invoked in the code. Perhaps it is invoked by some package command used in one of the defined commands. Anyways I tried compiling with and without it. Here is the code:
\documentclass{beamer}
\usefonttheme{professionalfonts}
\usefonttheme{serif}
\usefonttheme{structuresmallcapsserif}
\usepackage{amsmath, amssymb}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[beamer,markings]{hf-tikz}
\usepackage{mathtools,xparse} % texted arrows
\newcommand<>{\annotate}[2][]{
\onslide#3{
\tikz[remember picture,overlay]\node[#1,use marker id] at (0,0){#2};
}
}
\newlength{\notewidth}
\newcommand{\setnotewidth}[1]{%
\settowidth{\notewidth}{$#1$}%
}
\newcommand{\mth}[2]{
\setnotewidth{#2}
\mathmakebox[0.100\notewidth]{#1}
}
\NewDocumentCommand{\tikzmarkaligned}{r<> o m m}{
\phantom{\mth{#3}{#4}}
\tikzmarkin<#1>[#2]{#4}#3\tikzmarkend{#4}
\phantom{\mth{#3}{#4}}
}
\def\savepointas#1#2{%
\expandafter\gdef\csname save@pt@#1\endcsname{#2}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\indentdisplays[1]{%
\everydisplay{\addtolength\displayindent{#1}%
\addtolength\displaywidth{-#1}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{footline}[frame number]
\setbeamertemplate{navigation symbols}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{frame}
\transwipe
\begin{itemize}
\item<1->[]{ \indentdisplays{-3em} \begin{equation} \mathbf{pb_{i,\,t}} = \underbrace{\gamma_{i}~\{~+\delta_{t}\}}_{\textrm{fixed effects}} + \alpha \cdot pb_{i,\,t-1} +
\tikzmarkaligned<1->[mark at=0.825]{\beta_{0 (t)}}{foobarbaz}
\annotate<1->[below,black,font=\scriptsize]{$\beta_{0\,(t)} \gg 0$}~\cdot~d_{i,\,t-1} \mathbf{\vartheta_{i,\,t}}, \end{equation} }
\begin{itemize}
\item<1->{$ pb_{i,\,t} = \tau_{i,\,t} - g_{i,\,t} - ir_{i,\,t}$}
\item<2->{}
\item<2->[]{ \setbeamercolor{postit}{fg=black,bg=gray!10} \vskip -1.35em \hskip 0.0em \begin{beamercolorbox}[wd=\linewidth,rounded=true,shadow=true]{postit} {\textbf{\emph{Sufficient}} but not necessary condition} \end{beamercolorbox}}
\end{itemize}
\end{itemize}
\end{frame}
\end{document}
Output with that \def
line:

Output without it:

See any difference? I really don't… If you get a different result, you probably have an outdated version of one or more packages.
\newcommand
is followed by<>
. I have never seen that. I thought it had to be followed by the optional arguments (number of arguments of the new command and optional first argument's default value) or the mandatory argument. But maybe I'm about to discover something new :). Anyways there seem to be two problems: one comes from both the\annotate
and the\tikzmarkaligned
in the first item, the other one from the\hskip,\vskip
given as options tobeamercolorbox
. If you take those out of the options, and remove the\tikzmarkaligned
and (continues…)\annotate
lines (leaving\end{equation} }
there), you get this as a second slide (or at least I do). If that is what you want, then take those spacing commands out of thebeamercolorbox
's options.pgf
does not know the shapemarker unit vector-1
(which is whatmarker id
seems to be auto-translated to for some reason).#3
three times in\tikzmarkaligned
, there is no way of getting the\beta
in place. But if we give\tikzmarkin
and\tikzmarkend
argument#4
in\tikzmarkaligned
, and then change that argument tofoobarbaz
(or anything roughly the same length as argument#3
) we get the image. That of course is implicitly using the fix for the spaces problem stated above.