TkTeXCAD -- Short description <author>Hilmar Straube, <tt/hilmstr@web.de/ <date>Aug 16, 2001 <abstract> Short description for TkTeXCAD, a Python/Tkinter-Script to interactively create LaTeX picture environments. </abstract> <!-- Table of contents --> <toc> <!-- Begin the document --> <sect>Introduction <p>TkTeXCAD means to make creation of standard LaTeX picture environments easy. It knows about LaTeX' limitations and attempts to preview the dvi output. It is able to save and load pictures in its own format (realized using the module pickle provided with Python), but only exports LaTeX source. Special focus is laid on processing reusable picture parts. <sect>(Not-)Features <p>The program uses the unit pt and the picture environment without additional extension packages (except graphicx for .eps inclusion). So, the program only generates these: \circle (empty circle; stepped up to 40 pt), \circle* (filled, only up to 15 pt), lines and vectors (limited elevations; a very bold version is used to implement filled rectangles), various text boxes, the \qbezier splines, \includegraphics (requieres \usepackage{graphicx} in the preamble) and of course commands to insert saved picture parts. Moreover, it is possible to show the same object several times by using \multiput. <sect1>Saved picture parts <p>The program makes a difference between classes of pictures and instances of these picture classes. A picture class contains some objects with their individual properties. An instance of a picture class can then be an object inside other picture classes where it appears as a special, user-defined objects. Whenever the inner picture class changes, all instances of this class will be changed as well. The object "instance of a picture class" can be scaled (\unitlength). This may cause the diameters of the arcs of \oval and the circles to change un-proportional, but the program will (hopefully) preview that. So a picture for TkTeXCAD consists of several picture classes. There is a main picture, that will be inserted directly into the LaTeX source. All other classes will be referenced to (possibly indirectly) from the main picture. When exporting, the program creates a file for every exported picture class <em/with exactly the same name; so you have to take care that this name will be legal on your system./ <sect1>Inclusion of EPS pictures <p>As noted above, the program is able to include EPS files. It will preview their contents, but will need the help of the Python Imaging Library (PIL). This library then uses Ghostscript to render the pictures, but only on UNIX derivates with Ghostscript installed. If you have already installed the PIL on another platform, append some letters to the line "import Image" in tktc.py. This will raise an "ImportError" exception and thus tell the programm that there is no EPS support on your system. With no EPS support, every EPS picture will appear as a striked out rectangle whose aspect ratio is unknown. The programm will assume 1/1 which is probably wrong. The EPSs will not be saved, neiter in the .pic files of tkTeXCad nor in the exported files. So, you should copy them with your whole LaTeX document. (The exported files contain absolute paths to the files.) <sect>Notes on the user interface <sect1>The display menu <p>Every click into the canvas will be transformed into LaTeX coordinates. Additionally it will be placed onto the nearest point in the grid. This grid can be hidden, but this does not change that behavior. If you don't want it, just make the grid spacing small enough. To change the coordinate system, the data in the upper field of the menu is used. It denotes the number of points on the screen that will be one TeX pt. <sect1>The menu picture parts <p>To create a new picture class, select the objects you want to transfer into (elements/... mark) and select "create new picture class". These objects will be deleted in the picture class you are just editing and pasted into the newly created class. Then, the program places the first instance of this newly created picture class exactly to where it took the objects from. The next menu items are the picture classes that you have already created. Some of them may be grayed to make it impossible to insert them into classes whose instances they contain (to avoid circular references). The last menu item gives access to editing all classes. This does not really fit in here, but probably needs some explanation: Objects that are \multiputted can be changed into several stand-alone objects by selecting "create count simple objects". The same thing can be done with an instance of a picture class. This detaches it from its picture class; changes to the picture class will not affect the newly created objects any more. <sect>The file menu <p>Load, save and import refer to the files created by TkTeXCAD and pickle. Import will only work, if the imported file does not contain any picture classes whose names are ambiguous with those already in memory. The imported classes can then be selected in the menu picture classes. Exporting creates for every picture class a .tex file with the same name. These refer to one another and can be placed into your LaTeX source using \import{<em/name/> </article>