1 % \iffalse meta-comment
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
31 %%% From File: ltpictur.dtx
34 \ProvidesFile{ltpictur.dtx}
35 [2015/02/21 v1.1k LaTeX Kernel (Picture Mode)]
37 \documentclass{ltxdoc}
38 \GetFileInfo{ltpictur.dtx}
50 \MaintainedByLaTeXTeam{latex}
59 % \changes{v1.0g}{1995/05/07}{Use \cs{hb@xt@}}
60 % \changes{v1.1a}{1995/05/19}{Support autoloading feature}
61 % \changes{v1.1b}{1995/06/13}{Use \cs{ProvidesFile} in autoload}
62 % \changes{v1.1d}{1995/07/12}{allow 2e commands in 209 mode. latex/1737}
63 % \changes{v1.1e}{1995/10/03}{New autoload code}
64 % \changes{v1.1h}{1999/04/15}{Replaced octal numbers, CAR}
65 % \changes{v1.1k}{2015/02/21}{Removed autoload code}
67 % \section{Picture Mode}
68 % Picture mode commands. In addition to the commands available in
69 % \LaTeX2.09, This section adds the new |\qbezier| command for
72 % \DescribeMacro{\qbezier}
73 % |\qbezier|\oarg{N}\parg{AX,AY}\parg{BX,BY}\parg{CX,CY}
74 % plots a quadratic Bezier curve from \parg{AX,AY} to \parg{CX,CY},
75 % with \parg{BX,BY} as the third Bezier point, using $N+1$ points
76 % equally spaced parametrically.
77 % If $N = 0$ (the default value), then a sufficient number of points
78 % are used to draw a connected curve--except that at most
79 % $|\qbeziermax| + 1$ points are drawn. A ``point'' is a square of
80 % side |\@wholewidth|.
82 % \DescribeMacro{\bezier}
83 % In addition, to be compatible with the old |bezier| package, a
84 % variant of this command, |\bezier|, is defined, in which the first
85 % argument is not optional.
90 % \changes{v0.1a}{1994/03/07}{Initial version, split from latex.dtx}
91 % \changes{v0.1a}{1994/03/07}{Long lines wrapped to 72 columns}
92 % \changes{v0.1b}{1994/04/24}
93 % {Removed surplus spaces after \cs{hbox to } in several cases}
94 % \changes{v0.1d}{1994/05/13}
95 % {Removed surplus braces from \cs{@if..} constructions}
96 % \changes{v0.1e}{1994/05/22}{Use new warning cmds}
97 % \changes{v1.0f}{1994/11/17}
98 % {\cs{@tempa} to \cs{reserved@a}}
100 % \begin{oldcomments}
102 % \unitlength = value of dimension argument
103 % \@wholewidth = current line width
104 % \@halfwidth = half of current line width
105 % \@linefnt = font for drawing lines
106 % \@circlefnt = font for drawing circles
108 % \linethickness{DIM} : Sets the width of horizontal and vertical lines
109 % in a picture to DIM. Does not change width of slanted lines
110 % or circles. Width of all lines reset by \thinlines and
113 % \picture(XSIZE,YSIZE)(XORG,YORG)
115 % \@picht :=L YSIZE * \unitlength
117 % \hb@xt@ XSIZE * \unitlength
118 % {\hskip -XORG * \unitlength
119 % \lower YORG * \unitlength
121 % \ignorespaces %% added 13 June 89
127 % height of \@picbox := \@picht
128 % depth of \@picbox := 0
129 % \mbox{\box\@picbox} %% change 26 Aug 91
135 % \raise Y * \unitlength \hb@xt@ 0pt { \hskip X * \unitlength
140 % \multiput(X,Y)(DELX,DELY){N}{OBJ} ==
144 % \@xdim := X * \unitlength
145 % \@ydim := Y * \unitlength
146 % while \@multicnt > 0
147 % do \raise \@ydim \hb@xt@ 0pt { \hskip \@xdim
149 % \@multicnt := \@multicnt - 1
150 % \@xdim := \@xdim + DELX * \unitlength
151 % \@ydim := \@ydim + DELY * \unitlength
156 % \shortstack[POS]{TEXT} : Makes a \vbox containing TEXT stacked as
157 % a one-column array, positioned l, r or c as indicated by POS.
161 % The `2ekernel' code ensures that a |\usepackage{autopict}| is
162 % essentially ignored if a `full' format is being used that has
163 % picture mode already in the format.
165 %<2ekernel>\expandafter\let\csname ver@autopict.sty\endcsname\fmtversion
168 % \begin{macro}{\@wholewidth}
169 % \begin{macro}{\@halfwidth}
172 \newdimen\@wholewidth
178 % \begin{macro}{\unitlength}
180 \newdimen\unitlength \unitlength =1pt
184 % \begin{macro}{\@picbox}
185 % \begin{macro}{\@picht}
193 % \begin{macro}{\picture}
194 % \changes{v0.1c}{1994/04/28}{(DPC) Ignore spaces before (}
195 % |#1| should be white space.
196 % \begin{macro}{\pictur@}
197 % \changes{v1.0h}{1995/05/12}{Macro added for latex/1355}
198 % |#1| should be a |(| (eating any white space before the bracket),
200 \long\gdef\picture#1{\pictur@#1}
202 \@ifnextchar({\@picture(#1)}{\@picture(#1)(0,0)}}
207 % \begin{macro}{\@picture}
209 \gdef\@picture(#1,#2)(#3,#4){%
211 \setbox\@picbox\hb@xt@#1\unitlength\bgroup
212 \hskip -#3\unitlength
213 \lower #4\unitlength\hbox\bgroup
218 % \begin{macro}{\endpicture}
219 % \changes{LaTeX2.09}{1991/08/26}
220 % {(RmS \& FMi) extra boxing level around \cs{@picbox}
221 % to guard against unboxing in math mode
222 % (proposed by John Hobby)}
227 \ht\@picbox\@picht\dp\@picbox\z@
232 % In the definitions of |\put| and |\multiput|, |\hskip| was replaced by
233 % |\kern| just in case arg |#3| = ``plus''. (Bug detected by Don Knuth.
234 % changed 20 Jul 87).
237 \long\gdef\put(#1,#2)#3{%
238 \@killglue\raise#2\unitlength
239 \hb@xt@\z@{\kern#1\unitlength #3\hss}%
244 % \begin{macro}{\multiput}
245 % \changes{v0.1c}{1994/04/28}{(DPC) Ignore spaces between )(}
246 % |#3| had better be a |(|.
248 \gdef\multiput(#1,#2)#3{%
255 % \begin{macro}{\multiput}
256 % \changes{v0.1c}{1994/04/28}{(DPC) Macro added}
258 \long\gdef\@multiput(#1,#2)#3#4{%
259 \@killglue\@multicnt #3\relax
260 \@whilenum \@multicnt >\z@\do
261 {\raise\@ydim\hb@xt@\z@{\kern\@xdim #4\hss}%
262 \advance\@multicnt\m@ne
263 \advance\@xdim#1\unitlength\advance\@ydim#2\unitlength}%
268 % \begin{macro}{\@killglue}
270 \gdef\@killglue{\unskip\@whiledim \lastskip >\z@\do{\unskip}}
274 % \begin{macro}{\thinlines}
275 % \begin{macro}{\thicklines}
277 \gdef\thinlines{\let\@linefnt\tenln \let\@circlefnt\tencirc
278 \@wholewidth\fontdimen8\tenln \@halfwidth .5\@wholewidth}
279 \gdef\thicklines{\let\@linefnt\tenlnw \let\@circlefnt\tencircw
280 \@wholewidth\fontdimen8\tenlnw \@halfwidth .5\@wholewidth}
285 % \begin{macro}{\linethickness}
287 \gdef\linethickness#1{\@wholewidth #1\relax \@halfwidth .5\@wholewidth}
291 % \begin{macro}{\ishortstack}
293 \gdef\shortstack{\@ifnextchar[\@shortstack{\@shortstack[c]}}
297 % \begin{macro}{\@ishortstack}
299 \gdef\@shortstack[#1]{%
302 \baselineskip-\p@\lineskip 3\p@
303 \let\mb@l\hss\let\mb@r\hss
304 \expandafter\let\csname mb@#1\endcsname\relax
311 % \changes{LaTeX2.09}{1991/08/14}
312 % {(RmS) inserted extra braces around entry for NFSS}
313 % \changes{LaTeX2.09}{1993/11/03}
314 % {(RmS) changed \cs{halign} to \cs{ialign} to initialize
315 % \cs{tabskip} and \cs{everycr}}
317 % \begin{macro}{\@ishortstack}
319 \gdef\@ishortstack#1{\ialign{\mb@l {##}\unskip\mb@r\cr #1\crcr}\egroup}
323 % \begin{macro}{\@stackcr}
324 % \begin{macro}{\@ixstackcr}
326 \gdef\@stackcr{\@ifstar\@ixstackcr\@ixstackcr}
327 \gdef\@ixstackcr{\@ifnextchar[\@istackcr{\cr\ignorespaces}}
332 % \begin{macro}{\@istackcr}
334 \gdef\@istackcr[#1]{\cr\noalign{\vskip #1}\ignorespaces}
338 % \begin{oldcomments}
343 % \@linelen := LEN * \unitlength
362 % \@tempcnta := |\@yyarg|
364 % then error: 'LATEX ERROR: Illegal \line or \vector argument.'
367 % \box\@linechar := \hbox{\@linefnt \@getlinechar(\@xarg,\@yyarg) }
368 % if \@yarg > 0 then \@upordown = \raise
370 % else \@upordown = \lower
371 % \@clnht := height of \box\@linechar
373 % \@clnwd := width of \box\@linechar
375 % then \hskip - width of \box\@linechar
376 % \reserved@a == \hskip - 2* width of box \@linechar
377 % else \reserved@a == \relax
379 % %% Put out integral number of line segments
380 % while \@clnwd < \@linelen
381 % do \@upordown \@clnht \copy\@linechar
383 % \@clnht := \@clnht + ht of \box\@linechar
384 % \@clnwd := \@clnwd + width of \box\@linechar
387 % %% Put out last segment
388 % \@clnht := \@clnht - height of \box\@linechar
389 % \@clnwd := \@clnwd - width of \box\@linechar
390 % \@tempdima := \@linelen - \@clnwd
391 % \@tempdimb := \@tempdima - width of \box\@linechar
392 % if @negarg then \hskip -\@tempdimb
393 % else \hskip \@tempdimb
395 % \@tempdima := 1000 * \@tempdima
396 % \@tempcnta := \@tempdima / width of \box\@linechar
397 % \@tempdima := (\@tempcnta * ht of \box\@linechar)/1000
398 % \@clnht := \@clnht + \@tempdima
399 % if \@linelen < width of box\@linechar
400 % then \hskip width of box\@linechar
401 % else \hbox{\@upordown \@clnht \copy\@linechar}
407 % if \@xarg < 0 then \hskip -\@linelen \fi
408 % \vrule height \@halfwidth depth \@halfwidth width \@linelen
409 % if \@xarg < 0 then \hskip -\@linelen \fi
412 % \@vline == if \@yarg < 0 \@downline else \@upline fi
415 % \@getlinechar(X,Y) ==
417 % \@tempcnta := 8*X - 9
419 % then \@tempcnta := \@tempcnta + Y
420 % else \@tempcnta := \@tempcnta - Y + 64
425 % \vector(X,Y){LEN} ==
429 % \@linelen := LEN * \unitlength
442 % {\@linefnt if \@xarg < 0 then \@getlarrow(1,0)
443 % else \@getrarrow(1,0)
447 % \@vvector == if \@yarg < 0 \@downvector else \@upvector fi
452 % \@tempcnta := |\@yarg|
454 % then \hskip - width of \box\@linechar
455 % \@upordown \@clnht \hbox
457 % if @negarg then \@getlarrow(\@xarg,\@yyarg)
458 % else \@getrarrow(\@xarg,\@yyarg)
460 % else error: 'LATEX ERROR: Illegal \line or \vector argument.'
464 % \@getlarrow(X,Y) ==
467 % then \@tempcnta := '33
468 % else \@tempcnta := 16 * X - 9
469 % \@tempcntb := 2 * Y
471 % then \@tempcnta := \@tempcnta + \@tempcntb
472 % else \@tempcnta := \@tempcnta - \@tempcntb + 64
478 % \@getrarrow(X,Y) ==
482 % 0 : \@tempcnta := '55
484 % then \@tempcnta := 24*X - 6
486 % then \@tempcnta := 49
487 % else \@tempcnta := 58 fi
490 % then \@tempcnta := 24*X - 3
491 % else \@tempcnta := 51 % X must = 3
493 % 3 : \@tempcnta := 16*X - 2
494 % 4 : \@tempcnta := 16*X + 7
497 % then \@tempcnta := \@tempcnta + 64
503 % \begin{macro}{\if@negarg}
509 % \begin{macro}{\line}
511 \gdef\line(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax
512 \@linelen #3\unitlength
513 \ifdim\@linelen<\z@\@badlinearg\else
514 \ifnum\@xarg =\z@ \@vline
515 \else \ifnum\@yarg =\z@ \@hline \else \@sline\fi
521 % \begin{macro}{\@sline}
524 \ifnum\@xarg<\z@ \@negargtrue \@xarg -\@xarg \@yyarg -\@yarg
525 \else \@negargfalse \@yyarg \@yarg \fi
526 \ifnum \@yyarg >\z@ \@tempcnta\@yyarg \else \@tempcnta -\@yyarg \fi
527 \ifnum\@tempcnta>6 \@badlinearg\@tempcnta\z@ \fi
528 \ifnum\@xarg>6 \@badlinearg\@xarg \@ne \fi
529 \setbox\@linechar\hbox{\@linefnt\@getlinechar(\@xarg,\@yyarg)}%
531 % If we have something like |\line(5,5){30}| the |\@linechar| will
532 % not contain a char and later on we will end in an infinite loop.
533 % So we check the width of the box and put in something as an
534 % emergency fix if necessary.
535 % \changes{v1.1k}{2003/08/27}{check for \cs{@linechar} being empty pr/3570}
537 \ifdim\wd\@linechar=\z@
538 \setbox\@linechar\hbox{.}%
541 \ifnum \@yarg >\z@ \let\@upordown\raise \@clnht\z@
542 \else\let\@upordown\lower \@clnht \ht\@linechar\fi
543 \@clnwd \wd\@linechar
545 \hskip -\wd\@linechar \def\reserved@a{\hskip -2\wd\@linechar}%
547 \let\reserved@a\relax
549 \@whiledim \@clnwd <\@linelen \do
550 {\@upordown\@clnht\copy\@linechar
552 \advance\@clnht \ht\@linechar
553 \advance\@clnwd \wd\@linechar}%
554 \advance\@clnht -\ht\@linechar
555 \advance\@clnwd -\wd\@linechar
556 \@tempdima\@linelen\advance\@tempdima -\@clnwd
557 \@tempdimb\@tempdima\advance\@tempdimb -\wd\@linechar
558 \if@negarg \hskip -\@tempdimb \else \hskip \@tempdimb \fi
559 \multiply\@tempdima \@m
560 \@tempcnta \@tempdima
561 \@tempdima \wd\@linechar \divide\@tempcnta \@tempdima
562 \@tempdima \ht\@linechar \multiply\@tempdima \@tempcnta
563 \divide\@tempdima \@m
564 \advance\@clnht \@tempdima
565 \ifdim \@linelen <\wd\@linechar
568 % Warn if line gets so short that it can't be printed.
569 % \changes{v1.1g}{1997/09/15}{Warn if lines become invisible pr/2524}
570 % But don't warn if it is exactly zero since that was probably
571 % deliberate (e.g., to get a vector head only).
572 % \changes{v1.1j}{2001/06/04}{Don't warn for exactly zero pr/3318}
574 \ifdim \@linelen = \z@
578 \else\@upordown\@clnht\copy\@linechar\fi}
582 % \begin{macro}{\@hline}
584 \gdef\@hline{\ifnum \@xarg <\z@ \hskip -\@linelen \fi
585 \vrule \@height \@halfwidth \@depth \@halfwidth \@width \@linelen
586 \ifnum \@xarg <\z@ \hskip -\@linelen \fi}
590 % \begin{macro}{\getlinechar}
592 \gdef\@getlinechar(#1,#2){\@tempcnta#1\relax\multiply\@tempcnta 8%
593 \advance\@tempcnta -9\ifnum #2>\z@ \advance\@tempcnta #2\relax\else
594 \advance\@tempcnta -#2\relax\advance\@tempcnta 64 \fi
599 % \begin{macro}{\vector}
601 \gdef\vector(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax
602 \@tempcnta \ifnum\@xarg<\z@ -\@xarg\else\@xarg\fi
603 \ifnum\@tempcnta<5\relax
604 \@linelen #3\unitlength
605 \ifdim\@linelen<\z@\@badlinearg\else
606 \ifnum\@xarg =\z@ \@vvector
607 \else \ifnum\@yarg =\z@ \@hvector \else \@svector\fi
610 \else\@badlinearg\fi}
614 % \begin{macro}{\@hvector}
616 \gdef\@hvector{\@hline\hb@xt@\z@{\@linefnt
617 \ifnum \@xarg <\z@ \@getlarrow(1,0)\hss\else
618 \hss\@getrarrow(1,0)\fi}}
622 % \begin{macro}{\@vvector}
624 \gdef\@vvector{\ifnum \@yarg <\z@ \@downvector \else \@upvector \fi}
628 % \begin{macro}{\@svector}
630 \gdef\@svector{\@sline
631 \@tempcnta\@yarg \ifnum\@tempcnta <\z@ \@tempcnta -\@tempcnta\fi
633 \hskip -\wd\@linechar
634 \@upordown\@clnht \hbox{\@linefnt \if@negarg
635 \@getlarrow(\@xarg,\@yyarg)\else \@getrarrow(\@xarg,\@yyarg)\fi}%
636 \else\@badlinearg\fi}
640 % \begin{macro}{\@getlarrow}
641 % \changes{v1.1h}{1999/04/15}{Replaced octal number, CAR}
643 \gdef\@getlarrow(#1,#2){\ifnum #2=\z@ \@tempcnta 27 % '33
645 \@tempcnta #1\relax\multiply\@tempcnta \sixt@@n
646 \advance\@tempcnta -9 \@tempcntb #2\relax\multiply\@tempcntb \tw@
647 \ifnum \@tempcntb >\z@ \advance\@tempcnta \@tempcntb
648 \else\advance\@tempcnta -\@tempcntb\advance\@tempcnta 64
649 \fi\fi\char\@tempcnta}
653 % \changes{v1.1h}{1999/04/15}{Replaced octal number, CAR}
654 % \begin{macro}{\@getrarrow}
656 \gdef\@getrarrow(#1,#2){\@tempcntb #2\relax
657 \ifnum\@tempcntb <\z@ \@tempcntb -\@tempcntb\relax\fi
658 \ifcase \@tempcntb\relax \@tempcnta 45 % '55
660 \ifnum #1<\thr@@ \@tempcnta #1\relax\multiply\@tempcnta
661 24\advance\@tempcnta -6 \else \ifnum #1=\thr@@ \@tempcnta 49
662 \else\@tempcnta 58 \fi\fi\or
663 \ifnum #1<\thr@@ \@tempcnta=#1\relax\multiply\@tempcnta
664 24\advance\@tempcnta -\thr@@ \else \@tempcnta 51 \fi\or
665 \@tempcnta #1\relax\multiply\@tempcnta
666 \sixt@@n \advance\@tempcnta -\tw@ \else
667 \@tempcnta #1\relax\multiply\@tempcnta
668 \sixt@@n \advance\@tempcnta 7 \fi\ifnum #2<\z@ \advance\@tempcnta 64 \fi
673 % \begin{macro}{\@vline}
675 \gdef\@vline{\ifnum \@yarg <\z@ \@downline \else \@upline\fi}
679 % \begin{macro}{\@upline}
682 \hb@xt@\z@{\hskip -\@halfwidth \vrule \@width \@wholewidth
683 \@height \@linelen \@depth \z@\hss}}
687 % \begin{macro}{\@downline}
690 \hb@xt@\z@{\hskip -\@halfwidth \vrule \@width \@wholewidth
691 \@height \z@ \@depth \@linelen \hss}}
695 % \begin{macro}{\@upvector}
696 % \changes{v1.1h}{1999/04/15}{Replaced octal number, CAR}
697 % \changes{v1.1i}{2000/01/15}{Removed space at end-of-line, CAR}
699 \gdef\@upvector{\@upline\setbox\@tempboxa\hbox{\@linefnt\char 54}% '66
700 \raise \@linelen \hb@xt@\z@{\lower \ht\@tempboxa\box\@tempboxa\hss}}
704 % \changes{v1.1h}{1999/04/15}{Replaced octal number, CAR}
705 % \begin{macro}{\@downvector}
707 \gdef\@downvector{\@downline\lower \@linelen
708 \hb@xt@\z@{\@linefnt\char 63 % '77
713 % \begin{oldcomments}
714 % \dashbox{D}(X,Y) ==
716 % leave vertical mode
718 % \baselineskip := 0pt
720 % %% HORIZONTAL DASHES
721 % \@dashdim := X * \unitlength
722 % \@dashcnt := \@dashdim + 200 % to prevent roundoff error
723 % \@dashdim := D * \unitlength
724 % \@dashcnt := \@dashcnt / \@dashdim
725 % if \@dashcnt is odd
726 % then \@dashdim := 0pt
727 % \@dashcnt := (\@dashcnt + 1) / 2
728 % else \@dashdim := \@dashdim / 2
729 % \@dashcnt := \@dashcnt / 2 - 1
730 % \box\@dashbox := \hbox{\vrule height \@halfwidth
731 % depth \@halfwidth width \@dashdim}
732 % \put(0,0){\copy\@dashbox}
733 % \put(0,Y){\copy\@dashbox}
734 % \put(X,0){\hskip -\@dashdim\copy\@dashbox}
735 % \put(X,Y){\hskip -\@dashdim\box\@dashbox}
736 % \@dashdim := 3 * \@dashdim
738 % \box\@dashbox := \hbox{\vrule height \@halfwidth
739 % depth \@halfwidth width D * \unitlength
740 % \hskip D * \unitlength}
742 % \put(0,0){\hskip \@dashdim
743 % while \@tempcnta < \@dascnt
745 % \@tempcnta := \@tempcnta + 1
749 % put(0,Y){\hskip \@dashdim
750 % while \@tempcnta < \@dascnt
752 % \@tempcnta := \@tempcnta + 1
757 % \@dashdim := Y * \unitlength
758 % \@dashcnt := \@dashdim + 200 % to prevent roundoff error
759 % \@dashdim := D * \unitlength
760 % \@dashcnt := \@dashcnt / \@dashdim
761 % if \@dashcnt is odd
762 % then \@dashdim := 0pt
763 % \@dashcnt := (\@dashcnt + 1) / 2
764 % else \@dashdim := \@dashdim / 2
765 % \@dashcnt := \@dashcnt / 2 - 1
766 % \box\@dashbox := \hbox{\hskip -\@halfwidth
767 % \vrule width \@wholewidth
769 % \put(0,0){\copy\@dashbox}
770 % \put(X,0){\copy\@dashbox}
771 % \put(0,Y){\lower\@dashdim\copy\@dashbox}
772 % \put(X,Y){\lower\@dashdim\copy\@dashbox}
773 % \@dashdim := 3 * \@dashdim
775 % \box\@dashbox := \hbox{\vrule width \@wholewidth
776 % height D * \unitlength }
778 % put(0,0){\hskip -\halfwidth
779 % \vbox{while \@tempcnta < \@dashcnt
780 % do \vskip D*\unitlength
782 % \@tempcnta := \@tempcnta + 1
787 % put(X,0){\hskip -\halfwidth
788 % \vbox{while \@tempcnta < \@dashcnt
789 % do \vskip D*\unitlength
791 % \@tempcnta := \@tempcnta + 1
802 % \begin{macro}{\dashbox}
804 \gdef\dashbox#1(#2,#3){\leavevmode\hb@xt@\z@{\baselineskip \z@skip
806 \@dashdim #2\unitlength
807 \@dashcnt \@dashdim \advance\@dashcnt 200
808 \@dashdim #1\unitlength\divide\@dashcnt \@dashdim
809 \ifodd\@dashcnt\@dashdim \z@
810 \advance\@dashcnt \@ne \divide\@dashcnt \tw@
811 \else \divide\@dashdim \tw@ \divide\@dashcnt \tw@
812 \advance\@dashcnt \m@ne
813 \setbox\@dashbox \hbox{\vrule \@height \@halfwidth \@depth \@halfwidth
814 \@width \@dashdim}\put(0,0){\copy\@dashbox}%
815 \put(0,#3){\copy\@dashbox}%
816 \put(#2,0){\hskip-\@dashdim\copy\@dashbox}%
817 \put(#2,#3){\hskip-\@dashdim\box\@dashbox}%
818 \multiply\@dashdim \thr@@
820 \setbox\@dashbox \hbox{\vrule \@height \@halfwidth \@depth \@halfwidth
821 \@width #1\unitlength\hskip #1\unitlength}\@tempcnta\z@
822 \put(0,0){\hskip\@dashdim \@whilenum \@tempcnta <\@dashcnt
823 \do{\copy\@dashbox\advance\@tempcnta \@ne }}\@tempcnta\z@
824 \put(0,#3){\hskip\@dashdim \@whilenum \@tempcnta <\@dashcnt
825 \do{\copy\@dashbox\advance\@tempcnta \@ne }}%
826 \@dashdim #3\unitlength
827 \@dashcnt \@dashdim \advance\@dashcnt 200
828 \@dashdim #1\unitlength\divide\@dashcnt \@dashdim
829 \ifodd\@dashcnt \@dashdim \z@
830 \advance\@dashcnt \@ne \divide\@dashcnt \tw@
832 \divide\@dashdim \tw@ \divide\@dashcnt \tw@
833 \advance\@dashcnt \m@ne
834 \setbox\@dashbox\hbox{\hskip -\@halfwidth
835 \vrule \@width \@wholewidth
836 \@height \@dashdim}\put(0,0){\copy\@dashbox}%
837 \put(#2,0){\copy\@dashbox}%
838 \put(0,#3){\lower\@dashdim\copy\@dashbox}%
839 \put(#2,#3){\lower\@dashdim\copy\@dashbox}%
840 \multiply\@dashdim \thr@@
842 \setbox\@dashbox\hbox{\vrule \@width \@wholewidth
843 \@height #1\unitlength}\@tempcnta\z@
844 \put(0,0){\hskip -\@halfwidth \vbox{\@whilenum \@tempcnta <\@dashcnt
845 \do{\vskip #1\unitlength\copy\@dashbox\advance\@tempcnta \@ne }%
846 \vskip\@dashdim}}\@tempcnta\z@
847 \put(#2,0){\hskip -\@halfwidth \vbox{\@whilenum \@tempcnta<\@dashcnt
848 \do{\vskip #1\unitlength\copy\@dashbox\advance\@tempcnta \@ne }%
849 \vskip\@dashdim}}}\@makepicbox(#2,#3)}
853 % \begin{oldcomments}
858 % \circle{D} : Produces the circle with the diameter as close as
859 % possible to D * \unitlength. \put(X,Y){\circle{D}}
860 % puts the circle with its center at (X,Y).
862 % \oval(X,Y) : Makes an oval as round as possible that fits in the
863 % rectangle of width X * \unitlength and height
864 % Y * \unitlength. The reference point is the center.
866 % \oval(X,Y)[POS] : Save as \oval(X,Y) except it draws only the
867 % half or quadrant of the oval indicated by POS.
868 % E.G., \oval(X,Y)[t] draws just the top half
869 % and \oval(X,Y)[br] draws just the bottom right
870 % quadrant. In all cases, the reference point is
871 % the same as the unqualified \oval(X,Y) command.
873 % \@ovvert {DELTA1} {DELTA2} : Makes a vbox containing either the left
874 % side or the right side of the oval being constructed. The baseline
875 % will coincide with the outside bottom edge of the oval; the left
876 % side of the box will coincide with the left edge of the vertical
877 % rule. The width of the box will be \@tempdima.
878 % DELTA1 and DELTA2 are added to the character number in \@tempcnta
879 % to get the characters for the top and bottom quarter circle pieces.
881 % \@ovhorz : Makes an hbox containing the straight rule for either the
882 % top or the bottom of the oval being constructed. The baseline
883 % will coincide with bottom edge of the rule; the left side of
884 % the box will coincide with the left side of the oval.
885 % The width of the box will be \@ovxx.
887 % \@getcirc {DIAM} : Sets \@tempcnta to the character number
888 % of the top-right quarter circle with the largest
889 % diameter less than or equal to DIAM.
890 % Sets \@tempboxa to an hbox containing that character.
891 % Sets \@tempdima to \wd \@tempboxa, which is the distance
892 % from the circle's left outside edge to its right
894 % (These characters are like those described in the
895 % TeXbook, pp. 389-90.)
897 % \@getcirc {DIAM} ==
899 % \@tempcnta := integer coercion of (DIAM + 2pt)
900 % + 2pt added 1 Nov 88
901 % \@tempcnta := \@tempcnta / integer coercion of 4pt
903 % then \@tempcnta := 10 fi
905 % then \@tempcnta := \@tempcnta-1
906 % else LaTeX Warning: Oval too small.
908 % \@tempcnta := 4 * \@tempcnta
909 % \@tempboxa := \hbox{\@circlefnt \char \@tempcnta}
910 % \@tempdima := \wd \@tempboxa
913 % \@put{X}{Y}{OBJ} ==
915 % \raise Y \hb@xt@ 0pt{\hskip X OBJ \hss}
918 % \@oval(X,Y)[POS] ==
921 % \boxmaxdepth := \maxdimen
922 % @ovt := @ovb := @ovl := @ovr := true
924 % do @ovE := false od
925 % \@ovxx := X * \unitlength
926 % \@ovyy := Y * \unitlength
927 % \@tempdimb := min(\@ovxx,\@ovyy)
928 % \@getcirc{\@tempdimb-2pt} %% "-2pt" added 7 Dec 89
929 % \@ovro := \ht \@tempboxa
930 % \@ovri := \dp \@tempboxa
931 % \@ovdx := \@ovxx - \@tempdima
933 % \@ovdy := \@ovyy - \@tempdima
939 % then \@ovvert{3}{2} \kern -\@tempdima
942 % then \kern \@ovxx \@ovvert{0}{1} \kern -\@tempdima
946 % then \@ovhorz \kern -\@ovxx
949 % then \raise \@ovyy \@ovhorz
952 % \@ovdx := \@ovdx + \@ovro
953 % \@ovdy := \@ovdy + \@ovro
954 % \ht\@tempboxa := \dp\@tempboxa := 0
955 % \@put{-\@ovdx}{-\@ovdy}{\box\@tempboxa}
959 % \@ovvert {DELTA1} {DELTA2} ==
963 % then \@tempcntb := \@tempcnta + DELTA1
965 % \hbox { \char \@tempcntb }
967 % else \kern \@ovri \kern \@ovdy
969 % \leaders \vrule width \@wholewidth \vfil
972 % then \@tempcntb := \@tempcnta + DELTA2
973 % \hbox { \char \@tempcntb }
974 % else \kern \@ovdy \kern \@ovro
987 % \leaders \hrule height \@wholewidth \hfil
999 % \boxmaxdepth := maxdimen
1000 % \@tempdimb := DIAM *\unitlength
1001 % if \@tempdimb > 15.5pt
1002 % then \@getcirc{\@tempdimb}
1003 % \@ovro := \ht \@tempboxa
1004 % \@tempboxa := \hbox{
1006 % \@tempcnta := \@tempcnta + 2
1008 % \@tempcnta := \@tempcnta - 1
1010 % \kern -2\@tempdima
1011 % \@tempcnta := \@tempcnta + 2
1012 % \raise \@tempdima \hbox { \char \@tempcnta }
1013 % \raise \@tempdima \box\@tempboxa
1015 % \ht\@tempboxa := \dp\@tempboxa := 0
1016 % \@put{-\@ovro}{-\@ovro}{\@tempboxa}
1018 % \@circ{\@tempdimb}{96}
1023 % \circle*{DIAM} == \@dot{DIAM} == \@circ{DIAM*\unitlength}{112}
1025 % \@circ{DIAM}{CHAR} ==
1027 % \@tempcnta := integer coercion of (DIAM + .5pt)/1pt.
1028 % if \@tempcnta > 15 then \@tempcnta := 15 fi
1029 % if \@tempcnta > 1 then \@tempcnta := \@tempcnta - 1 fi
1030 % \@tempcnta := \@tempcnta + CHAR
1037 % \begin{macro}{\if@ovt}
1038 % \begin{macro}{\if@ovb}
1039 % \begin{macro}{\if@ovl}
1040 % \begin{macro}{\if@ovr}
1041 % If producing the Top Bottom Left or Right of an oval.
1054 % \begin{macro}{\@ovxx}
1055 % \begin{macro}{\@ovyy}
1056 % \begin{macro}{\@ovdx}
1057 % \begin{macro}{\@ovdy}
1058 % \begin{macro}{\@ovro}
1059 % \begin{macro}{\@ovri}
1076 % |\advance\@tempdima 2pt\relax| added 1 Nov 88 to fix bug in which
1077 % size of drawn circle not monotonic function of argument of |\circle|,
1078 % caused by different rounding for dimensions of large and small
1082 % \begin{macro}{\@getcirc}
1083 % \changes{v1.1j}{2003/12/30}{issue warning if circle size can't be met pr/3473}
1085 \gdef\@getcirc#1{\@tempdima #1\relax \advance\@tempdima 2\p@
1086 \@tempcnta\@tempdima
1087 \@tempdima 4\p@ \divide\@tempcnta\@tempdima
1088 \ifnum \@tempcnta >10\relax
1092 \ifnum \@tempcnta >\z@ \advance\@tempcnta\m@ne
1094 % Warn if requirements for oval or circle can't be met.
1095 % \changes{v1.1g}{1997/09/15}{Warn if lines become invisible pr/2524}
1097 \else \@picture@warn \fi
1098 \multiply\@tempcnta 4\relax
1099 \setbox \@tempboxa \hbox{\@circlefnt
1100 \char \@tempcnta}\@tempdima \wd \@tempboxa}
1104 % \begin{macro}{\@picture@warn}
1105 % Generic warning for lines, vectors (used in |\@sline|) and
1106 % oval or circle (used un |\@getcirc|) are not available at
1108 % \changes{v1.1g}{1997/09/15}{Macro added pr/2524}
1110 \def\@picture@warn{\@latex@warning{%
1111 \string\oval, \string\circle, or \string\line\space
1116 % \begin{macro}{\@put}
1118 \gdef\@put#1#2#3{\raise #2\hb@xt@\z@{\hskip #1#3\hss}}
1122 % \begin{macro}{\oval}
1124 \gdef\oval(#1,#2){\@ifnextchar[{\@oval(#1,#2)}{\@oval(#1,#2)[]}}
1128 % \begin{macro}{\@oval}
1130 \gdef\@oval(#1,#2)[#3]{\begingroup\boxmaxdepth \maxdimen
1131 \@ovttrue \@ovbtrue \@ovltrue \@ovrtrue
1132 \@tfor\reserved@a :=#3\do{\csname @ov\reserved@a false\endcsname}%
1134 #1\unitlength \@ovyy #2\unitlength
1135 \@tempdimb \ifdim \@ovyy >\@ovxx \@ovxx\else \@ovyy \fi
1136 \advance \@tempdimb -2\p@
1137 \@getcirc \@tempdimb
1138 \@ovro \ht\@tempboxa \@ovri \dp\@tempboxa
1139 \@ovdx\@ovxx \advance\@ovdx -\@tempdima \divide\@ovdx \tw@
1140 \@ovdy\@ovyy \advance\@ovdy -\@tempdima \divide\@ovdy \tw@
1141 \@circlefnt \setbox\@tempboxa
1142 \hbox{\if@ovr \@ovvert32\kern -\@tempdima \fi
1143 \if@ovl \kern \@ovxx \@ovvert01\kern -\@tempdima \kern -\@ovxx \fi
1144 \if@ovt \@ovhorz \kern -\@ovxx \fi
1145 \if@ovb \raise \@ovyy \@ovhorz \fi}\advance\@ovdx\@ovro
1146 \advance\@ovdy\@ovro \ht\@tempboxa\z@ \dp\@tempboxa\z@
1147 \@put{-\@ovdx}{-\@ovdy}{\box\@tempboxa}%
1152 % \begin{macro}{\@ovvert}
1154 \gdef\@ovvert#1#2{\vbox to\@ovyy{%
1155 \if@ovb \@tempcntb \@tempcnta \advance \@tempcntb #1\relax
1156 \kern -\@ovro \hbox{\char \@tempcntb}\nointerlineskip
1157 \else \kern \@ovri \kern \@ovdy \fi
1158 \leaders\vrule \@width \@wholewidth\vfil \nointerlineskip
1159 \if@ovt \@tempcntb \@tempcnta \advance \@tempcntb #2\relax
1160 \hbox{\char \@tempcntb}%
1161 \else \kern \@ovdy \kern \@ovro \fi}}
1165 % \begin{macro}{\@ovhorz}
1167 \gdef\@ovhorz{\hb@xt@\@ovxx{\kern \@ovro
1168 \if@ovr \else \kern \@ovdx \fi
1169 \leaders \hrule \@height \@wholewidth \hfil
1170 \if@ovl \else \kern \@ovdx \fi
1175 % \begin{macro}{\circle}
1176 % \changes{LaTeX2.09}{1993/08/05}
1177 % {(RMS) Added error message if \cs{circle} is used in math mode.}
1179 \gdef\circle{\@inmatherr\circle\@ifstar\@dot\@circle}
1183 % \begin{macro}{\@circle}
1186 \begingroup \boxmaxdepth \maxdimen \@tempdimb #1\unitlength
1187 \ifdim \@tempdimb >15.5\p@ \@getcirc\@tempdimb
1189 \setbox\@tempboxa\hbox{\@circlefnt
1190 \advance\@tempcnta\tw@ \char \@tempcnta
1191 \advance\@tempcnta\m@ne \char \@tempcnta \kern -2\@tempdima
1192 \advance\@tempcnta\tw@
1193 \raise \@tempdima \hbox{\char\@tempcnta}\raise \@tempdima
1194 \box\@tempboxa}\ht\@tempboxa\z@ \dp\@tempboxa\z@
1195 \@put{-\@ovro}{-\@ovro}{\box\@tempboxa}%
1196 \else \@circ\@tempdimb{96}\fi\endgroup}
1200 % \begin{macro}{\@dot}
1201 % Internal form of |\circle*|.
1203 \gdef\@dot#1{\@tempdimb #1\unitlength \@circ\@tempdimb{112}}
1207 % \begin{macro}{\@circ}
1209 \gdef\@circ#1#2{\@tempdima #1\relax \advance\@tempdima .5\p@
1210 \@tempcnta\@tempdima \@tempdima \p@
1211 \divide\@tempcnta\@tempdima
1212 \ifnum\@tempcnta >15\relax \@tempcnta 15\relax \fi
1213 \ifnum \@tempcnta >\z@ \advance\@tempcnta\m@ne\fi
1214 \advance\@tempcnta #2\relax
1215 \@circlefnt \char\@tempcnta}
1220 % \begin{macro}{\@xarg}
1221 % \begin{macro}{\@yarg}
1222 % \begin{macro}{\@yyarg}
1223 % Counters used for manipulating the `slope' arguments.
1233 % \begin{macro}{\@multicnt}
1234 % Counter used in |\multiput|, and also |\multicolumn|.
1240 % \begin{macro}{\@xdim}
1241 % \begin{macro}{\yxdim}
1250 % \begin{macro}{\@linechar}
1251 % Box for holding a line segment character, for sloping lines.
1257 % \begin{macro}{\@linelen}
1258 % Length of the line currently being built.
1264 % \begin{macro}{\@clnwd}
1265 % \begin{macro}{\@clnht}
1266 % Height and width of current line segment.
1274 % \begin{macro}{\@dashdim}
1275 % \begin{macro}{\@dashbox}
1276 % \begin{macro}{\@dashcnt}
1277 % |\dashbox| internal registers.
1287 % Initialization: ``|\thinlines|''
1288 % \changes{v1.1f}{1995/10/27}
1289 % {Move initialisation to kernel from autoload file}
1292 \let\@circlefnt\tencirc
1293 \@wholewidth\fontdimen8\tenln
1294 \@halfwidth .5\@wholewidth
1299 % \subsection{Curves}
1300 % The new |\qbezier| command, based on the old |\bezier| defined in
1302 % \changes{v0.1c}{1994/04/28}{bezier curves added}
1304 % \begin{oldcomments}
1306 % \qbezier[N] == \bezier{N}
1308 % \bezier{N}(AX,AY)(BX,BY)(CX,CY) ==
1311 % THEN \@xdima := |BX - AX|
1313 % \@xa := Max(\@xa, \@xb)
1316 % \@ya := Max(\@ya, \@yb)
1317 % @sc := Max(\@xa, \@ya)
1318 % %% The coefficient .5 below is the degree of overlap of
1319 % %% successive points, where 1 is no overlap and 0 is
1320 % %% complete overlap. A coefficient of C multiplies
1321 % %% the number of points plotted by 1/C.
1323 % \@xa := .5 * \@halfwidth
1324 % @sc := @sc / \@halfwidth
1325 % @sc := Max(@sc, qbeziermax)
1328 % \@xb := 2 * (BX - AX) * \unitlength
1329 % \@xa := ((CX-AX)*\unitlength - \@xb)/@sc
1330 % \@yb := 2 * (BY - AY) * \unitlength
1331 % \@ya := ((CY-AY)*\unitlength - \@yb)/@sc
1332 % \@pictdot := square rule of width \@wholewidth
1334 % WHILE \count@ < @scp
1335 % DO \@xdim := ((\count@*\@xa + @xb) / @sc) * \count@
1336 % \@ydim := ((\count@*\@ya + @yb) / @sc) * \count@
1337 % plot pt with relative coords (\@xdim,\@ydim)
1338 % \count@ := \count@+1
1343 % \begin{macro}{\qbeziermax}
1344 % The maximum number of points to plot.
1346 \gdef\qbeziermax{500}
1351 % In the code below, to save registers |\@a| \ldots\ are not used.
1352 % Instead other registers are reused.
1354 % |\newcounter{@sc} -> \c@multicnt|\par
1355 % |\newcounter{@scp} -> \@tempcnta|\par
1356 % |\newdimen\@xa -> \@ovxx|\par
1358 % |\newdimen\@xb -> \@ovdx|
1360 % |\newdimen\@ya -> \@ovyy|\par
1361 % |\newdimen\@yb -> \@ovdy|
1363 % |\newsavebox{\@pictdot} -> \@tempboxa|
1365 % \begin{macro}{\qbezier}
1366 % Main user-level command to plot quadratic bezier curves.
1367 % |#2| should be |(|.
1369 \newcommand\qbezier[2][0]{\bezier{#1}#2}
1373 % \begin{macro}{\bezier}
1374 % Form of |\bezier| compatible with 2.09 |bezier.sty|, but modified to
1375 % ignore spaces between its arguments.
1376 % |#2| should be white space, and |#4| should be |(|.
1378 \gdef\bezier#1)#2(#3)#4({\@bezier#1)(#3)(}
1381 % \begin{macro}{\@bezier}
1383 \gdef\@bezier#1(#2,#3)(#4,#5)(#6,#7){%
1385 \@ovxx #4\unitlength
1386 \advance\@ovxx -#2\unitlength
1387 \ifdim \@ovxx<\z@ \@ovxx -\@ovxx \fi
1388 \@ovdx #6\unitlength
1389 \advance\@ovdx -#4\unitlength
1390 \ifdim \@ovdx<\z@ \@ovdx -\@ovdx \fi
1391 \ifdim \@ovxx<\@ovdx \@ovxx \@ovdx \fi
1392 \@ovyy #5\unitlength
1393 \advance\@ovyy -#3\unitlength
1394 \ifdim \@ovyy<\z@ \@ovyy -\@ovyy \fi
1395 \@ovdy #7\unitlength
1396 \advance\@ovdy -#5\unitlength
1397 \ifdim \@ovdy<\z@ \@ovdy -\@ovdy \fi
1398 \ifdim \@ovyy<\@ovdy \@ovyy \@ovdy \fi
1400 \ifdim \@ovxx>\@ovyy \@ovxx \else \@ovyy \fi
1401 \@ovxx .5\@halfwidth \divide\@multicnt\@ovxx
1402 \ifnum \qbeziermax<\@multicnt \@multicnt\qbeziermax\relax \fi
1403 \else \@multicnt#1\relax \fi
1404 \@tempcnta\@multicnt \advance\@tempcnta\@ne
1405 \@ovdx #4\unitlength \advance\@ovdx -#2\unitlength
1406 \multiply\@ovdx \tw@
1407 \@ovxx #6\unitlength \advance\@ovxx -#2\unitlength
1408 \advance\@ovxx -\@ovdx \divide\@ovxx\@multicnt
1409 \@ovdy #5\unitlength \advance\@ovdy -#3\unitlength
1410 \multiply\@ovdy \tw@
1411 \@ovyy #7\unitlength \advance\@ovyy -#3\unitlength
1412 \advance\@ovyy -\@ovdy \divide\@ovyy\@multicnt
1415 % \changes{v1.1k}{2003/08/27}{added missing displacement pr/3566}
1417 \setbox\@tempboxa\hbox{%
1419 \vrule \@height\@halfwidth
1421 \@width \@wholewidth}%
1424 \@whilenum{\count@<\@tempcnta}\do
1425 {\@xdim\count@\@ovxx
1426 \advance\@xdim\@ovdx
1427 \divide\@xdim\@multicnt
1428 \multiply\@xdim\count@
1430 \advance\@ydim\@ovdy
1431 \divide\@ydim\@multicnt
1432 \multiply\@ydim\count@
1434 \hb@xt@\z@{\kern\@xdim
1435 \unhcopy\@tempboxa\hss}%
1436 \advance\count@\@ne}}}