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

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).
\texttt{\detokenize{a^2+b^2=c^2}}do the job? Maybe How to typset the symbol “^” (caret/circumflex/hat) is useful to you here? – Dai Bowen Dec 07 '16 at 00:34\verb|a^2+b^2=c^2|would be the usual way – David Carlisle Dec 07 '16 at 00:58\verbis just a basic latex command, the question must be a duplicate i'll see if i can find a suitable question... – David Carlisle Dec 07 '16 at 07:49