# Absolute value's vertical bar symbol in Text cell formula

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:

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]))


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?

• 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. – Henrik Schumacher Apr 23 '18 at 20:28
• @HenrikSchumacher I took MaTeX as a second plan, but if the pipe behaves like that, I'm totally using MaTeX – Riccardo Cazzin Apr 23 '18 at 20:49

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:

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