Page MenuHomePhabricator

Hyphens sometimes erroneously appended to equations when not converted to PNG
Closed, ResolvedPublic

Description

<math>f(x)\delta(x-a) = f(a)\delta(x-a)</math>
renders incorrectly to
f(x)δ(x − a) = f(a)δ(x − a)-
(mind the dash at the end)

<math>f(x)\delta(x-a) = f(a)\delta(x-a) </math> (mind the space at the end)
renders correctly to
f(x)δ(x − a) = f(a)δ(x − a)

to be seen on
http://cs.wikipedia.org/w/index.php?title=Diracova_delta_funkce&oldid=778611 and
following revision

occurs while "simple math as html, otherwise as png" checked, if "always png"
checked, it's rendered properly


Version: unspecified
Severity: normal

Details

Reference
bz7367

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:25 PM
bzimport added a project: Math.
bzimport set Reference to bz7367.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

*** Bug 7386 has been marked as a duplicate of this bug. ***

bggoldbg wrote:

I cannot be sure how it was few days ago but now it renders the extra dash
regardless of spaces (see http://bg.wikipedia.org/w/Овал_на_Касини as per #7386).

gunther.vogel wrote:

ISTR that this is an old bug which was resolved long ago. Since dewiki uses this
kind of in-line equations heavily and people have already started using
workarounds, I changed severity back to normal.

bernard wrote:

This is a really annoying bug. I have been using workarounds. However I would
much prefer the bug to be fixed! The problem is that when it eventually does get
fixed, the formulae with the workarounds may not render correctly!

gunther.vogel wrote:

patch for math/render.ml fixing the problem

When using dvipng, there is no temporary .ps file which could be deleted. This
results in a hyphen signalling "some error" (catch-all case in texvc.ml).

Attached:

jeluf wrote:

Committed revision 16890.

gunther.vogel wrote:

Problem persists, see
http://de.wikipedia.org/wiki/Portal_Diskussion:Mathematik#Mathe_bug.3F. This
is *not* a caching issue. Unfortunately, I cannot reproduce the problem on my
local MW installation once the patch is applied.

One way to trigger the bug is using superscripts. Still quite erratic, eg.
<math>1^a</math> triggers the error, while <math>0^x</math> not. See
http://hu.wikipedia.org/w/index.php?title=User:Tgr/teszt&oldid=914553 for some
more test cases.

jeluf wrote:

(In reply to comment #7)

Problem persists, see
http://de.wikipedia.org/wiki/Portal_Diskussion:Mathematik#Mathe_bug.3F.

The patch was not installed on wikipedia.org, it is now.

bggoldbg wrote:

(In reply to comment #9)

The patch was not installed on wikipedia.org, it is now.

It is still re-producing at bg.wiki (please see the first formula at
http://bg.wikipedia.org/wiki/%D0%9E%D0%B2%D0%B0%D0%BB_%D0%BD%D0%B0_%D0%9A%D0%B0%D1%81%D0%B8%D0%BD%D0%B8)

bggoldbg wrote:

(In reply to comment #10)

It is still re-producing at bg.wiki (please see the first formula at

http://bg.wikipedia.org/wiki/%D0%9E%D0%B2%D0%B0%D0%BB_%D0%BD%D0%B0_%D0%9A%D0%B0%D1%81%D0%B8%D0%BD%D0%B8)

OK, I've got a notification by bugzilla that it is fixed. Rushing to the article
with the rendering problem I've got the dash again (if you cannot open the long
URL above try [[:en:Cassini oval]] and follow the first interwiki, bg:). The
first formula renders as " = a4-, " and removals/additions of spaces do not help.

The bug is fixed, the problem for your part is that math images are cached
indefinite. There are only two ways to rerender the image, the fist one is to
purge the math database (contains millions of entries, so the devs have said
no), the second way is to manipulate the MD5 sum, for example add a \, or simlar
to the end (not a nice way, but at the moment it's the only way).

bggoldbg wrote:

(In reply to comment #12)

The bug is fixed, the problem for your part is that math images are cached
indefinite. There are only two ways to rerender the image, the fist one is to
purge the math database (contains millions of entries, so the devs have said
no), the second way is to manipulate the MD5 sum, for example add a \, or simlar
to the end (not a nice way, but at the moment it's the only way).

OK, this explains a lot. So (for me) in general the answer is there is no fix,
and is not going to be one in the foreseeable future. Addition of several spaces
is altering the sum, and is fine. Addition of "\," is not the same as it forces
the rendering engine to use image instead of HTML. Moreover it was described
that the problem comes up if and only if the rendering is done as HTML.

(In reply to comment #13)

(In reply to comment #12)

The bug is fixed, the problem for your part is that math images are cached
indefinite. There are only two ways to rerender the image, the fist one is to
purge the math database (contains millions of entries, so the devs have said
no), the second way is to manipulate the MD5 sum, for example add a \, or simlar
to the end (not a nice way, but at the moment it's the only way).

OK, this explains a lot. So (for me) in general the answer is there is no fix,
and is not going to be one in the foreseeable future. Addition of several spaces
is altering the sum, and is fine. Addition of "\," is not the same as it forces
the rendering engine to use image instead of HTML. Moreover it was described
that the problem comes up if and only if the rendering is done as HTML.

Oh, my bad, what I tested was that changing 'a' to 'b'. And the caching of the
html is the same, so no there is nothing to be done, I'm afraid.

ayg wrote:

Presumably the cache expires after a while.

*** This bug has been marked as a duplicate of 7768 ***

Re-marking this *fixed*. Will see what can be done about clearing affected items, which is separate from the issue being fixed.

  • Bug 9580 has been marked as a duplicate of this bug. ***