1 | initial version |
In the string "$\theta"
, the group \t
becomes a tab.
You need to either escape the backslash: "$\\theta"
or to use a raw string: r"$\theta"
.
2 | No.2 Revision |
In the string "$\theta"
, the group \t
becomes a tab.
You need to either can escape the backslash: backslash this way: "$\\theta"
or .
But it is more convenient to use a raw string: r"$\theta"
. .
So your code becomes:
p = polygon2d([[0,0], [0,3], [4,0]], fill = False, axes = False)
p += text(r"$\theta$", (3, 0.2), fontsize = 22)
show(p)
Use this trick whenever you have text containing \
, which is often the case if your text is latex code!
3 | No.3 Revision |
In the string
, the group "$\theta""$\theta$"\t
becomes a tab.
You can escape the backslash this way:
."$\\theta""$\\theta$"
But it is more convenient to use a raw string:
.r"$\theta"r"$\theta$"
So your code becomes:
p = polygon2d([[0,0], [0,3], [4,0]], fill = False, axes = False)
p += text(r"$\theta$", (3, 0.2), fontsize = 22)
show(p)
Use this trick whenever you have text containing \
, which is often the case if your text is latex code!