\cancel not working correctly

131 views
Skip to first unread message

Duane Nykamp

unread,
Mar 19, 2012, 6:28:20 PM3/19/12
to MathJax Users
Loading the extension

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { extensions: ["cancel.js"] }
});

I tried the lines
$$ \cancel{\int_0^1 f(x)dx} $$
$$ \bcancel{\int_0^1 f(x)dx} $$
$$ \xcancel{\int_0^1 f(x)dx} $$

The last two look fine, but for the first one (\cancel), the slash is
below the integral and only the right half shows.

This is with Firefox 11 on Linux, MathJax 2, and HTML-CSS. All look
fine with the renderer set at MathML.

Duane

Duane Nykamp

unread,
Mar 19, 2012, 6:34:07 PM3/19/12
to MathJax Users
Actually, it's not \cancel as opposed to the other versions.
Whichever cancel command appears first, it display incorrectly,
shifted down so that only the top part of it is showing. The second
and subsequent equations with a cancel command show up fine.

Davide P. Cervone

unread,
Mar 19, 2012, 6:49:07 PM3/19/12
to mathja...@googlegroups.com
This seems to be a bug in Firefox 11. It does not occur in FF 10 or
below for me (in Mac OS X).

I'll have to look into it further to see if I can figure anything out.

Davide

Duane Nykamp

unread,
Mar 19, 2012, 10:11:24 PM3/19/12
to MathJax Users
Oh, that explains it. I thought it was working before. Thanks.

Duane

Duane Nykamp

unread,
Mar 20, 2012, 1:25:39 PM3/20/12
to MathJax Users
Here's a workaround that seems to fix it, though I haven't tested in
other browsers. At the end of the paragraph preceding the \cancel, I
put in a

<span style="visibility:hidden">$\cancel{}$</span>

so that the first real \cancel becomes the second \cancel and is
displayed properly.

Duane

Davide P. Cervone

unread,
Mar 20, 2012, 2:02:57 PM3/20/12
to mathja...@googlegroups.com
I was considering suggesting that, but wanted to do some testing
before doing so. But I am traveling right now so don't have much time
to do that until I get back in a couple of days.

You might try using

<div style="visibility:hidden; position:absolute; top:0, height:0">$
\cancel{}$</div>

instead, so that it does not interfere with the layout.

Davide

Duane Nykamp

unread,
Mar 20, 2012, 2:54:14 PM3/20/12
to MathJax Users
Even better. That way I don't have to worry about sticking it at the
end of the paragraph to keep it from messing up the formatting.
Thanks for answering even while traveling.

Duane
Reply all
Reply to author
Forward
0 new messages