Under a Linux standard distribution all this software should already be installed. However, CLUCalc only works properly with either GNU Ghostscript v7.07 or AFPL Ghostscript v8.13, or a later version of either. For example, under SuSE 8.2 only GNU Ghostscript v7.05 is installed, which causes problems, since it does not seem to support eps-cropping. To obtain the latest version of Ghostscript go to www.ghostscript.com. It is also preferable to install AFPL Ghostscript, since it supports anti-aliasing of text. That makes your annotations look much nicer.
Under Windows you will need to install MikTex from www.miktex.org (or something comparable) and AFPL Ghostscript v8.13 or later from www.ghostscript.com. They both come with an installer for Windows and are easy to install.
\documentclass{article} \usepackage{latexsym} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \begin{document} \pagestyle{empty} [The text from the Text parameter] \end{document}
If you want to parse an external file you can do this as well, by passing the following text to the function: "\\file:[the filename]". The path to the file will be taken relative to the path the currently executed script is in.
Each time DrawLatex() is executed, it checks whether the text passed has changed since the last call, or whether a latex file given via "\\file:[the filename]" has been modified. If something has changed the LaTeX code is rendered again and then displayed.
Since not everybody has LaTeX installed but may want to look at a script that uses LaTeX annotations, you can also store the rendered LaTeX bitmaps in a file. These are then simply loaded instead of rendering the latex code every time the script is started. The rendered LaTeX is only stored in a file if the Name parameter is given. The filename used to store the bitmaps is then constructed as follows: "[filename of script]_[\a Name].rlb". The extension "rlb" stands for rendered latex bitmap. It is in fact a simple bitmap file and you can view with any other program simply by renaming the extension of these files to "bmp".
Here is a simple example.
// Set the background color to white _BGColor = White; // Set Latex Magnification SetLatexMagStep(10); // Set the active color :Blue; // Draw a formula starting at // the front bottom left corner // of the frame box. DrawLatex(1.5,-1.5,1.5, "\[\int_{-\infty}^\infty\,a_1\wedge b^\|\]", "formula"); // Set the current color to red. :Red; // Start an overlay block. // Elements drawn within this block // are not rotated and translated // together with the standard // visualization frame. StartOverlay(); // Increase the Latex size SetLatexMagStep(12); // Align the drawing of bitmaps to // the left top corner of the bitmap. SetLatexAlign(0,1); // Draw the latex bitmap 10% into the // visualization window from the left // and 10% down from the top. DrawLatex(10,10,0, "Hello,\par This is a little bit of \LaTeX.\par \begin{itemize} \item Start \item the game. \end{itemize}", "text"); // End the overlay block EndOverlay();
This generates the following visualization.