According to this question, labels are defined by default on a beamer slide to always be defined at the first slide <1>. Indeed \show\label shows

> \label=macro:
->\@ifnextchar <{\beamer@label }{\beamer@label <1>}

A solution is to use \label<2> for example to define labels on the second slide. I would rather not change all my labels. Instead, is there a way to redefine label so that it does not default to slide <1>, using the current slides like other commands?

  • \documentclass{beamer} \begin{document} \show\label \end{document}, shows the macro definition. – Tohiko May 21 '19 at 11:56

You can redefine \label in order to change <1> to <+-> (current and following). However, this only works for regular labels and not for display labels (such as in an equation), because beamer redefines these at the start of a math environment. For such cases you can use a custom macro like \mathlabel. This is not so convenient as just using \label, but it is easier than having to figure out which number you should put.

MWE, adapted from the referenced question:

\def\label{\@ifnextchar <{\beamer@label }{\beamer@label <+->}}
\def\mathlabel{\@ifnextchar <{\beamer@label@in@display }{\beamer@label@in@display <+->}}
  \item Item 1.
  \item Item 2, with equation

  \item Item 3, with references \eqref{eq:formula} and Figure \ref{fig:empty}.


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.