It's not clear exactly what layout you want, (perhaps a full minimal example and image in your question would have helped).
The main function of \operatorname
is to provide multi-letter operators like log etc, if you want a math italic f it seems that you just need one of these, depending on where you want the limits to go.
The other function is to give it operator spacing, ie a small gap before the argument, so perhaps the first or second form is what you are looking for?
$ f_1^2 x $
$ \mathop{f_1^2} x $
$ \mathop{{}f}_1^2 x $
$ \mathop{{}f}\limits_1^2 x $
This is the consequence of a bad decision in unicode-math
: they named \mathit
the normal math italic letters, instead of respecting the LaTeX convention of referring to them as \mathnormal
; \mathit
should choose the text italic font, in order to make unicode-math
a drop-in replacement.
I wouldn't expect different output when unicode-math
is loaded or not; but this simple example shows the bug:
\documentclass{article}
%\usepackage{unicode-math}
\begin{document}
$\mathit{different}$
$different$
\end{document}
If the line with unicode-math
is commented out, we get
If I uncomment the line, I get
which is definitely wrong.
Workaround:
Define a new math alphabet:
\documentclass{article}
\usepackage{unicode-math}
\DeclareMathAlphabet{\Lmathit}{\encodingdefault}{\familydefault}{m}{it}
\begin{document}
$\Lmathit{different}$
$different$
\end{document}
If you use lhs2TeX
, you can add
\renewcommand{\Conid}[1]{\Lmathit{#1}}
\renewcommand{\Varid}[1]{\Lmathit{#1}}
after loading it.
This shouldn't raise the Too many math alphabets
error; if it does, then add the code you find between \makeatletter
and \makeatother
in https://tex.stackexchange.com/a/100428/4427
Best Answer
No, you should use
\mathit
or\mathrm
(or higher level constructs like\DeclareMathOperator
) for multi-letter identifiers. The math italic (\mathnormal
) font is specifically designed so that characters have larger sidebearings to separate them so thatabc
looks like an implied product ofa
timesb
timesc
rather than the identifierabc
. This is a property of the font itself and not something under the control of TeX.