Apollo Apollo - 4 months ago 31
LaTeX Question

Writing LaTeX in JSON file

How would I include the math symbol Pi in a JSON file? \p seems to be reserved in JSON.

{
"Text": "This is the symbol for the number Pi: $\pi$",
"Type": "A"
}

Answer

You need to escape the backslash "This is the symbol for the number Pi: $\\pi$". Otherwise, the string literal tries to interpret \p in the same way that it would interpret something like \n.

Comments