2

This script

\documentclass{article}
\usepackage[all]{xy}

\begin{document}
\begin{equation}
\xymatrix @R=0.3pc @C=0.3pc{ 
     & N_0\oplus G_1 & N_1\oplus G_2 \ar@/_1.5pc/[l]_u }
\end{equation}
\end{document}

give the following result enter image description here

I wish that the arrow start from the "G_2" and arrive in "G_1". Thank you

A Diyanat
  • 777
papinou
  • 23

2 Answers2

4

You can use tikz package. Please consider the following code:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{calc}
\tikzstyle{every picture}+=[remember picture]

\begin{document}
\begin{equation}
N_0\oplus \tikz[baseline]{\node[fill=blue!20,circle,inner sep=1pt,anchor=base] (t1){$G_1$}} \quad 
N_1\oplus \tikz[baseline]{\node[fill=red!20,circle,inner sep=1pt,anchor=base] (t2){$G_1$}}
\end{equation}
\begin{tikzpicture}[overlay]
\draw[-latex](t2.90)to[in=60,out=120]node[midway,above]{$u$}(t1);
\end{tikzpicture}
\end{document}

This is the output:

enter image description here

Note: You can easily change or remove nodes color.

\begin{equation}
N_0\oplus \tikz[baseline]{\node[fill=none,draw=none,inner sep=1pt,anchor=base] (t1){$G_1$}} \quad 
N_1\oplus \tikz[baseline]{\node[fill=none,draw=none,inner sep=1pt,anchor=base] (t2){$G_1$}}
\end{equation}

enter image description here

You could also change the output and input angle and position of arrow, by changing the following line in the code:

\draw[-latex]($(t2)+(-1mm,2mm)$)to[in=60,out=120]node[midway,above]{$u$}($(t1)+(-1mm,2mm)$);

enter image description here

A Diyanat
  • 777
2

A possible solution with tikz-cd:

\documentclass{article} 
\usepackage{amsmath} 
\usepackage{tikz-cd}
\begin{document} 
\[
\begin{tikzcd}
N_0\oplus G_1 
& N_1\oplus G_2 
\arrow[l, bend right=60, "u", swap, start anchor={[xshift=-10pt]north east}, end anchor={[xshift=-10pt]north east}]\\
\end{tikzcd}
\] 
\end{document}

enter image description here

If you want an arrow tip like xymatrix add

\tikzcdset{arrow style=tikz, diagrams={>={Straight Barb[length=5pt,width=5pt]}}}

in your preamble, after \usepackage{tikz-cd}, and you'll get:

enter image description here

CarLaTeX
  • 62,716