| 1 |
% \iffalse |
| 2 |
%<*copyright> |
| 3 |
% pawpict macros for use with LaTeX and PAW |
| 4 |
% $Header: pawpict.dtx,v 1.0 97/12/24 14:43:14 sdc Exp $ |
| 5 |
%$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6 |
% Copyright (C) 1997 Christian Holm. |
| 7 |
% |
| 8 |
% The pawpict package is free software; you can redistribute it |
| 9 |
% and/or modify it under the terms of the GNU General Public License |
| 10 |
% as published by the Free Software Foundation; either version 2 of |
| 11 |
% the License, or (at your option) any later version. |
| 12 |
% |
| 13 |
% The pawpict package is distributed in the hope that it will be |
| 14 |
% useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
| 15 |
% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
% GNU General Public License for more details. |
| 17 |
% |
| 18 |
% You should have received a copy of the GNU General Public License |
| 19 |
% along with this program; if not, write to the Free Software |
| 20 |
% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 21 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 22 |
%% @LaTeX-style-file{ |
| 23 |
%% Author = "Christian Holm", |
| 24 |
%% Version = "1.0", |
| 25 |
%% Date = "1997/12/24", |
| 26 |
%% Time = "14:43:14", |
| 27 |
%% Filename = "pawpict.sty", |
| 28 |
%% Address = "Niels Bohr Institute of Physics |
| 29 |
%% University of Copenhagen |
| 30 |
%% Denmark", |
| 31 |
%% Email = "[email protected] (Internet)", |
| 32 |
%% CodeTable = "ISO/ASCII", |
| 33 |
%% Keywords = "LaTeX2e, PAW, graphics", |
| 34 |
%% Supported = "yes", |
| 35 |
%% Abstract = "LaTeX package for providing easy inclusion of |
| 36 |
%% graphics made in PAW" |
| 37 |
%% } |
| 38 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 39 |
%</copyright> |
| 40 |
%<*driver> |
| 41 |
\documentclass{ltxdoc} |
| 42 |
\EnableCrossrefs |
| 43 |
\RecordChanges |
| 44 |
\CodelineIndex |
| 45 |
\typeout{Expect some Under- and overfull boxes} |
| 46 |
\begin{document} |
| 47 |
\DocInput{pawpict.dtx} |
| 48 |
\end{document} |
| 49 |
% \fi |
| 50 |
% |
| 51 |
%\newcommand{\CERNLIB}{\textsc{cernlib}\index{CERNLIB}} |
| 52 |
%\newcommand{\CMZ}{\textsc{cmz}\index{CMZ}} |
| 53 |
%\newcommand{\COMIS}{\textsc{comis}\index{COMIS}} |
| 54 |
%\newcommand{\CSPACK}{\textsc{cspack}\index{CSPACK}} |
| 55 |
%\newcommand{\FATMEN}{\textsc{fatmen}\index{FATMEN}} |
| 56 |
%\newcommand{\GEANT}{\textsc{geant}\index{GEANT}} |
| 57 |
%\newcommand{\GKS}{\textsc{gks}\index{GKS}} |
| 58 |
%\newcommand{\HBOOK}{\textsc{hbook}\index{HBOOK}} |
| 59 |
%\newcommand{\HEPDB}{\textsc{hepdb}\index{HEPDB}} |
| 60 |
%\newcommand{\HIGZ}{\textsc{higz}\index{HIGZ}} |
| 61 |
%\newcommand{\HPLOT}{\textsc{hplot}\index{HPLOT}} |
| 62 |
%\newcommand{\KUIP}{\textsc{kuip}\index{KUIP}} |
| 63 |
%\newcommand{\MINUIT}{\textsc{minuit}\index{MINUIT}} |
| 64 |
%\newcommand{\PATCHY}{\textsc{patchy}\index{PATCHY}} |
| 65 |
%\newcommand{\PAW}{\textsc{paw}\index{PAW}} |
| 66 |
%\newcommand{\SIGMA}{\textsc{sigma}\index{SIGMA}} |
| 67 |
%\newcommand{\PAWPP}{\textsc{paw++}\index{PAW++}} |
| 68 |
%\newcommand{\WWW}{\textsc{www}\index{WWW}} |
| 69 |
%\newcommand{\VAXTAP}{\textsc{vaxtap}\index{VAXTAP}} |
| 70 |
%\newcommand{\ZEBRA}{\textsc{zebra}\index{ZEBRA}} |
| 71 |
% |
| 72 |
%\def\fileversion{v1.0} |
| 73 |
%\def\filedate{97/12/24} |
| 74 |
%\def\docdate {97/12/24} |
| 75 |
%\def\bs{{\tt\char'134}} |
| 76 |
%\newcommand{\Lcs}[1]{{\bs\tt#1}} |
| 77 |
% |
| 78 |
%\def\SpecialOptIndex#1{% |
| 79 |
% \index{#1\actualchar{\protect\ttfamily#1} |
| 80 |
% (option)\encapchar usage}% |
| 81 |
% \index{options:\levelchar{\protect\ttfamily#1}\encapchar |
| 82 |
% usage}} |
| 83 |
%\def\DescribeOption{\leavevmode |
| 84 |
% \begingroup\MakePrivateLetters\DescribeOPT} |
| 85 |
%\def\DescribeOPT#1{\endgroup |
| 86 |
% \marginpar{\raggedleft\PrintDescribeMacro{#1}}% |
| 87 |
% \SpecialOptIndex{#1}\ignorespaces} |
| 88 |
%\def\SpecialPawIndex#1{% |
| 89 |
% \index{#1\actualchar{\protect\ttfamily#1} |
| 90 |
% (\textsc{paw} command)\encapchar usage}% |
| 91 |
% \index{paw\actualchar{\protect\textsc{paw} command:}% |
| 92 |
% \levelchar{\protect\ttfamily#1}\encapchar |
| 93 |
% usage}} |
| 94 |
%\def\DescribePaw{\leavevmode |
| 95 |
% \begingroup\MakePrivateLetters\Describe@Paw} |
| 96 |
%\def\Describe@Paw#1{\endgroup |
| 97 |
% \marginpar{\raggedleft\PrintDescribeMacro{#1}}% |
| 98 |
% \SpecialPawIndex{#1}\ignorespaces} |
| 99 |
% |
| 100 |
% \DoNotIndex{\@ne,\advance,\begin,\char,\closein,\def,\DeclareOption} |
| 101 |
% \DoNotIndex{\divide,\docdate,\else,\end,\fi,\filedate,\fileversion} |
| 102 |
% \DoNotIndex{\framebox,\global,\ifdim,\ifeof,\ifnum,\ifx,\let,\loop} |
| 103 |
% \DoNotIndex{\makebox,\mbox,\mutliply,\NeedsTeXFormat,\newcommand} |
| 104 |
% \DoNotIndex{\newcount,\newdim,\newenvironment,\newif,\newsavebox} |
| 105 |
% \DoNotIndex{\noindent,\openin,\PackageWarning,\par,\ProcessOptions} |
| 106 |
% \DoNotIndex{\ProvidesPackage,\put,\relax,\repeat,\RequirePackage} |
| 107 |
% \DoNotIndex{\rule,\savebox,\space,\tempa,\textsc,\tt,\undefined} |
| 108 |
% \DoNotIndex{\usebox} |
| 109 |
% |
| 110 |
% \changes{v1.0}{97/12/24}{The creation of \textsf{pawpict}} |
| 111 |
% |
| 112 |
% \title{The \textsf{pawpict}--package\thanks{% |
| 113 |
% This package is based on output from \textsc{paw}. |
| 114 |
% This file has version number \fileversion{} dated \filedate{}. |
| 115 |
% The documentation was last revised on \docdate. |
| 116 |
% }} |
| 117 |
% \author{Christian Holm\thanks{Due thancks to the creators of \textsc{paw}}} |
| 118 |
% |
| 119 |
% \date{\docdate} |
| 120 |
% |
| 121 |
% \maketitle |
| 122 |
% \begin{abstract} |
| 123 |
% This package is for use with \textsc{paw} as distributed from the |
| 124 |
% \textsc{cernlib}. It is intended to make it easier to include |
| 125 |
% pictures made in \textsc{paw} in \LaTeX{} documents. However, this |
| 126 |
% package is really only usefull if more then one such picture is |
| 127 |
% included in the document. |
| 128 |
% \end{abstract} |
| 129 |
% |
| 130 |
% \tableofcontents |
| 131 |
% |
| 132 |
% \section{Motivation for use of \texttt{pawpict}} |
| 133 |
% |
| 134 |
% When you in \PAW{} create a picture for use in \LaTeX{}, you have |
| 135 |
% the option of either making a (Encapsulated) Postscript file, and |
| 136 |
% include this in your document by doing something like: |
| 137 |
% \begin{verbatim} |
| 138 |
% \begin{figure} |
| 139 |
% \epsffile{example.eps} |
| 140 |
% \caption{Example of Encapsulated PostScript in \LaTeX{}.} |
| 141 |
% \label{EXAMPLE_EPS} |
| 142 |
% \end{figure} |
| 143 |
% \end{verbatim} |
| 144 |
% or you can create a Encapsulated \LaTeX{} file and include it with |
| 145 |
% something like: |
| 146 |
% \begin{verbatim} |
| 147 |
% \begin{figure} |
| 148 |
% \include{example.tex} |
| 149 |
% \caption{Example of Encapsulated \LaTeX{} in \LaTeX{}.} |
| 150 |
% \label{EXAMPLE_TEX} |
| 151 |
% \end{figure} |
| 152 |
% \end{verbatim} |
| 153 |
% |
| 154 |
% Now the \LaTeX{} version has the obvoius advantage, that they take |
| 155 |
% up less disk space\footnote{Postscript Files are notriously big}, |
| 156 |
% and also, % you can view these files on \textit{any} |
| 157 |
% \texttt{dvi}--previewer\footnote{Some \texttt{dvi}--previewers do |
| 158 |
% not understand the \Lcs{special} command needed for Postscript |
| 159 |
% files}. |
| 160 |
% |
| 161 |
% However, the \LaTeX{} generated by \PAW{} tends to be rather long |
| 162 |
% and hard to read, making it diffecult to make changes, or just get a |
| 163 |
% clear picture of what is going on. Therefore, it would be nice to |
| 164 |
% \textit{reduce} the size of these files, and make them easier to |
| 165 |
% understand, as well as saving disk space. |
| 166 |
% |
| 167 |
% This package realizes this, by making the common commands needed for |
| 168 |
% pictures generated by \PAW{} (actually \HIGZ{}) avaliable in one |
| 169 |
% style file to be included by \Lcs{usepackage\{pawpict\}} |
| 170 |
% |
| 171 |
% \DescribeEnv{noborder} |
| 172 |
% The option \texttt{noborder} is avaliable for the \texttt{pawpict} |
| 173 |
% package. Pass the option \texttt{noborder} to pawpict, if you in |
| 174 |
% \PAW{} have created the pictures without borders. Else do nothing. |
| 175 |
% |
| 176 |
% \section{How to use \texttt{pawpict}} |
| 177 |
% |
| 178 |
% \subsection{Things to do in \PAW{}} |
| 179 |
% To create a \LaTeX{} file containing a picture produced by \HIGZ{}, |
| 180 |
% do the following in \PAW{}: |
| 181 |
% \begin{enumerate} |
| 182 |
% \item First you must open a file (in the current directory), and |
| 183 |
% assign it a Logical Unit Number (LUN). This is done by: |
| 184 |
% \DescribePaw{FORTRAN/FILE} |
| 185 |
% \begin{quote} |
| 186 |
% \texttt{FORTRAN/FILE} \textsl{LUN~FNAME} \texttt{[} |
| 187 |
% \textsl{STATUS} \texttt{]} |
| 188 |
% \end{quote} |
| 189 |
% where \textsl{LUN} is any integer\footnote{LUN 10 is used by |
| 190 |
% \PAW{} as \texttt{paw.metafile}}, \textsl{FNAME} is a valid file |
| 191 |
% name and \textsl{STATUS} can be any of: |
| 192 |
% \begin{description} |
| 193 |
% \item{OLD} Open existing file for reading. |
| 194 |
% \item{APPEND} Open existing file and position at EOF. |
| 195 |
% \item{NEW} Create new file; error if already existing. |
| 196 |
% \item{UNKNOWN} Open existing or create new file. |
| 197 |
% \item{DONTKNOW} Like UNKNOWN except on VMS opens highest cycle. |
| 198 |
% \end{description} |
| 199 |
% Default is UNKNOWN. |
| 200 |
% \item Second, you should tell \HIGZ{} that it should create output |
| 201 |
% on a file and this is to be in the \LaTeX{} format. This is |
| 202 |
% accompliced in \PAW{} by: |
| 203 |
% \DescribePaw{GRAPHICS/METAFILE} |
| 204 |
% \begin{quote} |
| 205 |
% \texttt{GRAPHICS/METAFILE} [$\pm$]\textsl{LUN} -777 |
| 206 |
% \textsl{FNAME} |
| 207 |
% \end{quote} |
| 208 |
% where \textsl{LUN} is the Logical Unit Number, and \textsl{FNAME} |
| 209 |
% is the filename, used in 1. If \textsl{LUN} is provided negative, |
| 210 |
% then the picyures will \emph{not} be output on the display, but |
| 211 |
% only in the file. |
| 212 |
% \item Now create what ever picture you may need, using zones, |
| 213 |
% superimpose, etc. However, do \emph{only} create one picture. |
| 214 |
% \item Lastly, you \emph{must} close the file: |
| 215 |
% \DescribePaw{FORTRAN/CLOSE} |
| 216 |
% \begin{quote} |
| 217 |
% \texttt{FORTRAN/CLOSE} \textsl{LUN} |
| 218 |
% \end{quote} |
| 219 |
% still using the \textsl{LUN} created in 1. |
| 220 |
% \end{enumerate} |
| 221 |
% |
| 222 |
% Now you have a file in your current directory, containing \LaTeX{} |
| 223 |
% commands to draw the picture created by \HIGZ{}. |
| 224 |
% |
| 225 |
% There is an example of what might be in such a file (a lot is left |
| 226 |
% out) in Figure~\ref{exa:higzfile} |
| 227 |
% \begin{figure}[htbp]\label{exa:higzfile} |
| 228 |
% \begin{verbatim} |
| 229 |
% HIGZ version 1.23/07 LaTeX metafile created 97/12/11 23.58 |
| 230 |
% \ifx\higzunit\undefined\unitlength=0pt{} |
| 231 |
% \else\unitlength=\higzunit\fi |
| 232 |
% \ifdim\unitlength=0pt\unitlength=\textwidth |
| 233 |
% \divide\unitlength 2000\fi\par\noindent |
| 234 |
% \begin{picture}(2000,2000)(0,0) |
| 235 |
% \ifx\higzdraft\undefined\newcount |
| 236 |
% \higzdraft\higzdraft=0{}\fi\ifnum\higzdraft>0 |
| 237 |
% \put(0,0){\framebox(2000,2000){}} |
| 238 |
% \else\ifx\higzstep\undefined\newcount\higzstep\higzstep=0{}\fi |
| 239 |
% \ifnum\higzstep<1\higzstep=2\fi |
| 240 |
% ... |
| 241 |
% \def\higzstroke#1,#2,#3,#4;{ |
| 242 |
% \advance\higzloffs\higzllen |
| 243 |
% \ifnum\higzloffs>#1\advance\higzloffs-\higzllen\advance\higzloffs-#1 |
| 244 |
% \higzloffs=-\higzloffs\ifnum#2>0 |
| 245 |
% \put(\higzlx,\higzly){\line(#3,#4){\higzloffs}}\fi\ |
| 246 |
% ifnum#2<0\put(\higzlx,\higzly){\circle*{0}}\fi |
| 247 |
% \higztemp=\higzloffs\multiply\higztemp#3 |
| 248 |
% \advance\higzlx\higztemp\higztemp=\higzloffs |
| 249 |
% \multiply\higztemp#4\advance\higzly\higztemp |
| 250 |
% \advance\higzllen-\higzloffs\higzloffs=#1 |
| 251 |
% \else\ifnum#2>0 |
| 252 |
% \put(\higzlx,\higzly){\line(#3,#4){\higzllen}} |
| 253 |
% \fi\ifnum#2<0\put(\higzlx,\higzly){\circle*{0}} |
| 254 |
% \fi\higzllen=0\fi} |
| 255 |
% ... |
| 256 |
% % End of Initialisation |
| 257 |
% \let\higzline=\higzsolid |
| 258 |
% \put(0,0){\framebox(2268,2268){}} |
| 259 |
% \put(227,227){\framebox(1814,1814){}} |
| 260 |
% \m1058,76;\s-1,3;\s-5,1;\r4;\s-5,-1; |
| 261 |
% \s-1,-3;\s1,-3;\s3,-2;\s8,-1;\s3,-2;\s1,-3; |
| 262 |
% \D1;\s-1,-4;\s-5,-1;\r4;\s-5,1;\s-1,4; |
| 263 |
% \m1067,91;\s2,-2;\s1,2;\s-1,1;\s-2,-1;\m1069,80; |
| 264 |
% ... |
| 265 |
% \fi\end{picture} |
| 266 |
% \end{verbatim} |
| 267 |
% \caption{Example of a picture created by \HIGZ{}} |
| 268 |
% \end{figure} |
| 269 |
% |
| 270 |
% \subsection{Things to do in an editor} |
| 271 |
% |
| 272 |
% The file created by \HIGZ{} contains |
| 273 |
% \emph{all} the commands needed, but since a lot of these commands |
| 274 |
% are also in style file \texttt{pawpict}, you need to take some of |
| 275 |
% the definitions out of the file, created by \HIGZ{}. |
| 276 |
% |
| 277 |
% Open the newly created file in you favorite ASCII editor, and then |
| 278 |
% delete up to the line saying |
| 279 |
% \texttt{\% End of Initialisation}, and then save the file. |
| 280 |
% |
| 281 |
% The next step needed, is to edit your \LaTeX{} document, making |
| 282 |
% paragraphs, text, tables, figures, etc and include the picture made |
| 283 |
% by \HIGZ{}. More on this in the next section. |
| 284 |
% |
| 285 |
% \subsection{Things to do in document} |
| 286 |
% |
| 287 |
% The picture should be included in some \textsc{figure} |
| 288 |
% enviroment. To do this easely, \DescribeEnv{pawfig} use the |
| 289 |
% \texttt{pawfig} enviroment. It takes one mandatory argument, the |
| 290 |
% caption to put under the figure. It also has a optional |
| 291 |
% argument. The optional argument is the width of the figure (defaults |
| 292 |
% amounts to full page width). |
| 293 |
% |
| 294 |
% In any case, the \texttt{pawfig} environment, should be used as: |
| 295 |
% \begin{quote} |
| 296 |
% \Lcs{begin\{pawfig\}[}\textsl{option}\texttt{]\{}\textsl{caption}\texttt{\}}\\ |
| 297 |
% \Lcs{input\{}\textsl{filename}\texttt{\}}\\ |
| 298 |
% \Lcs{end\{pawfig\}}\\ |
| 299 |
% \end{quote} |
| 300 |
% |
| 301 |
% \DescribeEnv{pawpict} |
| 302 |
% Also, if you like, you can provide the figure enironment yourself, |
| 303 |
% but then you should use the \texttt{pawpict} enviroment, wich takes |
| 304 |
% no arguments. It is used like this: |
| 305 |
% \begin{quote} |
| 306 |
% \Lcs{begin\{pawpict\}}\\ |
| 307 |
% \Lcs{input\{}\textsl{filename}\texttt{\}}\\ |
| 308 |
% \Lcs{end\{pawfig\}}\\ |
| 309 |
% \end{quote} |
| 310 |
% |
| 311 |
% \DescribeEnv{pawfigure} |
| 312 |
% This is a simple environment, that takes two mandatory arguments: |
| 313 |
% the width and the caption. Optional argument is the placement. |
| 314 |
% |
| 315 |
% \section{The User Commands} |
| 316 |
% |
| 317 |
% In this part we describe the commands, |
| 318 |
% which you have at your disposal in the present style. |
| 319 |
% |
| 320 |
% \DescribeMacro{\pawdraft} |
| 321 |
% You can use the command \Lcs{pawdraft} to control the output |
| 322 |
% of the pictures made by \HIGZ{}. If this is set, no picture |
| 323 |
% will be drawn, instead, a frame of the size of the picture |
| 324 |
% is produced, at the place where the picture would go. |
| 325 |
% |
| 326 |
% \DescribeMacro{\pawfigplacement} |
| 327 |
% This macro takes one argument, the placement of the figure |
| 328 |
% floats. Notice this is meaningless if you use the \texttt{floatflt} |
| 329 |
% package. The placement parameters are in the standard \LaTeX{} form. |
| 330 |
% (\texttt{h}ere, \texttt{t}op, \texttt{b}ottom, |
| 331 |
% or \texttt{p}age, in any combination. Default is \texttt{htbp}.) |
| 332 |
% |
| 333 |
% \DescribeMacro{\pawincludepict} |
| 334 |
% This macro includes a file, putting it in a \texttt{pawpict} |
| 335 |
% environment. The mandaory argument is the filename, the optional is |
| 336 |
% the width of the picture. |
| 337 |
% |
| 338 |
% \DescribeMacro{\pawincludefig} |
| 339 |
% Much like above, only it is put in a \texttt{pawfig} environment, |
| 340 |
% with to mandatory arguments, the filename, and the |
| 341 |
% caption. Optionally the width of the figure may be specified. |
| 342 |
% |
| 343 |
% \DescribeMacro{\pawincludefigure} |
| 344 |
% Much like above, only it is put in a \texttt{pawfigure} environment, |
| 345 |
% with three mandatory arguments, the filename, the width, and the |
| 346 |
% caption. Optionally the placement of the figure may be specified. |
| 347 |
% |
| 348 |
% There are also some commands for producing simple text |
| 349 |
% inserts. These are listed in Table~\ref{tab:short}. They are |
| 350 |
% basically convinient shorthand macroes for various text inserts, |
| 351 |
% but also makes and index entry to that keyword. |
| 352 |
% |
| 353 |
% \begin{table}[htbp] |
| 354 |
% \label{tab:short} |
| 355 |
% \begin{tabular}{l l} |
| 356 |
% \textbf{Command}&\textbf{Resault}\\ |
| 357 |
% \Lcs{CERNLIB}& \textsc{cernlib}\\ |
| 358 |
% \Lcs{CMZ}& \textsc{cmz}\\ |
| 359 |
% \Lcs{COMIS}& \textsc{comis} \\ |
| 360 |
% \Lcs{CSPACK}& \textsc{cspack} \\ |
| 361 |
% \Lcs{FATMEN}& \textsc{fatmen} \\ |
| 362 |
% \Lcs{GEANT}& \textsc{geant} \\ |
| 363 |
% \Lcs{GKS}& \textsc{gks} \\ |
| 364 |
% \Lcs{HBOOK}& \textsc{hbook} \\ |
| 365 |
% \Lcs{HEPDB}& \textsc{hepdb} \\ |
| 366 |
% \Lcs{HIGZ}& \textsc{higz} \\ |
| 367 |
% \Lcs{HPLOT}& \textsc{hplot} \\ |
| 368 |
% \Lcs{KUIP}& \textsc{kuip} \\ |
| 369 |
% \Lcs{MINUIT}& \textsc{minuit} \\ |
| 370 |
% \Lcs{PATCHY}& \textsc{patchy} \\ |
| 371 |
% \Lcs{PAW}& \textsc{paw} \\ |
| 372 |
% \Lcs{SIGMA}& \textsc{sigma} \\ |
| 373 |
% \Lcs{PAWPP}& \textsc{paw++} \\ |
| 374 |
% \Lcs{WWW}& \textsc{www} \\ |
| 375 |
% \Lcs{VAXTAP}& \textsc{vaxtap} \\ |
| 376 |
% \Lcs{ZEBRA}& \textsc{zebra} \\ |
| 377 |
% \end{tabular} |
| 378 |
% \caption{Shorthand macroes} |
| 379 |
% \end{table} |
| 380 |
% |
| 381 |
% \DescribeMacro{\bs}\DescribeMacro{\Lcs} |
| 382 |
% Also defined are the macroes \Lcs{bs} and \Lcs{Lcs}. |
| 383 |
% type, preceded by a backslash. \Lcs{bs} takes no argument, and produce |
| 384 |
% a backslash \bs{}. \Lcs{Lcs} takes one argument, and typesets this |
| 385 |
% argument in typewriter font, preceded by a backslash. This is usefull |
| 386 |
% for macro descriptions etc. In fact \Lcs{Lcs} is produced by the |
| 387 |
% sequence \bs\texttt{Lcs\{Lcs\}}. These commands where actaully defined |
| 388 |
% to ease the writing of this documentation, but left in the style, since |
| 389 |
% I find them generally usefull. |
| 390 |
% |
| 391 |
% \iffalse |
| 392 |
%<*package> |
| 393 |
% \fi |
| 394 |
% |
| 395 |
% \section{Implementation} |
| 396 |
% |
| 397 |
% In this section, the implementation of the \texttt{pawpict} package |
| 398 |
% will be described. |
| 399 |
% |
| 400 |
% \subsection{Style definitions} |
| 401 |
% |
| 402 |
% These definitions serve basically to say something about the style |
| 403 |
% and not much else. |
| 404 |
% |
| 405 |
% \begin{macrocode} |
| 406 |
\def\fileversion{v1.0} |
| 407 |
\def\filedate{97/12/12} |
| 408 |
\def\docdate {97/12/12} |
| 409 |
\ProvidesPackage{pawpict}[\filedate\space\fileversion\space pawpict |
| 410 |
package.] |
| 411 |
\NeedsTeXFormat{LaTeX2e} |
| 412 |
\def\bs{{\tt\char'134}} |
| 413 |
\newcommand{\Lcs}[1]{{\bs\tt#1}} |
| 414 |
% \end{macrocode} |
| 415 |
% |
| 416 |
% \subsection{Options} |
| 417 |
% |
| 418 |
% \DescribeOption{noborder} |
| 419 |
% \DescribeOption{border} |
| 420 |
% The Following is the avaliable options to the \texttt{pawpict} |
| 421 |
% package. |
| 422 |
% \begin{macrocode} |
| 423 |
\DeclareOption{border}{} |
| 424 |
\DeclareOption{noborder}{\def\noborder{}} |
| 425 |
\DeclareOption*{\PackageWarning{pawpict}{Unkown option: `\CurrentOption'}} |
| 426 |
\ProcessOptions\relax |
| 427 |
% \end{macrocode} |
| 428 |
% Pass the option \texttt{noborder} to pawpict, if you in \PAW{} have |
| 429 |
% created the pictures without borders. Else do nothing. |
| 430 |
% |
| 431 |
% \subsection{Control Commands} |
| 432 |
% |
| 433 |
% \begin{macro}{\pawdraft} |
| 434 |
% This command controls wether \LaTeX{} should draw the picture, |
| 435 |
% or a box, the size of the picture. |
| 436 |
% \begin{macrocode} |
| 437 |
\def\pawdraft{\def\higzdraft{}} |
| 438 |
% \end{macrocode} |
| 439 |
% \end{macro} |
| 440 |
% |
| 441 |
% \begin{macro}{\pawfigplacement} |
| 442 |
% This command tells \LaTeX{} how to place the figures, using normal |
| 443 |
% \LaTeX{} placement syntax. It defaults to \texttt{htbp}. |
| 444 |
% \begin{macrocode} |
| 445 |
\newcommand{\pawfigplacement}[1]{\def\tempa{#1}} |
| 446 |
\ifx\tempa\undefined |
| 447 |
\def\figplacement{htbp} |
| 448 |
\else |
| 449 |
\def\figplacement{\tempa{}} |
| 450 |
\fi |
| 451 |
% \end{macrocode} |
| 452 |
% \end{macro} |
| 453 |
% |
| 454 |
% \subsection{The enviroments} |
| 455 |
% |
| 456 |
% Next the environments are defined. |
| 457 |
% |
| 458 |
% \paragraph*{Notice:} No definitions are |
| 459 |
% present in the environment definitions. This is not possible because |
| 460 |
% of the way \TeX{} interpreds argumments. It would have been nice to |
| 461 |
% limit the use of the definitions to the enviroments, but I just don't |
| 462 |
% know a way to do that. The reason why \TeX{} will not allow it, is |
| 463 |
% because \TeX{} expands the possible arguments of an environment, in |
| 464 |
% \emph{all} subseguent uses of that argument, also in macro definitions. |
| 465 |
% So if you have an enviroment that takes an argument, then \emph{every} |
| 466 |
% occurence of \texttt{\#1}\footnote{\texttt{\#1} is the \textit{token} |
| 467 |
% \TeX{} uses for the \textit{type}: ``\textit{the first argument of a |
| 468 |
% macro}''.} is concidered an argument to the environment. That means, |
| 469 |
% if you have a macro definition in the definition of the environment |
| 470 |
% of the form \Lcs{def}\Lcs{foo\#1\{...\#1...\}}, then, the argument |
| 471 |
% the user gave to the environment, will be passed to the macro, |
| 472 |
% which doesn't make sense, because you will create a new macro every |
| 473 |
% time you use the enviroment. For exapmle, if you gave the |
| 474 |
% environment the argument `\texttt{foo}', then the above macro would |
| 475 |
% be \Lcs{foobar\{...\#1...\}} wich is strictly forbidden. |
| 476 |
% |
| 477 |
% \begin{macro}{pawpict} |
| 478 |
% This is the simple enviroment, that takes no arguments, and merely |
| 479 |
% provide the neccesary dimensions. |
| 480 |
% \begin{macrocode} |
| 481 |
\newenvironment{pawpict}[1][\textwidth]{ |
| 482 |
\ifx\higzunit\undefined |
| 483 |
\newdimen\higzunit |
| 484 |
\fi |
| 485 |
\higzunit#1 |
| 486 |
% \end{macrocode} |
| 487 |
% Test to see if dimension \Lcs{higzunit} is defined, then define |
| 488 |
% it. In any case, set it to the (optional) argument of |
| 489 |
% \texttt{pawpict} which defaults to width of page |
| 490 |
% \begin{macrocode} |
| 491 |
\ifx\noborder\undefined |
| 492 |
\divide\higzunit2268 |
| 493 |
\else |
| 494 |
\divide\higzunit2045 |
| 495 |
\fi |
| 496 |
\unitlength\higzunit |
| 497 |
% \end{macrocode} |
| 498 |
% First we check to see, if the dimension \Lcs{higzunit} is set. This |
| 499 |
% should be set by \HIGZ{}, when it writes out the \LaTeX{} file, or |
| 500 |
% by some other style (maybe \texttt{cernman}?). If it isn't set, then |
| 501 |
% it becomes the size of the text width. In any case |
| 502 |
% the unit lenght (\Lcs{unitlenght}) becomes one $2000^\mbox{\small th}{}$ or |
| 503 |
% one $2268^\mbox{\small th}{}$ part of \Lcs{higzwidth} depending on wether |
| 504 |
% the picture was created with a border or not. \Lcs{textwidth} is |
| 505 |
% usally defined in either a class (such as \texttt{article}) or a |
| 506 |
% style (such as \texttt{a4wide}). This is done to make the picture |
| 507 |
% come out right relative to the text. |
| 508 |
% \begin{macrocode} |
| 509 |
\ifx\higzdraft\undefined |
| 510 |
\else |
| 511 |
\begin{picture}(2000,2000) |
| 512 |
\put(0,0){\framebox(2000,2000){}} |
| 513 |
\put(500,500){\mbox{Here will be a picture made by \PAW{}}} |
| 514 |
\end{picture} |
| 515 |
\unitlength=0pt{} |
| 516 |
\fi |
| 517 |
% \end{macrocode} |
| 518 |
% This is a check to see, if the picture should be draw. This is |
| 519 |
% usefull if you don't want \LaTeX{} to produce the final picture, for |
| 520 |
% example if you are preparing a draft of your document, and only want |
| 521 |
% to see if the picture has the right size, and comes out the right |
| 522 |
% place. If \Lcs{higzdraft} is set, then \LaTeX will only produce a |
| 523 |
% frame in the size of the right size. You can control this by the |
| 524 |
% command \Lcs{pawdraft}. |
| 525 |
% \begin{macrocode} |
| 526 |
\ifx\higzstep\undefined |
| 527 |
\newcount\higzstep\higzstep=0{} |
| 528 |
\fi |
| 529 |
\ifnum\higzstep<1 |
| 530 |
\higzstep=2 |
| 531 |
\fi |
| 532 |
% \end{macrocode} |
| 533 |
% The dimension \Lcs{higzstep} determinds in how many steps, a curve, |
| 534 |
% line, etc should be drawn. The should \emph{not} be extarnally |
| 535 |
% defined, unless in some very rare cases. |
| 536 |
% \begin{macrocode} |
| 537 |
\ifx\higzxx\undefined |
| 538 |
\newcount\higzxx |
| 539 |
\newcount\higzyy |
| 540 |
\newcount\higzx |
| 541 |
\newcount\higzy |
| 542 |
\newcount\higzdx |
| 543 |
\newcount\higzdy |
| 544 |
\newcount\higzlx |
| 545 |
\newcount\higzly |
| 546 |
\newcount\higzslope |
| 547 |
\newcount\higzlen |
| 548 |
\newcount\higzllen |
| 549 |
\newcount\higzoffs |
| 550 |
\newcount\higzloffs |
| 551 |
\newcount\higzadash |
| 552 |
\newcount\higzbdash |
| 553 |
\newcount\higzcdash |
| 554 |
\newcount\higzddash |
| 555 |
\newcount\higzmsize |
| 556 |
\newcount\higztemp |
| 557 |
\fi |
| 558 |
% \end{macrocode} |
| 559 |
% Define all the counters needed to draw the pictures, if they are |
| 560 |
% not defined\footnote{Actually, they should not be defined any where |
| 561 |
% else, then via the \texttt{pawpict} environment.} |
| 562 |
% \begin{macrocode} |
| 563 |
\par |
| 564 |
\noindent |
| 565 |
\ifx\noborder\undefined |
| 566 |
\begin{picture}(2268,2268)(0,0) |
| 567 |
\else |
| 568 |
\begin{picture}(2000,2000)(0,0) |
| 569 |
\fi |
| 570 |
} |
| 571 |
{ |
| 572 |
\end{picture} |
| 573 |
} |
| 574 |
% \end{macrocode} |
| 575 |
% Finally, start a \texttt{picture} environment, to put the drawing |
| 576 |
% macroes inside. |
| 577 |
% \end{macro} |
| 578 |
% |
| 579 |
% \begin{macro}{pawfig} |
| 580 |
% This is the more complex environment, with one mandatory and one |
| 581 |
% optional argument. It is set in a \texttt{floatingfigure} or |
| 582 |
% in a \texttt{figure} environment, depending on wether the |
| 583 |
% \texttt{floatflt} style is avaliable. |
| 584 |
% |
| 585 |
% By default the figures are treated as normal floats, but if the |
| 586 |
% \texttt{floatflt} style is avaliable, it makes a nicer output, to |
| 587 |
% use this package for floats (i.e.\ for figures) |
| 588 |
% So that {\sf pawpict} can be run independently of {\tt floatflt.sty} |
| 589 |
% we first check for its existence and set the "have@floatflt" flag |
| 590 |
% appropriately for use below. |
| 591 |
% \begin{macrocode} |
| 592 |
\newif\ifhave@floatflt |
| 593 |
\openin\@ne floatflt.sty |
| 594 |
\ifeof\@ne \else \have@floatflttrue \fi |
| 595 |
\closein\@ne \relax |
| 596 |
% \end{macrocode} |
| 597 |
% If we found {\tt floatflt.sty} we use it. |
| 598 |
% \begin{macrocode} |
| 599 |
\ifhave@floatflt |
| 600 |
\RequirePackage{floatflt} |
| 601 |
\fi |
| 602 |
% \end{macrocode} |
| 603 |
% Now the conditinal definition of the \texttt{pawfig} environment |
| 604 |
% \begin{macrocode} |
| 605 |
\newsavebox{\pawfigcaption} |
| 606 |
% \end{macrocode} |
| 607 |
% Savebox for the caption of the figure. |
| 608 |
% \begin{macrocode} |
| 609 |
\ifhave@floatflt |
| 610 |
\newenvironment{pawfig}[2][\textwidth]{ |
| 611 |
\savebox{\pawfigcaption}{#2} |
| 612 |
% \end{macrocode} |
| 613 |
% Save the second (mandatory) argument in the save box for the |
| 614 |
% caption. |
| 615 |
% \begin{macrocode} |
| 616 |
\ifx\pawfigwidth\undefined |
| 617 |
\newdimen\pawfigwidth |
| 618 |
\fi |
| 619 |
\pawfigwidth#1 |
| 620 |
\ifdim\pawfigwidth>\textwidth |
| 621 |
\pawfigwidth\textwidth |
| 622 |
\fi |
| 623 |
% \end{macrocode} |
| 624 |
% Define the dimension \Lcs{pawfigwidth}, and set it to the first |
| 625 |
% (optional) argument. Then test to see if this is bigger then the |
| 626 |
% dimension \Lcs{textwidth}, if it is, then set it to that |
| 627 |
% dimension. |
| 628 |
% \begin{macrocode} |
| 629 |
\begin{floatingfigure}{\pawfigwidth} |
| 630 |
\begin{pawpict}[\pawfigwidth] |
| 631 |
} |
| 632 |
{ |
| 633 |
\end{pawpict} |
| 634 |
\caption{\usebox{\pawfigcaption}} |
| 635 |
\end{floatingfigure} |
| 636 |
} |
| 637 |
% \end{macrocode} |
| 638 |
% Using the \texttt{floatingfigure} environment, we make a figure in |
| 639 |
% the width of the text, if no optional argument is given, and then |
| 640 |
% start the primitive \texttt{pawpict} environment. Finally the |
| 641 |
% caption is put under the figure. |
| 642 |
% \begin{macrocode} |
| 643 |
\else |
| 644 |
\newenvironment{pawfig}[2][\textwidth]{ |
| 645 |
\savebox{\pawfigcaption}{#2} |
| 646 |
\ifx\pawfigwidth\undefined |
| 647 |
\newdimen\pawfigwidth |
| 648 |
\fi |
| 649 |
\pawfigwidth#1 |
| 650 |
\begin{figure}[\figplacement] |
| 651 |
\begin{pawpict}[\pawfigwidth] |
| 652 |
} |
| 653 |
{ |
| 654 |
\end{pawpict} |
| 655 |
\caption{\usebox{\pawfigcaption}} |
| 656 |
\end{figure} |
| 657 |
} |
| 658 |
\fi |
| 659 |
% \end{macrocode} |
| 660 |
% End of the conditional definition of \texttt{pawfig} environmanent. |
| 661 |
% \end{macro} |
| 662 |
% |
| 663 |
% \begin{macro}{pawfigure} |
| 664 |
% This is a simple environment, that takes two mandatory arguments: |
| 665 |
% the width and the caption. Optional argument is the placement. |
| 666 |
% \begin{macrocode} |
| 667 |
\newenvironment{pawfigure}[3][htbp]{% |
| 668 |
\savebox{\pawfigcaption}{#3} |
| 669 |
\ifx\pawfigwidth\undefined |
| 670 |
\newdimen\pawfigwidth |
| 671 |
\fi |
| 672 |
\pawfigwidth#2 |
| 673 |
\begin{figure}[#1] |
| 674 |
\begin{pawpict}[\pawfigwidth] |
| 675 |
} |
| 676 |
{ |
| 677 |
\end{pawpict} |
| 678 |
\caption{\usebox{\pawfigcaption}} |
| 679 |
\end{figure} |
| 680 |
} |
| 681 |
% \end{macrocode} |
| 682 |
% \end{macro} |
| 683 |
% |
| 684 |
% \subsection{Picture include commands} |
| 685 |
% |
| 686 |
% \begin{macro}{\pawincludepict} |
| 687 |
% This macro includes a file, putting it in a \texttt{pawpict} |
| 688 |
% environment. The mandaory argument is the filename, the optional is |
| 689 |
% the width of the picture. |
| 690 |
% \begin{macrocode} |
| 691 |
\newcommand{\pawincludepict}[2][\textwidth]{% |
| 692 |
\begin{pawpict}% |
| 693 |
\input{#2}% |
| 694 |
\end{pawpict}% |
| 695 |
}% |
| 696 |
% \end{macrocode} |
| 697 |
% \end{macro} |
| 698 |
% \begin{macro}{\pawincludefig} |
| 699 |
% Much like above, only it is put in a \texttt{pawfig} environment, |
| 700 |
% with to mandatory arguments, the filename, and the |
| 701 |
% caption. Optionally the width of the figure may be specified. |
| 702 |
% \begin{macrocode} |
| 703 |
\newcommand{\pawincludefig}[3][\textwidth]{% |
| 704 |
\begin{pawfig}[#1]{#3}% |
| 705 |
\input{#2} % |
| 706 |
\end{pawfig}% |
| 707 |
} |
| 708 |
% \end{macrocode} |
| 709 |
% \end{macro} |
| 710 |
% \begin{macro}{\pawincludefigure} |
| 711 |
% Much like above, only it is put in a \texttt{pawfigure} environment, |
| 712 |
% with three mandatory arguments, the filename, the width, and the |
| 713 |
% caption. Optionally the placement of the figure may be specified. |
| 714 |
% \begin{macrocode} |
| 715 |
\newcommand{\pawincludefigure}[4][htbp]{% |
| 716 |
\begin{pawfigure}[#1]{#3}{#4}% |
| 717 |
\input{#2} % |
| 718 |
\end{pawfigure}% |
| 719 |
} |
| 720 |
% \end{macrocode} |
| 721 |
% \end{macro} |
| 722 |
% |
| 723 |
% \subsection{The Drawing macroes} |
| 724 |
% |
| 725 |
% These macroes are not well documentated, I'm sorry \verb+:-(+. |
| 726 |
% |
| 727 |
% All the lines, curves, characters, etc.\ made by \HIGZ{} is made of |
| 728 |
% horizontal and vertical lines, or dots. |
| 729 |
% |
| 730 |
% In time, these maybe substuted with more efficient macros. Since the |
| 731 |
% number of command needed to draw a picture is large, it takes some |
| 732 |
% time to process the picture. |
| 733 |
% |
| 734 |
% \begin{macro}{\higzstroke} |
| 735 |
% This defines the basic stroke of \HIGZ{}, an either vertical or |
| 736 |
% horizontal line. |
| 737 |
% \begin{macrocode} |
| 738 |
\def\higzstroke#1,#2,#3,#4;{ |
| 739 |
\advance\higzloffs\higzllen |
| 740 |
\ifnum\higzloffs>#1 |
| 741 |
\advance\higzloffs-\higzllen |
| 742 |
\advance\higzloffs-#1 |
| 743 |
\higzloffs=-\higzloffs |
| 744 |
\ifnum#2>0 |
| 745 |
\put(\higzlx,\higzly){\line(#3,#4){\higzloffs}} |
| 746 |
\fi |
| 747 |
\ifnum#2<0 |
| 748 |
\put(\higzlx,\higzly){\circle*{0}} |
| 749 |
\fi |
| 750 |
\higztemp=\higzloffs |
| 751 |
\multiply\higztemp#3 |
| 752 |
\advance\higzlx\higztemp |
| 753 |
\higztemp=\higzloffs |
| 754 |
\multiply\higztemp#4 |
| 755 |
\advance\higzly\higztemp |
| 756 |
\advance\higzllen-\higzloffs |
| 757 |
\higzloffs=#1 |
| 758 |
\else |
| 759 |
\ifnum#2>0 |
| 760 |
\put(\higzlx,\higzly){\line(#3,#4){\higzllen}} |
| 761 |
\fi |
| 762 |
\ifnum#2<0 |
| 763 |
\put(\higzlx,\higzly){\circle*{0}} |
| 764 |
\fi |
| 765 |
\higzllen=0 |
| 766 |
\fi |
| 767 |
} |
| 768 |
% \end{macrocode} |
| 769 |
% \end{macro} |
| 770 |
% \begin{macro}{\higzdased} |
| 771 |
% Like above, only with spaces between the lines, to make dashed and |
| 772 |
% punctured lines, curves etc. |
| 773 |
% \begin{macrocode} |
| 774 |
\def\higzdashed#1,#2,#3,#4,#5;{{ |
| 775 |
\higzlx=#1 |
| 776 |
\higzly=#2 |
| 777 |
\higzllen=#5 |
| 778 |
\higzloffs=\higzoffs |
| 779 |
\loop |
| 780 |
\ifnum\higzloffs<\higzadash |
| 781 |
\ifnum\higzadash>1 |
| 782 |
\higzstroke\higzadash,1,#3,#4; |
| 783 |
\else |
| 784 |
\higzstroke\higzadash,-1,#3,#4; |
| 785 |
\fi |
| 786 |
\else |
| 787 |
\ifnum\higzloffs<\higzbdash |
| 788 |
\higzstroke |
| 789 |
\higzbdash,0,#3,#4; |
| 790 |
\else |
| 791 |
\ifnum\higzloffs<\higzcdash |
| 792 |
\higztemp=\higzcdash |
| 793 |
\advance\higztemp-\higzbdash |
| 794 |
\ifnum\higztemp>1 |
| 795 |
\higzstroke\higzcdash,1,#3,#4; |
| 796 |
\else |
| 797 |
\higzstroke\higzcdash,-1,#3,#4; |
| 798 |
\fi |
| 799 |
\else |
| 800 |
\ifnum\higzloffs<\higzddash |
| 801 |
\higzstroke\higzddash,0,#3,#4; |
| 802 |
\else |
| 803 |
\higzloffs=0 |
| 804 |
\fi |
| 805 |
\fi |
| 806 |
\fi |
| 807 |
\fi |
| 808 |
\ifnum\higzllen>0 |
| 809 |
\repeat |
| 810 |
\global\higzoffs=\higzloffs |
| 811 |
}} |
| 812 |
% \end{macrocode} |
| 813 |
% \end{macro} |
| 814 |
% \begin{macro}{\higzsolid} |
| 815 |
% This macro draws a solid line! |
| 816 |
% \begin{macrocode} |
| 817 |
\def\higzsolid#1,#2,#3,#4,#5;{ |
| 818 |
\put(#1,#2){\line(#3,#4){#5}} |
| 819 |
} |
| 820 |
% \end{macrocode} |
| 821 |
% \end{macro} |
| 822 |
% \begin{macro}{\higzhslant} |
| 823 |
% This macro draws a slanted line made from small horizontal lines. |
| 824 |
% \begin{macrocode} |
| 825 |
\def\higzhslant#1,#2,#3;{ |
| 826 |
\higzslope=#1 |
| 827 |
\multiply\higzslope1000 |
| 828 |
\advance\higzslope500 |
| 829 |
\divide\higzslope#2 |
| 830 |
\higzlen=\higzslope |
| 831 |
\multiply\higzlen\higzstep |
| 832 |
\divide\higzlen1000 |
| 833 |
\higzdy=0 |
| 834 |
\loop |
| 835 |
\ifnum\higzdy<#2 |
| 836 |
\higzx=\higzxx |
| 837 |
\higzy=\higzyy |
| 838 |
\higzdx=\higzslope |
| 839 |
\multiply\higzdx\higzdy |
| 840 |
\advance\higzdx500 |
| 841 |
\divide\higzdx1000 |
| 842 |
\advance\higzy\higzdy |
| 843 |
\multiply\higzdx#3 |
| 844 |
\advance\higzx\higzdx |
| 845 |
\multiply\higzdx#3 |
| 846 |
\advance\higzdx\higzlen |
| 847 |
\ifnum\higzdx>#1 |
| 848 |
\advance\higzlen#1 |
| 849 |
\advance\higzlen-\higzdx |
| 850 |
\fi |
| 851 |
\higzline\higzx,\higzy,#3,0,\higzlen; |
| 852 |
\advance\higzdy\higzstep |
| 853 |
\repeat |
| 854 |
} |
| 855 |
% \end{macrocode} |
| 856 |
% \end{macro} |
| 857 |
% \begin{macro}{\higzvslant} |
| 858 |
% This macro draws a slanted line made from small vertical lines. |
| 859 |
% \begin{macrocode} |
| 860 |
\def\higzvslant#1,#2,#3;{ |
| 861 |
\higzslope=#2 |
| 862 |
\multiply\higzslope1000 |
| 863 |
\advance\higzslope500 |
| 864 |
\divide\higzslope#1 |
| 865 |
\higzlen=\higzslope |
| 866 |
\multiply\higzlen\higzstep |
| 867 |
\divide\higzlen1000 |
| 868 |
\higzdx=0 |
| 869 |
\loop |
| 870 |
\ifnum\higzdx<#1 |
| 871 |
\higzx=\higzxx |
| 872 |
\higzy=\higzyy |
| 873 |
\higzdy=\higzslope |
| 874 |
\multiply\higzdy\higzdx |
| 875 |
\advance\higzdy500 |
| 876 |
\divide\higzdy1000 |
| 877 |
\advance\higzx\higzdx |
| 878 |
\multiply\higzdy#3 |
| 879 |
\advance\higzy\higzdy |
| 880 |
\multiply\higzdy#3 |
| 881 |
\advance\higzdy\higzlen |
| 882 |
\ifnum\higzdy>#2 |
| 883 |
\advance\higzlen#2 |
| 884 |
\advance\higzlen-\higzdy |
| 885 |
\fi |
| 886 |
\higzline\higzx,\higzy,0,#3,\higzlen; |
| 887 |
\advance\higzdx\higzstep |
| 888 |
\repeat |
| 889 |
} |
| 890 |
% \end{macrocode} |
| 891 |
% \end{macro} |
| 892 |
% \begin{macro}{\s} |
| 893 |
% Draws a slanted line. This calls either \Lcs{higzhslant} or |
| 894 |
% \Lcs{higzvslant} depending on the slope of the line. |
| 895 |
% \begin{macrocode} |
| 896 |
\def\s#1,#2;{ |
| 897 |
\higzdx=#1{} |
| 898 |
\ifnum\higzdx<0 |
| 899 |
\higzdx=-\higzdx |
| 900 |
\fi |
| 901 |
\higzdy=#2{} |
| 902 |
\ifnum\higzdy<0 |
| 903 |
\higzdy=-\higzdy |
| 904 |
\fi |
| 905 |
\ifnum\higzdx<\higzdy |
| 906 |
\ifnum#1<0 |
| 907 |
\advance\higzxx#1 |
| 908 |
\advance\higzyy#2 |
| 909 |
\ifnum#2<0 |
| 910 |
\higzvslant-#1,-#2,1; |
| 911 |
\else |
| 912 |
\higzvslant-#1,#2,-1; |
| 913 |
\fi |
| 914 |
\else |
| 915 |
\ifnum#2<0 |
| 916 |
\higzvslant#1,-#2,-1; |
| 917 |
\else |
| 918 |
\higzvslant#1,#2,1; |
| 919 |
\fi |
| 920 |
\advance\higzxx#1 |
| 921 |
\advance\higzyy#2 |
| 922 |
\fi |
| 923 |
\else |
| 924 |
\ifnum#2<0 |
| 925 |
\advance\higzxx#1 |
| 926 |
\advance\higzyy#2 |
| 927 |
\ifnum#1<0 |
| 928 |
\higzhslant-#1,-#2,1; |
| 929 |
\else |
| 930 |
\higzhslant#1,-#2,-1; |
| 931 |
\fi |
| 932 |
\else |
| 933 |
\ifnum#1<0 |
| 934 |
\higzhslant-#1,#2,-1; |
| 935 |
\else |
| 936 |
\higzhslant#1,#2,1; |
| 937 |
\fi |
| 938 |
\advance\higzxx#1 |
| 939 |
\advance\higzyy#2 |
| 940 |
\fi |
| 941 |
\fi |
| 942 |
} |
| 943 |
% \end{macrocode} |
| 944 |
% \end{macro} |
| 945 |
% \begin{macro}{\h} |
| 946 |
% Draws a horizontal line. |
| 947 |
% \begin{macrocode} |
| 948 |
\def\h#1;{ |
| 949 |
\higzline\higzxx,\higzyy,1,0,#1; |
| 950 |
\advance\higzxx#1 |
| 951 |
} |
| 952 |
% \end{macrocode} |
| 953 |
% \end{macro} |
| 954 |
% \begin{macro}{\r} |
| 955 |
% Draws a horizontal line (reversed). |
| 956 |
% \begin{macrocode} |
| 957 |
\def\r#1;{ |
| 958 |
\higzline\higzxx,\higzyy,-1,0,#1; |
| 959 |
\advance\higzxx-#1 |
| 960 |
} |
| 961 |
% \end{macrocode} |
| 962 |
% \end{macro} |
| 963 |
% \begin{macro}{\U} |
| 964 |
% Draw an upward line. |
| 965 |
% \begin{macrocode} |
| 966 |
\def\U#1;{ |
| 967 |
\higzline\higzxx,\higzyy,0,1,#1; |
| 968 |
\advance\higzyy#1 |
| 969 |
} |
| 970 |
% \end{macrocode} |
| 971 |
% \end{macro} |
| 972 |
% \begin{macro}{\D} |
| 973 |
% Draws a downward line. |
| 974 |
% \begin{macrocode} |
| 975 |
\def\D#1;{ |
| 976 |
\higzline\higzxx,\higzyy,0,-1,#1; |
| 977 |
\advance\higzyy-#1 |
| 978 |
} |
| 979 |
% \end{macrocode} |
| 980 |
% \end{macro} |
| 981 |
% \begin{macro}{\m} |
| 982 |
% Move to the point \texttt{(\#1,\#2)}. |
| 983 |
% \begin{macrocode} |
| 984 |
\def\m#1,#2;{ |
| 985 |
\higzxx=#1 |
| 986 |
\higzyy=#2 |
| 987 |
} |
| 988 |
% \end{macrocode} |
| 989 |
% \end{macro} |
| 990 |
% \begin{macro}{\higzdot} |
| 991 |
% Draws a dot. |
| 992 |
% \begin{macrocode} |
| 993 |
\def\higzdot#1,#2;{ |
| 994 |
\put(#1,#2){\circle*{\higzmsize}} |
| 995 |
} |
| 996 |
% \end{macrocode} |
| 997 |
% \end{macro} |
| 998 |
% \begin{macro}{\higzplus} |
| 999 |
% A plus (+) sign. |
| 1000 |
% \begin{macrocode} |
| 1001 |
\def\higzplus#1,#2;{ |
| 1002 |
\higzx=#1 |
| 1003 |
\multiply\higzx2 |
| 1004 |
\advance\higzx-\higzmsize |
| 1005 |
\divide\higzx2 |
| 1006 |
\put(\higzx,#2){\line(1,0){\higzmsize}} |
| 1007 |
\higzy=#2 |
| 1008 |
\multiply\higzy2 |
| 1009 |
\advance\higzy-\higzmsize |
| 1010 |
\divide\higzy2 |
| 1011 |
\put(#1,\higzy){\line(0,1){\higzmsize}} |
| 1012 |
} |
| 1013 |
% \end{macrocode} |
| 1014 |
% \end{macro} |
| 1015 |
% \begin{macro}{\higzstar} |
| 1016 |
% Draws a star (an ``x'' on top of a ``+''). |
| 1017 |
% \begin{macrocode} |
| 1018 |
\def\higzstar#1,#2;{ |
| 1019 |
\higzplus#1,#2;\higzcross#1,#2; |
| 1020 |
} |
| 1021 |
% \end{macrocode} |
| 1022 |
% \end{macro} |
| 1023 |
% \begin{macro}{\higzcircle} |
| 1024 |
% A circle. |
| 1025 |
% \begin{macrocode} |
| 1026 |
\def\higzcircle#1,#2;{ |
| 1027 |
\put(#1,#2){\circle{\higzmsize}} |
| 1028 |
} |
| 1029 |
% \end{macrocode} |
| 1030 |
% \end{macro} |
| 1031 |
% \begin{macro}{\higzcross} |
| 1032 |
% Draws an ``x'' |
| 1033 |
% \begin{macrocode} |
| 1034 |
\def\higzcross#1,#2;{ |
| 1035 |
\let\higzsave\higzline |
| 1036 |
\let\higzline\higzsolid |
| 1037 |
\higzlx=#1 |
| 1038 |
\multiply\higzlx2 |
| 1039 |
\advance\higzlx-\higzmsize |
| 1040 |
\divide\higzlx2\higzly=#2 |
| 1041 |
\multiply\higzly2 |
| 1042 |
\advance\higzly-\higzmsize |
| 1043 |
\divide\higzly2 |
| 1044 |
\m\higzlx,\higzly; |
| 1045 |
\s\higzmsize,\higzmsize; |
| 1046 |
\higzly=#2 |
| 1047 |
\multiply\higzly2 |
| 1048 |
\advance\higzly\higzmsize |
| 1049 |
\divide\higzly2 |
| 1050 |
\m\higzlx,\higzly; |
| 1051 |
\s\higzmsize,-\higzmsize; |
| 1052 |
\let\higzline\higzsave |
| 1053 |
} |
| 1054 |
% \end{macrocode} |
| 1055 |
% \end{macro} |
| 1056 |
% \begin{macro}{\p} |
| 1057 |
% Sets a point. \Lcs{higzmarker} is set by \HIGZ{}, to eihter |
| 1058 |
% \Lcs{higzplus}, \Lcs{higzcross}, \Lcs{higzstar}, etc.. |
| 1059 |
% \begin{macrocode} |
| 1060 |
\def\p#1,#2;{ |
| 1061 |
\higzmarker#1,#2; |
| 1062 |
} |
| 1063 |
% \end{macrocode} |
| 1064 |
% \end{macro} |
| 1065 |
% \begin{macro}{\f} |
| 1066 |
% Draws a frame. |
| 1067 |
% \begin{macrocode} |
| 1068 |
\def\f#1,#2;{ |
| 1069 |
\put(\higzxx,\higzyy){ |
| 1070 |
\makebox(#1,#2)[lb]{\rule{#1\unitlength}{#2\unitlength}}} |
| 1071 |
} |
| 1072 |
% \end{macrocode} |
| 1073 |
% \end{macro} |
| 1074 |
% |
| 1075 |
% \subsection{Simple Text Producing Macroes} |
| 1076 |
% |
| 1077 |
% \begin{macrocode} |
| 1078 |
\newcommand{\CERNLIB}{\textsc{cernlib}\index{CERNLIB}} |
| 1079 |
\newcommand{\CMZ}{\textsc{cmz}\index{CMZ}} |
| 1080 |
\newcommand{\COMIS}{\textsc{comis}\index{COMIS}} |
| 1081 |
\newcommand{\CSPACK}{\textsc{cspack}\index{CSPACK}} |
| 1082 |
\newcommand{\FATMEN}{\textsc{fatmen}\index{FATMEN}} |
| 1083 |
\newcommand{\GEANT}{\textsc{geant}\index{GEANT}} |
| 1084 |
\newcommand{\GKS}{\textsc{gks}\index{GKS}} |
| 1085 |
\newcommand{\HBOOK}{\textsc{hbook}\index{HBOOK}} |
| 1086 |
\newcommand{\HEPDB}{\textsc{hepdb}\index{HEPDB}} |
| 1087 |
\newcommand{\HIGZ}{\textsc{higz}\index{HIGZ}} |
| 1088 |
\newcommand{\HPLOT}{\textsc{hplot}\index{HPLOT}} |
| 1089 |
\newcommand{\KUIP}{\textsc{kuip}\index{KUIP}} |
| 1090 |
\newcommand{\MINUIT}{\textsc{minuit}\index{MINUIT}} |
| 1091 |
\newcommand{\PATCHY}{\textsc{patchy}\index{PATCHY}} |
| 1092 |
\newcommand{\PAW}{\textsc{paw}\index{PAW}} |
| 1093 |
\newcommand{\SIGMA}{\textsc{sigma}\index{SIGMA}} |
| 1094 |
\newcommand{\PAWPP}{\textsc{paw++}\index{PAW++}} |
| 1095 |
\newcommand{\WWW}{\textsc{www}\index{WWW}} |
| 1096 |
\newcommand{\VAXTAP}{\textsc{vaxtap}\index{VAXTAP}} |
| 1097 |
\newcommand{\ZEBRA}{\textsc{zebra}\index{ZEBRA}} |
| 1098 |
% \end{macrocode} |
| 1099 |
% \iffalse |
| 1100 |
%</package> |
| 1101 |
% \fi |
| 1102 |
% |
| 1103 |
% \Finale |
| 1104 |
% \PrintIndex \PrintChanges |
| 1105 |
\endinput |