A strange error with $\phi$ as a variable
I have encountered a strange error. Look at this code
var('π c ϕ')
C(q) = c*q
π(q) = ϕ*q-C(q)
show(LatexExpr(r"C(q) = "),C(q))
show(LatexExpr(r"π(q) = "),π(q))
It generates an error because $\phi$ is interpreted as $\varphi$. If I replace the first by the second there is no error.
How do you input
ϕ
on in which front-end ? I suspect Jupyter, but you don't say...I suspect an homophony not detected by your frontend : there are four Unicode codepoints encoding a "phi" character (see there) : ɸ, Φ, φ,and ϕ.
Depending of your setup (platform, interface, font, etc...), there is no waranty that you may distinguish them "optically", if you happen to enter one for the other.
Your question may be better addressed to a forum dedicated to your frontend of choice...
FWIW, you may try (with a lot of cun'n paste to be sure to use the same characters at each use of
π
andϕ
) :but, if
works as expected,
doesn't : LaTeX chokes on :
This might work with (xe|lua)latex and adequate setup (via
latex.add_to_preamble
), exercise left to the reader as an exercise, after his homework with his interface...BTW, there is a workaround for this workaround. Also left as an exercise. to the same reader...
HTH,