(page i)

The PICTEX Manual

Michael J. Wichura

The University of Chicago

(page ii)

First printing: November 1986 Second printing: September 1987

This manual was written using TEX supplemented by the PICTEX macros. The features described herein exist in Version 1.1 of PICTEX.

The PICTEX project was carried out using computer facilities supported in part by National Science Foundation Grant No. DMS-8404941 to the Department of Statistics at the University of Chicago.

The author provides no guarantee as to the correctness of this manual and the associated software; the user accepts them as is.

Copyright \begin{matrix}c \\ ◯ \end{matrix} 1987 by Michael J. Wichura All rights reserved.

(page iii)

PREFACE

In the preface to The TEXbook, Knuth describes TEX as a “typesetting system intended for the creation of beautiful books—and especially for books that contain a lot of mathematics”. PICTEX is a collection of TEX macros by means of which TEX users can easily instruct TEX to typeset beautiful pictures as a part of their books—and especially mathematical figures, such as the one below:

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

0.0 0.5 α β 1.0

t

shaded area is A(β) − A(α)

0.0 1.0 2.0 a(t)

Density a(t) = 1/(π\sqrt{t(1 − t)} ) of the arc sine law

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

0.0  0.5  1.0
x

0.0 0.5 1.0

A(x)

Distribution function A(x) = \frac{2}{π} arcsin(\sqrt{x}) of the arc sine law

FIGURE 1

That figure is destined to appear in a book on probability theory that I’m writing using TEX. Indeed, the PICTEX macros are an outgrowth of the attempt I made at coercing TEX into drawing the kinds of figures I wanted to include in that book. Happily, it turned out that what I wanted to be able to do fell just within the limits of what seems feasible by way of making TEX function as a graphics device.

PICTEX offers these advantages: (1) Figures become an integral part of the typesetting process. You can avoid having to leave the proper amount of space in your document for material that has to be created on some external device and later stripped into the finished product. (2) All of TEX’s formatting capabilities are available for annotating your figures. In addition, that annotation will be done (if you so desire) in the same fonts as you’re using in the rest of your document. (3) Just as TEX is machine independent, so too is PICTEX. It doesn’t matter whether you’re working on a PC or mainframe computer. (4) Since typeset figures are embedded in the dvi file along with the

(page 1)

1. INTRODUCTION

1.1. PICTEX COMMANDS

To draw a PICture you first have to load the PICTEX macros into TEX’s memory—see your local system guru for details. To start drawing a PICture you type the command \beginpicture, and to finish it off you type the command \endpicture. The overall structure is thus

   \beginpicture

additional PICTEX commands

   \endpicture

All this goes in your TEX input file.

The PICTEX commands are described in detail in the following pages. A few words need to be said here about the syntax with which sample commands are presented. Consider, e.g., the \put command of Subsection 2.1:

\put {text} [[[o_{x}][o_{y}]]] [<xshift,yshift>] at xcoord ycoord

First of all, notice the matched pairs of thin brackets: [ ] and [ ]. In contrast to the thick brackets ‘[’ and ‘]’, these are \underline{not} part of the command; rather they indicate that the phrases contained therein may be omitted. Secondly, note the blank spaces separating the various phrases of the command. These are \underline{essential}. However to enhance the readability of your input, you can use as many spaces as you like (provided there is at least one) wherever a sample command shows a single space. Moreover, at least one blank \underline{must} follow every PICTEX command. Do try hard to get the syntax of the PICTEX commands right, paying particular attention to the delimiters {, }, [, ], <, >, (, ), and /. If you mess up, TEX will get confused and you will get a lot of error messages—and quite possibly no PICture. Appendix C lists all the PICTEX commands alphabetically, so you can easily check the syntax of any command you write.

Exercise 1. B. L. User didn’t pay attention to the three words that were underlined in the preceding paragraph. What price did he pay in consequence?

It is important that you understand TEX’s concept of grouping (see Chapter 5 of The TEXbook). The point is that any change you make to one of PICTEX’s parameters is local to the group in which that change is made. In particular, since \beginpicture and \endpicture mark the start and end of a group, TEX will undo the changes you’ve made while drawing a PICture once it reaches the terminating \endpicture command. Consider, e.g., the effect of PICTEX’s \setcoordinatesystem command, which is discussed in the next subsection. There is a major difference between typing

APPENDICES

A. ANSWERS TO ALL THE EXERCISES

1. Untold hours of frustration.

2. The reference point of the first system is at its origin, while the reference point of the second system is 20 x-units to the left of its origin. Since 1 x-unit in the second system amounts to 10 pts, the origin of the second system is 200 pts to the right of that of the first system.

