#### 7.11.6 NewTeXlabel

• NewTeXlabel( <"name">, <affix>, <"text">, [, options] )
• Description: that macro asks TEX to compile the <"text"> in a pdf file, that file will then be converted in an eps file using pstoedit, and the result will be loaded by loadFlatPs and stored in a global variable called TeX_+name. A graphical element called <name> is created to draw the formula with drawTeXLabel. The parameter <options> is a list (optional) like: [ option1:= value1, ..., optionN:=valueN ], options are:
• dollar := < 0/1 >: tells TeXgraph to add or not the tags $and$ around the formula. ($0$ by default).
• scale := < number>0 >: scale, 1 by default.
• hollow := < 0/1 >: with the value 0 (by default) the fillings are done.

In the options, following attributes can also be used: LabelSize, LabelStyle, LabelAngle and Color.

Here is the definition of that macro:

[dollar:=0, scale:=1, hollow:=0, $options:=%4,$L:=TeX2FlatPs( %3, dollar), \$aux:=NewVar(["TeX_",%1],L),
NewGraph(%1, ["drawTeXlabel(",%2,", TeX_",%1,", [scale:=",scale,", hollow:=",hollow,"])"]),
ReDraw()
]

The formula is written in the file formula.tex, then we compile the following tex2FlatPs.tex file:

\documentclass[12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage{fourier}
\pagestyle{empty}
\begin{document}
\input{formula.tex}%
\end{document}

NewTeXlabel( "label1", 0, "$\$frac{$\$pi}{$\$sqrt{2}}", [scale:=1.5, Color:=blue, LabelAngle:=45])