I am using mtpro2 as the math font in my document (exam class). When I type a quantity using the siunitx package, it displays the unit using italics. I do not want this; instead, I want the units to be upright.

Units are italicized. Undesired.

Units are italicized. Undesired.

Units are upright. Desired.

Units are upright. Desired.

Code that results in italic units.


% standard document packages

% chemistry packages

% math packages

% exam class settings

        \choice \SI{1.5}{\hour}
        \CorrectChoice \SI{2.5}{\hour}
        \choice \SI{3.5}{\hour}
        \choice \SI{4.0}{\hour}

So far, the only "solution" I can determine is to use \text to wrap around the unit. All other attempts have failed, including modifications to \sisetup.

        \choice \SI{1.5}{\text{\hour}}
        \CorrectChoice \SI{2.5}{\text{\hour}}
        \choice \SI{3.5}{\text{\hour}}
        \choice \SI{4.0}{\text{\hour}}

This "solution" is tedious and inelegant as it would require me to go through every inch of my exam and type \text in the units. I would like to use mtpro2, but I need the units to be upright.

How can I redefine the unit in the siunitx package to use upright text globally when implementing mtpro2? Can I define the unit (e.g., hour) to be in baskervald while having the value (e.g., 1.5) remain in mtpro2? The siunitx documentation states quantities are defined as including both value and unit, so this makes me think otherwise.

Edit 1

I included another picture here to demonstrate the problem I have when I leave out \math-rm=\ensuremath. If I leave this code out, the magnitude of the quantity changes from mtpro2 to baskervald, which is undesired. In this case, it does not matter whether I add \unit-mode=text or omit it because the magnitude is in baskervald, not mtpro2.

Magnitude changes; unit upright. Undesirable

Leaving out \math-rm=\ensuremath produces the magnitude in baskervald, not mtpro2. Undesired.

Keeping \math-rm=\ensuremath forces siunitx to use mtpro2 as the font from what I can tell. Adding \unit-mode=text changes the unit from italics to upright since I am guessing it reverts the font from mtpro2 to baskervald specifically for the unit while ignoring the magnitude. Using \unit-mode=text with \math-rm=\ensuremath creates the desired output.

Desired outpt.

Magnitude in mtpro2 and unit upright. Desired output.

Edit 2

It seems several people disagree with using \math-rm=\ensuremath in combination with \unit-mode=text to create this effect. Is there a more appropriate way to achieve the desired output without \math-rm to use mtpro2?


What is the most appropriate way to ensure that the magnitude (e.g., 1.5) of a given quantity is in any desired font while the unit (e.g., h) is in any different desired font using siunitx? Is it possible to make this distinction without using \math-rm?

  • 1
    Does adding option mode=text to sisetup render you the desired output?
    – gusbrs
    Jun 20, 2018 at 0:08
  • 2
    what's the intention of math-rm=\ensuremath ? the default is \mathrm which is an upright font.... Jun 20, 2018 at 0:11
  • 1
    Adding that particular option changes the font of the entire quantity to baskervald. Although it makes the unit upright, the magnitude (e.g., 1.5) is no longer in mtpro2, which is undesired. I want to have the magnitude in mtpro2, so using math-rm=\ensuremath creates that desired effect. Jun 20, 2018 at 0:13
  • 1
    Then unit-mode=text?
    – gusbrs
    Jun 20, 2018 at 0:15
  • 3
    the \ensuremath simply wrong: it specifies to use math italic as the font for things that should be set in roman. that is, it is the cause of the problem that you ask about. Jun 20, 2018 at 0:31

1 Answer 1


You can select \mathnormal in place of \mathrm with for example

unit-math-rm = \mathnormal

This is a documented possibility: some fonts don't have quite the right set up for \mathrm to work.

  • 1
    This option is removed in version 3 of the package. I don't know if unit-font-command = \mathnormal is the replacement.
    – quark67
    Feb 27, 2023 at 23:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .