1
\documentclass[serif]{beamer} 

\usepackage{tikz}
\usepackage{amsmath}

\begin{document}

\begin{frame}{Adam Optimizer}
Initialize ...

Parameter $\beta_1$ is usually 0.9.

Calculate momentum 
$$ a=b $$

Calculate velocity

$$ b=c $$

\onslide*<2>{
\begin{tikzpicture}[overlay]
    \node {hello world};
\end{tikzpicture}
}

\onslide<3->
Then we have ...

\end{frame}
\end{document}

From slide 1 to slide 2, the text shifts up a bit. How to fix this?

enter image description here

Is the tikzpicture with overlay option still somehow occupy space?

I also tried to change \onslide*<2> to \onslide<2>, then the text doesn't shift, but the space between b=c and Then we have ... is enlarged.

Gqqnbig
  • 564
  • 2
    Add a % right after \onslide*<2>{ and another one after \end{tikzpicture} with no spaces before the %. –  Nov 24 '20 at 16:44
  • @abcdefg Your comments are useful, but for me I have to add % on the next line of } and after \onslide<3->. Then it's fixed. – Gqqnbig Nov 24 '20 at 17:05

0 Answers0