![仅在显示样式中缩放符号](https://linux22.com/image/425866/%E4%BB%85%E5%9C%A8%E6%98%BE%E7%A4%BA%E6%A0%B7%E5%BC%8F%E4%B8%AD%E7%BC%A9%E6%94%BE%E7%AC%A6%E5%8F%B7.png)
是否可以缩放符号使用其默认名称仅在显示样式中?
例如,当调用时\int_{a}^{b}
,结果应该是
\mathlarger{\mathlarger{\int}}_{a}^{b}
在 displaystyle 数学中以及在内联数学中用两个\mathlarger
(来自包)进行缩放?relsize
\int_{a}^{b}
\documentclass{article}
\usepackage{amsmath}
\usepackage{relsize}
\begin{document}
Redefine \texttt{\textbackslash int} so that its scaled version is
used only in displaystyle math.
\[
\mathlarger{\mathlarger{\int}}_{a}^{b}
\]
$\int_{a}^{b}$
\end{document}
答案1
不支持\limits
和\nolimits
,抱歉。可以添加,但我不建议使用这么大的符号。
\documentclass{article}
\usepackage{amsmath}
\usepackage{relsize}
%\usepackage{xparse} % uncomment if running LaTeX prior than the 2020-10-01 release
\RenewDocumentCommand{\int}{e{^_}}{%
\mathchoice
{\expanded{\noexpand\mathlarger{\noexpand\mathlarger\intop}\nolimits
\IfValueT{#2}{_{\unexpanded{#2}}}\IfValueT{#1}{^{\unexpanded{#1}}}}}
{\intop\IfValueT{#1}{^{#1}}\IfValueT{#2}{_{#2}}}
{\intop\IfValueT{#1}{^{#1}}\IfValueT{#2}{_{#2}}}
{\intop\IfValueT{#1}{^{#1}}\IfValueT{#2}{_{#2}}}
}
\begin{document}
Redefine \texttt{\textbackslash int} so that its scaled version is
used only in displaystyle math.
\[
\mathlarger{\mathlarger{\intop}}\nolimits_a^b
\]
\[
\int_{a}^{b}
\]
$\int_{a}^{b}$
\end{document}