3. (1) He should have omitted the [’s and ]’s. (He presumably skimmed Subsection 1.1 and so misinterpreted the [ ]’s that appear in the statement of the syntax of the \setcoordinatesystem command on page 3.) (2) He should have left a space after ‘units’. (3) He should have typed ‘1in,2in’ instead of ‘1inch,2inches’. (Page 57 of The TEXbook lists the only ways dimensions can be written). (4) He should have typed ‘3 -2’ instead of ‘(3,-2)’.

4. \put {$\bullet$} at 1 2
\put {$(1,2)$} [l] <10pt,0pt> at 1 2
5. \put {\ninepoint$\bullet$} at 1 2
\put {\ninepoint $(1,2)$} [l] <10pt,0pt> at 1 2

or (better)

\ninepoint
\put {$\bullet$} at 1 2
\put {$(1,2)$} [l] <10pt,0pt> at 1 2

6. The author used

\setcoordinatesystem units <1pt,1pt>
\put {\vrule height .4pt width 300pt} [l] at 0 0
\multiput {\vrule height 18pt} [t] at  0 0  *3 100 0  /
\multiput {\vrule height 14pt} [t] at  0 0  *6  50 0  /
\multiput {\vrule height 10pt} [t] at  0 0  *30 10 0  /
\multiput {\vrule height  6pt} [t] at  5 0  *29 10 0  /
\put {0 pt}   [t] at   0 -24   \put {100 pt} [t] at 100 -24
\put {200 pt} [t] at 200 -24   \put {300 pt} [t] at 300 -24

7. You get: (3, 2) → × stacking is as simple as ABC

8. You get: (3, 2) → × Rows of lines are easy to put into a PiCture

9. (a) No. In the first case the word ‘lines’ sits just above the point (3, 2), whereas in the second case the word ‘Two’ sits just above this point. (b) Yes.

(page v)

CONTENTS

PREFACE . . . . . . . . . . . . . . . . . . . . . iii

SECTION

1. INTRODUCTION . . . . . . . . . . . . . . . . . . . 1 1.1. PICTEX COMMANDS . . . . . . . . . . . . . . . 1 1.2. COORDINATE SYSTEMS . . . . . . . . . . . . . . 2

2. PUTTING TEXT INTO A PICTURE . . . . . . . . . . . . 4 2.1. SINGLE PUTS . . . . . . . . . . . . . . . . . 4 2.2. MULTIPLE PUTS . . . . . . . . . . . . . . . . 6 2.3. STACKS OF LETTERS AND ROWS OF LINES . . . . . . . 8

3. GRAPH SETUP . . . . . . . . . . . . . . . . . . . 9 3.1. ESTABLISHING A PLOT AREA . . . . . . . . . . . . 10 3.2. DRAWING AXES . . . . . . . . . . . . . . . . 10 3.3. HEADINGS AND GRIDS . . . . . . . . . . . . . . 14 3.4. MODIFYING THE DEFAULTS FOR GRAPH SETUP . . . . . 15

4. RULES AND OBJECTS MADE FROM THEM . . . . . . . . . 17

4.1. RULES . . . . . . . . . . . . . . . . . . . . 17

4.2. RECTANGLES . . . . . . . . . . . . . . . . . 18 4.3. HISTOGRAMS . . . . . . . . . . . . . . . . . 19 4.4. BAR GRAPHS . . . . . . . . . . . . . . . . . 21 4.5. PICTEX’S INTERPOLATION MODES . . . . . . . . . . 22

5. LINES AND CURVES . . . . . . . . . . . . . . . . . 23 5.1. PIECEWISE LINEAR AND QUADRATIC INTERPOLATION . . 23 5.2. SPECIFYING THE PLOT SYMBOL . . . . . . . . . . 25 5.3. CIRCLES AND ELLIPSES . . . . . . . . . . . . . . 26

5.4. ARROWS . . . . . . . . . . . . . . . . . . . 27

5.5. THE ROLE OF PLOT AREAS . . . . . . . . . . . . 28 5.6. REPLOTTING LINES AND CURVES . . . . . . . . . . 29 5.7. THE CURVE DRAWING ALGORITHM . . . . . . . . . 31

6. DOTS AND DASHES . . . . . . . . . . . . . . . . . 34 6.1. SIMPLE DOT AND DASH PATTERNS . . . . . . . . . . 34 6.2. GENERAL DASH PATTERNS . . . . . . . . . . . . 36 6.3. TAILORING A PATTERN TO THE LENGTH OF A CURVE … 37

7. SHADING . . . . . . . . . . . . . . . . . . . . . 38 7.1. SPECIFYING THE SHADING SYMBOL . . . . . . . . . 38 7.2. SPECIFYING THE SHADING LATTICE . . . . . . . . . 39 7.3. SHADING: VERTICAL MODE . . . . . . . . . . . . 40