使用 \stackrel 定义一个符号,它可以内联工作,而不会改变行高

使用 \stackrel 定义一个符号,它可以内联工作,而不会改变行高

在此处输入图片描述

\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没有起作用。

相关内容