![\[ c^2 = a^2 + b^2 \text{,} \] 难道不比 \[ c^2 = a^2 + b^2 , \] 更好吗?](https://linux22.com/image/463939/%5C%5B%20c%5E2%20%3D%20a%5E2%20%2B%20b%5E2%20%5Ctext%7B%2C%7D%20%5C%5D%20%E9%9A%BE%E9%81%93%E4%B8%8D%E6%AF%94%20%5C%5B%20c%5E2%20%3D%20a%5E2%20%2B%20b%5E2%20%2C%20%5C%5D%20%E6%9B%B4%E5%A5%BD%E5%90%97%EF%BC%9F.png)
我知道方程式末尾标点符号的问题已经在这里讨论过很多次了(例如这里)然而,据我所知,房间里的大象之一从未真正得到妥善解决:假设我输入以下内容:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Consider the Pythagorean identity
\begin{equation*}
c^2 = a^2 + b^2,
\end{equation*}
and let us try to generalize it to non-right triangles.
\end{document}
然后等式末尾的逗号将从数学字体,而不是文本字体,文档中的所有内联逗号都将从该字体中取出。根据您的字体设置,这两个逗号可能看起来完全不同。
此外,假设这发生在定理环境中:
\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
Consider the Pythagorean identity
\begin{equation*}
c^2 = a^2 + b^2,
\end{equation*}
and let us try to generalize it to non-right triangles.
\begin{theorem}
If \( \gamma \)~denotes the angle of the triangle, we have
\begin{equation*}
c^2 = a^2 + b^2 - 2ab \cos(\gamma),
\end{equation*}
which generalizes the usual Pythagorean identity.
\end{theorem}
\end{document}
看,第一个逗号是斜体,而第二个不是!这真的是应该的样子吗?我不应该\text{,}
在显示的数学中一致使用吗?
换句话说,以下不是更好的解决方案吗?
\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
Consider the Pythagorean identity
\begin{equation*}
c^2 = a^2 + b^2 \text{,}
\end{equation*}
and let us try to generalize it to non-right triangles.
\begin{theorem}
If \( \gamma \)~denotes the angle of the triangle, we have
\begin{equation*}
c^2 = a^2 + b^2 - 2ab \cos(\gamma)
\text{,}
\end{equation*}
which generalizes the usual Pythagorean identity.
\end{theorem}
\end{document}