I want to typeset some category-theoretic calculations involving adjunctions (sometimes called two-way rules).
In short, they look approximately like this (MWE):
\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
C &\longrightarrow FD\\
\line(1,0){75}&\line(1,0){75}\\
GC &\longrightarrow D\\
\line(1,0){75}&\line(1,0){75}\\
1 &\longrightarrow D^{GC}
\end{align*}
\end{document}
Of course, this looks horrendous, but it should get the approximate idea across.
I would like to have an environment (called, say, adjunctions
) which allows me to input the above as, e.g.:
\begin{adjunctions}
C & FD \\
GC & D \\
1 & D^{GC}
\end{adjunctions}
There are several things that I need:
- An option to set the width of the lines (which is universal throughout the environment), perhaps with the possibility to make them asymmetrical (i.e. longer to the left than to the right);
- Proper spacing; in the example above, the spacing between
GC \to D
and the line above it is about what I'm looking for, both top and bottom-margin; - Optionally, control over the symbol going at the place of
\longrightarrow
(universal throughout the environment is fine).
I have looked around on the internet, but I couldn't find anything (not even a properly typeset image). General references for creating custom align
-like environments are also very much appreciated.