Page MenuHomePhabricator

PDFs do not include superscript for chemical formulas ("Chem" tag)
Closed, ResolvedPublic


Author: raffamaiden

I think I have found a bug in the wikipedia PDF renderer.

Go to this page: In the chemistry box on the right, there is the "Properties" section with "Molecular formula" as the first record. This record has the value of "CHO_3^-".

Now download the PDF of the page. You will see that in the PDF the same record has the incorrect value of "CHO". The same applies to, where "CO_3^2-" becomes "CO" in the PDF.

This does <u>NOT</u> apply to non-ions like, so I think that the problem are the superscripts, while subscripts cause no problems.

Particularly, it should be the "{{Chem|text|subscript|superscript}}" tag. If there is no superscript, the PDF is rendered correctly. If there is the superscript, the renderer seems to ignore both the sub and the super scripts.

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:07 AM
bzimport added a project: Collection.
bzimport set Reference to bz40042.
bzimport added a subscriber: Unknown Object (MLST).

This is due to the fact that there is no good way to universally format math and chem formulas yet.

The problem comes from the fact of having to use a subscript and a superscript at the SAME time, which is not something that is supported in HTML. If both are present, a 'trick' is used and the PDF renderer (rightfully) doesn't understand the trick. Problems like these won't ever be fully solved until MathML has further matured.

Idea. use an 'alt' text if the template needs to show both sup and sub, and let the PDF rendere fallback to the alt text instead of just 'stripping' the html out of the rendering.

Jdlrobson added a subscriber: Jdlrobson.

Is this still going to be an issue with the new Proton service?

@Jdlrobson no, this is OCG specific and not an issue with Proton/Electron.

Tested the articles for Carbonate and Bicarbonate on production. The 'properties' in the article infobox seems to match the properties on the article infobox in the PDF.

ABorbaWMF claimed this task.

Looks good to me on Production and Beta.
Article -

Screen Shot 2018-05-31 at 3.44.09 PM.png (300×1 px, 163 KB)

Screen Shot 2018-05-31 at 3.44.40 PM.png (728×1 px, 129 KB)