How can I replicate the following LaTeX command in Typst?
\newcommand\p[3]{{}^{#1}{p}^{#2}_{#3}}
Here is what \p{A}{B}{C} looks like in LaTeX:
![]()
In Typst, I tried to write the following:
#let p(a, b, c) = $#super(a)p#sub(c)#super(b)$
but the output of #p("A", "B", "C") is not quite the same as the output of LaTeX:
The letters “A”, “B”, and “C” are not italic and the letter “B”'s position way off.
Questions
- How can I replicate the exact output of LaTeX?
- In LaTeX, I can write the
pcommand as\p{A}{B}{C}while in Typst I have to include quotation marks around the letters “A”, “B”, and “C”, as shown in the command#p("A", "B", "C"). Including quotation marks can be cumbersome when writing. How can I avoid having to include quotation marks (i.e. write something likep(A,B,C))? If it helps, I plan on using thepcommand only in math mode.