Tex Equation Editor

This dialog is activated by selecting the Add Equation... command from the Graph menu. It can be used in order to add LaTeX formatted equations to a 2D plot layer.

Figure 5-207. The Tex Equation Editor: using a rendering web service.

Up to release 1.1.1 of QtiPlot the equations were rendered under the form of PNG images created by one of the following third party tools: a web service (which requires a working internet connection) or a locally installed LaTeX compiler. This had the draw-back of a bad image quality when exporting the plots to a vectorial image format file.

Starting with release 1.1.2 the equations are rendered as SVG vectorial images, resulting in a very good quality of the exported images. A third rendering method was also added in this release: it uses JKQTMathText as a built-in LaTeX parser.

Figure 5-208. The Tex Equation Editor: using a built-in LaTeX parser.

The web service used by QtiPlot up to release was provided by MathTran (http://mathtran.org/). Since the beggining of May 2017 this web service seems to have been discontinued, therefore starting with release QtiPlot uses the services of another website: CodeCogs. This server brought the possibility to set a transparent background for the equation by checking the Transparent box.

If you have installed a LaTeX compiler on your computer you don't need to enter document/equation environment commands since QtiPlot automatically does it for you: it creates a temporary file which contains either the following hardcoded preamble:


or a custom preamble that is read from a user defined file path (since one might want to use particular LaTeX packages).

The following code is then appended to the temporary .tex file:

\huge{\\mbox{$text in the editor window$}}

The paths for both the LaTeX compiler and the custom preamble file can be set via the File Locations tab of the Preferences dialog.

The generation method using a local compiler allows for compilation of complete LaTeX documents and not just of equation markup, so that you can fully customize the image output in terms of font size, text color and background color. Using this method you can also force a transparent background for the equation by checking the Transparent box.

In order to customise the font sizes used by the local compiler (Tiny, Small, Normal, Large and Huge) you need to define a preamble file containing the code bellow:


Figure 5-209. The Tex Equation Editor: compilation of complete LaTeX documents.