# Render text upright in math mode

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.

-
don't do this:-) better to declare \Hom as a math operatpr and use like \log and \sin –  David Carlisle Feb 27 at 23:41
–  Werner Feb 28 at 0:14
@DavidCarlisle, I have an unusual use case in mind (rendering math on a web-based wiki), where for practical purposes this would be very useful. –  Adeel Feb 28 at 0:35
@Werner, this doesn't answer my question. –  Adeel Feb 28 at 0:36
As the interletter spacing is not quite the same as ordinary text, you could try simply \textrm{string}. –  Bernard Feb 28 at 1:36