答案1
堆栈注释?有人提到堆栈了吗?
\documentclass{article}
\usepackage{stackengine,amsmath,graphicx}
\stackMath
\newcommand\triar[3]{%
\vcenter{\hbox{$%
#1%
\setbox0=\hbox{$\rightarrow#3\leftarrow$\kern-4pt}%
\stackunder[0pt]{\xrightarrow{\kern\wd0}}%
{%
\rotatebox[origin=r]{-20}{$\rightarrow$}%
\raisebox{-2pt}{$#3$}%
\rotatebox[origin=l]{+20}{$\leftarrow$}%
}%
#2%
$}}%
}
\begin{document}
whose objects are $\mathcal{P}$ morphisms to $Y$, with
\(
\left\{\triar{X_i}{X}{Y}\right\}
\)\medskip
but not this:
\(
\left\{\triar{X_i}{X}{Y_\text{long middle element}}\right\}
\)
\end{document}
答案2
和tikz-cd
:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\newcommand{\tricd}[3]{%
\begin{tikzcd}[
baseline={([yshift=-axis_height]mycd)},
ampersand replacement=\&,
every matrix/.append style={
name=mycd,
nodes={inner sep=0pt, outer sep=2pt}
},
row sep=0pt, column sep=12pt
]
#1\ar[rr]\ar[to=mycd-2-2.west]\&\\ar[to=mycd-2-2.east]\\
\
\end{tikzcd}%
}
\begin{document}
whose objects are $\mathcal{P}$ morphisms to $Y$, with
\(
\left\{\tricd{X_i}{X}{Y}\right\}
\)\medskip
but not this:
\(
\left\{\tricd{X_i}{X}{Y_\text{long middle element}}\right\}
\)
\end{document}
PS = 感谢 Qrrbrbirlbel他们的解决方案垂直对齐问题。