帶有高低破折號的積分符號

帶有高低破折號的積分符號

如何在 Latex 中製作以下積分符號?

在此輸入影像描述 在此輸入影像描述

我知道如何求積分和極限。我不知道如何用穿過它的線來製作它。

答案1

使用條目中的程式碼主值積分符號(定義宏\dashint)在TeX 常見問題作為起點,定義兩個新宏\lowdashint和是相當簡單的\highdashint,它們分別放置一個「破折號」符號(實際上是一個「減號」符號),分別比它低一點和高一點\dashint

在下面的程式碼中,巨集\lowdashint\highdashint僅為顯示樣式和文字樣式數學模式設定。 (我無法想像它們會出現在第一層的表達式中,更不用說第二層的下標和上標了。但是,請告訴我這個假設是否無效。)

當然,您應該隨意更改破折號的垂直位置(請參閱\lower\raise命令的參數)以適應您的風格偏好。

在此輸入影像描述

\documentclass{article}
\usepackage{booktabs,amsmath}
\def\Xint#1{\mathchoice
    {\XXint\displaystyle\textstyle{#1}}%
    {\XXint\textstyle\scriptstyle{#1}}%
    {\XXint\scriptstyle\scriptscriptstyle{#1}}%
    {\XXint\scriptscriptstyle\scriptscriptstyle{#1}}%
      \!\int}
\def\XXint#1#2#3{{\setbox0=\hbox{$#1{#2#3}{\int}$}
    \vcenter{\hbox{$#2#3$}}\kern-.5\wd0}}
\def\dashint{\Xint-}

\def\Yint#1{\mathchoice
    {\YYint\displaystyle\textstyle{#1}}%
    {\YYYint\textstyle\scriptscriptstyle{#1}}%
    {}{}%
    \!\int}
\def\YYint#1#2#3{{\setbox0=\hbox{$#1{#2#3}{\int}$}
    \lower1ex\hbox{$#2#3$}\kern-.46\wd0}}
\def\YYYint#1#2#3{{\setbox0=\hbox{$#1{#2#3}{\int}$}
    \lower0.35ex\hbox{$#2#3$}\kern-.48\wd0}}
\def\lowdashint{\Yint-}

\def\Zint#1{\mathchoice
    {\ZZint\displaystyle\textstyle{#1}}%
    {\ZZZint\textstyle\scriptscriptstyle{#1}}%
    {}{}%
    \!\int}
\def\ZZint#1#2#3{{\setbox0=\hbox{$#1{#2#3}{\int}$}
    \raise1.15ex\hbox{$#2#3$}\kern-.57\wd0}}
\def\ZZZint#1#2#3{{\setbox0=\hbox{$#1{#2#3}{\int}$}
    \raise0.85ex\hbox{$#2#3$}\kern-.53\wd0}}
\def\highdashint{\Zint-}

\begin{document}
$\begin{array}{@{}lccc@{}}
\toprule
\text{Math mode} & \multicolumn{3}{c@{}}{\text{Integral symbol}}\\
\cmidrule(l){2-4}
& \texttt{\string\lowdashint} 
& \texttt{\string\highdashint}
& \texttt{\string\dashint} \\
\midrule
\texttt{\string\displaystyle} 
& \displaystyle \lowdashint_M f
& \displaystyle \highdashint_M f
& \displaystyle \dashint_M f \\[4ex]
\texttt{\string\textstyle} 
& \lowdashint_M f
& \highdashint_M f
& \dashint_M f \\
\bottomrule
\end{array}$
\end{document}

答案2

透過數學字元放置條形的一種方法是使用\ooalign.在下面定義的兩個命令中,第一個數字控制條形在積分符號上的高度,第二個數字控制條形的長度,第三個數字控制條形的厚度酒吧的。

\documentclass{article}

\newcommand{\stI}{%
\ooalign{\hidewidth $\int$\hidewidth\cr\rule[1.1ex]
{1ex}{.4pt}}}

\newcommand{\stII}{%
\ooalign{\hidewidth $\int$\hidewidth\cr\rule[-0.1ex]
{1ex}{.4pt}}}

\begin{document}
\[\stI_m f\]
\[\stII_m f(x)\]
\end{document}

為了讓這些看起來不錯,您可能還想閱讀這個答案:大積分符號

相關內容