Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there any way of modifying the preamble, so instead of typing

$\mathtt{x}$ ...
    \mathtt{y} & \mathtt{=} & \mathtt{z^\pi}

I can omit the \mathtt{...} commands?

share|improve this question
Have a look at the \everymath command, and also eqnarray-vs-align for reasons to avoid eqnarray – cmhughes Jul 11 '12 at 16:46

1 Answer 1

up vote 12 down vote accepted

You can add


to the document preamble (or the part of the document where you need this)



if you need display math as well.

In then in addition you may need to force the initialisation by putting

\setbox0\hbox{$ $} 

in the preamble otherwise the first expression may not be initialised correctly. This just makes an empty math expression on a box and discards it to avoid the problem.

share|improve this answer
This is great, thank you. How would I reset the presentation of math LaTeX for later use? E.g. if I want monospace for some math blocks in a document using your solution, but want the default math presentation for everywhere else in the document? – Rob Stewart Jul 1 at 10:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.