![使用 \stackrel 定义一个符号,它可以内联工作,而不会改变行高](https://linux22.com/image/342885/%E4%BD%BF%E7%94%A8%20%5Cstackrel%20%E5%AE%9A%E4%B9%89%E4%B8%80%E4%B8%AA%E7%AC%A6%E5%8F%B7%EF%BC%8C%E5%AE%83%E5%8F%AF%E4%BB%A5%E5%86%85%E8%81%94%E5%B7%A5%E4%BD%9C%EF%BC%8C%E8%80%8C%E4%B8%8D%E4%BC%9A%E6%94%B9%E5%8F%98%E8%A1%8C%E9%AB%98.png)
\documentclass{article}
\usepackage[margin=6cm]{geometry}
\usepackage{graphicx}
\newcommand\mysymbol
{\ensuremath{\stackrel{(\mathsf{lin})}{\longrightarrow_{(1)}}}}
\begin{document}
This is an example of what happens and what I want.
I want this: \mysymbol\ to be inline but not to
change the vertical line spacing. However, with
\verb|\smash| I get $\smash{\mysymbol}$, which is
not what I want. I want to change the symbol so it
fits in a line, not to change the line so it
superposes the symbol with another line. For example,
\verb|\scalebox{1}[0.6]{\mysymbol}| almost works, but
looks awful: \scalebox{1}[0.6]{\mysymbol}, and also
changes the symbol. The most important would be not
to change the shape of the \verb|\longrightarrow_{(1)}|.
\end{document}
有什么建议吗?
答案1
虽然很严格,但似乎有效:
\documentclass{article}
\usepackage[margin=6cm]{geometry}
\usepackage{amsmath}
\newcommand{\linto}[1]{%
\overset{\scriptscriptstyle\smash{(\mathsf{lin})}\vphantom{x}}{\longrightarrow_{(#1)}}%
}
\begin{document}
\lineskip=30pt % would kick in if lines have to be spread
This is an example of what happens and what I want.
I want this: $\linto{1}$ to be inline but not to
change the vertical line spacing.
\noindent
pypypypy\\
$\linto{1}$
\end{document}
设置为高\lineskip
是为了表明线条必须放大。如果没有,\smash
我们会得到
所以我们看到\smash
参数\lineskip
没有起作用。