免費論壇 繁體 | 簡體
Sclub交友聊天~加入聊天室當版主
分享
返回列表 发帖

扯一下 mod

加载了 amsmath 之后,关于 mod 有四个命令:
5.2 \mod and its relatives
Commands \mod, \bmod, \pmod, \pod are provided to deal with the special
spacing conventions of “mod” notation. \bmod and \pmod are available in LATEX,
but with the amsmath package the spacing of \pmod will adjust to a smaller value
if it’s used in a non-display-mode formula. \mod and \pod are variants of \pmod
preferred by some authors; \mod omits the parentheses, whereas \pod omits the
“mod” and retains the parentheses.

\bmod  - 最细间距,无括号,不分行间行内
\pmod  - 有括号,行间间距大,行内间距稍小
\mod  - 无括号,其余同 \pmod
\pod  - 无 mod ,其余同 \pmod

测试效果
\begin{align*}
& \gcd(n,m\bmod n)\\
& x\equiv y\pmod b\\
& x\equiv y\mod c\\
& x\equiv y\pod d
\end{align*}$\gcd(n,m\bmod n)$
$x\equiv y\pmod b$
$x\equiv y\mod c$
$x\equiv y\pod d$

代码:
  1. \begin{align*}
  2. & \gcd(n,m\bmod n)\\
  3. & x\equiv y\pmod b\\
  4. & x\equiv y\mod c\\
  5. & x\equiv y\pod d
  6. \end{align*}
  7. $\gcd(n,m\bmod n)$
  8. $x\equiv y\pmod b$
  9. $x\equiv y\mod c$
  10. $x\equiv y\pod d$
复制代码
如果想了解得更清楚,可以看看它们在 amsmath.sty 内的定义:
  1. \renewcommand{\bmod}{\nonscript\mskip-\medmuskip\mkern5mu\mathbin
  2.   {\operator@font mod}\penalty900
  3.   \mkern5mu\nonscript\mskip-\medmuskip}
  4. \newcommand{\pod}[1]{\allowbreak
  5.   \if@display\mkern18mu\else\mkern8mu\fi(#1)}
  6. \renewcommand{\pmod}[1]{\pod{{\operator@font mod}\mkern6mu#1}}
  7. \newcommand{\mod}[1]{\allowbreak\if@display\mkern18mu
  8.   \else\mkern12mu\fi{\operator@font mod}\,\,#1}
复制代码
\nonscript:在标号及小标号中忽略随后的粘连或 kern
\allowbreak:允许断行,其定义为 \penalty0
其余的是字面义就不解释了
分享到: QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
$\href{https://kuingggg.github.io/}{\text{About Me}}$

返回列表 回复 发帖