Invalid LaTex formula

I'm writing a paper with some logical formulas. The default way to do this now in pages is to insert LaTex code. I've never liked LaTex, I'm lazy and like WYSIWYG editors. I found this nice little tool on the web called Visual Math Editor: http://visualmatheditor.equatheque.net/ And I used it and got the first formula looking the way I wanted In the tool it looks great. I've included a screen snapshot below. And the actual code I'm using is:


\begin{aligned}

\forall e1 \forall e2\forall R\forall x\left(MoralEvent(e1)\wedge MoralEvent (e2) \\

R\thicksim = recipient \wedge R\thicksim = responsiblAgent\wedge e1Rx =e2Rx \\

\rightarrow equivalentEvent(e1,e2)\right)

\end{aligned}

But when I do Insert>Equation and then paste that code I get an error message that just says "invalid formula". BTW, in case you are wondering, yes, I've posted a question on the help page for this tool but so far no response (it's a freeware tool). And I realize this may be more of a LaTex question than really a Pages question but I thought someone here might be able to help. The main thing is I just need a simple way to make sure the whole formula doesn't appear on one line. When I didn't use the begin and end aligned it worked fine but it put everything in one long line and used a very tiny font. So I looked at some of the samples on the VisualMathEditor page and saw one where they had several formulas center aligned and tried to copy that code which as I said seemed to work in the tool but not in Pages.


User uploaded file

iMac, macOS High Sierra (10.13.2), 2.7 GHz Intel Core i5 8GB RAM

Posted on Feb 10, 2018 1:36 PM

Reply
10 replies

Feb 10, 2018 4:45 PM in response to JGatsby

Of course, I have the full MacTeX 2017 package installed (~ 5GB), and it generates PDF via pdflatex.


You could get the MathType trial, which will revert to a free MathType after 30 days. If MathType is installed, you can change Pages v6 to automatically use it via the Pages Preferences : General panel, where there is an Equations checkbox for MathType.


Launch MathType before you launch Pages v6.

Feb 10, 2018 4:05 PM in response to JGatsby

Pages v6 does not incorporate a TeX/LaTeX engine, but rather it uses blahtex (2013) which is a translator between TeX/LaTeX and MathML. So virtually, all the TeX/LaTeX examples that you find on the Internet, that may incorporate certain modules behind the scenes — will not work in this Pages equation translator because it excludes packages, and considerable familiar syntax that online TeX/LaTeX engines permit.


Here is what you can and cannot do with the Equation editor in Pages v6.1 and later. Note the direct link to the blahtex PDF that is also found on the following link:


About LaTeX and MathML support in Pages and iBooks Author

Feb 10, 2018 4:01 PM in response to VikingOSX

What is deceptive for you is that your online TeX/LaTeX site is silently pulling in the amsmath module that has the equation*, align*, split, and multline environments which allow you to use \\ or & to allow multi-line equations. The Pages Equation editor does not support the amsmath package, and thus, you will get “invalid formula” because you are referencing unsupported functionality.


After an hour of scrutiny and trial/error, I see no option in the blahtex PDF manual that would allow one to create multiline equations in the Pages Equation editor. Best to generate that equation online, download as PDF, and drag/drop into Pages v6. In the Arrange tab, set Text Wrap to None, so it plays nice with the other document content.

Feb 10, 2018 4:15 PM in response to VikingOSX

Thanks. I continue to be kind of disappointed at how difficult it is to do formulas in Pages, but that was a great answer. Do you know a good tool to convert the LaTex to PDF? There is what's billed as a "beta" version of that on the Visual Math Editor site but I tried that and the PDF that got generated didn't look right. BTW, I also tried the "Save as Image" option but it saved the formula with a weird gray background. (I know these are all issues with the tool, but just in case you have any insight on that). Thanks for the quick response. I'm leaving this open for now, I'm not sure if you can still reply if I say the issue is solved but either way I'll mark it so you get credit for the solution. thanks again.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Invalid LaTex formula

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.