6. 数学公式中的文字
6.1. \text
命令
要将普通文本放入数学中,最好使用\text
命令而不是’\ mathrm’的命令。 \text
命令确保使用正确的字体大小设置文本。该字体将是当前数学材料之外使用的文本字体。
1\usepackage{amsmath}
2% -------------------------------------------------------------------------------
3\begin{gather}
4\text{Also, if } \Delta_{\text{max up}} = \Delta_{\text{min down}} \notag \\
5\text{(for all ups and downs) then} \notag \\
6\Delta_{\text{sum of ups}} = \Delta_{\text{sum of downs}}
7\end{gather}
6.2. 操作员名称
普通数学功能(例如 *sin *and *log *)和运算符(例如 *min *and *sup *)的名称通常优先区分与斜体中设置的可变名称。因此,它们传统上被视为罗马类型的文本。标准乳胶中有预定义的命令,用于最常见的功能和操作员。 amsmath
软件包足够扩展了此类命令的集合。下表列出了“标准”命令和’amsmath提供的命令。后者以粗体突出显示。当在显示的公式中使用时,斜体设置的那些在极限位置中可能具有下标/上标。
![]() | \arccos | ![]() | \arcsin | ![]() | \arctan |
![]() | \arg | ![]() | \cos | ![]() | \cosh |
![]() | \cot | ![]() | \coth | ![]() | \csc |
![]() | \deg | ![]() | \det | ![]() | \dim |
![]() | \exp | ![]() | \gcd | ![]() | \hom |
![]() | \inf | ![]() | \injlim | ![]() | \ker |
![]() | \lg | ![]() | \lim | ![]() | \liminf |
![]() | \limsup | ![]() | \ln | ![]() | \log |
![]() | \max | ![]() | \min | ![]() | \Pr |
![]() | \projlim | ![]() | \sec | ![]() | \sin |
![]() | \sinh | ![]() | \sup | ![]() | \tan |
![]() | \tanh | ![]() | \varinjlim | ![]() | \varliminf |
![]() | \varlimsup | ![]() | \varprojlim |
1\usepackage[fleqn]{amsmath}
2\newcommand\abs[1]{\lvert#1\rvert}
3\setlength\mathindent{0pt}
4% -------------------------------------------------------------------------------
5\begin{gather*}
6\lim_{x \rightarrow 0} \frac{ \sin^2(x) }{ x^2 } = 1 \\
7\varliminf_{n \rightarrow \infty}
8\abs{a_{n+1}} / \abs{a_n} = 0 \\
9\varinjlim (m_i^\lambda \cdot M)^* \le
10\varprojlim_{A/p \rightarrow \lambda(A)}A_p \le 0
11\end{gather*}
通常事实证明,此列表还不够。 amsmath
软件包定义了定义新“操作员名称”的一般方法。
1\DeclareMathOperator*{cmd}{text}
\declaremathoperator
命令定义cmd
以在“ textual operators”的适当字体中生成text
。如果期望新运算符在限制位置(在显示中使用时使用)的下标/上标,则应使用星级\declaremathoperator
。除了使用合适的字体外,\declaremathoperator
在操作员名称的两侧设置了良好的间距。文本参数是使用“伪文本模式”处理的
- 连字符将打印为文本连字符(而不是减号)(请参阅下一示例中的
\supminus
)。 - 星号字符
*
将打印为凸起的文本星号(不居中)。 - 否则,文本将以数学模式处理,以便忽略空格,并且您可以使用下标、上标和其他元素。
下面的示例显示了如何为新功能名称“ MES”(MEATE)和操作员函数提供命令\sues's \esssup
和\supminus
(两者都在限制位置具有下标/超级字样)。
1\usepackage[fleqn]{amsmath}
2\DeclareMathOperator \meas {meas}
3\DeclareMathOperator*\esssup {ess \, sup}
4\DeclareMathOperator*\supminus{sup - minus*}
5\newcommand\abs [1]{\lvert#1\rvert}
6\newcommand\norm[1]{\lVert#1\rVert}
7% -------------------------------------------------------------------------------
8\begin{gather*}
9 \norm{f}_\infty = \esssup_{x \in R^n} \abs{f(x)} \\
10 \meas_1 \{ u \in R_+^1 \colon f^*(u)>\alpha \} \\
11 \quad \esssup_{x \in R^i} \; \meas_i
12 \{ u \in R^n \colon \abs{f(u)} \geq \alpha \} \\
13 \quad (\forall \alpha \in \supminus_{f^*} R_{*+})
14\end{gather*}
这样的声明必须出现在序言中,并且不可能暂时更改它们。严格来说,`\declaremathoperator“只能用于以前尚未使用的命令名称。要替换现有命令,您必须先删除先前的定义,然后再重新启动它。
1\usepackage{amsmath}
2%% Low-level TeX needed here to cancel the old the definition of \csc:
3\let \csc \relax
4\DeclareMathOperator\csc{cosec}
5\newcommand\calQ{\mathcal{Q}}
6% -------------------------------------------------------------------------------
7\[
8\varlimsup_{n\to\infty} \calQ (u_n, u_n - u^{\#})
9 \ge \csc (\calQ' (u^{\#}))
10\]