答案1
\catcode`@=11
\def\upsim{\mathrel{\mathpalette\upsim@\relax}}
\def\upsim@#1#2{%
\begingroup
\setbox\z@=\hbox{$\m@th#1\uparrow$}%
\vphantom{\raise0.5\dp\z@\copy\z@}% fix the bounding box
\ooalign{\hidewidth\raise0.5\dp\z@\box\z@\hidewidth\cr$\m@th#1\sim$\cr}%
\endgroup
}
\catcode`@=12
$x\upsim y_{x\upsim y}$
\bye
和重叠,但前者略微凸起,以避免冲突\uparrow
。\sim
向下箭头的概括:
\catcode`@=11
\def\upsim{\mathrel{\mathpalette\arrowsim@{\uparrow\raise}}}
\def\downsim{\mathrel{\mathpalette\arrowsim@{\downarrow\lower}}}
\def\arrowsim@#1#2{\arrowsim@@#1#2}
\def\arrowsim@@#1#2#3{%
\begingroup
\setbox\z@=\hbox{$\m@th#1#2$}%
\vphantom{#30.5\dp\z@\copy\z@}% fix the bounding box
\ooalign{\hidewidth#30.5\dp\z@\box\z@\hidewidth\cr$\m@th#1\sim$\cr}%
\endgroup
}
\catcode`@=12
$x\upsim y_{x\upsim y}$
$x\downsim y_{x\downsim y}$
\bye