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?

6
  • I know of only the arrows (\rightleftharpoons) but with that _|_ in the middle, never seen it. Also Detexify didn't find it. Sep 30, 2016 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, 2016 at 21:31
  • @Fran Looks promising, but it gives me some errors, and I have no clue how to fix it. Sep 30, 2016 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 1, 2016 at 1: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. Oct 1, 2016 at 1:17

1 Answer 1

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

3
  • 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! Sep 30, 2016 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 1, 2016 at 6:30
  • Anyway, I greatly appreciate the effort. I will certainly us it, and I think that other people will, when they see it. Oct 1, 2016 at 9:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .