I have the following equation:
<trigger threshold> = average - (<trigger fraction> * average)
I want to print this in math mode in a very specific way: <trigger threshold>
and <trigger fraction>
need to be in a fixed-width font. They should appear exactly as they do in this paragraph. I can't figure out how to get LaTeX to ignore < and > and still print in a fixed-width font. Things I've tried:
\[ \mathtt{<trigger threshold>} = \mathrm{average} - (\mathtt{<trigger fraction>} * \mathrm{average}) \]
The above doesn't work for 2 reasons: the < and > symbols are interpreted as less than and greater than, and also, there is no space between the words "trigger" and "threshold". Another attempt:
\[ \mathtt{\mathrm{<trigger threshold>}} = \mathrm{average} - (\mathtt{\mathrm{<trigger fraction>}} * \mathrm{average}) \]
Here, trigger threshold doesn't appear with a space and also doesn't appear in a fixed-width font. I've played around with a lot of things, but I just can't get this. I'm guessing I may have to resort to a package to do this, but I'm not sure where to look. Does anyone know how to accomplish this?
Best Answer
You could just use a text-version of "
tt
", called\texttt
:In the above example I've included both, just to show you that you can mix and match what you want. However, if you're interested in such things on a more global scale, it's best to define something like
and then use
See Consistent typography. If you're not using a macro-form, a plain short-hand
\verb
also suffices.