5

I have an equation within the statement of one of my theorems. Within this equation, I have some text to name a function. However, when this equation appears within the theorem environment, the output treats each letter of my function name as though it were a variable. How can I fix this?

\documentclass[11pt]{article}
\usepackage{amsmath}
\newtheorem{theorem}{Theorem}

\begin{document}

$\text{Function}(x) = 1$

\begin{theorem}
$\text{Function}(x) = 1$
\end{theorem}

\end{document}

output

1 Answers1

3

\text honors the surrounding font. A better approach to get the desired font and the proper spacing is to use \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}

enter image description here

Gonzalo Medina
  • 505,128