[Tex/LaTex] Using a negative space \! to differentiate between functions and products

best practicesmath-modespacingtypography

In Physics, I often have functions like f(x), but also multiplications like y(-x). I would like my math to be easy to understand, so I am looking for a way to suggest function calls and multiplications.

In programming languages like C or Python, this is easy. A function call is f(x) and a multiplication has to have a * in it. I think it would be ugly and confusing to put \cdot everywhere, since that is more thought of as am inner product.

In Mathematica, function calls are with square brackets, like f[x], whereas multiplication is with round parenteses y(-x).

Since LaTeX has the \! command, a friend thought of using that between the function name and the parameters.

I tried the negative spacing and the square brackets, but I am not sure whether it is valid to use \! at that point. Or should I use even more negative spacing?


(source: stw-bonn.de)

The font in the image is Bitstream Charter with mathdesign.

The code for the examples is:

f\del x y \del{-x}
f\sbr x y \del{-x}
f \! \del x y \del{-x}
f \! \sbr x y \del{-x}

Where \del and \sbr come from the commath package and create automatically sized parenteses and square brackets.

Best Answer

Arguably the function form ought to be \mathop{{}f}(x) although this renders the same way.

In MathML (and so now in Unicode) we faced the same problem and have invisible operators FUNCTION APPLICATION (U+2061) (InvisibleApplication in Mathematica) and INVISIBLE TIMES (U+2062) (InvisibleTimes in Mathematica). As their names suggest, by default these have no affect on visual rendering but in aural renderings (and when generating code from markup) they help to distinguish these cases with f⁡(x) usually being read as f of x and f⁢(x) being read as f times x.

Whether you should distinguish these in traditional print form is really an open question, usually a reader can distinguish by context and if you vary too much from the traditional layout the reader is more distracted by the novel display than helped by the distinguished notation. (I think this is the case with the Mathematica [] convention which would be fatally distracting if used in general mathematical context rather than explicitly discussing Mathematica code.)

So... It is good to have different markup for the two cases even if you make them render the same way, as that makes the expressions distinguishable in other contexts, and also of course allows you to easily experiment with different typeset renderings affecting the whole document, by changing the definitions of your function application and invisible times commands.

Related Question