This morning I have been wracking my brain trying to solve the issue
of \int xdx. When rendered using mathtex there is no spacing between
the integral sign and the x -- producing unattractive output.
However, as soon as limits are added, everything renders correctly.
After looking through various packages it appears as TeX uses the
\nolimits macro to handle this.
In mathtex a 'hack' is to add dummy limits: \int^{}_{} xdx -- which
renders as expected.
I am hence interested to know what people think is the best way to go
about solving this. One possible solution would be to ensure that \int
and \oint always have limits, even if they are empty. Another option
would be to look into \nolimits and \limits, which would likely
require changes to the parser. Does anyone have any comments or
suggestions on this?
Regards, Freddie.
On 31 Jul 2009, at 13:51, Michael Droettboom wrote:
> The fundamental problem seems to be that the x-advance on the
> integral sign is too short. When you do $\int xdx$, it just uses
> whatever the fonts x-advance (and kerning if any) between the
> integral and the x. When you do $\int^{}_{} xdx$ the sub/
> superscripts prevent any kerning from happening, which is why it
> seems like a workaround. I suppose one could special case the
> get_kerning for the integral symbol (which seems like an aggregious
> hack). Or, more difficult but less hacky, change the parser to
> recognize \int (and friends) as non-kernable symbols, which I
> suspect is what TeX does. Might be a good opportunity to get your
> hands dirty in the parser, though... ;)
I don't think it is kerning; I tried short-circuiting the get_kern
function for the TrueType fonts class so that it always returned 0.
However, it did not seem to have any effect in the case of $\int xdx$.
I'll look over the sub/super script code some more to see if I can
work out exactly what is going on.
Regards, Freddie.