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.
\newcommandis 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\annotateand the\tikzmarkalignedin the first item, the other one from the\hskip,\vskipgiven as options tobeamercolorbox. If you take those out of the options, and remove the\tikzmarkalignedand (continues…) – MickG Mar 18 '16 at 15:15\annotatelines (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. – MickG Mar 18 '16 at 15:17pgfdoes not know the shapemarker unit vector-1(which is whatmarker idseems to be auto-translated to for some reason). – MickG Mar 18 '16 at 15:23Two spaces are for the box to be aligned in the itemize (I have not found other way yet). If ommitted, it does not change the result. I can only see in the background "\beta_{0,(t)} rectangle 1.00.00.01.0-2..." However, if I use "beta" instead of "\beta", box is adjusted, annotate is below the highlighted variable, i.e. all as it should be... Any suggestion how to fix the pgf problem?
– vendaval Mar 18 '16 at 15:47#3three times in\tikzmarkaligned, there is no way of getting the\betain place. But if we give\tikzmarkinand\tikzmarkendargument#4in\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. – MickG Mar 18 '16 at 16:15`. It makes it easier to identify and thus makes the post easier to read. And nicer to the eye if you ask me :). (And "omitted" has only one m :) ) – MickG Mar 18 '16 at 16:160em, preceded by something that already places the box to the right of the bullet. – MickG Mar 18 '16 at 16:28itemize, since its only item is a display which anyway deletes the bullet, and the point of the empty\itemin the seconditemize. – MickG Mar 18 '16 at 16:31Yes, it should be that the highlighting goes first, then the annotation appears. I will check your suggestions. The empty
– vendaval Mar 18 '16 at 17:47\itemand the\hspaceare only to make it fit in better (I have spent some time playing with it.)\#4as you suggested results in me seeing now the equation written correctly, not adjusted box around the variable and one empty slide with>> 0pgfid2 >>0pgfid7. (The error message is now:Missing \endcsname inserted...t \kern +..1667em\relax (t)} \gg 0}{pgfid2}). I will try to adjust thelengthfollowing your advice.Many thanks for your help!
– vendaval Mar 18 '16 at 18:00\,, so I fixed that. I can see the equation completely, but the box is still not adjusted - I am trying to update the defintion of\savepointasfrom#1#2to a more general. – vendaval Mar 18 '16 at 18:38\def\savepointas#1#2{% \expandafter\gdef\csname save@pt@#1\endcsname{#2}% }, then the "oval" is misplaced and there are some numbers written over the equation. With#3#4I get not-adjusted "oval" and an errorParameters must be numbered consecutively. \def\savepointas#3. A bit clueless now... – vendaval Mar 18 '16 at 18:46\savepointasin your code, so what is it for? Anyway of course you can't have#3#4without#1#2! – MickG Mar 18 '16 at 18:53Missing \endcsname inserted. \savepointas {\beta_{0\,(t)} \gg 0}{pgfid2}..., i.e. repeating the content of{...}being highlighted. – vendaval Mar 18 '16 at 19:12\savepointas. No difference in the warnings/errors and I find it really hard to tell the difference between the two outputs. Consider updating your TeX distribution: it's probably out of date. I have TL2014 which is, AFAIK, the latest. – MickG Mar 18 '16 at 20:38