Hi,
for my homepage I generate a FAQ reading a yaml file. Then I loop over the items and put them in questions and answers with the accordion widget. The text parts from the yaml-file I put in a Markdown pane (pn.pane.Markdown)
In one of my “answers”, I use latex code to make the formulars look nicely. In some of my formulars I use an ampersand (&) to get the, e.g. the equation system, aligned.
This is a simplified example in the yaml-file:
$$
begin{aligned}
a + 2 * b &= 1 \\\\
a + 30* b &= 0,5\\\\
end{aligned}$$
This is my code:
import pnael as pn
import yaml
with open("text.yaml") as file:
yaml_data= yaml.safe_load(file)
pn.pane.Markdown(yaml_data)
Then it displays the following:
a + 2 * bamp;= 1
a+30*bamp;=0,5
I want to have the “amp;” out.
I tried out different encoding and decoding functions but nothing worked so far.
$$
\begin{aligned}
a + 2 \cdot b &= 1 \\
a + 30 \cdot b &= 0.5
\end{aligned}$$
import panel as pn
import yaml
pn.extension("mathjax")
with open("script.yaml") as file:
yaml_data= yaml.safe_load(file)
pn.pane.Markdown(fr"{yaml_data}").servable()
The LaTeX pane works for me with the .yaml file above
import panel as pn
import yaml
pn.extension("mathjax")
with open("script.yaml") as file:
yaml_data= yaml.safe_load(file)
pn.pane.LaTeX(fr"{yaml_data}").servable()
Thanks a lot for your quick reply and the issue!
I used to use the LaTeX pane. We refactured our FAQs and in this way I changed everything to the Markdown pane (just for explanation ;)).