6

I would like to draw adjunction arrows in LaTeX, i.e. something like this:

Possibly, I would also like to be able to name the arrows (but I can use \stackrel or similar, if not). Is there a package containing this symbol somewhere?

  • I know of only the arrows (\rightleftharpoons) but with that _|_ in the middle, never seen it. Also Detexify didn't find it. – Guilherme Zanotelli Sep 30 '16 at 18:28
  • Some like \documentclass{article} \usepackage{stackrel} \begin{document} $F:C\stackrel[^\leftharpoondown]{_\rightharpoonup}{{\scriptscriptstyle \perp}}O:G$ \end{document} ? – Fran Sep 30 '16 at 21:31
  • @Fran Looks promising, but it gives me some errors, and I have no clue how to fix it. – Daniel Robert-Nicoud Sep 30 '16 at 21:35
  • 1
    @DanielRobert-Nicoud For some unknown reason, when pasted, a "zero with space" was inserted in the comment inside \scriptscriptstyle (in the second "sc"). Just remove it and it should work. – Fran Oct 01 '16 at 01:03
  • @Fran Oh, weird! Ok, it works now, but it is not typesetted the way I would like it to look. No offense, but I'll stick to egreg's answer for now. – Daniel Robert-Nicoud Oct 01 '16 at 01:17
  • @DanielRobert-Nicoud None taken. It is a great answer. – Fran Oct 01 '16 at 02:23

1 Answers1

7

Here's a possibility, with a very small symbol in the middle.

\documentclass{article}
\usepackage{amsmath}
\usepackage{pict2e}

\makeatletter
\newcommand{\adjunction}[4]{%
  % #1 : #2 <arrows> #3 : #4
  #1\colon #2%
  \mathrel{\vcenter{%
    \offinterlineskip\m@th
    \ialign{%
      \hfil$##$\hfil\cr
      \longrightharpoonup\cr
      \noalign{\kern-.3ex}
      \smallbot\cr
      \longleftharpoondown\cr
    }%
  }}%
  #3 \noloc #4%
}
\newcommand{\longrightharpoonup}{\relbar\joinrel\rightharpoonup}
\newcommand{\longleftharpoondown}{\leftharpoondown\joinrel\relbar}
\newcommand\noloc{%
  \nobreak
  \mspace{6mu plus 1mu}
  {:}
  \nonscript\mkern-\thinmuskip
  \mathpunct{}
  \mspace{2mu}
}
\newcommand{\smallbot}{%
  \begingroup\setlength\unitlength{.15em}%
  \begin{picture}(1,1)
  \roundcap
  \polyline(0,0)(1,0)
  \polyline(0.5,0)(0.5,1)
  \end{picture}%
  \endgroup
}
\makeatother

\begin{document}

\[
\adjunction{F}{\mathcal{C}}{\mathcal{D}}{G}
\]

\end{document}

enter image description here

A version where you can choose, with \adjunction*, to place the labels above and below.

\documentclass{article}
\usepackage{amsmath}
\usepackage{pict2e}

\makeatletter
\newcommand{\adjunction}{\@ifstar\named@adjunction\normal@adjunction}
\newcommand{\normal@adjunction}[4]{%
  % #1 : #2 <arrows> #3 : #4
  #1\colon #2%
  \mathrel{\vcenter{%
    \offinterlineskip\m@th
    \ialign{%
      \hfil$##$\hfil\cr
      \longrightharpoonup\cr
      \noalign{\kern-.3ex}
      \smallbot\cr
      \longleftharpoondown\cr
    }%
  }}%
  #3 \noloc #4%
}
\newcommand{\named@adjunction}[4]{%
  % #1 : #2 <arrows> #3 : #4
  #2%
  \mathrel{\vcenter{%
    \offinterlineskip\m@th
    \ialign{%
      \hfil$##$\hfil\cr
      \scriptstyle#1\cr
      \noalign{\kern.1ex}
      \longrightharpoonup\cr
      \noalign{\kern-.3ex}
      \smallbot\cr
      \longleftharpoondown\cr
      \scriptstyle#4\cr
    }%
  }}%
  #3%
}
\newcommand{\longrightharpoonup}{\relbar\joinrel\rightharpoonup}
\newcommand{\longleftharpoondown}{\leftharpoondown\joinrel\relbar}
\newcommand\noloc{%
  \nobreak
  \mspace{6mu plus 1mu}
  {:}
  \nonscript\mkern-\thinmuskip
  \mathpunct{}
  \mspace{2mu}
}
\newcommand{\smallbot}{%
  \begingroup\setlength\unitlength{.15em}%
  \begin{picture}(1,1)
  \roundcap
  \polyline(0,0)(1,0)
  \polyline(0.5,0)(0.5,1)
  \end{picture}%
  \endgroup
}
\makeatother

\begin{document}

\[
\adjunction{F}{\mathcal{C}}{\mathcal{D}}{G}
\]
\[
\adjunction*{F}{\mathcal{C}}{\mathcal{D}}{G}
\]

\end{document}

enter image description here

egreg
  • 1,121,712
  • This is great! Thank you for your remarkable (and pretty long, I'd say) work! It's a shame that the symbol in the middle is so small, but it's true that it's basically impossible to make it bigger without putting the arrows too far apart. Thanks again! – Daniel Robert-Nicoud Sep 30 '16 at 23:12
  • @DanielRobert-Nicoud As you observed, making the symbol larger would mean pushing the harpoons too far apart, unless a different arrow tip style is adopted. The code is long, but I already had some similar code, so writing the main part was easy and only testing it was reeded. – egreg Oct 01 '16 at 06:30
  • Anyway, I greatly appreciate the effort. I will certainly us it, and I think that other people will, when they see it. – Daniel Robert-Nicoud Oct 01 '16 at 09:05