# 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.

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.

The web service used by QtiPlot up to release 0.9.9.10 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 0.9.9.11 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:

\documentclass{article}
\pagestyle{empty}


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:

\begin{document}
\huge{\\mbox{$text in the editor window$}}
\end{document}


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:

\documentclass{article}
\makeatletter
\renewcommand\scriptsize{\@setfontsize\scriptsize{7}{8}}
\renewcommand\tiny{\@setfontsize\tiny{10}{15}}
\renewcommand\small{\@setfontsize\small{15}{20}}
\renewcommand\normalsize{\@setfontsize\normalsize{20}{30}}
\renewcommand\large{\@setfontsize\large{30}{40}}
\renewcommand\huge{\@setfontsize\huge{40}{50}}
\makeatother
\pagestyle{empty}