I would like to ask about a nifty macro for the following operator from category theory, to be used to denote comma categories:
It takes two arguments, such as (category, object), (object, functor), (functor, functor) etc.. An example of the symbol in use is as follows: For $B$ a topological space,
denotes the comma category of topological bundles with base space $B$, whose objects are pairs $(E,p)$ where $E$ is a topological space and $p:E\to B$ is a continuous map, and whose arrows$\phi:(E,p)\to (F,q)$ are continuous $\phi:E\to F$ such that $q\circ \phi=p$.
As for properties, it should be scalable, vertically and horizontally (independently), and it should have a reflection like so (for convenience):
I have no experience in creating macros of this complexity, so I would appreciate a full example, but just suggestions are welcome as well. Thank you for your time.
Edit: Using egreg's answer and this tex.SE entry I came up with my own version, in case someone else wants to use this notation as well, but can not be bothered adjusting the height of the stair. I got rid of the third adjustment argument of egreg's version and employed the package cellspace instead:
\documentclass{article}
\usepackage{amsmath,hhline}
\usepackage{amssymb,faktor}
\usepackage{cellspace}
\setlength\cellspacetoplimit{1pt}
\setlength\cellspacebottomlimit{1pt}
\newcommand{\cat}[1]{\mathbf{#1}} % or whatever YOU like
\newcommand{\rcom}[2]{%
\begingroup
\renewcommand{\arraystretch}{1}%
\setlength{\arraycolsep}{2pt}%
\begin{array}{Sr|Sl}
\hhline{~|-}
${#1}$ & ${#2}$\\
\hhline{-|~}
\end{array}%
\endgroup
}
\newcommand{\lcom}[2]{%
\begingroup
\renewcommand{\arraystretch}{1}%
\setlength{\arraycolsep}{2pt}%
\begin{array}{r|l}
\hhline{-|~}
#1\\
\hhline{~|-}
\end{array}%
\endgroup
}
\begin{document}
$\lcom{\overline{\underline{R}}}{\cat{Rng}}$\\
$\rcom{\cat{Ab}}{\faktor{G}{H}}$\\
$\rcom{\underline{\cat{Top}}}{\widetilde{G}}$\\
$\rcom{\cat{Ab}}{\dfrac{G}{H}}$
\end{document}