stackengine 下标大小

stackengine 下标大小

没有使用 stackengine 包获取正确的下标大小,请查找 MWE 文件如下:

\documentclass{book}

\usepackage{stackengine}
\newcommand{\Utildesim}[1]{%
  \ensurestackMath{\stackengine{1pt}{#1}{\sim}{U}{c}{F}{F}{S}}\vphantom{#1}%
}

\begin{document}
\noindent{}${\Utildesim{\mathrm{A}}} (x )$and the symbol $\mu _{\Utildesim{\mathrm{A}}} (x )$ is the degree of membership of element \textit{x} in fuzzy set $\Utildesim{\mathrm{A}}$. Therefore, $\mu _{\Utildesim{\mathrm{A}}} (x )$ is a value on the unit interval that measures the degree to which element \textit{x} belongs to fuzzy set $\Utildesim{\mathrm{A}}$; equivalently, $\mu _{\Utildesim{\mathrm{A}}} (x )$ = degree to which $x\in \protect\Utildesim{\mathrm{A}}$.
\end{document}

在此处输入图片描述

答案1

确实,stackengine不会保留调用时当前的数学样式。一种解决方案是另外使用scalerel包的功能(即\ThisStyle{...\SavedStyle...})在堆栈中保存和恢复当前数学样式(如果需要)。

此外,我将堆栈间隙设置为1\LMpt,在内部\ThisStyle,将其设置为 1pt 的标称值,但缩放到当前数学样式的大小。

\documentclass{book}

\usepackage{stackengine,scalerel}
\newcommand{\Utildesim}[1]{\ThisStyle{%
  \ensurestackMath{\stackengine{1\LMpt}{\SavedStyle#1}{\SavedStyle\sim}
  {U}{c}{F}{F}{S}}\vphantom{#1}}}

\begin{document}
\noindent{}${\Utildesim{\mathrm{A}}} (x )$and the symbol $\mu _{\Utildesim{\mathrm{A}}} (x )$ is the degree of membership of element \textit{x} in fuzzy set $\Utildesim{\mathrm{A}}$. Therefore, $\mu _{\Utildesim{\mathrm{A}}} (x )$ is a value on the unit interval that measures the degree to which element \textit{x} belongs to fuzzy set $\Utildesim{\mathrm{A}}$; equivalently, $\mu _{\Utildesim{\mathrm{A}}} (x )$ = degree to which $x\in \protect\Utildesim{\mathrm{A}}$.
\end{document}

在此处输入图片描述

相关内容