How to draw arrows pointing a desired position

I want to reproduce the following equation:

Do I need to use tikz package? Thanks.

• You don't need to use the TikZ package, but it will simplify things. – Henri Menke Mar 25 '16 at 9:51

With TikZ you can use the remember picture option to make the defined nodes available in the whole document. Then you can connect the two remembered nodes with an arrow by using the overlay option.

\documentclass{article}
\usepackage{tikz}
\begin{document}
$\tikz[remember picture,baseline=(A1.base)]\node[inner xsep=0pt] (A1) {$A$}; B \tikz[remember picture,baseline=(A2.base)]\node[inner xsep=0pt] (A2) {$A$};$
\begin{tikzpicture}[remember picture,overlay]
\draw[<->] (A1) -- +(0,-.5) -| (A2);
\end{tikzpicture}
\end{document}


It is also possible to place this arrow with the capabilities of pure LaTeX. Therefore I abuse the array environment. Here you will have to adjust the width of the connecting rule each time the width of the cell with B changes.

\documentclass{article}
\begin{document}
$\begin{array}{@{}c@{}c@{}c@{}} A & B & A \\ \uparrow & \hidewidth\rule[-2pt]{16pt}{.4pt}\hidewidth & \uparrow \\ \end{array}$
\end{document}


• I guess TikZ package suits for me. Thank you! – Ren-Bo Wang Mar 26 '16 at 10:34

It is easy to do with pst-node and auto-pst-pdf (the latter to compile with pdflatex): define nodes in your equation, and connect them with an \nc... command:

\documentclass[10pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{pst-node}
\usepackage{auto-pst-pdf}

\begin{document}

\begin{equation*}
\begin{postscript}%
\rnode{A0}{A}\enspace B\enspace \rnode{A1}{A}\enspace . \:. \:. \:.
\ncbar[angle=-90, nodesep=2pt, linewidth=0.6pt, arrowinset=0.15, linejoin=1]{<->}{A0}{A1}
\end{postscript}
\end{equation*}

\end{document}


• This helps me to learn another way to do so. Thanks a lot! – Ren-Bo Wang Mar 26 '16 at 10:37