standardnotes / math-editor

[Moved to https://github.com/standardnotes/app]
GNU Affero General Public License v3.0
2 stars 5 forks source link

LaTeX tables don't render #19

Open chaserene opened 3 years ago

chaserene commented 3 years ago

inserting the below example renders a nice table in the website demo, but in Standard Notes desktop, it renders as red text (malformed LaTeX).

$$\begin{tabular}{ l | c | r }
    \hline
    1 & 2 & 3 \\ \hline
    4 & 5 & 6 \\ \hline
    7 & 8 & 9 \\
    \hline
\end{tabular}$$
JaspalSuri commented 3 years ago

I think that this could be because there are certain features that the Upmath editor uses a server for in order to convert/render the LaTeX in a human-readable format whereas the Markdown Math editor does not since it would not be private. I didn't see anything get picked up in the Network tab of my browser's dev tools, so I'll reach out to our Extensions dev to confirm this.

JaspalSuri commented 3 years ago

Hi @chaserene,

I've heard back from them and they said the following (lightly edited by me in brackets):

The editor uses https://i.upmath.me/svg/ to render LaTeX into SVG images. This seems to be removed from the [Markdown] Math Editor, though (for privacy reasons, maybe). Ideally, LaTeX syntax should be rendered locally. There are a few solutions that I found that we can use, but I'll need to spend more time figuring out what is the best option for us [if at all any].

chaserene commented 3 years ago

hey @JaspalSuri, thanks for asking them. actually what they said is not really new, #10 deals with the case of the Math Editor leaking data because it called the Upmath server for rendering LaTeX, which was later solved. now that I skimmed over the thread, it seems local rendering became possible by adding KaTeX to SN and passing along formula requests to it. could you ask the devs is passing along other LaTeX requests to the local KaTeX is possible? tables ({tabular}) would be what I need most, though plotting functions (with {tikzpicture}) would also be nice to have.

JaspalSuri commented 3 years ago

Hi @chaserene, you're welcome. I'll ask them if that's possible. 🙂

chaserene commented 3 years ago

hey Jaspal, have you heard anything back from the devs on this?

JaspalSuri commented 3 years ago

Hi @chaserene, I haven't heard anything back yet, but it is on their list of things to look into.