我知道方程式末尾标点符号的问题已经在这里讨论过很多次了(例如这里)然而,据我所知,房间里的大象之一从未真正得到妥善解决:假设我输入以下内容:
\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}