Académique Documents
Professionnel Documents
Culture Documents
=========================
<<About TpX drawing tool>>
<<TpX usage>>
<<TpX output formats>>
<<Export formats>>
<<Import>>
<<TpX primitives>>
<<Bitmap objects>>
<<LaTeX preamble>>
<<LaTeX figure environment>>
<<Using mouse for editing>>
<<TpX command line options>>
<<Preview>>
<<Program settings>>
<<Picture properties>>
<<Some painting details>>
<<Lazarus version of TpX>>
<<Adding TpX to WinEdt menu>>
<<Image tool>>
<<TpX modifications log file>>
<<Acknowledgements>>
<<Links>>
About TpX drawing tool
=========================
TpX is a lightweight, easy-to-use graphical editor for Windows
platform for creation of drawings and inclusion them into LaTeX files
in publication-ready form. It can also be used as a stand-alone editor
for vector graphics.
The output is a file (with extension .TpX) containing the drawing as
LaTeX code or as an \includegraphics link to an external file created
by the program. User can choose between several <<output formats>>.
TpX saves its own data in TeX file comments so that the drawing could
be loaded into TpX and edited again. This internal TpX format is based
on XML and could be understood and edited easily.
environment to put text over the picture. Can not be used with
PdfLaTeX.
* PDF. Included in TpX in the same fashion as EPS. Can only be used with
PdfLaTeX, not LaTeX/DVI.
* PDF from EPS. PDF is created from EPS using GhostScript. Set the path
to the program in <<"TpX Settings">>. (The format is called epstopdf
for historical reasons).
* PGF. PGF code is kept in LaTeX pgfpicture environment similar to
picture environment. Requires pgf package. Compatible with both
LaTeX/DVI and PdfLaTeX.
* TikZ. TikZ is similar to PGF (and is based upon it), but is more
readable. Requires tikz package.
* PSTricks. PSTricks code is kept in TeX pspicture environment similar
to picture environment. Requires pstricks package. Not compatible with
PdfLaTeX.
* Metapost. Graphic language similar to pstricks, but an external file
is created and an external MetaPost program is needed. Set the path to
the program in <<"TpX Settings">>. Compatible with both LaTeX/DVI and
PdfLaTeX. TeX is used to typeset text labels in MetaPost. This could
be turned off by setting MetaPostTeXText to 0. Use metapost.tex.inc
file to configure LaTeX preamble used in MetaPost files
(\documentclass command and \usepackage commands for needed packages).
* Bitmap (PNG, BMP). Requires graphicx LaTeX package. Obviously, bitmap
is not vector graphics, so it is not scalable. TpX does not use LaTeX
to write text in bitmaps, so they can not incorporate LaTeX formulas.
PNG is compatible with both LaTeX/DVI and PdfLaTeX. Currently BMP is
not compatible with PdfLaTeX. Currently bitmaps are not compatible
with DVIPS and dvi2pdf; they are for DVI viewers only when used with
LaTeX. Thus, bitmaps are most useful with PdfLaTeX.
* Enhanced Metafile (EMF). Can be used with LaTeX/DVI for preview (it is
converted to bitmap for this purpose). Not compatible with PdfLaTeX.
Recommended as <<export format>> only.
* None. Set format to 'none' if you do not need output.
All TeX packages used are available from CTAN [http://www.ctan.org/].
See also <<Export formats>>
Export formats
=========================
To import TpX drawing into some other program, to embed fonts into
EPS/PDF or to publish drawing on the Web TpX export capabilities could
be used ("Save as.." in "File" menu). TpX can export to several
formats. Note that most export formats can not incorporate TeX fonts
and formulas (however, see below on "LaTeX EPS", and derived formats;
also note MetaPost which is LaTeX-aware).
* EPS. Type 1 font (.pfb) could be embedded. Set the path to a font in
<<"TpX Settings">>.
Set the path to the program in <<"TpX Settings">>. The utility could
be downloaded from http://pstoedit.com/.
TpX primitives
=========================
Line (can include arrows)
Rectangle
Polyline
Polygon
Circle
Ellipse
Arc
Sector
Segment
Curve
Closed curve
Bezier path
Closed Bezier path
Text
Star
Symbol
<< Bitmap>>
Bitmap objects
=========================
Bitmaps are included in TpX drawings as external files. TpX
understands JPEG, PNG and BMP images. Image files can be in the same
directory as the parent drawing or in a subdirectory. If inserted
bitmap is not in a subdirectory then "bitmaps" subdirectory is created
and the file is moved there.
In order to include bitmap in a LaTeX document TpX has to convert it
to EPS. Set the path to converter program in <<"TpX Settings">>
(Bitmap2EpsPath). It is recommended to use sam2p utility which could
be downloaded from http://www.inf.bme.hu/~pts/sam2p/. It is also
possible to use the widespread bmeps utility.
Bitmaps can not be used with 'tex' and 'metapost' output formats.
LaTeX preamble
=========================
This is a sample preamble to include in parent LaTeX file. It uses
ifpdf package to switch between two different modes of running
PdfLaTeX. (Download ifpdf from CTAN [http://www.ctan.org/] if you do
not have one). Comment out unused packages or just delete the
corresponding commands.
\documentclass[a4paper,10pt]{article}
\usepackage{color}
\usepackage{ifpdf}
\ifpdf %if using pdfLaTeX in PDF mode
\usepackage[pdftex]{graphicx}
\DeclareGraphicsExtensions{.pdf,.png,.jpg,.jpeg,.mps}
\usepackage{pgf}
\usepackage{tikz}
\else %if using LaTeX or pdfLaTeX in DVI mode
\usepackage{graphicx}
\DeclareGraphicsExtensions{.eps,.bmp}
\DeclareGraphicsRule{.emf}{bmp}{}{}% declare EMF filename extension
\DeclareGraphicsRule{.png}{bmp}{}{}% declare PNG filename extension
\usepackage{pgf}
\usepackage{tikz}
\usepackage{pstricks}
\fi
\usepackage{epic,bez123}
\usepackage{floatflt}% package for floatingfigure environment
\usepackage{wrapfig}% package for wrapfigure environment
associated with the image extension. Note that the fonts are normally
not embedded and the result is not as nice as it is with LaTeX. So use
this for quick preview or for drawings without complex text or
formulas.
Temporary LaTeX document is produced using one of the following
sequences:
* LaTeX -> DVI
* LaTeX -> DVI -> PS
* PdfLaTeX -> PDF
Make sure that the paths to the tools (LaTeX, PdfLaTeX, DVIPS) and
viewers needed are set in <<"TpX Settings">>.
LaTeX preamble is taken from the preview.tex.inc file. This is
basically a \documentclass command. Current version of TpX adds the
packages it needs (graphicx, color, pstricks, pgf, tikz, epic, bez123,
floatflt, wrapfig) automatically. However, make sure that other
relevant packages are included in LaTeX preamble. For example, if you
use AMS fonts, put \usepackage[psamsfonts]{amssymb} to the preamble.
Do not forget to include language and encoding stuff as needed. For
example,
\usepackage[english,russian]{babel}
\usepackage[cp1251]{inputenc}
Program settings
=========================
Program settings can be changed in "TpX Settings" (in "Files" menu).
The settings are stored in TpX.ini. For the meaning of the settings
used to set initial properties for a new picture (like
PicScale_Default) see <<Picture properties>>.
* PicScale_Default: Default value of PicScale
* Border_Default: Default value of Border
* TeXFormat_Default: Default value of TeXFormat
* PdfTeXFormat_Default: Default value of PdfTeXFormat
* BitmapRes_Default: Default value of BitmapRes
* PicMagnif_Default: Default value of PicMagnif
* IncludePath_Default: Default value of IncludePath
* LineWidth_Default: Default value of LineWidth
* ArrowsSize_Default: Default value of ArrowsSize
* StarsSize_Default: Default value of StarsSize
* HatchingStep_Default: Default value of HatchingStep
* HatchingLineWidth_Default: Default value of HatchingLineWidth
Picture properties
=========================
Picture properties are stored inside .TpX file. Default values (which
are used for the new drawings) are taken from <<"TpX Settings">>.
(FontName is left empty which means the use of FontName_Default).
* Caption: Text for LaTeX \caption
* Comment: Information about the picture
* Label: Id for LaTeX \label
* PicScale: Picture scale (mm per unit), physical size of the logical
unit representing picture coordinates. (This unit is referred to as
"sp" in hints for other picture properties). Use PicScale to scale
picture without scaling line widths and other dimensions set in
physical units.
* Border: Picture border (mm)
* TeXFormat: Format for including picture in TeX (tex, pgf, pstricks,
eps, png, bmp, metapost, tikz, emf, none)
* PdfTeXFormat: Format for including picture in PdfTeX (tex, pgf, pdf,
png, metapost, tikz, epstopdf, none)
* BitmapRes: Bitmap resolution in pixels per meter. Use BitmapRes to set
resolution of exported PNG and BMP images). Conversion between pixels
per meter (PPM) and pixels per inch (PPI): 100 PPI = 3937 PPM 300 PPI
= 11811 PPM 600 PPI = 23622 PPM
* PicMagnif: Picture physical size magnification factor. Use PicMagnif
to change the meaning of mm for quick rescaling of the picture
* IncludePath: Path to add before \includegraphics file name (like
mypictures/)
* LineWidth: Basic line width (mm). Line widths for the drawing are set
as fractions of this quantity
* ArrowsSize: Arrows size (sp)
* StarsSize: Stars size (sp)
* HatchingStep: Hatching step (mm)
* HatchingLineWidth: Hatching line width (fraction of LineWidth)
* DottedSize: Dotted line step size (mm)
* DashSize: Dashed line step size (mm)
* DefaultFontHeight: Default font height (sp)
* FontName: Font for text labels. Leave FontName empty to use
FontName_Default
* DefaultSymbolSize: Default symbol size factor ("diameter", sp)
Line join. Currently TpX uses only "miter line join" (not "bevel join"
or "round join").
Miter limit. Used to cut off too long spike miter join could have when
the angle between two lines is sharp. If the ratio of miter length
(distance between the outer corner and the inner corner of the miter)
to line width is greater than miter limit, then bevel join is used
instead of miter join. Default value of miter limit is 10. This option
is not applicable to LaTeX-picture and PsTricks formats.
Line cap. Currently TpX uses only "butt" line caps.
Fill rule. Currently TpX uses only "nonzero winding" fill rule (as
opposed to "even-odd" aka "alternate").
References:
* Scalable Vector Graphics (SVG) Specification by W3C
http://www.w3.org/TR/SVG/
* PostScript Language Reference by Adobe Systems ("Red Book")
http://www.adobe.com/products/postscript/resources.html
Lazarus version of TpX
=========================
Lazarus is a cross platform clone of Delphi based on open source Free
Pascal compiler. Lazarus version of TpX has some limitations. Some of
the major known ones are
* Export of bitmap images (PNG, BMP) is not working (this feature needs
conversion of Graphics32 package to Lazarus)
* Export of EMF images is not working
* Import of WMF images is not working
* No "Capture EMF"
* "Image tool" is not working
* Alignment of text labels is incorrect (correct alignment needs
additional information about font dimensions)
Adding TpX to WinEdt menu
=========================
* Edit TpX_menu.dat, replacing Path_to_TpX by the actual path to TpX.exe
* Start "Macros">"Execute Macro..."
* Choose install_TpX.edt
Default keyboard shortcut is Alt+P. You can change this in
"Options">"Menu Setup">"Tools">"TpX drawing tool"
Typing Alt+P in a TeX document with included TpX drawings will run
TpX.exe and load a drawing into it. The drawing closest to the current
cursor position will be opened. The TpX file containing drawing need
not exist.
=========================================
2004-10-31 TpX Version 1.0.1 released
=========================================
[+] PDF from EPS using epstopdf
[+] Type 1 fonts in EPS
[-] Incorrect help about WinEdt installation (edit TpX_menu.dat,
not install_TpX.edt)
[-] Ini file location was not linked to exe file path
[-] Error when running on Windows system with comma set as a
decimal point
=========================================
2004-10-24 TpX Version 1.0 released
=========================================
Acknowledgements
=========================
Modules used in TpX:
CADSYS 4.0
Copyright (c) 2001 Piero Valagussa
pivalag[@@@]tin.it
Graphics32 library
Copyright (c) 2000-2004 Alex Denisov and Contributors
http://graphics32.org
PowerPdf library, ver 0.9
Takeshi Kanno
http://www.est.hi-ho.ne.jp/takeshi_kanno/powerpdf/
XML library
Copyright (c) 2002 Ravil Batyrshin, Mikhail Vlasov (Aravil Software)
http://www.torry.net/vcl/internet/html/mvrbxmlparsers.zip
PNG Component
Copyright (c) Gustavo Huffenbacher Daud,
http://pngdelphi.sourceforge.net
HTML Help Kit for Delphi,
Copyright (c) 1999 The Helpware Group
http://www.helpware.net
MD5 Message-Digest for Delphi
Copyright (c) 1997-1999 Medienagentur Fichtner & Meyer
Written by Matthias Fichtner
http://www.fichtner.net/delphi/md5.delphi.phtml
StitchSAX 1.1 - Trivial SAX parser for Delphi
Copyright (c) 2002, Roman Poterin
poterin[@@@]mail.ru
Paszlib