
次の積分記号を LaTeX で作成するにはどうすればよいですか?
積分と極限の作り方は知っています。線を引く方法がわかりません。
答え1
エントリーのコードを使用する主値積分記号(マクロを定義する\dashint
)TeXに関するよくある質問\lowdashint
出発点として、と という2 つの新しいマクロを定義するのは比較的簡単です。\highdashint
これらのマクロは、「ダッシュ」記号 (実際には「マイナス」記号) を よりもそれぞれ少し低く、少し高く配置します\dashint
。
以下のコードでは、マクロ\lowdashint
とが、\highdashint
表示スタイルとテキスト スタイルの数式モードに対してのみ設定されています。(これらが、第 1 レベル、ましてや第 2 レベルの下付き文字や上付き文字の式で発生するとは考えられません。ただし、この仮定が無効である場合はお知らせください。)
もちろん、ダッシュの垂直位置 ( コマンドの引数を参照) は、自分のスタイルの好みに合わせて自由に変更でき\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
数式文字にバーを配置する 1 つの方法は、以下で定義した 2 つのコマンドを使用することです\ooalign.
。最初の数値は積分記号上のバーの高さを制御し、2 番目の数値はバーの長さを制御し、3 番目の数値はバーの太さを制御します。
\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}
これらをきれいに見せるには、次の回答も読んでみてください:大きな積分記号