(texdraw)TeX text


Next: Circles and arcs Prev: Line vectors Up: TeXdraw Commands
Enter node , (file) or (file)node

2.6 TeX text
============

Text may be superimposed on the drawing.  The text argument of the
'\htext' command is in horizontal mode.  This text can be ordinary text,
math mode expressions, or even more complicated boxes consisting of
tables and the like.  The resulting TeX text is placed in a box.  The
reference point of the box can be chosen to be one of nine locations:
horizontally left, center or right; vertically top, center or bottom.
The '\htext' command takes one of two forms.

'\htext (X Y){TEXT}'
'\htext {TEXT}'
     The first form of this command places the TeX text TEXT
     horizontally with the text reference point at the coordinate '(X
     Y)'.  The new current position is '(X Y)'.  The second form of this
     command places the TeX text TEXT horizontally with the text
     reference point at the current position.  The text reference point
     is set with the '\textref' command.

   Text can be placed vertically using the '\vtext' command.  The text
argument is in horizontal mode.  The TeX text is placed in a box and
then rotated counterclockwise.  The reference point is the point in the
box, _before_ rotation of the text.  Not all PostScript printer drivers
support vertical text.

'\vtext (x y){TEXT}'
'\vtext {TEXT}'
     The first form of this command places the TeX text TEXT vertically
     with the text reference point at the coordinate '(X Y)'.  The new
     current position is '(X Y)'.  The second form of this command
     places the TeX text TEXT vertically with the text reference point
     at the current position.  In both cases, the TeX text is placed in
     a box and the box is rotated counterclockwise by 90 degrees about
     the text reference point.  The text reference point is set with the
     '\textref' command.

   Text can be placed at an arbitrary angle using the '\rtext' command.
The text argument is in horizontal mode.  The TeX text is placed in a
box and then rotated counterclockwise.  The reference point is the point
in the box, _before_ rotation of the text.  Not all PostScript printer
drivers support rotated text.

'\rtext td:ANGLE (x y){TEXT}'
'\rtext td:ANGLE {TEXT}'
     The first form of this command places the TeX text TEXT at an angle
     with the text reference point at the coordinate '(X Y)'.  The new
     current position is '(X Y)'.  The second form of this command
     places the TeX text TEXT at an angle with the text reference point
     at the current position.  In both cases, the TeX text is placed in
     a box and the box is rotated counterclockwise by ANGLE degrees
     about the text reference point.  The text reference point is set
     with the '\textref' command.

   The reference point for subsequent TeX text in a '\htext', '\vtext'
or '\rtext' command is set with the '\textref' command.

'\textref h:H-REF v:V-REF'
     Set the text reference point for subsequent text commands.  The
     horizontal reference point H-REF is one of 'L', 'C' or 'R' (left,
     center or right).  The vertical reference point V-REF is one of
     'T', 'C' or 'B' (top, center or bottom).  For rotated text, the
     reference point is determined before rotation.  The initial text
     reference point corresponds to '\textref h:L v:B'.

   The font used to render the text is determined as for any other TeX
text.  Normally the font used outside of TeXdraw is in effect.  If
desired, other fonts can be specified as part of the text.  Any font
changes within a TeXdraw text command remain local to that command.

   Only the coordinate of the text reference point in a '\htext',
'\vtext' or '\rtext' command is used in calculating the size of the
drawing.  This means that text itself can spill outside of the drawing
area determined by TeXdraw.  The area of the drawing can be increased to
include the text by issuing additional '\move' commands.

     \centertexdraw{
                  \avec(-0.75 -0.25) \textref h:R v:C \htext{H-text}
       \move(0 0) \avec(-0.75 +0.25) \textref h:R v:B \htext{H-text}
       \move(0 0) \avec(0 +0.5)      \textref h:L v:T \vtext{V-text}
       \move(0 0) \avec(+0.75 +0.25) \textref h:L v:B \htext{H-text}
       \move(0 0) \avec(+0.75 -0.25) \textref h:L v:C \htext{H-text}
     }


automatically generated by info2www version 1.2.2.9