| 1 |
%% BEGIN poster.tex/poster.sty |
| 2 |
%% |
| 3 |
\def\fileversion{1.2} |
| 4 |
\def\filedate{93/08/28} |
| 5 |
%% |
| 6 |
%% COPYRIGHT 1993, by Timothy Van Zandt, [email protected] |
| 7 |
%% |
| 8 |
%% DESCRIPTION: |
| 9 |
%% poster.tex/poster.sty contains a macro for making posters and banners |
| 10 |
%% with TeX. It is compatible with most TeX macro packages, including Plain |
| 11 |
%% TeX, LaTeX, AmSTeX, and Ams-LaTeX. The only special requirement is that |
| 12 |
%% your printer not be bothered by text that lies off the page. This is |
| 13 |
%% true of most printers, including laser printers and PostScript printers. |
| 14 |
%% |
| 15 |
%% INSTALLATION: |
| 16 |
%% Put this file where your TeX looks for inputs, under the name poster.tex. |
| 17 |
%% Name a copy poster.sty to use as a LaTeX style option, or create a file |
| 18 |
%% poster.sty with the lines: |
| 19 |
%% \input poster.tex |
| 20 |
%% \endinput |
| 21 |
%% |
| 22 |
%% DOCUMENTATION: |
| 23 |
%% See poster.doc, and the sample files poster1.tex and poster2.tex. |
| 24 |
%% These might be appended to this file. |
| 25 |
%% |
| 26 |
%% COPYING: |
| 27 |
%% Copying of part or all of this file is allowed under the following |
| 28 |
%% conditions only: |
| 29 |
%% (1) You may freely distribute unchanged copies of the file. Please |
| 30 |
%% include the documentation when you do so. |
| 31 |
%% (2) You may modify a renamed copy of the file, but only for personal |
| 32 |
%% use or use within an organization. |
| 33 |
%% (3) You may copy fragments from the file, for personal use or for |
| 34 |
%% distribution, as long as credit is given where credit is due. |
| 35 |
%% |
| 36 |
%% You are NOT ALLOWED to take money for the distribution or use of |
| 37 |
%% this file or modified versions or fragments thereof, except for |
| 38 |
%% a nominal charge for copying etc. |
| 39 |
%% |
| 40 |
%% CODE: |
| 41 |
% These macros use TeX primitives, plus the Plain TeX commands: |
| 42 |
% \dimen@, \dimen@i, \count@, \newcount, \newtoks, |
| 43 |
% \p@, \z@, \@ne |
| 44 |
% |
| 45 |
% Check if file is loaded, announce file on terminal, and take care of @: |
| 46 |
% |
| 47 |
\csname PosterLoaded\endcsname |
| 48 |
\let\PosterLoaded\endinput |
| 49 |
|
| 50 |
\message{\space\space v\fileversion\space\space\filedate\space\space <tvz>} |
| 51 |
|
| 52 |
\edef\TheAtCode{\the\catcode`\@} |
| 53 |
\catcode`\@=11 |
| 54 |
|
| 55 |
\newbox\@posterbox |
| 56 |
\newbox\poster@savedbox |
| 57 |
\newbox\poster@cropbox |
| 58 |
\newcount\poster@cnt |
| 59 |
|
| 60 |
\def\POSTERpaperheight{11in} |
| 61 |
\def\POSTERpaperwidth{8.5in} |
| 62 |
\def\POSTERimageheight{10in} |
| 63 |
\def\POSTERimagewidth{7.5in} |
| 64 |
\def\POSTERlandscape{false} |
| 65 |
\def\POSTERclip{none} |
| 66 |
\def\POSTERcrop{corners} |
| 67 |
\def\POSTERcropwidth{2pt} |
| 68 |
\def\POSTERvcenter{false} |
| 69 |
\def\POSTERhcenter{false} |
| 70 |
\def\POSTERimmediatewrites{true} |
| 71 |
\def\POSTERnumbering{automatic} |
| 72 |
|
| 73 |
\def\poster@set#1[#2]{% |
| 74 |
\poster@@set#2,=\@nil,% |
| 75 |
\csname posterwrites@\POSTERimmediatewrites\endcsname |
| 76 |
#1} |
| 77 |
\def\poster@@set#1=#2,{% |
| 78 |
\ifx\@nil#2\else |
| 79 |
\expandafter\ifx\csname POSTER#1\endcsname\relax |
| 80 |
\errmessage{Poster parameter `#1' not defined}% |
| 81 |
\else |
| 82 |
\expandafter\edef\csname POSTER#1\endcsname{#2}% |
| 83 |
\fi |
| 84 |
\expandafter\poster@@set |
| 85 |
\fi} |
| 86 |
|
| 87 |
\def\poster@true{true} |
| 88 |
|
| 89 |
\def\poster{% |
| 90 |
\begingroup |
| 91 |
\futurelet\next\poster@i} |
| 92 |
\def\poster@i{% |
| 93 |
\ifx\next[% |
| 94 |
\expandafter\poster@set |
| 95 |
\fi |
| 96 |
\poster@ii} |
| 97 |
\def\poster@ii{% |
| 98 |
\let\posternumbering@automatic\posternumbering@rowcol |
| 99 |
\afterassignment\poster@iii |
| 100 |
\setbox\@posterbox=\hbox} |
| 101 |
\def\poster@iii{\aftergroup\poster@iv} |
| 102 |
\def\poster@iv{% |
| 103 |
\setbox\@posterbox=\hbox{\raise\dp\@posterbox\box\@posterbox}% |
| 104 |
\poster@savepage |
| 105 |
\poster@magtonum |
| 106 |
\ifx\POSTERlandscape\poster@true \poster@landscape \fi |
| 107 |
\poster@hoffsets |
| 108 |
\poster@voffsets |
| 109 |
\ifx\POSTERvcenter\poster@true \poster@vcenter \fi |
| 110 |
\ifx\POSTERhcenter\poster@true \poster@hcenter \fi |
| 111 |
\poster@makecropbox |
| 112 |
\count\@ne=\z@ |
| 113 |
\poster@vloop |
| 114 |
\endgroup} |
| 115 |
|
| 116 |
\def\Poster{% |
| 117 |
\begingroup |
| 118 |
\futurelet\next\Poster@i} |
| 119 |
\def\Poster@i{% |
| 120 |
\ifx\next[% |
| 121 |
\expandafter\poster@set |
| 122 |
\fi |
| 123 |
\Poster@ii} |
| 124 |
\def\Poster@ii{% |
| 125 |
\let\posternumbering@automatic\posternumbering@rowcol |
| 126 |
\setbox\@posterbox=\hbox\bgroup\ignorespaces} |
| 127 |
\def\endPoster{\egroup\poster@iv} |
| 128 |
|
| 129 |
\def\PosterPage{\futurelet\next\PosterPage@i} |
| 130 |
\def\PosterPage@i{% |
| 131 |
\ifx\next[% |
| 132 |
\expandafter\poster@set |
| 133 |
\fi |
| 134 |
\PosterPage@ii} |
| 135 |
\def\PosterPage@ii{% |
| 136 |
\let\posternumbering@automatic\posternumbering@page |
| 137 |
\let\poster@trueshipout\shipout |
| 138 |
\let\shipout\poster@pageshipout} |
| 139 |
\def\poster@pageshipout{% |
| 140 |
\begingroup |
| 141 |
\let\poster@savepage\relax |
| 142 |
\let\shipout\poster@trueshipout |
| 143 |
\setbox\@posterbox\box\voidb@x |
| 144 |
\afterassignment\poster@@pageshipout |
| 145 |
\setbox\@posterbox} |
| 146 |
\def\poster@@pageshipout{% |
| 147 |
\ifvoid\@posterbox\aftergroup\poster@iv\else\poster@iv\fi} |
| 148 |
\let\poster@swapcounters\relax |
| 149 |
|
| 150 |
% Make writes immediates, so that they are not repeated. |
| 151 |
\def\posterwrites@true{% |
| 152 |
\let\PosterSaved@write\write |
| 153 |
\let\PosterSaved@read\read |
| 154 |
\let\PosterSaved@openout\openout |
| 155 |
\let\PosterSaved@closeout\closeout |
| 156 |
\def\write{\PosterSaved@write-1{}\immediate\PosterSaved@write}% |
| 157 |
\def\read{\PosterSaved@write-1{}\immediate\PosterSaved@read}% |
| 158 |
\def\openout{\PosterSaved@write-1{}\immediate\PosterSaved@openout}% |
| 159 |
\def\closeout{\PosterSaved@write-1{}\immediate\PosterSaved@closeout}} |
| 160 |
|
| 161 |
\def\posternumbering@rowcol{% |
| 162 |
\count\z@=\count\@ne |
| 163 |
\count\@ne=\count\tw@ |
| 164 |
\count\tw@=\z@} |
| 165 |
|
| 166 |
\def\posternumbering@serial{% |
| 167 |
\count\z@=\poster@cnt |
| 168 |
\count\@ne=\z@ |
| 169 |
\count\tw@=\z@} |
| 170 |
|
| 171 |
% Save current contents of page in case it contains \special's: |
| 172 |
\def\poster@savepage{% |
| 173 |
\begingroup |
| 174 |
\global\setbox\poster@savedbox\box\voidb@x |
| 175 |
\output{\global\setbox\poster@savedbox\box\@cclv}% |
| 176 |
\par\hbox{}\penalty-10000 |
| 177 |
\endgroup |
| 178 |
\ifvoid\poster@savedbox\else |
| 179 |
\dp\poster@savedbox\z@ |
| 180 |
\ht\poster@savedbox\z@ |
| 181 |
\wd\poster@savedbox\z@ |
| 182 |
\fi} |
| 183 |
|
| 184 |
% \poster@mag set to decimal value of \mag. |
| 185 |
\def\poster@magtonum{% |
| 186 |
\ifnum\mag=1000 |
| 187 |
\def\poster@mag{}% |
| 188 |
\else |
| 189 |
\count@=10000000 |
| 190 |
\divide\count@\mag |
| 191 |
\advance\count@ by 200000000 |
| 192 |
\expandafter\poster@@magtonum\the\count@ |
| 193 |
\fi |
| 194 |
\dimen@=\POSTERcropwidth\relax |
| 195 |
\multiply\dimen@ 100 |
| 196 |
\divide\dimen@\mag |
| 197 |
\multiply\dimen@ 10 |
| 198 |
\edef\poster@cropwidth{\number\dimen@ sp }} |
| 199 |
|
| 200 |
\def\poster@@magtonum#1#2#3#4#5#6#7#8#9{% |
| 201 |
\count@ #2#3#4#5\relax |
| 202 |
\edef\poster@mag{\the\count@.#6#7#8#9}} |
| 203 |
|
| 204 |
\def\poster@landscape{% |
| 205 |
\let\next\POSTERpaperheight |
| 206 |
\let\POSTERpaperheight\POSTERpaperwidth |
| 207 |
\let\POSTERpaperwidth\next |
| 208 |
\let\next\POSTERimageheight |
| 209 |
\let\POSTERimageheight\POSTERimagewidth |
| 210 |
\let\POSTERimagewidth\next} |
| 211 |
|
| 212 |
% \dimen@ii set to imageheight |
| 213 |
\def\poster@voffsets{% |
| 214 |
\dimen@\POSTERimageheight\relax |
| 215 |
\dimen@ii=\poster@mag\dimen@ |
| 216 |
\voffset=\POSTERpaperheight\relax |
| 217 |
\advance\voffset-\dimen@ |
| 218 |
\divide\voffset\tw@ |
| 219 |
\ifdim\voffset<\z@ |
| 220 |
\voffset\z@ |
| 221 |
\fi |
| 222 |
\dimen@=\poster@mag\voffset |
| 223 |
\edef\poster@vmargin{\number\dimen@ sp }% |
| 224 |
\advance\voffset\m@ne in |
| 225 |
\voffset=\poster@mag\voffset} |
| 226 |
|
| 227 |
% \dimen@i set to imagewidth |
| 228 |
\def\poster@hoffsets{% |
| 229 |
\dimen@\POSTERimagewidth\relax |
| 230 |
\dimen@i=\poster@mag\dimen@ |
| 231 |
\hoffset=\POSTERpaperwidth\relax |
| 232 |
\advance\hoffset-\dimen@ |
| 233 |
\divide\hoffset\tw@ |
| 234 |
\ifdim\hoffset<\z@ |
| 235 |
\hoffset=\z@ |
| 236 |
\fi |
| 237 |
\dimen@=\poster@mag\hoffset |
| 238 |
\edef\poster@hmargin{\number\dimen@ sp }% |
| 239 |
\advance\hoffset\m@ne in |
| 240 |
\hoffset=\poster@mag\hoffset} |
| 241 |
|
| 242 |
% Center vertically |
| 243 |
\def\poster@vcenter{% |
| 244 |
\count@=\ht\@posterbox |
| 245 |
\divide\count@\dimen@ii |
| 246 |
\dimen@=\the\count@\dimen@ii |
| 247 |
\advance\dimen@-\ht\@posterbox |
| 248 |
\ifdim\dimen@<-.1pt |
| 249 |
\advance\count@\@ne |
| 250 |
\fi |
| 251 |
\setbox\@posterbox=\hbox{\vbox to \the\count@\dimen@ii{% |
| 252 |
\vss\box\@posterbox\vss}}} |
| 253 |
|
| 254 |
% Center horizontally |
| 255 |
\def\poster@hcenter{% |
| 256 |
\count@=\wd\@posterbox |
| 257 |
\divide\count@\dimen@i |
| 258 |
\dimen@=\the\count@\dimen@i |
| 259 |
\advance\dimen@-\wd\@posterbox |
| 260 |
\ifdim\dimen@<-.1pt |
| 261 |
\advance\count@\@ne |
| 262 |
\fi |
| 263 |
\setbox\@posterbox=\hbox to \the\count@\dimen@i{% |
| 264 |
\hss\box\@posterbox\hss}} |
| 265 |
|
| 266 |
% Print rows: |
| 267 |
\def\poster@vloop{% |
| 268 |
\ifdim\ht\@posterbox>.1\p@ |
| 269 |
\ifdim\ht\@posterbox<\dimen@ii |
| 270 |
\dimen@ii=\ht\@posterbox |
| 271 |
\poster@makecropbox |
| 272 |
\fi |
| 273 |
\advance\count\@ne\@ne |
| 274 |
\count\tw@=\z@ |
| 275 |
\dimen@=\wd\@posterbox |
| 276 |
\poster@hloop |
| 277 |
\dimen@=\ht\@posterbox |
| 278 |
\advance\dimen@-\dimen@ii |
| 279 |
\ht\@posterbox\dimen@ |
| 280 |
\expandafter\poster@vloop |
| 281 |
\fi} |
| 282 |
|
| 283 |
% Print columns. |
| 284 |
% \dimen@ is used as scratch to keep track of remaining width. |
| 285 |
\def\poster@hloop{% |
| 286 |
\ifdim\dimen@>.1\p@ |
| 287 |
\advance\count\tw@ by \@ne |
| 288 |
\begingroup |
| 289 |
\ifdim\dimen@<\dimen@i |
| 290 |
\dimen@i=\dimen@ |
| 291 |
\poster@makecropbox |
| 292 |
\fi |
| 293 |
\ifnum\count\@ne=\@ne |
| 294 |
\begingroup |
| 295 |
\advance\[email protected]\p@ |
| 296 |
\ifdim\ht\@posterbox>\dimen@ii |
| 297 |
\global\let\next\relax |
| 298 |
\else |
| 299 |
\gdef\next{\count\@ne=\count\tw@ \count\tw@=\z@}% |
| 300 |
\fi |
| 301 |
\endgroup |
| 302 |
\next |
| 303 |
\fi |
| 304 |
\global\advance\poster@cnt\@ne |
| 305 |
\csname posternumbering@\POSTERnumbering\endcsname |
| 306 |
\poster@shipout |
| 307 |
\endgroup |
| 308 |
\advance\dimen@-\dimen@i |
| 309 |
\expandafter\poster@hloop |
| 310 |
\fi} |
| 311 |
|
| 312 |
% Shipout, aligning everything at the top-left corner: |
| 313 |
\def\poster@shipout{% |
| 314 |
\shipout\hbox{% |
| 315 |
\ifvoid\poster@savedbox\else\box\poster@savedbox\fi |
| 316 |
\csname beginposterclip@\POSTERclip\endcsname |
| 317 |
\lower\ht\@posterbox\hbox to\z@{% |
| 318 |
\advance\dimen@-\wd\@posterbox |
| 319 |
\kern\dimen@ |
| 320 |
\copy\@posterbox |
| 321 |
\hss}% |
| 322 |
\csname endposterclip@\POSTERclip\endcsname |
| 323 |
\copy\poster@cropbox}}% |
| 324 |
|
| 325 |
% clip=pstricks |
| 326 |
\def\beginposterclip@pstricks{% |
| 327 |
\expandafter\ifx\csname @pstrickserr\endcsname\relax |
| 328 |
\errmessage{% |
| 329 |
You must load PSTricks to use poster.tex's clip=pstricks option!}% |
| 330 |
\global\let\beginposterclip@pstricks\relax |
| 331 |
\else |
| 332 |
\gdef\beginposterclip@pstricks{\beginposterclip@@pstricks}% |
| 333 |
\gdef\endposterclip@pstricks{\pstVerb{currentpoint initclip moveto}}% |
| 334 |
\beginposterclip@@pstricks |
| 335 |
\fi} |
| 336 |
|
| 337 |
\let\endposterclip@pstricks\relax |
| 338 |
|
| 339 |
\def\beginposterclip@@pstricks{% |
| 340 |
\pst@Verb{% |
| 341 |
/mtrxc CM def |
| 342 |
\tx@STV |
| 343 |
CP translate |
| 344 |
newpath |
| 345 |
0 0 moveto |
| 346 |
\pst@number\dimen@i 0 rlineto |
| 347 |
0 \pst@number\dimen@ii neg rlineto |
| 348 |
\pst@number\dimen@i neg 0 rlineto |
| 349 |
closepath |
| 350 |
clip |
| 351 |
newpath |
| 352 |
0 0 moveto |
| 353 |
mtrxc setmatrix}} |
| 354 |
|
| 355 |
\def\poster@makecropbox{% |
| 356 |
\setbox\poster@cropbox=\hbox{\csname postercrop@\POSTERcrop\endcsname}% |
| 357 |
\ht\poster@cropbox=\z@ |
| 358 |
\dp\poster@cropbox=\z@ |
| 359 |
\wd\poster@cropbox=\z@} |
| 360 |
|
| 361 |
\def\postercrop@corners{% |
| 362 |
\vtop{% |
| 363 |
\hbox{% |
| 364 |
\kern -\poster@hmargin |
| 365 |
\vrule height \poster@cropwidth width \poster@hmargin |
| 366 |
\kern -\poster@cropwidth |
| 367 |
\vrule height \poster@vmargin width \poster@cropwidth |
| 368 |
\kern \dimen@i |
| 369 |
\vrule height \poster@vmargin width \poster@cropwidth |
| 370 |
\kern -\poster@cropwidth |
| 371 |
\vrule height \poster@cropwidth width \poster@hmargin}% |
| 372 |
\nointerlineskip |
| 373 |
\vskip\dimen@ii |
| 374 |
\hbox{% |
| 375 |
\kern -\poster@hmargin |
| 376 |
\vrule height \z@ depth \poster@cropwidth width \poster@hmargin |
| 377 |
\kern -\poster@cropwidth |
| 378 |
\vrule height \z@ depth \poster@vmargin width \poster@cropwidth |
| 379 |
\kern \dimen@i |
| 380 |
\vrule height \z@ depth \poster@vmargin width \poster@cropwidth |
| 381 |
\kern -\poster@cropwidth |
| 382 |
\vrule height \z@ depth \poster@cropwidth width \poster@hmargin}}}% |
| 383 |
|
| 384 |
\def\postercrop@full{% |
| 385 |
\begingroup |
| 386 |
\hbox to\z@{% |
| 387 |
\advance\dimen@ii\poster@vmargin |
| 388 |
\kern -\poster@cropwidth |
| 389 |
\vrule height \poster@vmargin depth \dimen@ii width \poster@cropwidth |
| 390 |
\kern \dimen@i |
| 391 |
\vrule height \poster@vmargin depth \dimen@ii width \poster@cropwidth |
| 392 |
\hss}% |
| 393 |
\kern -\poster@hmargin |
| 394 |
\vtop{% |
| 395 |
\advance\dimen@i \poster@hmargin |
| 396 |
\advance\dimen@i \poster@hmargin |
| 397 |
\kern-\poster@cropwidth |
| 398 |
\hrule height \poster@cropwidth width \dimen@i |
| 399 |
\kern\dimen@ii |
| 400 |
\hrule height \z@ depth \poster@cropwidth width \dimen@i}% |
| 401 |
\endgroup} |
| 402 |
|
| 403 |
\catcode`\@=\TheAtCode\relax |
| 404 |
\endinput |
| 405 |
%% |
| 406 |
%% END poster.tex |
| 407 |
|