EMT – LaTeX in Plots

EMT can now insert LaTeX formulas in plots. This may be useful for web pages or even publications. Here is an example.


One should be aware that the formulas are sampled by a converter (dvipng) to a specific graphics size. For a print, this graphics size would have to take the intended dpi into consideration. E.g., an 8cm print at 300dpi takes about 1000×1000 pixels. The image above is just 448×448 pixels. This is sufficient for the web. In the output dialog, the user can simply select a larger size in pixels and that scales everything.

It is often advertised to use a vector format like EPS to be able to scale the image to any size. First of all, this is not a complete solution. For an image to look well, it must be designed for the intended display from the start. This is necessary, since font sizes, the width of lines and points and other items cannot be scaled arbitrarily. Too small fonts are not readable and too large fonts look ugly. Faint lines may not print at all. Moreover, it is not easy to mix vector graphics from an EPS output of LaTeX and a graphics from EMT. For this, EMT would need to be able to import EPS and parse it onto the display. Thus, while EMT an export the vector format SVG, this is not for arbitrary scaling, but for convenience, if one wants only one file for screen and print at the same physical size.

The plot above looks okay on this page. But one may want the font to be larger. This can be done with setfont() in EMT. However, one has to redesign the position of the labels.


In my geometry program Z.u.L., I made a very fancy output dialog for PNG export with user defined scaling of fonts, line widths and point markers. The LaTeX output could be done with a Java scanner for LaTeX or with an special output as a LaTeX image. Then the formula would have to be parsed by LaTeX over the PNG export. In EMT, this is not available. If you need that and have some expertise in LaTeX, you can do it by hand in your LaTeX code.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.