You could also use a tikzmark to mark the appropriate points in the text and then draw the appropriate graphics. The advantage of this is that it separates the content from the annotations. In this specific case the advantage is not huge, but in more complicated situations the same methodology can be applied:

Notes:
Code:
\documentclass{article}
\usepackage{xparse}
\usepackage{tikz}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node[baseline] (#1) {};}
\NewDocumentCommand{\DrawBox}{O{} O{} m m}{%
% #1 = line draw options
% #2 = node options
% #3 = tikzmark name
% #4 = node text
\begin{tikzpicture}[remember picture, overlay]
\draw [ultra thick, blue, -latex, shorten >=1pt, #1]
(#3) ++ (-1.5ex,1.5ex) -- +(.7,.5)
node [black, right, draw=black, #2] {#4};
\end{tikzpicture}%
}
\begin{document}
This is an example:
[
X =\tikzmark{Point A} Y
]
and another example
[
X =\tikzmark{Point B} Z
]
\DrawBox{Point A}{Always true}
\DrawBox[draw=red][draw=gray, thin, fill=yellow]{Point B}{Sometimes true}
\end{document}