I want to typeset Gielis's superformula using the DisplayFormula cell style. The result should look like $$\rho = R \left(\varphi \right) \left[ \left| \frac{1}{a} \cos \left( \frac{m}{4} \varphi\right)\right| ^{p_2} + \left| \frac{1}{b} \sin \left( \frac{m}{4} \varphi \right) \right| ^{p_3} \right] ^{{-}\frac{1}{p_1}}$$

If I don't write $p_2$ and $p_3$, the result is quite fine, as

\[Rho]=R (\[CurlyPhi])[|1/a cos(m/4 \[CurlyPhi])|+|1/b sin(m/4 \[CurlyPhi])|]^(-(1/Subscript[p, 1]))

produces this: Gielis equation without p2 and p3: everything is fine

However, if I try to add $p_2$ and $p_3$ to this formula, the result is quite confusing, as the | becomes smaller for I don't know what reason:

\[Rho]=R (\[CurlyPhi])[|1/a cos(m/4 \[CurlyPhi])(|^Subscript[p, 2])+|1/b sin(m/4 \[CurlyPhi])(|^Subscript[p, 3])]^(-(1/Subscript[p, 1]))

Why does the ABS operator get smaller???

I see that a simple pipe | is not what I need to typeset an expression like mine. Which character is the correct one to use in this case?

  • 2
    $\begingroup$ The pipe | is the infix form of Aternatives, so yours is barely correct syntax. Use Abs for the absolute value, backets [ and ] for function arguments and Cos and Sin for the cosine and sine function, repectively. Then you can apply TeXForm and use the external package MaTeX to convert to nice formulas for display. $\endgroup$ Apr 23, 2018 at 20:28
  • $\begingroup$ @HenrikSchumacher I took MaTeX as a second plan, but if the pipe behaves like that, I'm totally using MaTeX $\endgroup$ Apr 23, 2018 at 20:49

1 Answer 1


If you want to type the expression into a cell, use Esc l | Esc instead of just | for the left side of the absolute value expression, and similarly Esc r | Esc instead of | for the right side. Here is an animation where I enter your expression into a Text cell style:

enter image description here

If your question is actually about how to create an expression that formats in the way you want, you should clarify this.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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