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.

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

enter image description here

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.

A & B & A \\
\uparrow & \hidewidth\rule[-2pt]{16pt}{.4pt}\hidewidth & \uparrow \\

enter image description here

  • I guess TikZ package suits for me. Thank you! – rbwang 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:



    \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}


enter image description here

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

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.