找回密码
 快速注册
搜索
查看: 2419|回复: 0

扯一下 mod

[复制链接]

730

主题

1万

回帖

9万

积分

积分
93593
QQ

显示全部楼层

kuing 发表于 2018-7-14 16:10 |阅读模式
加载了 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
其余的是字面义就不解释了

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 12:03

Powered by Discuz!

× 快速回复 返回顶部 返回列表