仅在显示样式中缩放符号

仅在显示样式中缩放符号

是否可以缩放符号使用其默认名称仅在显示样式中?

例如,当调用时\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}

在此处输入图片描述

相关内容