StevenClontz / Mastr

DEPRECATED -- This project is being refactored at StevenClontz/masterit
https://github.com/StevenClontz/masterit
0 stars 0 forks source link

Ampersands being eaten #5

Closed siwelwerd closed 4 years ago

siwelwerd commented 4 years ago

I believe Mastr is eating ampersands. They appear in the seeds.json file, but then do not appear in the xml or latex output.

siwelwerd commented 4 years ago

Maybe this is why?

https://github.com/sparklemotion/nokogiri/issues/1705

siwelwerd commented 4 years ago

Added lin-alg/V9 to this project, which exhibits the error.

StevenClontz commented 4 years ago

Yeah & is a reserved character in XML. I think the correct thing is to have seeds.json contain valid XML snippets, so use &.

I forget my hacky implementation of XML->LaTeX so it's quite likely that will cause errors in the LaTeX output.

StevenClontz commented 4 years ago

Oh I see. The Sagemath code is producing &, so I need to figure out how to clean that up. Or maybe I'm mistaken: seeds.json should contain valid LaTeX snippets, which I'll need to handle.

siwelwerd commented 4 years ago

Yeah. Compare the following two lines:

v1="\\begin{bmatrix}"+ latex(vec1[0])+" & "+ latex(vec1[1]) +" \\\\ "+ latex(vec1[2]) +" & "+latex(vec1[3]) +"\\end{bmatrix}" v2=latex(matrix([[vec2[0],vec2[1]],[vec2[2],vec2[3]]]))

v1 prints okay now, v2 is obviously more elegant but the latex() call throws a plain & that gets eaten.

StevenClontz commented 4 years ago

Drew reopen if this doesn't address the issue.