I am wondering when to use roman or italic font in math mode. I found that variables should be italicized and functions like max should be put in roman.

I found some sites on the topic, e.g. this or this, but I still have some uncertainties. Somewhere else I found that concrete entities should be put in roman font.

  • I am not sure what a concrete entity is.
  • In the following example: should letter or startmarker etc. appear in roman font?
  • The subscript free is not a variable, but descriptional text. Thus, it should be romanized?

Picture of some formulas I defined, for which I'd like formatting advice

Edit 1: The formulas startmarker, letter, only etc. are abbreviations for formulas in some logic such as First Order Logic.

  • 1
    Using words as variables is SOP in programming, but not math. Using words in subscripts is okay. Jun 9, 2015 at 13:51
  • 1
    Put every text in \text{}, every variable is italicized by default, and each constant (concrete entity) like e or pi can be set \mathrm{e}. No rule for that but personally I strongly recommend that. Just try to distinguish between text and math. Right now, your are writing "f times r times e times e" in your subscript. Most people set functions and operators upright as well: \sin\max\mathrm{d}x... (Off topic: you forgot the spaces after your \equiv)
    – LaRiFaRi
    Jun 9, 2015 at 13:51
  • 1
    Please tell us what the meaning of "only", "letter", "startmarker", and "endmarker" is: are they names of variables, operators (like "sin" and "log"), constants (like the base of the natural logarithms), or something else?
    – Mico
    Jun 9, 2015 at 13:53
  • 2
    never use the default math italic for multi-letter words so never $only$ if you need italic words in math use $\mathit{only}$ Jun 9, 2015 at 14:27
  • @JohnKormylo: I prefer to have speaking names, as I use many more such formulas. @David Carlisle: I put all words in formulas in \mathit. @LaRiFaRi: Thanks for the remark Jun 9, 2015 at 14:55

1 Answer 1


This is going to be opinion-based, so I'll first suggest a strategy for typing your document.


\newcommand{\func}[1]{\operatorname{\mathit{#1}}}  % or \mathrm
\newcommand{\const}[1]{\mathit{#1}}                % or \mathrm
\newcommand{\wsub}[1]{\mathrm{#1}}                 % 'word' subscript

Then you can type


Of course you can add shorthands for the functions you use most often

  \if\relax\detokenize{#1}\relax _{\wsub{#1}}\fi

and the above formulas would be


The definition of \only with an optional textual subscript can be simpler if xparse is used:


Or you can opt for an even simpler \newcommand{\only}{\func{only}} and type


Now my opinions. A function such as startmarker is not a “standard” function like max, log or sin. Those function names should always be typeset upright in order to emphasize their “fixed” meaning. The function you define in your document are not of universal use, so you can choose between upright or italic. Just be consistent and that's the purpose of the definitions I propose.

If you later decide that functions such as startmarker should be typeset upright, just remove \mathit from the definition of \func (or replace it by \mathrm, but since we are already under \operatorname this is not needed).

For constants it's a similar problem. I never typeset constants upright (that's something I leave to physicists), but I understand others can have different ideas.

Surely you won't place two multiletter constants next to each other without an explicit multiplication sign: so


and not \const{foo}\const{bar}.

  • 1
    Thanks for the example with xparse Jun 10, 2015 at 10:11

You must log in to answer this question.

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