trase icon indicating copy to clipboard operation
trase copied to clipboard

support for rendering latex equations

Open martinjrobins opened this issue 6 years ago • 3 comments

I would really like to be able to add latex equations for axis labels, but this seems like it would be very difficult to achieve in pure C++. There seems to be no C++ parsers or renderers for latex. Any ideas for how to do this?

Here is a java library for latex: https://github.com/opencollab/jlatexmath Here is a "C++" library for latex that laughably just generates javascript (!) and use KaTex to render the equations (perhaps their parser is in C++, I didn't check): https://github.com/goldsborough/latexpp

martinjrobins avatar Jun 18 '18 05:06 martinjrobins

might be able to include mathml as a foreignObject in svg, see https://stackoverflow.com/questions/27840705/rendering-mathml-on-svg-using-d3-js

martinjrobins avatar Jun 21 '18 20:06 martinjrobins

Well... it would be nice to have it completely within svg, if at all possible. How about:

  1. Work out how to go TeX -> svg (e.g. this)
  2. Embed the resulting svg in the output

fcooper8472 avatar Jun 26 '18 13:06 fcooper8472

yea, agreed. Here are a few libraries to compile the TeX: https://github.com/ForNeVeR/wpf-math (.NET) http://hackage.haskell.org/package/texmath-0.3.0.3/docs/Text-TeXMath-Parser.html (Haskell - tutorial on calling Haskell from C++ - https://github.com/jarrett/cpphs) https://vog.github.io/texcaller/index.html (C, but no SVG output) https://khan.github.io/KaTeX/ (javascript)

martinjrobins avatar Jun 26 '18 13:06 martinjrobins