2

I am trying to create a slide with overlays in beamer using tikzmark.

I currently have

\documentclass{beamer}

\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{arrows, shapes, calc, decorations.pathmorphing, tikzmark, decorations.pathreplacing, scopes, fit}

\newcommand{\Bmat}{\mathbf{B}}
\newcommand{\zvec}{\mathbf{z}}
\newcommand{\trace}[1]{\text{Tr}\left[#1\right]}

\begin{document}

\begin{frame}{The Wahba Problem can be solved through an \textbf{eigenvalue--eigenvector} problem.}
    The attitude quaternion is the eigenvector corresponding to the largest eigenvalue in the system
    \begin{center}
        \only<1->{
        \begin{tikzpicture}[remember picture]
            \node<1-> (dport) {$\subnode[inner sep=0pt]{dmat}{$\textbf{K}$} \bar{\textbf{q}} = \lambda \subnode[inner sep=0pt]{qbar}{$\bar{\textbf{q}}$}$};
            {[draw=blue, ultra thick, <-]
                \draw<2-> (dmat.south)--+(-10pt,-10pt) node[inner sep=0pt, anchor=north east, align=center] (dav) {$\textbf{K} = \left[\begin{array}{c c}
                        \subnode[inner sep=0pt]{smat}{$\textbf{S}$} - \mu \textbf{I}_{3 \times 3} & \textbf{z} \\
                        \subnode[inner sep=0pt]{zvec}{$\textbf{z}^T$} & \subnode[inner sep=0pt]{mu}{$\mu$}
                    \end{array}\right]$};

                 \draw<2-> (qbar.south)--+(10pt,-10pt) node[inner sep=0pt, anchor=north west, align=center] (quat) {\small attitude quaternion};

                 \draw<3-> (smat.north)--+(-10pt,10pt) node[inner sep=0pt, anchor=south east, align=center] (sexp) {\small $\mathbf{S}=\Bmat+\Bmat^T$};
                 \draw<3-> (zvec.south)--+(-10pt,-10pt) node[inner sep=0pt, anchor=north east, align=center] (zexp) {\small $\zvec=\sum_{i=1}^m\frac{1}{\sigma_i^2}\left(\widetilde{\mathbf{b}_i}\times\mathbf{a}_i\right)$};
                 \draw<3-> (mu.south)--+(10pt,-10pt) node[inner sep=0pt, anchor=north west, align=center] (muexp) {\small $\mu=\trace{\subnode[inner sep=0pt]{bmat}{$\Bmat$}}$};
                 \draw<4> (bmat.south)--+(10pt,-10pt) node[inner sep=0pt, anchor=north west, align=center] (bexp) {\small $\Bmat=\sum_{i=1}^m\frac{1}{\sigma_i^2}\widetilde{\mathbf{b}_i}\mathbf{a}_i^T$};

            }


        \end{tikzpicture}
    }
    \end{center}

\end{frame}

\end{document}

which is very similar to another slide I did with overlays. The only problem is that for some reason everything gets screwed up as you can see below.enter image description hereenter image description hereenter image description hereenter image description here

The first and last slide are fine but everything freaks out in the middle slides. I can't see anything different between this code and later code that I have that works. Can somebody see what is going wrong here?

Also, I apologize about the format of the images. I wasn't sure how to best attach the output from my mwe.

The following is the output from using listfiles as requested in the comments

File List*
  beamer.cls    2012/10/15 development version 3.24 A class for typesetting pre
sentations (rcs-revision 24853e6b98cf)
beamerbasercs.sty    2012/11/13 (rcs-revision cb16a617839f)
beamerbasemodes.sty    2012/04/15 (rcs-revision cc6557182d97)
beamerbasedecode.sty    2010/05/01 (rcs-revision efa082c6111d)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
beamerbaseoptions.sty    2010/04/27 (rcs-revision 982469101dd6)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
geometry.sty    2010/09/12 v5.6 Page Geometry
  ifvtex.sty    2010/03/01 v1.5 Detect VTeX and its facilities (HO)
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
  size11.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
 pgfcore.sty    2010/04/11 v2.10 (rcs-revision 1.7)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
  pgfsys.sty    2010/06/30 v2.10 (rcs-revision 1.37)
  pgfrcs.sty    2010/10/25 v2.10 (rcs-revision 1.24)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2008/07/18  (rcs-revision 1.7)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 pgfcore.code.tex
 xxcolor.sty    2003/10/24 ver 0.1
hyperref.sty    2012/11/06 v6.83m Hypertext links for LaTeX
hobsub-hyperref.sty    2012/05/28 v1.13 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty    2012/05/28 v1.13 Bundle oberdiek, subset generic (HO)
  hobsub.sty    2012/05/28 v1.13 Construct package bundles (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
 intcalc.sty    2007/09/27 v1.1 Expandable calculations with integers (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty    2011/11/25 v1.13 Implements pdfTeX's escape features (HO)
bigintcalc.sty    2012/04/08 v1.3 Expandable calculations on big integers (HO)
  bitset.sty    2011/01/30 v1.1 Handle bit-vector datatype (HO)
uniquecounter.sty    2011/01/30 v1.2 Provide unlimited unique counter (HO)
letltxmacro.sty    2010/09/02 v1.4 Let assignment for LaTeX macros (HO)
 hopatch.sty    2012/05/28 v1.2 Wrapper for package hooks (HO)
xcolor-patch.sty    2011/01/30 xcolor patch
atveryend.sty    2011/06/30 v1.8 Hooks at the very end of document (HO)
atbegshi.sty    2011/10/05 v1.16 At begin shipout hook (HO)
refcount.sty    2011/10/16 v3.4 Data extraction from label references (HO)
 hycolor.sty    2011/01/30 v1.7 Color options for hyperref/bookmark (HO)
 auxhook.sty    2011/03/04 v1.3 Hooks for auxiliary files (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
  pd1enc.def    2012/11/06 v6.83m Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
     url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
 hpdftex.def    2012/11/06 v6.83m Hyperref driver for pdfTeX
rerunfilecheck.sty    2011/04/15 v1.7 Rerun checks for auxiliary files (HO)
beamerbaserequires.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbasecompatibility.sty    2012/05/01  (rcs-revision 67c48b3b652d)
beamerbasefont.sty    2012/09/19  (rcs-revision 733629cd0c6c)
 amssymb.sty    2013/01/14 v3.01 AMS font symbols
amsfonts.sty    2013/01/14 v3.01 Basic AMSFonts support
beamerbasetranslator.sty    2010/06/11  (rcs-revision 85fd1cc7fc42)
translator.sty    2010/06/12 ver 1.10
translator-language-mappings.tex
beamerbasemisc.sty    2012/02/24  (rcs-revision 2ff5461be705)
beamerbasetwoscreens.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbaseoverlay.sty    2012/11/11  (rcs-revision 6afbc49b1109)
beamerbasetitle.sty    2010/09/21  (rcs-revision f0446ed0b6ae)
beamerbasesection.sty    2012/11/11  (rcs-revision 0056eef6f17f)
beamerbaseframe.sty    2012/09/13  (rcs-revision dcd846607320)
beamerbaseverbatim.sty    2012/08/30  (rcs-revision dfdb135076b3)
beamerbaseframesize.sty    2011/09/12  (rcs-revision 70f9d8411e54)
beamerbaseframecomponents.sty    2012/09/13  (rcs-revision dcd846607320)
beamerbasecolor.sty    2010/06/06  (rcs-revision d1a9b48be06d)
beamerbasenotes.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbasetoc.sty    2012/10/02  (rcs-revision 5ed0f4010e8a)
beamerbasetemplates.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbaseauxtemplates.sty    2012/05/01  (rcs-revision 67c48b3b652d)
beamerbaseboxes.sty    2012/05/13  (rcs-revision 56972908a390)
beamerbaselocalstructure.sty    2012/11/13  (rcs-revision ddfba79dac19)
enumerate.sty    1999/03/05 v3.00 enumerate extensions (DPC)
beamerbasenavigation.sty    2012/04/03  (rcs-revision 42a0f21a412d)
beamerbasetheorems.sty    2010/06/06  (rcs-revision 7e7cc5e53e9d)
 amsmath.sty    2013/01/14 v2.14 AMS math features
 amstext.sty    2000/06/29 v2.01
  amsgen.sty    1999/11/30 v2.0
  amsbsy.sty    1999/11/29 v1.2d
  amsopn.sty    1999/12/14 v2.01 operator names
  amsthm.sty    2004/08/06 v2.20
beamerbasethemes.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerthemedefault.sty    2010/06/17  (rcs-revision d02a7cf4d8ae)
beamerfontthemedefault.sty    2010/06/17  (rcs-revision d02a7cf4d8ae)
beamercolorthemedefault.sty    2010/06/17  (rcs-revision d02a7cf4d8ae)
beamerinnerthemedefault.sty    2012/05/01  (rcs-revision 67c48b3b652d)
beamerouterthemedefault.sty    2012/10/02  (rcs-revision 5ed0f4010e8a)
    tikz.sty    2010/10/13 v2.10 (rcs-revision 1.76)
     pgf.sty    2008/01/15 v2.10 (rcs-revision 1.12)
pgfcomp-version-0-65.sty    2007/07/03 v2.10 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v2.10 (rcs-revision 1.1)
  pgffor.sty    2010/03/23 v2.10 (rcs-revision 1.18)
 pgfkeys.sty    
 pgfkeys.code.tex
  pgffor.code.tex
    tikz.code.tex
supp-pdf.mkii
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf
  grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
 nameref.sty    2012/10/27 v2.43 Cross-referencing by name of section
gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)
    test.out
    test.out
translator-basic-dictionary-English.dict    
translator-bibliography-dictionary-English.dict    
translator-environment-dictionary-English.dict    
translator-months-dictionary-English.dict    
translator-numbers-dictionary-English.dict    
translator-theorem-dictionary-English.dict    
    umsa.fd    2013/01/14 v3.01 AMS symbols A
    umsb.fd    2013/01/14 v3.01 AMS symbols B
 ***********
  • I can't reproduce the output you've posted from the code you've posted. However, I'm not sure if the output I get is what you expect or not. Is this correct? If so, you need to revise your MWE so that we can reproduce the issue. Make sure that the names you choose for subnodes are unique. You can't reuse names in later pictures because you're using remember picture. – cfr Apr 4 '16 at 20:55
  • @cfr What you posted is what I am looking for. This is the exact code I used to get the output I posted though, which I guess means there is something screwed up with one of my package installations or something. I ran into the problem of non-unique nodes before so I know these are all unique in addition when I ran it by itself (as it is in the mwe above) it still messed things up... – Andrew Apr 4 '16 at 20:58
  • Hmm... That was just a guess because it might have explained why it worked OK in another picture. And I assume you've compiled twice. Can you add \listfiles and post the output to compare versions? – cfr Apr 4 '16 at 21:01
  • @cfr I believe I've added the output from listfiles that you wanted to the question. Also, I definitely ran it twice (I use vim-latex which autorecompiles until things are correct and it actually compiled 5 times which was my first hint something was wrong). – Andrew Apr 4 '16 at 21:05
  • Your TeX installation appears to be quite old. I'd recommend updating. For example, you have version 2.1 of PGF/TikZ and there are a lot of fixes and enhancements in version 3, which has been available for quite some time. Your version of Beamer is from 2012, whereas mine is from 2015 and so on. I'm assuming this explains the differences in output. – cfr Apr 4 '16 at 21:40
2

As far as I know, you cannot write things like

\draw<overlay specification>

or

\node<overlay specification>

and have things work reliably correctly. If it sometimes works, that is largely a matter of luck and certainly not to be expected, I think. At least, it seems to cause problems here; it wouldn't work reliably for me; and there is a bunch of specialist code floating around which would be entirely pointless if it did work. Since people rarely dream up such solutions to non-existent problems, the claim that this isn't the way to go is reasonably well, albeit indirectly, supported by the evidence.

It is possible to use \onslide<overlay> specification within tikzpictures and this (generally) seems to work reliably. For subtler overlay effects, it is necessary to grab some of the specialist TikZ styles designed for this purpose. In this case, however, the specialist grab isn't needed and we can achieve the desired result simply with \onslide<>.

I've removed the \onslide<1->{} around everything as that's the default anyhow.

\documentclass{beamer}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{arrows, shapes, calc, decorations.pathmorphing, tikzmark, decorations.pathreplacing, scopes, fit}
\newcommand{\Bmat}{\mathbf{B}}
\newcommand{\zvec}{\mathbf{z}}
\newcommand{\trace}[1]{\text{Tr}\left[#1\right]}
\begin{document}
\begin{frame}{The Wahba Problem can be solved through an \textbf{eigenvalue--eigenvector} problem.}
  The attitude quaternion is the eigenvector corresponding to the largest eigenvalue in the system
  \begin{center}
    \begin{tikzpicture}[remember picture]
      \node (dport) {$\subnode[inner sep=0pt]{dmat}{$\textbf{K}$} \bar{\textbf{q}} = \lambda \subnode[inner sep=0pt]{qbar}{$\bar{\textbf{q}}$}$};
      {[draw=blue, ultra thick, <-]
        \onslide<2->
        \draw  (dmat.south)--+(-10pt,-10pt) node[inner sep=0pt, anchor=north east, align=center] (dav) {$\textbf{K} = \left[\begin{array}{c c}
            \subnode[inner sep=0pt]{smat}{$\textbf{S}$} - \mu \textbf{I}_{3 \times 3} & \textbf{z} \\
            \subnode[inner sep=0pt]{zvec}{$\textbf{z}^T$} & \subnode[inner sep=0pt]{mu}{$\mu$}
          \end{array}\right]$};
        \draw  (qbar.south)--+(10pt,-10pt) node[inner sep=0pt, anchor=north west, align=center] (quat) {\small attitude quaternion};
        \onslide<3->
        \draw  (smat.north)--+(-10pt,10pt) node[inner sep=0pt, anchor=south east, align=center] (sexp) {\small $\mathbf{S}=\Bmat+\Bmat^T$};
        \draw  (zvec.south)--+(-10pt,-10pt) node[inner sep=0pt, anchor=north east, align=center] (zexp) {\small $\zvec=\sum_{i=1}^m\frac{1}{\sigma_i^2}\left(\widetilde{\mathbf{b}_i}\times\mathbf{a}_i\right)$};
        \draw (mu.south)--+(10pt,-10pt) node[inner sep=0pt, anchor=north west, align=center] (muexp) {\small $\mu=\trace{\subnode[inner sep=0pt]{bmat}{$\Bmat$}}$};
        \onslide<4->
        \draw  (bmat.south)--+(10pt,-10pt) node[inner sep=0pt, anchor=north west, align=center] (bexp) {\small $\Bmat=\sum_{i=1}^m\frac{1}{\sigma_i^2}\widetilde{\mathbf{b}_i}\mathbf{a}_i^T$};
      }
%       \foreach \i in {qbar,dmat,smat,zvec,mu,bmat} \draw [fill,red] (\i) circle (1pt) node [red, font=\tiny] {\i};
    \end{tikzpicture}
  \end{center}
\end{frame}
\end{document}

incremental arrows in Beamer

EDIT

As pointed out by Andrew, this code obliterates any footline your theme might use. If you use such a theme, then the workarounds demonstrated in the answers to this question can be used to ensure the expected output. For example, using Joachim Breitner's method:

\documentclass{beamer}
\usepackage{amsmath}
\usetheme{Madrid}
\usepackage{tikz}
\usetikzlibrary{arrows, shapes, calc, decorations.pathmorphing, tikzmark, decorations.pathreplacing, scopes, fit}
\newcommand{\Bmat}{\mathbf{B}}
\newcommand{\zvec}{\mathbf{z}}
\newcommand{\trace}[1]{\text{Tr}\left[#1\right]}
\begin{document}
\begin{frame}{The Wahba Problem can be solved through an \textbf{eigenvalue--eigenvector} problem.}
  The attitude quaternion is the eigenvector corresponding to the largest eigenvalue in the system
  \begin{center}
    \begin{tikzpicture}[remember picture]
      \node (dport) {$\subnode[inner sep=0pt]{dmat}{$\textbf{K}$} \bar{\textbf{q}} = \lambda \subnode[inner sep=0pt]{qbar}{$\bar{\textbf{q}}$}$};
      {[draw=blue, ultra thick, <-]
        \onslide<2->
        \draw  (dmat.south)--+(-10pt,-10pt) node[inner sep=0pt, anchor=north east, align=center] (dav) {$\textbf{K} = \left[\begin{array}{c c}
            \subnode[inner sep=0pt]{smat}{$\textbf{S}$} - \mu \textbf{I}_{3 \times 3} & \textbf{z} \\
            \subnode[inner sep=0pt]{zvec}{$\textbf{z}^T$} & \subnode[inner sep=0pt]{mu}{$\mu$}
          \end{array}\right]$};
        \draw  (qbar.south)--+(10pt,-10pt) node[inner sep=0pt, anchor=north west, align=center] (quat) {\small attitude quaternion};
        \onslide<3->
        \draw  (smat.north)--+(-10pt,10pt) node[inner sep=0pt, anchor=south east, align=center] (sexp) {\small $\mathbf{S}=\Bmat+\Bmat^T$};
        \draw  (zvec.south)--+(-10pt,-10pt) node[inner sep=0pt, anchor=north east, align=center] (zexp) {\small $\zvec=\sum_{i=1}^m\frac{1}{\sigma_i^2}\left(\widetilde{\mathbf{b}_i}\times\mathbf{a}_i\right)$};
        \draw (mu.south)--+(10pt,-10pt) node[inner sep=0pt, anchor=north west, align=center] (muexp) {\small $\mu=\trace{\subnode[inner sep=0pt]{bmat}{$\Bmat$}}$};
        \onslide<4->
        \draw  (bmat.south)--+(10pt,-10pt) node[inner sep=0pt, anchor=north west, align=center] (bexp) {\small $\Bmat=\sum_{i=1}^m\frac{1}{\sigma_i^2}\widetilde{\mathbf{b}_i}\mathbf{a}_i^T$};
      }
%       \foreach \i in {qbar,dmat,smat,zvec,mu,bmat} \draw [fill,red] (\i) circle (1pt) node [red, font=\tiny] {\i};
      \onslide<1->
    \end{tikzpicture}
  \end{center}
\end{frame}
\end{document}

produces

footline

  • Thanks, I also had to delete my aux file in order to get this to work which caused me a headache for a couple of hours... Your help is greatly appreciated @cfr. Just for my reference can you direct me to the specialty packages for the tikz overlays that you were referencing? – Andrew Apr 5 '16 at 14:26
  • Also, something else to note (perhaps you can edit and add to your answer for others) if you are using a footline in your style you either need to add \onslide<1-> to the end of the tikzpicture environment or use curly braces to limit the ranges of the onslide commands. If you don't do this the last onslide extends too far and removes the footline from some of the slides as discussed in tex.stackexchange.com/questions/21512/…. – Andrew Apr 5 '16 at 14:32
  • @Andrew Thanks - edited as suggested. Very weird effect, though! – cfr Apr 5 '16 at 20:29
2

Update: 2016-04-06

I've added the ability to add prefixes and suffixes to tikzmark names, and put in an automatic suffix when beamer is loaded. This makes the original code work as it makes the subnode names unique on each frame.

This needs the latest version of tikzmark, available from github.


Firstly, you can write \draw<overlay specification> and it will do what you mean it to do: the \draw appears only if the overlay specification is met.

The problem is that the \subnode command works by writing stuff to the aux file and then reading it back in on subsequent runs. However, this requires using unique names as each will overwrite earlier ones with the same name. If all the subnodes with the same name were in the same place, this wouldn't be a problem. But they aren't. Your picture jumps around meaning that on each frame the subnodes are in different places.

One solution would be to modify the names so that they contain a unique part, the frame number would be a suitable choice there. A better solution (in my opinion) would be to fix the jumping. This creates a better visual effect as well where the focus each time is on the part that is new and the viewer is not having to hunt around for the additional stuff each step.

Fortunately, this is a solved issue. Adding the code from How can I fix jumping TikZ pictures in beamer? seems to work.

\documentclass{beamer}
%\url{https://tex.stackexchange.com/q/302517/86}



\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{arrows, shapes, calc, decorations.pathmorphing, tikzmark, decorations.pathreplacing, scopes, fit}

\newcommand{\Bmat}{\mathbf{B}}
\newcommand{\zvec}{\mathbf{z}}
\newcommand{\trace}[1]{\text{Tr}\left[#1\right]}

\makeatletter
\newcounter{jumping}
\resetcounteronoverlays{jumping}

\def\jump@setbb#1#2#3{%
  \@ifundefined{jump@#1@maxbb}{%
    \expandafter\gdef\csname jump@#1@maxbb\endcsname{#3}%
  }{%
    \csname jump@#1@maxbb\endcsname
    \pgf@xa=\pgf@x
    \pgf@ya=\pgf@y
    #3
    \pgfmathsetlength\pgf@x{max(\pgf@x,\pgf@xa)}%
    \pgfmathsetlength\pgf@y{max(\pgf@y,\pgf@ya)}%
    \expandafter\xdef\csname jump@#1@maxbb\endcsname{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}%
  }
  \@ifundefined{jump@#1@minbb}{%
    \expandafter\gdef\csname jump@#1@minbb\endcsname{#2}%
  }{%
    \csname jump@#1@minbb\endcsname
    \pgf@xa=\pgf@x
    \pgf@ya=\pgf@y
    #2
    \pgfmathsetlength\pgf@x{min(\pgf@x,\pgf@xa)}%
    \pgfmathsetlength\pgf@y{min(\pgf@y,\pgf@ya)}%
    \expandafter\xdef\csname jump@#1@minbb\endcsname{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}%
  }
}

\tikzset{
  stop jumping/.style={
    execute at end picture={%
      \stepcounter{jumping}%
      \immediate\write\pgfutil@auxout{%
        \noexpand\jump@setbb{\the\value{jumping}}{\noexpand\pgfpoint{\the\pgf@picminx}{\the\pgf@picminy}}{\noexpand\pgfpoint{\the\pgf@picmaxx}{\the\pgf@picmaxy}}
      },
      \csname jump@\the\value{jumping}@maxbb\endcsname
      \path (\the\pgf@x,\the\pgf@y);
      \csname jump@\the\value{jumping}@minbb\endcsname
      \path (\the\pgf@x,\the\pgf@y);
    },
  }
}

\makeatother

\begin{document}

\begin{frame}{The Wahba Problem can be solved through an \textbf{eigenvalue--eigenvector} problem.}
    The attitude quaternion is the eigenvector corresponding to the largest eigenvalue in the system
    \begin{center}
%        \only<1->{
        \begin{tikzpicture}[remember picture,stop jumping]
            \node<1-> (dport) {$\subnode[inner sep=0pt]{dmat}{$\textbf{K}$} \bar{\textbf{q}} = \lambda \subnode[inner sep=0pt]{qbar}{$\bar{\textbf{q}}$}$};
            {[draw=blue, ultra thick, <-]
                \draw<2-> (dmat.south)--+(-10pt,-10pt) node[inner sep=0pt, anchor=north east, align=center] (dav) {$\textbf{K} = \left[\begin{array}{c c}
                        \subnode[inner sep=0pt]{smat}{$\textbf{S}$} - \mu \textbf{I}_{3 \times 3} & \textbf{z} \\
                        \subnode[inner sep=0pt]{zvec}{$\textbf{z}^T$} & \subnode[inner sep=0pt]{mu}{$\mu$}
                    \end{array}\right]$};

                 \draw<2-> (qbar.south)--+(10pt,-10pt) node[inner sep=0pt, anchor=north west, align=center] (quat) {\small attitude quaternion};

                 \draw<3-> (smat.north)--+(-10pt,10pt) node[inner sep=0pt, anchor=south east, align=center] (sexp) {\small $\mathbf{S}=\Bmat+\Bmat^T$};
                 \draw<3-> (zvec.south)--+(-10pt,-10pt) node[inner sep=0pt, anchor=north east, align=center] (zexp) {\small $\zvec=\sum_{i=1}^m\frac{1}{\sigma_i^2}\left(\widetilde{\mathbf{b}_i}\times\mathbf{a}_i\right)$};
                 \draw<3-> (mu.south)--+(10pt,-10pt) node[inner sep=0pt, anchor=north west, align=center] (muexp) {\small $\mu=\trace{\subnode[inner sep=0pt]{bmat}{$\Bmat$}}$};
                 \draw<4> (bmat.south)--+(10pt,-10pt) node[inner sep=0pt, anchor=north west, align=center] (bexp) {\small $\Bmat=\sum_{i=1}^m\frac{1}{\sigma_i^2}\widetilde{\mathbf{b}_i}\mathbf{a}_i^T$};

            }


        \end{tikzpicture}
%    }
    \end{center}

\end{frame}

\end{document}

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.