The mathtools package has a feature only to show the equation number for equations that are actually referenced, which seems to be what you are asking for.

**However** let me advise you against this, as a matter of style. Just because *you* don't refer to one of your equations, doesn't mean that your readers won't. It's extremely annoying as a user of a mathematical document to have to discuss with your colleagues "the 3rd unnumbered equation on page 42", or whatever, and there is really no harm in having a number for every equation in the document.

Load `theorems`

library (I do it with class option `most`

) and use `ams`

or any other maths options.

`ams`

set upper and lower parts to mathematical mode with `\displaystyle`

. You don't need `equation`

environments is these boxes. And you don't need `valign`

.

```
\documentclass{beamer}
\usepackage[most]{tcolorbox}
\newtcolorbox{equationframe}{
math
}
\begin{document}
\begin{frame}
\begin{itemize}
\item[]
\begin{equationframe}
p(x,y)=\begin{cases}
\min\{q(x,y),\frac{\pi({y})q(y,{x})}{\pi(x)}\}, \quad x\neq y\\
1-\int_{x\neq y} p(x,y)
\end{cases}
\end{equationframe}
\begin{equationframe}
\pi(x)p(x,y)=\min\{\pi(x)q(x,y),\pi(y)q(y,x)\}=\pi(y)p(y,x)%
\end{equationframe}
\end{itemize}
\end{frame}
\end{document}
```

**Update: **`ams equation*`

, `ams align*`

:

Instead of `math`

, `tcolorbox`

also offers some other mathematical boxes: `ams equation`

, `ams align`

, `ams gather`

, ...

```
\documentclass{beamer}
\usepackage[most]{tcolorbox}
\begin{document}
\begin{frame}
\begin{tcolorbox}[ams equation*]
p(x,y)=\begin{cases}
\min\{q(x,y),\frac{\pi({y})q(y,{x})}{\pi(x)}\}, \quad x\neq y\\
1-\int_{x\neq y} p(x,y)
\end{cases}
\end{tcolorbox}
\begin{tcolorbox}[ams nodisplayskip, ams align*]
\pi(x)p(x,y) & =\min\{\pi(x)q(x,y),\pi(y)q(y,x)\}\\
& =\pi(y)p(y,x)%
\end{tcolorbox}
\end{frame}
\end{document}
```

## Best Answer

I believe that

`breqn`

makes more problems that it solves. By default,everyrelation symbol in`dmath`

marks a line break point for alignment. Those you don't want should be hidden. Choose one of the methods below.Note that

`\not\in`

produces a wrong symbol and`\notin`

should be used; this doesn't depend on`breqn`

.