[Tex/LaTex] Spacing around longer function argument’s parentheses

math-modespacing

The line

i(x,y,z,t) = \delta(x-\ell_x(z)) \delta(y-\ell_y(z)) \hat{\imath}(\xi(z),t)

enter image description here

produces (for my eyes, at least) too little space between the successive function calls. It is difficult to visually distinguish the three calls. I guess the underlying reason is that the expressions that serve as function arguments are relatively long. For comparison,

i(x,y,z,t) = \delta(x) \delta(y) \hat{\imath}(\xi(z),t)

enter image description here

already looks a lot better in my opinion.

I know that I could

  1. Manually adjust spacing using \, etc., including the option to define a macro that does this automatically.
  2. Insert \cdot as a means of adding seperating space.

However, my question is: Is there a canonical way (e.g. a package) of dealing with this problem? I imagine I'm not the first one to encounter this problem… still, I wasn't able to find useful, general solutions to the problem.

A possible solution might be something along the lines of

i(x,y,t) = \delta \funcargs{x-\ell_x(z)} \delta \funcargs{y-\ell_y(z)} \hat{\imath} \funcargs{\xi(z)}{t}

Note that I find the use of \cdot to be unsatisfying since it introduces inconsistency in the document (sometimes having the dot and sometimes not, with the meaning being the same).

Best Answer

First, let me give a paraphrasing from The TeXbook showing the amounts of spaces between different types of math atoms:

enter image description here

where

  • Ord includes things like a, \theta, and things inside \mathord or just plain {}'s;
  • Op includes things like \sin, \gcd, and things inside \mathop;
  • Bin includes things like \pm, \otimes, and things inside \mathbin;
  • Rel includes things like \leq, \mid, and things inside \mathrel;
  • Open includes things like \langle, (, and things inside \mathopen;
  • Close includes things like \rangle, ), and things inside \mathclose;
  • Punct includes things like ,, ., and things inside \mathpunct;
  • Inner includes things like \cdots and things inside \mathinner.

Here is an example document illustrating a couple of different ways:

\let\funarg\mathinner
\def\funop#1{\mathop{{}#1}}
$$ i(x,y,z,t) = \delta(x-\ell_x(z)) \delta(y-\ell_y(z)) \hat\imath(\xi(z),t), $$
$$ i\funarg{x,y,z,t} = \delta\funarg{(x-\ell_x(z))} \delta\funarg{(y-\ell_y(z))} \hat\imath\funarg{(\xi(z),t)}, $$
$$ \funarg{i(x,y,z,t)} = \funarg{\delta(x-\ell_x(z))} \funarg{\delta(y-\ell_y(z))} \funarg{\hat\imath(\xi(z),t)}, $$
$$ \funop i(x,y,z,t) = \funop\delta(x-\ell_x(z)) \funop\delta(y-\ell_y(z)) \funop{\hat\imath}(\xi(z),t), $$
\bye

enter image description here

So as you can see, you probably want the last option of using a \mathop atom for the function "name".

With LaTeX, this could be defined as follows (the second row below shows the output of your original code):

\documentclass{article}
\newcommand\funop[1]{\mathop{{}#1}}
\begin{document}
$i(x,y,z,t) = \funop\delta(x-\ell_x(z)) \funop\delta(y-\ell_y(z)) \funop{\hat\imath}(\xi(z),t)$

vs.

$i(x,y,z,t) = \delta(x-\ell_x(z)) \delta(y-\ell_y(z)) \hat{\imath}(\xi(z),t)$
\end{document}

(The reason I didn't include the parenthesis in the command is that I felt it would be too much effort to measure the arguments to decide on the size of the fences. I think it's simpler to just manually define the height with \bigl( etc., and also it's nicer to see the parens in the manuscript instead of {}'s)

enter image description here

Related Question