
我在我的一個定理的陳述中有一個方程式。在這個方程中,我有一些文字來命名一個函數。但是,當方程式出現在定理環境中時,輸出會將函數名稱的每個字母視為變數。我怎樣才能解決這個問題?
\documentclass[11pt]{article}
\usepackage{amsmath}
\newtheorem{theorem}{Theorem}
\begin{document}
$\text{Function}(x) = 1$
\begin{theorem}
$\text{Function}(x) = 1$
\end{theorem}
\end{document}
答案1
\text
尊重周圍的字體。獲得所需字體和適當間距的更好方法是使用\DeclareMathOperator
:
\documentclass[11pt]{article}
\usepackage{amsmath}
\newtheorem{theorem}{Theorem}
\DeclareMathOperator{\Func}{Function}
\begin{document}
$\text{Function}(x) = 1\quad\Func(x) = 1$
\begin{theorem}
$\text{Function}(x) = 1\quad\Func(x) = 1$
\end{theorem}
\end{document}