gipplab/MathMLben

Fix w-macro conflict with new DLMF macro set

Closed this issue · 8 comments

The mathml update button does not work
Check out
https://mathmlben.wmflabs.org/300
press MathML
see that the MathML field is not updated. No qID appear

@physikerwelt
The button is not broken, the \w command is broken. It looks like the new macros from DLMF using \w or overwrite it somehow. Enter the following command instead:

\wDef{Q11379}{E}\wDef{Q11423}{m}\wDef{Q2111}{c} E = mc^2

And you will see it works!

ok that w stopped working is a regression in MathMLben anyhow, So it should be fixed

It would be ok with me if we normalize the macro name... i.e. \wf and \wi to indicate the difference between identifier and function. However if you decide to go this way you have to make sure to do the replacements in the input correctly. Maybe texvcjs can ba used for that purpose. On the other hand if w could be restored that would be fine as well.

I'm more happy with the \wf, \wi solution. A one character macro is risky in case of duplicating and overwriting issues. To perform this, I would just run a regex-replacement over each semantic field. Since this macro is unique in our semantic latex field, there should be any problem with that.

On the other hand, to restore \w I must find the overwriting in LaTeXML. It could be the new latexml version or the new DLMF macros. Since I only assume that's the problem, this approach would take much more time to solve the problem.

I'm more happy with the \wf, \wi solution. A one character macro is risky in case of duplicating and overwriting issues. To perform this, I would just run a regex-replacement over each semantic field. Since this macro is unique in our semantic latex field, there should be any problem with that.

I think this is hard to do correctly with regexp. For instance wf also matches w ...

I don't get it. Why not using \w{? And if someone didn't use curly brackets, he must use white space, otherwise its another macro.
/\\w([{\s])/g replaced by \\wi$1 would do the job.

If you do that this way you have to check all 300 elements manually. Because it could also be a number or another command or something else. Also: maybe it's \w or in text mode or... That why I would just use texvcjs

Good news about this problem. It turned out, not latexml was the problem but a bug in the macro itself... Simple typo error... Someone defined the macro with \wDef{#1}{#1}#2 instead of \wDef{#1}{#2}#2.
Blame: 0b28970