Previous Bottom
 First Last
 Next Bottom

1 Introduction
The picture environment in the LATEX macro package for TEX allows simple line drawing using characters. These characters include quadrant circular arcs, solid disks with diameters from 1 to 15pt and short lines with a limited range of slopes in two thicknesses. A \begin{picture} command defines an area where following commands place these characters to draw a LATEX picture.
L
ATEX pictures save disk space for source descriptions and computer time in producing documents compared with printer commands or bit mapped graphics. From initial pencil sketch on squared graph paper to final printout, they take half the time for manual pen drawings. The labor savings are higher for revisions and rewrites. Unfortunately standard LATEX cannot yet draw curves like a pen, compass and French curves can.
Superimposing characters closely can draw any curve. Disks give directional independence of line thickness and visual smoothness at large pitch. Smoothness increases with output resolution but is almost independent of disk pitch below a critical maximum. The following table suggests this maximum varies from 0.34pt for an 0.5pt thick curve to 3pt for a 15pt curve.
 Thickness Magnified Comments Line at 1/6 slope 15pt 1pt pitch disks 15pt 3pt pitch disks 0.5pt LATEX \line(6,1) 0.5pt 0.34pt pitch disks 0.5pt _ 0.34pt pitch disks resolution _
_
LATEX \line or line drawing \special commands require a tenth the TEX memory so are preferable to disks if available. A smooth curve may require thousands of disks or hundreds of lines. LATEX can load TEX macros from style files with a .sty extension. These macros can calculate the disk or line positions for a curve.
curves.sty provides macro commands for drawing curves using disks. Version 1.41 loads in about 2500 words of TEX's main memory, which allows a small TEX. Complex or numerous floating drawings still require a big TEX with curves.sty. curvesls.sty uses fewer disks and line drawing \specials for increased speed and a tenth the TEX memory.
The capabilities of these macros are:---

 A compatible replacement for \bezier from bezier.sty or LaTeX2e. Work with SLiTeX for overhead transparencies and LaTeX2e Curves have the minimum number of disks or straight lines for visual smoothness. Curve thickness adjustable from 0.5 to 15pt (0.17 to 5mm). Curves have continuous slope. Curves for any number of points greater than one using \curve. Control of end slopes using \tagcurve. Closed curves with continuous slope using \closecurve. Large circles \bigcircle and circular arcs \arc. Independent scaling of curve abscissa and ordinates to fit graphs. Affine scaling for making arcs or circles elliptical. Symbols and dash patterns combined without interference. Any dash length or spacing. Three methods for fitting dash patterns to curves.
Parabolas approximate the segments between the specified coordinate points. At an internal point, the slope of the parabolas joining from either side is the same as the straight line joining the points on either side. For an end segment, the inside point of the parabola is made a vertex which determines the slope of the end point. \tagcurve has hidden end segments which allows complete control of slope at the visible end point when desired.
The four points at the end and adjacent to a segment may make a parabola inappropriate. The points could be close to a straight line or consistent with an inflexion point. A straight line then replaces the parabola and optionally a warning is issued.
The parabolas are drawn as a series of short straight line segments. For
curvesls.sty, the dvi driver draws the straight lines as instructed by \special commands. For curves.sty, the straight lines are drawn as overlapping disks at high speed using a simple tail chasing macro. This macro's arithmetic calculations are two fixed point additions per disk drawn.
The TEX arithmetic in
curves.sty for the initial differences between disk positions gives an error of less than 0.005% at the segment end. Even for a segment 1000pt long, this is less than 0.05pt and the resolution of most output devices. Errors are sometimes slightly larger between coordinates but you can reduce them if necessary by specifying more coordinates.
For circles and circular arcs, a parabola approximates an arc segment no more than 23 giving a radius increase between segment ends less than 0.02%. The error in computing and multiplying by sine and cosine is usually less than 0.01% of the radius at the far end of an arc.
Brief descriptions, simple examples and a command summary follow. They presume familiarity with relevant chapters of the L
ATEX manual.
Figure 1: This is a box.

Leslie Lamport, LATEX A Document Preparation System 2nd ed., Addison-Wesley, 1994.
Donald E. Knuth, The TEXbook, Addison-Wesley, 1984.
A printer's point, abbreviated pt, is approximately 0.351460 mm.
Donald E. Knuth,
The TEXbook, Addison-Wesley, 1984, Chapter 20.
A character or token takes a TEX word, 32 bits or larger.
See your Local Guide. Try the system command latex local to get a LATEXed Guide.
Michel Goossens, Frank Mittelbach and Alexander Samarin, The LATEX Companion, Addison-Wesley, 1994.