DXsmiley / mathbot

Discord bot for mathematics
https://dxsmiley.github.io/mathbot/
GNU General Public License v3.0
279 stars 53 forks source link

Add graphviz DOT support #77

Open Kreijstal opened 4 years ago

Kreijstal commented 4 years ago

well, it'd be nice if it supported graphs too, as in networks where you could specify the graph and it'd draw it for you. You could use the graphviz package for that, but do you support latex packages?

I tried

\usepackage[pdf]{graphviz}

\begin{document}
\digraph[scale=0.5]{abc}{rankdir=LR; a->b->c
a [label=<foo<SUP>bar</SUP>>];}
\end{document}

But the bot kept throwing errors, how'd you make it accept graphviz if it is supported?

DXsmiley commented 4 years ago

This is going to take more effort than just adding an additional package.

For context, the actual LaTeX rendering is done by rTeX, a microservice that I also run. I attempted to run your sample code, and got this output:

image

For security reasons, I cannot allow -shell-escape to be used. But I think tweaking the server to just run the dot command should be sufficient?

Kreijstal commented 4 years ago

I think it only needs dot,