1

In a previous question here I basically asked how to change the default mathmode font to lmodern. I had a good answer but partial however, I was recommended to create another post to solve the issue. My problem is that the function created to change the font does only apply on text that is written in exponent or index like below in the image but not on the text written on a normal line. How do we solve this ? I don't want the default mathmode font at all when i type text in any math environments.

enter image description here

1 Answer 1

4

enter image description here

\documentclass{article}

\usepackage{lmodern}
\everymath{\fam=0\relax}

\begin{document}


zzz $something_{anything}^{anything}$

\end{document}

This effectively adds \mathrm{...} around every math formula.

3
  • Nice thanks, if i want to type a formula with \equation environment it goes back to standard mathmode font. I finally understand that i just have to type \rm in the environnment to get out of this. Thank you Feb 25 at 21:16
  • \rm is not defined by default in latex, you can use \everydisplay as well as \everymath and set \fam in both. @BachirHassaine Feb 25 at 21:19
  • thank you it's awesome Feb 26 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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