This is going to be opinion-based, so I'll first suggest a strategy for typing your document.
\usepackage{amsmath}
\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
$\func{letter}(\sigma,c)\equiv\func{startmarker}(c)$
$\func{only}_{\wsub{free}}(\{c_{0}\})$
Of course you can add shorthands for the functions you use most often
\newcommand{\letter}{\func{letter}}
\newcommand{\startmarker}{\func{startmarker}}
\newcommand{\only}[1][]{%
\func{only}%
\if\relax\detokenize{#1}\relax _{\wsub{#1}}\fi
}
and the above formulas would be
$\letter(\sigma,c)\equiv\startmarker(c)$
$\only[free](\{c_{0}\})$
The definition of \only
with an optional textual subscript can be simpler if xparse
is used:
\usepackage{xparse}
\NewDocumentCommand{\only}{o}{%
\func{only}%
\IfValueT{#1}{_{\wsub{#1}}}%
}
Or you can opt for an even simpler \newcommand{\only}{\func{only}}
and type
$\only_{\wsub{free}}(\{c_{0}\})$
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
\const{foo}\cdot\const{bar}
and not \const{foo}\const{bar}
.
\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
)$only$
if you need italic words in math use$\mathit{only}$
\mathit
. @LaRiFaRi: Thanks for the remark