This a tiny change to the math-fixing routine behind the useMath
flag. Basically, what we were getting back from XSweet when there was a display equation was this:
<p><math-display>[equation]</math-display></p>
The problem with this is when it hits Wax, which sees math-display
as a block-level element that can't go inside a p
so it's thrown away, and what comes out is this:
<p>[equation]</p>
The LaTeX of the equation is correct, and if you type a "$$ " before it, it turns into a display equation. But this fix modifies what's coming out of XSweet to this:
<math-display>[equation]</math-display>
which goes into Wax without any trouble.
Alexandros Georgantas (234f3baa) at 21 Mar 12:30
chore(release): 2.3.0
Alexandros Georgantas (b9acff82) at 21 Mar 12:30
chore(release): 2.3.0
Dan Visel (59a1396b) at 21 Mar 12:27
Trying to get a cleaner branch to make the changes more clear!
This changes the MathType processing code to deal with inline equations and edge situations found in a particular document from Amnet. Sometimes LaTeX was being exported that included inline MTEF XML, which contains positioning and color data that can't be represented in vanilla LaTeX; this strips that out. This is not stripping out all XML tags (which might look very much like valid LaTeX); it only strips out the tags that were represented in that document. I've asked for more sample MathType documents to see how often this issue comes up, but haven't yet received them. This does post a warning if it does encounter something in LaTeX from Mathtype that looks like XML so that we can better diagnose this issue in the future.
All of this is behind the math flag, so it should not affect anything that's not using this (or anything that's not converting WMF to LaTeX).
Alexandros Georgantas (f33dc46b) at 21 Mar 12:27
Merge branch 'mathtype-refinements-fixed' into 'master'
... and 1 more commit
Alexandros Georgantas (59a1396b) at 21 Mar 12:25
chore(service): removed unnecessary await
(closing this, this one is better: !10 (merged) )
This changes the MathType processing code to deal with inline equations and edge situations found in a particular document from Amnet. Sometimes LaTeX was being exported that included inline MTEF XML, which contains positioning and color data that can't be represented in vanilla LaTeX; this strips that out. This is not stripping out all XML tags (which might look very much like valid LaTeX); it only strips out the tags that were represented in that document. I've asked for more sample MathType documents to see how often this issue comes up, but haven't yet received them. This does post a warning if it does encounter something in LaTeX from Mathtype that looks like XML so that we can better diagnose this issue in the future.
Trying to get a cleaner branch to make the changes more clear!
This changes the MathType processing code to deal with inline equations and edge situations found in a particular document from Amnet. Sometimes LaTeX was being exported that included inline MTEF XML, which contains positioning and color data that can't be represented in vanilla LaTeX; this strips that out. This is not stripping out all XML tags (which might look very much like valid LaTeX); it only strips out the tags that were represented in that document. I've asked for more sample MathType documents to see how often this issue comes up, but haven't yet received them. This does post a warning if it does encounter something in LaTeX from Mathtype that looks like XML so that we can better diagnose this issue in the future.
All of this is behind the math flag, so it should not affect anything that's not using this (or anything that's not converting WMF to LaTeX).
Dan Visel (6b5179e0) at 20 Mar 10:17
feat(service): more mathtype fixes, this time in a clean branch
Not really sure why there are so many changes here? Only mathtype.js
was changed here.
This changes the MathType processing code to deal with inline equations and edge situations found in a particular document from Amnet. Sometimes LaTeX was being exported that included inline MTEF XML, which contains positioning and color data that can't be represented in vanilla LaTeX; this strips that out. This is not stripping out all XML tags (which might look very much like valid LaTeX); it only strips out the tags that were represented in that document. I've asked for more sample MathType documents to see how often this issue comes up, but haven't yet received them. This does post a warning if it does encounter something in LaTeX from Mathtype that looks like XML so that we can better diagnose this issue in the future.
Dan Visel (a0c5a9eb) at 12 Mar 21:00
fix(service): catches more failing wmf transformations
... and 6 more commits
Alexandros Georgantas (466769a0) at 05 Mar 15:15
chore(release): 2.2.4
Alexandros Georgantas (ba41a4a3) at 05 Mar 15:15
chore(release): 2.2.4
Dan Visel (d59b2ef6) at 05 Mar 15:14
This MR adds conversion of MathType binary files to LaTeX equations.
MathType is a proprietary equation editor used in MS Word; documents that have MathType have binary .WMF
files. A Ruby gem made by Jure ( https://github.com/jure/mathtype/tree/master ) which was then brought into XSweet by Suki ( https://gitlab.coko.foundation/XSweet/XSweet/-/tree/mtef/applications/math/mtef ) is run on .wmf
files if any are found in the unzipped files. If they exist, we try to convert them to LaTeX (via MathML) and replace the images in the html
with <math-display>
or <math-inline>
LaTeX equations.
Note that this doesn't work for all WMF files – not all WMF files are MathType. And it seems possible that Jure's gem doesn't actually work for all flavors of MathType.
Alexandros Georgantas (1d66f94c) at 05 Mar 15:14
Merge branch 'mathtype-implementation' into 'master'
... and 1 more commit
Okay, new version only runs this if useMathCleaner
is set to true
. We do that for Kotahi, I don't think anyone else does.