11

Is it possible to achieve something like this in LaTeX?

enter image description here

I want a curved arrrow pointing from 1st line to the other line and is coupled with an equation number which indicates the equation used. I want to be able to specify equation used manually like for example \eqref{2.10}.


I have learned TikZ a bit and found something what might look like a solution:

\begin{tikzpicture}
\path (0,1) coordinate(c1)
(-0.5,0.85) coordinate(c2)
(-0.5,0.15) coordinate(c3)
(0,0) coordinate(c4)
(-1,0.5) coordinate(c5);
\draw [-latex] (c1) .. controls (c2) and (c3)
.. (c4);
\draw (c5) node [anchor=east] {\text{\eqref{2.10}}};
\end{tikzpicture}

This produces a lovely arrow (below) which i don't know how to put on the left side of two rows of an equation. Please someone give me advice on this.

enter image description here

Additional question:

Is it possible for this arrow to dynamically change coordinates c1, c2, c4 and c4 if equation rows are sepparated more or less?

71GA
  • 3,573

4 Answers4

4

Just another suggestion with PSTricks.

enter image description here

\documentclass[preview,border=12pt,leqno,varwidth]{standalone}
\usepackage{pst-node}
\usepackage{amsmath}
\begin{document}
\begin{align}
\rnode[l]{A}{y} &= ax^2 +bx +c\\
\rnode[l]{B}{y} &= mx +c
\pcbar[angle=180,nodesep=3pt,linearc=3pt,linecolor=blue]{->}(A)(B)
\end{align}
\end{document}
David Carlisle
  • 757,742
3

If the equations have the same length the code below works fine.

Use xymatrix with an empty column to produce the arrow.

\begin{equation}
\begin{gathered}
 \xymatrix@R=1ex@C=-2pt{
   \ar@/_7pt/[d] & \hat{H}= -\frac{num}{den}\cdots\\ 
                 & \hat{H}= -\frac{num}{den}\cdots} 
\end{gathered}
\end{equation}

The @R= controls the distance between the (R)ows. The same to the (C)olumns.

The @/_7pt/ controls the curvature of the arrow. _ is to curve down (from top to bottom).

enter image description here

Sigur
  • 37,330
  • This is not as compact as i would like it to be. I don't like the empty row inbetween. – 71GA May 05 '13 at 15:06
  • @71GA, there is no empty row. You can control the distance between the rows and columns. See the edited code. I'll update the image. – Sigur May 05 '13 at 15:07
2

Tongue-in-cheek solution: rip the character from MnSymbol, and make it huge:

\documentclass[leqno]{article}

\usepackage{graphicx}
\usepackage{amsmath}

\DeclareFontFamily{U}{MnSymbolA}{}
\DeclareSymbolFont{MnSyA}{U}{MnSymbolA}{m}{n}
\DeclareFontShape{U}{MnSymbolA}{m}{n}{
    <-6>  MnSymbolA5
   <6-7>  MnSymbolA6
   <7-8>  MnSymbolA7
   <8-9>  MnSymbolA8
   <9-10> MnSymbolA9
  <10-12> MnSymbolA10
  <12->   MnSymbolA12}{}
\DeclareMathSymbol{\rcurvearrowdown}{\mathrel}{MnSyA}{195}
\newcommand{\follows}{\raisebox{-6pt}{\scalebox{3}{$\rcurvearrowdown$}}}

\begin{document}
\begin{equation}\tag{2.10}
\follows\quad
\begin{aligned}
  \widehat{H} & = - \frac{\hbar^2}{2m} \frac{d^2}{x^2} + \frac{1}{2} m \omega^2 x^2 \\
  \widehat{H} & = - \frac{\hbar^2}{2m} \frac{d^2}{x^2} + \frac{1}{2} m \omega^2 x^2
\end{aligned}
\end{equation}
\end{document}

sample output

David Carlisle
  • 757,742
mafp
  • 19,096
  • Is it possible to make the arrow look more like the one on my picture - i mean smaller, more discrete? – 71GA May 06 '13 at 07:18
  • @71GA Unfortunately not. Because of the scaling (here: factor 3) of the original glyph the arrow gets fat. – mafp May 06 '13 at 07:38
2

With tikz, you can use tkz-linknodes. margin=11cm is determined with the right margin of the document.

\documentclass[preview,border=12pt,leqno,varwidth]{standalone}
\usepackage{tkz-linknodes}
\usepackage{amsmath}
\begin{document}

\begin{NodesList}
 \begin{align}
    y &= ax^2 +bx +c\AddNode\\
    y &= mx +c  \AddNode
\tikzset{ArrowStyle/.append style = {blue,rounded corners=.25cm}}
\LinkNodes[margin=11cm]{}%
\end{align}
\end{NodesList}
\end{document}

enter image description here

A more complex example

\documentclass{article}
\usepackage{tkz-linknodes}
\usepackage{amsmath}
\begin{document}


\begin{minipage}{11cm} 
    {\renewcommand{\arraystretch}{2}% 
    \begin{NodesList}
\[y = \left\{%
   \begin{array}{ll}
     x^2+2x  &\textrm{if }x<0,               \AddNode   \\
     x^3     &\textrm{if }0\le x<1,          \AddNode[2]\\
     x^2+x   &\textrm{if }1\le x<2,          \AddNode   \\
     x^3-x^2 &\textrm{if }2\le x.            \AddNode[2]
   \end{array}\right.\]
\tikzset{ArrowStyle/.append style = {<->,red,rounded corners=.25cm}}
\tikzset{LabelStyle/.append style = {pos=0.20}}
\LinkNodes[margin=3cm]{Degree 2 - quadratic}
{\tikzset{ArrowStyle/.append style = {<->,blue,rounded corners=.25cm}}
\LinkNodes[margin=1cm]{Degree 3 - cubic}}
\end{NodesList}}
\end{minipage}

\end{document}

enter image description here

David Carlisle
  • 757,742
Alain Matthes
  • 95,075