in the code below, when I place the arrow to the equation, it messes with the alignment of the elements of the equation that the arrows are referring to. Is it possible to maintain the alignment of the equation (as shown in the second equation) and still have the arrows pointing to them? Thanks for your help.
Here is my code:
\documentclass{book}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{mathptmx}
\usepackage{calc}
\usepackage{tikz}
\usetikzlibrary{tikzmark,calc,,arrows,shapes,decorations.pathreplacing}
\tikzset{every picture/.style={remember picture}}
\begin{document}
We denote
\begin{equation}
\hat{x}^{-}_{k} \equiv \hat{x}(\tikz[baseline]{\node(d1){$k$}}\mid \tikz[baseline]{\node(d2){$k-1$}})
\end{equation}
\begin{tikzpicture}[remember picture,overlay]{
\draw[blue,thick,<-,rounded corners] (d1) |- ++ (0.6cm,-1.5cm) node[anchor=west,text = black,] (label1) {\emph{what is the $kth~x$}};
\draw[blue,thick,<-,rounded corners] (d2) |- ($(label1.west)-(-0.8cm,-0.6cm)$) node[anchor=west,text = black] {$given~\hat{x}_{k-1},~z_{k-1}$};}
\end{tikzpicture}
\vspace{1cm}
We denote
\begin{equation}
\hat{x}^{-}_{k} \equiv \hat{x}(k\mid k-1)
\end{equation}
\end{document}
tikz
approach: tex.stackexchange.com/questions/263480/…amssymb
loadsamsfonts
, you needn't specify the latter.