3

I have the following LaTeX code:

\documentclass[serif]{beamer}
\mode<presentation> {
\usetheme{Warsaw}
}

\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage[sc]{mathpazo}
\linespread{1.05} % Palladio needs more leading (space between lines)
\usepackage[T1]{fontenc}


\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}

\begin{document}

    \begin{frame}
        \frametitle{Probability}
        \tikz[overlay,remember picture]{\only<2>{\node[right=10,gray,draw,fill=white,text width=130,align=left] at (5,0) {Update the probability $s_n$};}}
    \end{frame}

\end{document}

I need to load \usetikzlibrary{automata,positioning}. When I do, the command \tikz[overlay,remember picture]{\only<2>{\node[right=10,gray,draw,fill=white,text width=130,align=left] at (5,0) {Update the probability $s_n$};}} will not have any effect. In other words, the rectangle disappears after loading the package. Do you have any idea why?

Before loading the package I get:

enter image description here

But after loading the package I get:

enter image description here

  • did you compile twice? Remove the overlay, remember picture part and try again – percusse Apr 3 '16 at 21:56
  • Yes, more than twice. The problem is with automata I think. – Ribz Apr 3 '16 at 21:57
  • I don't think so. That doesn't load any related parts – percusse Apr 3 '16 at 21:58
  • 2
    Change right=10 to right=10pt. – Benjamin Apr 3 '16 at 22:01
2

Taking @Benjamin's comment about right=10pt into accout, the code needs to be:

\documentclass{beamer}
\mode<presentation>{%
\usetheme{Warsaw}
\usefonttheme{serif} %[serif] is deprecated
}%

\usepackage{tikz}
\usetikzlibrary{automata,positioning}
\usetikzlibrary{calc}

\usepackage[sc]{mathpazo}
\linespread{1.05} % Palladio needs more leading (space between lines)
\usepackage[T1]{fontenc}

\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}

\begin{document}

    \begin{frame}
        \frametitle{Probability}
        \tikz[overlay,remember picture]{\only<2>{\node[right=10pt,gray,draw,fill=white,text width=130,align=left] at (5,0) {Update the probability $s_n$};}}
    \end{frame}

\end{document}

Also the serif-option is deprecated, hence the code is using the more appropriate \usefonttheme{serif}.

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.