When writing a equation, sometimes we need write letters non-italic. For example, let A be a matrix and its transpose should be A^{\mathrm{T}} instead of A^T. In addition, if a letter does not represent a variable, it should not be italic either.

My question is: there are several ways such as \mathrm{} and \mbox{}. They will give slightly different results. Let's take the transpose of a matrix for example. Which one should we use? A^{\mbox{T}} or A^{\mathrm{T}}? What is the convention when writing technique papers?


First of all you should use the amsmath package, that makes commands such as \textrm to respect the sizes for subscripts and superscripts.

What's the difference between \mathrm and \textrm? The former chooses a math alphabet, that is a fixed combination of font attributes, typically

  • Encoding: OT1
  • Family: default Roman family (\rmdefault)
  • Weight: medium
  • Shape: normal

The latter (\textrm) builds a box in which \rmfamily is issued but, like every \text... command, all other font attributes are unchanged with respect to the font which is current outside the formula. So, with the following input

A test $a^\textrm{test}$

\itshape A test $a^\textrm{test}$

the first "test" will be upright and the second one will be in italics. In a boldface context, the bold series attribute will not change.

The command \text will simply choose the font which is current outside the formula.

Another difference is that \math... commands ignore spaces in their argument, while \text... commands don't.

If your problem is to insert letters which don't represent mathematical variables, usually as subscript, say "efficient force" Feff, you should use \textnormal or \mathrm (the latter has limitations about what characters one can use, to wit, only unadorned Latin letters):


So, for your transpose operator, you can use \mathrm{T}, probably hidden in a personal command:


and $A^\transp$ for "the transpose of A". For more complicated input, \textnormal will be the better choice.

To the contrary, for textual insertion in formulas such as

a = b \quad\text{if and only if}\quad b = a

you should use \text, so that this will inherit the surrounding font attributes.


use always the macro \text{..} from package amsmath. It takes the surrounding text size into account and uses the text font. Compare:



enter image description here

  • 1
    Thank you for the answer. But under what circumstance should we use \mathrm{xxx}? It seems \mathrm{xxx} also gives reasonable results. In addition, if the font size is a problem for \mbox, we may use \scriptsize to solve it. Anyway, I am wondering which one do people use in technique papers. Or people just use whatever they want? Thanks. – Shiyu Dec 31 '12 at 9:12
  • 3
    \mathrm uses the math font in upright mode and should be used for operators when not defined with \mathop. For text like characters I use always \text – user2478 Dec 31 '12 at 9:35
  • 1
    \text will use the font which is current outside the formula. – egreg Dec 31 '12 at 11:06
  • 2
    I'd say the T here is more of an operator, just not placed in the conventional place as other operators, and therefore should be set in \mathrm. \text is for labels that do not have inherent mathematical meaning. – Siyuan Ren Dec 31 '12 at 11:09
  • Also \text{} allows space. $A^{\text{power two}}\neq A^{\mathrm{power one}}$. – Sigur Dec 31 '12 at 11:13

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.