Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using \tag with an earlier equation number and \label does not work #814

Open
cejkiebo opened this issue Dec 18, 2022 · 1 comment
Open

Comments

@cejkiebo
Copy link

cejkiebo commented Dec 18, 2022

I'm trying to use Beamer to show a variant of a previously defined equation, yet it throws me weird undescriptive errors (that appear to relate to the frame, not the equation environment). My MWE:

\documentclass{beamer}
\usepackage{amsmath,amsfonts,amssymb}

\begin{document}
\begin{equation}
y = x^2 \label{eq:equation1}
\end{equation}
\begin{equation}
y = x^2+2 \tag{\ref*{eq:equation1}m}\label{eq:equation2}
\end{equation}

Equations \eqref{eq:equation1} and \eqref{eq:equation2}
\end{document}

It does work with the article class (with hyperref added), so it appears to be a bug on Beamer's part. Commenting out the label with the second equation solves the problem, but then I can't refer to my modified equation elsewhere.

@samcarter
Copy link
Collaborator

samcarter commented Dec 18, 2022

The original definition of \ref is still available as \beamer@origref:

\documentclass{beamer}

\makeatletter
  \long\def\myref#1{%
    \beamer@origref{#1}%
  }
\makeatother

\begin{document}
\begin{frame}
\begin{equation}
y = x^2 \label{eq:equation1}
\end{equation}
\begin{equation}
y = x^2+2 
\tag{\myref{eq:equation1}m}
\label{eq:equation2}
\end{equation}

Equations \eqref{eq:equation1} and \eqref{eq:equation2}
\end{frame}
\end{document}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants