2

I am using a combination of Computer Modern TT and Euler Math for my document:

\usepackage[euler-digits,euler-hat-accent]{eulervm}
\usepackage[T1]{fontenc}
\renewcommand*\familydefault{\ttdefault}
\renewcommand*\sfdefault{\rmdefault}

This works as expected in most cases, but when I use the mathrm command in math mode, the font used is Computer Modern Roman. How to make LaTeX use the same font as the main text instead?

2
  • 1
    there are other ways, but simplest is \renewcommand\mathrm{\mathtt} Commented Jun 26 at 17:39
  • @DavidCarlisle I was afraid to mess things up redefining mathrm directly, but it seems to work, thanks!
    – user325447
    Commented Jun 26 at 17:40

1 Answer 1

1

You want to redeclare the operators symbol font.

\documentclass{article}
\usepackage[euler-digits,euler-hat-accent]{eulervm}
\usepackage[T1]{fontenc}

\renewcommand*\familydefault{\ttdefault}
\renewcommand*\sfdefault{\rmdefault}

\DeclareSymbolFont{operators}{OT1}{\ttdefault}{m}{n}

\begin{document}

$\sin^2\alpha+\cos^2\alpha=1$

$\mathrm{abc}$

\end{document}

enter image description here

1
  • yes I was going to suggest that but suggested redefining \mathrm instead, it depends a bit what you want to happen to upper case Greek and + and other less obvious "operators" Commented Jun 27 at 13:32

You must log in to answer this question.