# Arrows with different directions

I want to drawing two arrows which different directions from 1 edge to 2 edge.

I want to print a and b on the arrows respectively.

• It's not very clear. Can you illustrate your question with a freehand figure? Sep 9 '18 at 9:04
• Ok. I am sorry. Sep 9 '18 at 9:20
• It's clearer, can you modify the image to remove all the unnecessary white part? Sep 9 '18 at 10:06
• Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. Nov 21 '18 at 13:25

\documentclass{article}
\usepackage{amssymb}
\usepackage{stackrel}
\begin{document}
$1\stackrel[b]{a}{\rightleftarrows}2$
\end{document}

• Anyone know how to get this in markdown-embedded equations ? Oct 11 '21 at 6:32
• In Rmarkdowm, provide the above packages in the YALM header or in a template and just type the formula in LaTeX.
– Fran
Oct 11 '21 at 20:05
• Thanks. I am using markdown to write documents in VSCode, I found this to work: $X \underset{txdown}{\stackrel{txup}{\rightleftharpoons}} Y$ Oct 12 '21 at 8:18

An answer with tikz overlays (1 and 2 are not in the tikz picture but could be)

\documentclass[]{article}
\usepackage{tikz}

\newcommand{\tikzmark}[1]{\begin{tikzpicture}[overlay,remember picture]\coordinate(#1);\end{tikzpicture}}

\begin{document}
{\Huge 1\tikzmark{A}\hspace{50pt}\tikzmark{B}2}
\begin{tikzpicture}[overlay,remember picture]
\draw[thick,->] ([shift={(0,0.4)}]A)--([shift={(0,0.4)}]B) node[midway, above]{{\large a}};
\draw[thick,<-] ([shift={(0,0.1)}]A)--([shift={(0,.1)}]B) node[midway, below]{{\large b}};
\end{tikzpicture}
\end{document}


it is not clear, if you like to have as math expression (as provide Fran in his nice answer), or you like to have picture with such content. for the latter is handy package tikz-cd (intended for the commutative diagrams):

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}

\begin{tikzcd}
1 \arrow[r,shift left,"a"]
&
2 \arrow[l,shift left,"b"]
\end{tikzcd}

\end{document}