# Render text upright in math mode [duplicate]

I am looking for a way to have LaTeX render strings of more than one letter as upright (in math mode). For example, I want it to render

• $Hom$ as $\mathrm{Hom}$,
• $apple$ as $\mathrm{apple}$,
• $apple + orange$ as $\mathrm{apple} + \mathrm{orange}$,

while rendering

• $a$ and $a + o$ as normal.

The answers at Use \mathrm by default are close to what I want, but they fail the last example.