[Tex/LaTex] Adjunction arrows

math-mode

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?

Best Answer

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

Related Question