2
$\begingroup$

I'm writing an online book in a Mathematica template and would like to display equations using Szabolcs' wonderful MaTeX (LaTeX typesetting in Mathematica) because the readability is superior to the default from Mathematica. Thus I use:

<<MaTeX`
SetOptions[MaTeX, "Magnification" -> 1.5];

This gives me the typography I seek:

MaTeX[HoldForm[Integrate[x^2, x] = x^3/3]]

Equation

I can then collapse the paired cells so that only the typeset equation is visible.

Fine.

However, I want such an equation to be in the EquationNumbered style, complete with automatic numbering. Right now I have to hand select each such typeset cell and use the pull-down menu to change its style to EquationNumbered.

I thought the right approach would be:

CellPrint[EquationNumbered[
  MaTeX[HoldForm[Integrate[x^2, x] = x^3/3]]]]

but that does not work.

Question: How do I programmatically create an EquationNumbered that nevertheless has the style of MaTeX?

$\endgroup$
2
  • $\begingroup$ It is also possible to edit the stylesheets to get the box ratios/fonts/layout nicer. I did that a few years back and it’s really paid off. I do all of my writing in Mathematica first now and then transfer to LaTeX for the second draft since it is much nicer/easier/less buggy to explore and edit iteratively in Mathematica for me $\endgroup$
    – b3m2a1
    May 28, 2021 at 20:58
  • $\begingroup$ @b3m2a1: If you have stylesheets available, or can point to one online, I'd love to see it. I really need a style that mimics the Mathematica blue "reference" definitions of functions. (I don't know Mathematica didn't include that in the as a Style.) $\endgroup$ May 28, 2021 at 23:14

1 Answer 1

1
$\begingroup$

Ah... I think I figured it out:

CellPrint[
 ExpressionCell[MaTeX[HoldForm[Integrate[x^2, x] = x^3/3]], 
  "EquationNumbered"]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.