[Tex/LaTex] \mathrm not working with \documentclass{elsarticle}

elsarticlesymbolstimestxfonts

I am trying to type a non-italiac \mu in a inline math mode. The problem is related to the use of the elsarticle class. The normal method using \mathrm{} is not working.

Here is a MWM:

\documentclass[5p,times,hidelinks]{elsarticle}
\begin{document}
    normal math mode $\mu$ \\
    mathrm $\mathrm{\mu}$ \\
\end{document}

That on my computer returns

enter image description here

Best Answer

Your code can't work because \mathrm is designed to work with Latin, not Greek, letters.

If the elsarticle package is loaded with the option times, the txfonts text and math font package is loaded. To generate upright Greek letters, the txfonts package provides the -up suffix method: $\alphaup$, $\betaup$, etc. For the txfonts case, $\muup$ and \si{\micro} (with \si being a macro of the siunitx package) produce the same output.

enter image description here

\documentclass[5p,times,hidelinks]{elsarticle}
\usepackage{siunitx}
\begin{document}
slanted $\mu$ 

upright $\muup$

siunitx \si{\micro}
\end{document}