無數學模式的顯示模式

無數學模式的顯示模式

首先,如果這個問題的答案是眾所周知的,我想表示歉意。但經過一番搜索,我找不到任何類似的問題。

在我的文檔中,我想使用display mode.例如我想顯示下面的句子:

\begin{equation}
\textrm{All }x\textrm{ are }y;\textrm{ all }y\textrm{ are }z;\textrm{ therefore, all }x\textrm{ are }z.
\end{equation}

我通過使用\begin{equation}命令生成了它。但是,請注意,使用此命令時,會自動包含數學模式,因此我的句子將變為斜體,除非我將除變數之外的所有內容都包裝在\textrm{...}.在這種情況下,我認為如果我可以做相反的事情會更好:「關閉」數學模式(所以我不需要\textrm{...}),並只用 包裝我的變數$$

有誰知道沒有自動啟用數學模式的替代方案\begin{equation}和環境?\begin{align}

感謝您的幫忙!

答案1

我會\text這樣使用:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
  \text{All $x$ are $y$; all $y$ are $z$; therefore, all $x$ are $z$.}
\end{equation}

\end{document}

相關內容