2

Recently, I learned about the command \texttt{...} from Werner's (very nice) answer here.

Here is a basic example Werner gives:

\documentclass{article}
\usepackage{courier}
\begin{document}
This is not Courier font. \texttt{This is Courier font.}
\end{document}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

which produces

Typewriter font in LaTeX

How can I use the same idea to describe a math equation? For example, I want to see exactly a^2+b^2 = c^2 in Courier font. Trying \texttt{a^2+b^2=c^2} doesn't work because texttt doesn't seem to interact well with the math mode. But I precisely don't want to use double dollar signs because it displays the expression a^2+b^2=c^2 in math mode, but I explicitly want to see the symbols ^.

For those curious, this is supposed to represent a mathematical input to a software, so I precisely want to write a^2+b^2=c^2 (in Courier font).

Prism
  • 529

0 Answers0