Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

QuickLaTeX cannot compile formula Error #73

Open
johnpeterm opened this issue Jul 17, 2018 · 9 comments
Open

QuickLaTeX cannot compile formula Error #73

johnpeterm opened this issue Jul 17, 2018 · 9 comments
Labels

Comments

@johnpeterm
Copy link

johnpeterm commented Jul 17, 2018

Description

On some section of the formula, the following error occurs
*** QuickLaTeX cannot compile formula:
\begin{array}{}\ \ \phantom{\rule{1.2em}{0ex}}7.56\phantom{\rule{0.2em}{0ex}}\text{kg}\hfill \ -6.052\phantom{\rule{0.2em}{0ex}}\text{kg}\hfill \ \ \ \phantom{\rule{0.2em}{0ex}}\frac{\phantom{\rule{0.2em}{0ex}}+13.7\phantom{\rule{0.2em}{0ex}}\text{kg}}{15.208\phantom{\rule{0.2em}{0ex}}\text{kg}}=15.2\phantom{\rule{0.2em}{0ex}}\text{kg}\text{.}\hfill \end{array}

*** Error message:
Missing # inserted in alignment preamble.
leading text: $\begin{array}{}
Missing $ inserted.
leading text: ...15.208\phantom{\rule{0.2em}{0ex}}\text{kg}}
Extra }, or forgotten $.
leading text: ...15.208\phantom{\rule{0.2em}{0ex}}\text{kg}}
Missing } inserted.
leading text: ...m}{0ex}}\text{kg}\text{.}\hfill \end{array}
Extra }, or forgotten $.
leading text: ...m}{0ex}}\text{kg}\text{.}\hfill \end{array}
Missing } inserted.
leading text: ...m}{0ex}}\text{kg}\text{.}\hfill \end{array}
Extra }, or forgotten $.
leading text: ...m}{0ex}}\text{kg}\text{.}\hfill \end{array}
Missing } inserted.
leading text: ...m}{0ex}}\text{kg}\text{.}\hfill \end{array}
Extra }, or forgotten $.
leading text: ...m}{0ex}}\text{kg}\text{.}\hfill \end{array}
Missing } inserted.

Expected behaviour

12

Actual behaviour

[What actually happened]

Steps to reproduce the problem

It happens in random sections of formula of imported book into pressbooks.

System Information

  • Openstax Import for Pressbooks: [Enter POI Version here]
    Pressbooks: [Version 5.4.0]
    WordPress: [Version 4.9.7]
@bdolor
Copy link
Contributor

bdolor commented Aug 3, 2018

I can reproduce this - the conversion process is from mathml (in the original book) to LaTeX via xsl: https://github.com/BCcampus/pressbooks-openstax-import/tree/dev/inc/import/openstax/xsl

The LaTeX is then rendered via QuickLaTeX image rendering service. Unfortunately equation conversion is not 100% all the time, especially in books with many equations. That said, we've been happy with the results, albeit imperfect.

@johnpeterm
Copy link
Author

Despite imperfection, it is huge time saver.

@bdolor
Copy link
Contributor

bdolor commented Aug 9, 2018

@johnpeterm - thanks for mentioning that. We agree it's better than it was when it was a purely manual process. Converting an openstax book with equations would take months. That said, there are plans to incrementally improve the performance of this importer, so I'll leave this ticket open for now. Though I'm not sure how it will affect equation transformation, we hope to see some improvements with #71 Thanks for reporting the issue.

@otterscotter
Copy link

None of the formulas in this conversion are displaying properly after the import. Any ideas?
Code in the editor:
The magnitude of the charge is independent of the type. Phrased another way, the smallest possible positive charge (to four significant figures) is $+1.602\times10^{-19}\mathrm{C}$, and the smallest possible negative charge is $-1.602\times10^{-19}\mathrm{C}$; these values are exactly equal. This is simply how the laws of physics in our universe turned out.
As displayed in the book:
The magnitude of the charge is independent of the type. Phrased another way, the smallest possible positive charge (to four significant figures) is $+1.602\times10^{-19}\mathrm{C}$, and the smallest possible negative charge is $-1.602\times10^{-19}\mathrm{C}$; these values are exactly equal. This is simply how the laws of physics in our universe turned out.
https://pbooks.scottrobison.net/physics155/chapter/electric-charge

@bdolor
Copy link
Contributor

bdolor commented Oct 1, 2018

Could be a number of things, @otterscotter - really depends on a number of things. Most importantly which plugin you're using to to render Math. Is it a problem that can be addressed by making changes to the plugin? If so, you could consider opening a new ticket, or making sure you are using WP QuickLaTeX plugin. This one addresses the larger problem of the transformation working 95% of the time which is a different issue than transformations working 0% of the time. Thanks!

@otterscotter
Copy link

otterscotter commented Oct 1, 2018 via email

@otterscotter
Copy link

Sorry, doesn't look like the screen shot went through...
sketch 54

@bdolor
Copy link
Contributor

bdolor commented Oct 1, 2018

If the WP QuickLaTeX plugin was activated prior to and during the import process, then there is no other trickery required. If this is something you can confirm is an issue with the plugin then I encourage you to create a new issue with an eye to giving me enough detail to re-create the issue. If it is a general support request though, I'm afraid I don't have the capacity to be much help.

@otterscotter
Copy link

otterscotter commented Oct 1, 2018

Ha. I just imported Calculus Volume 1 and at first glance, formulas display properly! I'll try re-importing problematic titles again. Thanks!

@bdolor bdolor added the bug label Oct 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants