定理環境内での \text の失敗

定理環境内での \text の失敗

定理の 1 つのステートメント内に方程式があります。この方程式内に、関数に名前を付けるテキストがあります。ただし、この方程式が定理環境内に表示されると、出力では関数名の各文字が変数であるかのように扱われます。これを修正するにはどうすればよいですか?

\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}

ここに画像の説明を入力してください

関連情報