(texdraw)Accessing TeXdraw


Next: Command syntax Up: TeXdraw Commands
Enter node , (file) or (file)node

2.1 Accessing TeXdraw
=====================

The form of the user command to run the TeX program depends on which
version of TeX is being used, and which other macro packages are
preloaded as format files.  Typically, installations have at least two
versions of TeX -- plain TeX which includes basic typesetting macros
(usually invoked as 'tex') and LaTeX2e which includes the LaTeX2e
typesetting macros (usually invoked as 'latex').  An older version of
LaTeX, version 2.09, may also be available.  The TeXdraw macros can be
used with plain TeX and with either version of LaTeX.

   For use with plain TeX, the user must read in the TeXdraw macros from
the file 'texdraw.tex'.
     \input texdraw            % Read in the TeXdraw macros
      ...
     \btexdraw
       ...                     % TeXdraw commands to generate a drawing
     \etexdraw

   For use with LaTeX version 2.09, the user reads in the TeXdraw macros
from the file 'texdraw.tex' and optionally defines the '\begin{texdraw}'
/ '\end{texdraw}' environment.
     \documentstyle[11pt]{article}  % Article style with the 11pt size options
     ...
     \input texdraw            % Read in the TeXdraw macros
     \newenvironment{texdraw}{\leavevmode\btexdraw}{\etexdraw}
      ...
     \begin{texdraw}
       ...                     % TeXdraw commands to generate a drawing
     \end{texdraw}
     ...
     \end{document}

   For use with LaTeX2e, the user must load the 'texdraw' package (file
'texdraw.sty').  This package file defines the '\begin{texdraw}' /
'\end{texdraw}' environment, brings in the standard 'graphics' package
and reads in the file 'texdraw.tex' containing the definitions of the
TeXdraw macros.
     \documentclass[11pt]{article}  % Article class with the 11pt size option
     \usepackage{texdraw}           % TeXdraw commands

     \begin{document}
      ...
     \begin{texdraw}
       ...                     % TeXdraw commands to generate a drawing
     \end{texdraw}
      ...
     \end{document}

   As the TeXdraw commands are processed by TeX, an intermediate
PostScript file is generated.  The intermediate PostScript has a name of
the form 'NAME.ps1'.  The name part is derived from the name of the main
TeX file being processed.  If more than one drawing is produced, the
digit in the file name extension is incremented.(1)

   The TeXdraw commands to produce a drawing are inserted between
'\btexdraw' and '\etexdraw' commands, or for LaTeX, between
'\begin{texdraw}' and '\end{texdraw}' commands.  This results in a TeX
box of appropriate size containing the drawing generated by the TeXdraw
commands.  The TeXdraw box can be positioned in a document like any
other TeX box.

   The '\centertexdraw{...}' macro centers the box generated by TeXdraw.
The vertical space taken up is equal to the vertical size of the
drawing.  The '\centertexdraw' macro is normally used in vertical mode
(between paragraphs).  A '\par' command (a blank line will do also)
before a '\centertexdraw' command will terminate horizontal mode and
return to vertical mode.  For LaTeX, a structured equivalent to the
'\centertexdraw{...}' command is shown below.
     \begin{center}
     \begin{texdraw}
       ...
     \end{texdraw}
     \end{center}

   The '\everytexdraw' command can be used to define a set of TeXdraw
commands that will be executed at the beginning of every TeXdraw
drawing.  It is invoked as '\everytexdraw{ ...}', with the desired
TeXdraw commands as arguments.

'\btexdraw'
     Start a TeXdraw drawing.  The drawing is terminated with an
     '\etexdraw' command.
'\etexdraw'
     End a TeXdraw drawing started with a '\btexdraw' command.  The
     resulting TeXdraw drawing is placed in a box with height equal to
     the height of the drawing and width equal to the width of the
     drawing.  The depth of the box is zero.
'\begin{texdraw}'
     Start a TeXdraw drawing.  The drawing is terminated with an
     '\end{texdraw}' command.  This command is for use with LaTeX.
'\end{texdraw}'
     End a TeXdraw drawing started with a '\begin{texdraw}' command.
     The resulting TeXdraw drawing is placed in a box with height equal
     to the height of the drawing and width equal to the width of the
     drawing.  The depth of the box is zero.  This command is for use
     with LaTeX.
'\centertexdraw{ ... }'
     Center a TeXdraw box horizontally.  The argument contains TeXdraw
     commands.  The resulting box has the horizontal size '\hsize' and
     height equal to the height of the drawing.
'\everytexdraw{ ... }'
     Specify TeXdraw commands to be executed at the beginning of every
     TeXdraw drawing.

   ---------- Footnotes ----------

   (1) After the ninth PostScript file, the name of the intermediate
PostScript file takes the form 'NAME.p10', with the number increasing
from 10 with each file.


automatically generated by info2www version 1.2.2.9