diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/generic/epsf |
Initial commit
Diffstat (limited to 'macros/generic/epsf')
-rw-r--r-- | macros/generic/epsf/LICENSE | 5 | ||||
-rw-r--r-- | macros/generic/epsf/Makefile | 83 | ||||
-rw-r--r-- | macros/generic/epsf/README | 294 | ||||
-rw-r--r-- | macros/generic/epsf/bboxgrid.ps | 317 | ||||
-rw-r--r-- | macros/generic/epsf/epsf-doc.pdf | bin | 0 -> 267725 bytes | |||
-rw-r--r-- | macros/generic/epsf/epsf-doc.tex | 659 | ||||
l--------- | macros/generic/epsf/epsf.sty | 1 | ||||
-rw-r--r-- | macros/generic/epsf/epsf.tex | 653 | ||||
-rw-r--r-- | macros/generic/epsf/fndbadps | 18 | ||||
-rw-r--r-- | macros/generic/epsf/okay/teps.eps | 186 | ||||
-rw-r--r-- | macros/generic/epsf/okay/tepsf.eps | 186 | ||||
-rw-r--r-- | macros/generic/epsf/okay/tepsf1.dvi | bin | 0 -> 5264 bytes | |||
-rw-r--r-- | macros/generic/epsf/okay/tepsf2.dvi | bin | 0 -> 7840 bytes | |||
-rw-r--r-- | macros/generic/epsf/okay/tepsf3.dvi | bin | 0 -> 3444 bytes | |||
-rw-r--r-- | macros/generic/epsf/teps.eps | 186 | ||||
-rw-r--r-- | macros/generic/epsf/tepsf.eps | 186 | ||||
-rw-r--r-- | macros/generic/epsf/tepsf1.tex | 146 | ||||
-rw-r--r-- | macros/generic/epsf/tepsf2.ltx | 232 | ||||
-rw-r--r-- | macros/generic/epsf/tepsf3.tex | 108 |
19 files changed, 3260 insertions, 0 deletions
diff --git a/macros/generic/epsf/LICENSE b/macros/generic/epsf/LICENSE new file mode 100644 index 0000000000..5bb543fb04 --- /dev/null +++ b/macros/generic/epsf/LICENSE @@ -0,0 +1,5 @@ +The epsf.tex and epsf.sty files are identical, and are freely +redistributable and placed into the public domain by Tomas Rokicki. +The changes since their original release in 1989 are similarly in the +public domain, as are all of the files distributed in the epsf-x.y.z +package. diff --git a/macros/generic/epsf/Makefile b/macros/generic/epsf/Makefile new file mode 100644 index 0000000000..16b4c3f58b --- /dev/null +++ b/macros/generic/epsf/Makefile @@ -0,0 +1,83 @@ +### ==================================================================== +### [30-Jul-2005] +### ==================================================================== + +prefix = /usr/local + +CP = /bin/cp -p + +INSTDIRS = $(prefix)/share/lib/tex/inputs \ + $(prefix)/share/lib/tex/latex \ + $(prefix)/share/lib/tex/latex2e/unpacked + +LATEX = latex +LATEX = latex2e + +LN = /bin/ln -f + +LS = ls + +RM = /bin/rm -f + +SHELL = /bin/sh + +TEX = tex + +### ==================================================================== + +LTXFILES = tepsf2.ltx + +TEXFILES = tepsf1.tex tepsf3.tex + +### ==================================================================== + +all: + @echo There is nothing to build in this directory. + +check: check-latex check-tex + +check-latex: + for f in $(LTXFILES) ; \ + do \ + $(LATEX) $$f ; \ + $(LS) -l `basename $$f .ltx`.* ; \ + done + +check-tex: + for f in $(TEXFILES) ; \ + do \ + $(TEX) $$f ; \ + $(LS) -l `basename $$f .tex`.* ; \ + done + +clean: + -$(RM) *.aux + -$(RM) *.dvi + -$(RM) *.log + -$(RM) *~ + -$(RM) \#* + -$(RM) a.out + -$(RM) core core.* + +clobber: distclean + +distclean: mostlyclean + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +mostlyclean: clean + +install: uninstall + for d in $(INSTDIRS) ; \ + do \ + $(CP) epsf.tex $$d/epsf.tex ; \ + $(LN) $$d/epsf.tex $$d/epsf.sty ; \ + done + +uninstall: + for d in $(INSTDIRS) ; \ + do \ + $(RM) $$d/epsf.tex $$d/epsf.sty ; \ + done diff --git a/macros/generic/epsf/README b/macros/generic/epsf/README new file mode 100644 index 0000000000..986453765a --- /dev/null +++ b/macros/generic/epsf/README @@ -0,0 +1,294 @@ +%% /u/sy/beebe/tex/epsf/epsf-2.7.3/README, Sat Jul 30 18:41:35 2005 +%% Edit by Nelson H. F. Beebe <beebe@math.utah.edu> + +============ +Introduction +============ + +The epsf.tex and epsf.sty (identical) files provide for +low-level typesetting of Encapsulated PostScript (EPS) +files, with optional suppression of the figure contents (for +faster display and printing during document development), +optional figure framing, and optional figure labeling. + +See the header comments in epsf.tex or epsf.sty files for +usage information. + +LaTeX users are cautioned that the graphicx package +documented in the LaTeX Graphics Companion and LaTeX +Companion (2nd ed.) books provides a much more powerful and +general facility, and allows easy switching between +pdf(la)tex and (la)tex without document modification. + +Plain TeX and AmSTeX users, however, may find epsf.tex +useful. + + +=================== +Testing the package +=================== + +The test files in the package can be typeset on Unix systems +with + + make check + +You can then view or print the .dvi files to see several +examples of what they are supposed to look like. + +If you are in doubt about their appearance when generated at +your site, try the okay/*.dvi files: they were produced by +the package maintainers to illustrate the correct behavior +the package macros. + + +================= +Problem EPS files +================= + +If you experience difficulty in positioning an EPS picture, +and find that it appears in an unexpected location, or in an +incorrect scale or orientation, then it is often the case +that the PostScript is not EPSF-conformant (see the +specification in the references below). This may be because +it uses forbidden low-level PostScript operators that modify +the PostScript page transformations. The fndbadps shell +script in the distribution can be used on Unix systems to +search for forbidden operators in EPS files. If you find +any, you should complain to the author or vendor of the +software that produced the bad EPS files: the EPS +specification has been available since 1992, and is very +clear about what operators are forbidden. + +It is sometimes possible to repair problem EPS files by +converting from PostScript to PDF and back to PostScript. +Suitable tools for PostScript to PDF conversion include +Adobe distill, ghostscript ps2pdf, and Frank M. Siegert's +pstill. For PDF to PostScript conversion, use Adobe +acroread, ghostscript pdf2ps, or your PDF file viewer's +print-to-PostScript-file option. + +In bad cases, the only way to deal with a problem EPS file +may be to convert it to a high-resolution bitmap and back to +PostScript, taking care to choose a lossless bitmap format. +This can be done with the NetPBM tools and ghostscript. +These utilities offer a myriad of options, so it is +convenient to combine them in a separate tool that provides +the commonly-needed options: pstopngtops (see the References +section below). + + +=========================== +Bounding boxes and clipping +=========================== + +Sometimes the only problem is that the size of the figure is +wrong. This is usually because the %%BoundingBox comment +that is normally present in the first few lines of the EPS +file is wrong: indeed, most PostScript-producing software +produces nonsensical bounding boxes. + +One way to fix this problem is to print your EPS file and +the bboxgrid.ps file from this package on the SAME printer, +overlay them against a light source, and measure the +lower-left and upper-right corner coordinates in big points +(72bp = 1in = 25.4mm) of the picture and then edit the EPS +file to supply the correct coordinates as whole numbers in +order: + + %%BoundingBox: lower-left-x lower-left-y upper-right-x upper-right-y + +The PostScript coordinate system is right-handed Cartesian +with the origin at the lower-left page corner. The reason +that you need the grid provided by bboxgrid.ps is that even +though PostScript defines the coordinate position (0,0) to +be at the lower-left page corner, mechanical limitations +and/or misadjustments in PostScript printers often result in +that point being displaced by as much 1cm in any direction. +Even two identical models of the same printer can differ in +their true page origins! When you measure the picture +corners of your figure using the bboxgrid.ps output on the +same printer, you eliminate this source of confusion and +error. + +A better way to obtain an accurate bounding box is to ask +ghostscript to measure it for you: + + % gs -sDEVICE=bbox -dNOPAUSE bboxgrid.ps quit.ps + AFPL Ghostscript 8.51 (2005-04-18) + Copyright (C) 2005 artofcode LLC, Benicia, CA. All rights reserved. + This software comes with NO WARRANTY: see the file PUBLIC for details. + Loading NimbusSanL-Bold font from /usr/local/share/ghostscript/fonts/n019004l.pfb... 4506264 2452117 1502816 214110 1 done. + Loading NimbusSanL-Regu font from /usr/local/share/ghostscript/fonts/n019003l.pfb... 4506264 2483411 1522912 220580 1 done. + %%BoundingBox: 15 18 610 783 + %%HiResBoundingBox: 15.444000 18.395999 609.713981 782.045976 + +You can then replace the faulty %%BoundingBox comment in +your file with the correct one. + +The %%HiResBoundingBox comment is produced and used by some +software, but is nonstandard, and should not be relied on. +The epsf package ignores it, and PostScript printers ignore +all comments (text outside strings from percent to end of +line). + +If editing the EPS file is impossible, impractical, or +undesirable, you can supply the correct bounding box as a +square-bracketed optional argument to \epsfbox: + + \epsfbox[30 50 250 270]{filename.eps} + +This will override any %%BoundingBox comment in the file, +and if clipping is turned on with \epsfclipon, only material +inside the bounding box will appear in your output. + +If you find that the bounding box specification near the +start of the EPS file looks like this: + + %%BoundingBox: (atend) + +then search backward from the end of the file to find the +NEAREST %%BoundingBox comment, and then replace the (atend) +comment with the one you just found. TeX has to read the +EPS file until it finds the %%BoundingBox comment, and the +further it is from the beginning, the longer TeX will take +to find it. Parsing text in TeX is NOT a fast operation! + +Historical note: The bbox device was added to ghostscript at +version 3.68 in April 1996 at the suggestion of Nelson +H. F. Beebe. + + +========== +References +========== + +Web resources: + + LaTeX graphicx package: + http://ctan.tug.org/tex-archive/macros/latex/required/graphics/graphicx.dtx + + + Pstill (PostScript to PDF conversion tool): + http://www.wizards.de/~frank/pstill.html + http://www.this.net/~frank/pstill_win.html + + Aladdin Ghostscript: + ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/ + http://prdownloads.sourceforge.net/ghostscript/ + http://www.artifex.com/ + http://www.cs.wisc.edu/~ghost/ + + GNU Ghostscript: + ftp://ftp.gnu.org/gnu/ghostscript + http://directory.fsf.org/ghostscript.html + + pstopngtops: + ftp://ftp.math.utah.edu/pub/pstopngtops + http://www.math.utah.edu/pub/pstopngtops + + netpbm: + http://netpbm.sourceforge.net/ + http://sourceforge.net/projects/netpbm/ + http://ii2.sourceforge.net/ + Note: NetPBM has a nonstandard build + procedure and historically has been very + painful to build on most Unix systems. The + first URL listed provides pointers to binary + distributions for some platforms that you + may find easier to install. Some GNU/Linux + distributions already have them: if the + Unix command + + which pngtopnm pnmcrop pnmmargin pnmtops + + reports locations of each those tools, then + you already have the ones needed for pstopngtops. + Mac OS X users can most conveniently install NetPBM + from the ii2 link above. + + +Books: + +@String{pub-ADOBE = "{Adobe Systems Incorporated}"} +@String{pub-ADOBE:adr = "San Jose, CA, USA"} + +@String{pub-AW = "Ad{\-d}i{\-s}on-Wes{\-l}ey"} +@String{pub-AW:adr = "Reading, MA, USA"} + +@Book{Adobe:1990:PLR, + author = "Adobe Systems Incorporated", + title = "{PostScript} Language Reference Manual", + publisher = pub-AW, + address = pub-AW:adr, + edition = "Second", + pages = "viii + 764", + year = "1990", + ISBN = "0-201-18127-4", + ISBN-13 = "978-0-201-18127-2", + LCCN = "QA76.73.P67 P67 1990", + bibdate = "Sat Oct 28 08:25:15 2000", + remark = "Appendix H documents the EPSF 3.0 specification.", +} + +@TechReport{Adobe:1992:EPF, + author = "{Adobe PostScript Developer Support Group}", + title = "{Encapsulated PostScript Files} Specification Version + 3.0", + number = "PN LPS5002", + institution = pub-ADOBE, + address = pub-ADOBE:adr, + day = "1", + month = may, + year = "1992", + bibdate = "Sat Jul 30 18:50:43 2005", + URL = "http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf", + note = "The specification is also published in + \cite[Appendix~H]{Adobe:PLR90}.", +} + +@Book{Goossens:1997:LGC, + author = "Michel Goossens and Sebastian Rahtz and Frank + Mittelbach", + title = "The {\LaTeX} Graphics Companion: Illustrating + Documents with {\TeX} and {PostScript}", + publisher = pub-AW, + address = pub-AW:adr, + pages = "xxi + 554", + year = "1997", + ISBN = "0-201-85469-4", + ISBN-13 = "978-0-201-85469-5", + LCCN = "Z253.4.L38G663 1997", + bibdate = "Fri Jul 11 07:51:47 1997", + price = "US\$39.75", + series = "Tools and Techniques for Computer Typesetting", + acknowledgement = ack-nhfb, + keywords = "LaTeX (Computer file); Computerized typesetting.; + PostScript (Computer program language); Scientific + illustration --- Computer programs.; Mathematics + printing --- Computer programs.; Technical publishing + --- Computer programs.", +} + +@Book{Mittelbach:2004:LC, + author = "Frank Mittelbach and Michel Goossens and Johannes + Braams and David Carlisle and Chris Rowley and + Christine Detig and Joachim Schrod", + title = "The {\LaTeX} Companion", + publisher = pub-AW, + address = pub-AW:adr, + edition = "Second", + pages = "xxvii + 1090", + year = "2004", + ISBN = "0-201-36299-6", + ISBN-13 = "978-0-201-36299-2", + LCCN = "Z253.4.L38 G66 2004", + bibdate = "Thu May 20 13:23:24 2004", + price = "US\$59.99, CAN\$86.99", + series = "Tools and Techniques for Computer Typesetting", + acknowledgement = ack-nhfb, + remark = "Authors listed as: Frank Mittelbach and Michel + Goossens with Johannes Braams, David Carlisle, and + Chris Rowley, and with contributions by Christine Detig + and Joachim Schrod.", +} diff --git a/macros/generic/epsf/bboxgrid.ps b/macros/generic/epsf/bboxgrid.ps new file mode 100644 index 0000000000..7db6828817 --- /dev/null +++ b/macros/generic/epsf/bboxgrid.ps @@ -0,0 +1,317 @@ +%!PS-Adobe +%%BoundingBox: 0 0 612 792 +%%% ==================================================================== +%%% @PostScript-file{ +%%% author = "Nelson H. F. Beebe", +%%% version = "1.01", +%%% date = "22 January 1994", +%%% time = "23:33:36 MST", +%%% filename = "bboxgrid.ps", +%%% address = "Center for Scientific Computing +%%% Department of Mathematics +%%% University of Utah +%%% Salt Lake City, UT 84112 +%%% USA +%%% Tel: +1 801 581 5254 +%%% FAX: +1 801 581 4148", +%%% checksum = "57568 317 1097 8973", +%%% email = "beebe@solitude.math.utah.edu (Internet)", +%%% codetable = "ISO/ASCII", +%%% keywords = "grid, measure, calibration", +%%% supported = "yes", +%%% docstring = "This PostScript file produces a numbered grid +%%% measured in PostScript units of big points +%%% for the determination of correct bounding +%%% boxes of other PostScript files. +%%% +%%% Accurate bounding box measurements are +%%% required if the PostScript is to be included +%%% in other PostScript documents, such as via +%%% the TeX \special{} command. +%%% +%%% While PostScript by default places the (0,0) +%%% origin at the lower-left page corner, +%%% variations of several points will be found in +%%% different printers, even between identical +%%% models from the same vendor. +%%% +%%% To correctly determine the BoundingBox of an +%%% arbitrary PostScript figure, overlay a +%%% printed copy of the figure on the grid +%%% produced by this file on the SAME printer, +%%% and measure from it the coordinates of the +%%% lower-left and upper-right corners. These +%%% four integers should be entered in the +%%% PostScript file as a comment of the form +%%% +%%% %%BoundingBox: llx lly urx ury +%%% +%%% This comment should be placed near the +%%% beginning, preferably right after the initial +%%% line that should start %! or %!PS-Adobe... +%%% +%%% The checksum field above contains a CRC-16 +%%% checksum as the first value, followed by the +%%% equivalent of the standard UNIX wc (word +%%% count) utility output of lines, words, and +%%% characters. This is produced by Robert +%%% Solovay's checksum utility.", +%%% } +%%% ==================================================================== + +%%% 1.01 [22-Jan-1994] add top label, and bp axis labels +%%% 1.00 [22-Nov-1991] original version + +/TickSize 5 def +/TickStep 5 def +/TickFontSize 9 def + +/Frame % x y width height Frame +{ + /height exch def + /width exch def + /y exch def + /x exch def + newpath + x y moveto + width 0 rlineto + 0 height rlineto + width neg 0 rlineto + closepath + stroke + + x y width TickStep TickSize TickX + x y width TickStep TickSize NumberX + x y height add width TickStep TickSize neg TickX + x y height add width TickStep TickSize neg NumberX + x y height TickStep TickSize TickY + x y height TickStep TickSize NumberY + x width add y height TickStep TickSize neg TickY + x width add y height TickStep TickSize neg NumberY + x y 25 25 width height Grid +} def + +/Grid % x y dx dy width height Grid +{ + /Gheight exch def + /Gwidth exch def + /Gdy exch def + /Gdx exch def + /Gy exch def + /Gx exch def + + Gx + Gdx + Gx Gwidth add + { + newpath + Gy moveto + 0 Gheight rlineto + closepath + stroke + } + for + + Gy + Gdy + Gy Gheight add + { + newpath + Gx exch moveto + Gwidth 0 rlineto + closepath + stroke + } + for +} def + + +/NumberX % x y length dx tick NumberX +{ + /Helvetica findfont TickFontSize scalefont setfont + /Ttick exch def + /Tdx exch def + /Tlength exch def + /Ty exch def + /Tx exch def + + /temp 12 string def + Tx + Tdx 5 mul + Tx Tlength add + { + dup + Ty moveto % Tx already on stack + Ttick 0 lt + { 0 TickFontSize 0.5 mul rmoveto } + { 0 TickFontSize -1.5 mul rmoveto } + ifelse + temp cvs + dup stringwidth pop -2 div 0 rmoveto + show + } + for +} def + +/NumberY % x y length dy tick NumberY +{ + /Helvetica findfont TickFontSize scalefont setfont + /Ttick exch def + /Tdy exch def + /Tlength exch def + /Ty exch def + /Tx exch def + + /temp 12 string def + Ty + Tdy 5 mul + Ty Tlength add + { + dup + Tx exch moveto % Ty already on stack + Ttick neg TickFontSize -2 div rmoveto + temp cvs + Ttick 0 gt + { dup stringwidth pop neg 0 rmoveto } + if + show + } + for +} def + +/TickX % x y length dx tick TickX +{ + /Ttick exch def + /Tdx exch def + /Tlength exch def + /Ty exch def + /Tx exch def + + Tx + Tdx + Tx Tlength add + { + dup + newpath + Ty moveto % Tx already on stack + cvi Tdx 5 mul cvi mod 0 eq% draw tick, double length every 5th + { Ttick 2 mul } + { Ttick } + ifelse + 0 + exch + rlineto + closepath + stroke + } + for +} def + +/TickY % x y length dy tick TickY +{ + /Ttick exch def + /Tdy exch def + /Tlength exch def + /Ty exch def + /Tx exch def + + Ty + Tdy + Ty Tlength add + { + dup + newpath + Tx exch moveto % Ty already on stack + cvi Tdy 5 mul cvi mod 0 eq% draw tick, double length every 5th + { Ttick 2 mul } + { Ttick } + ifelse + 0 + rlineto + closepath + stroke + } + for +} def + +/inch +{ + 72 mul +} def + +/mm +{ + 72 mul 25.4 div +} def + +% (string) CenterCenterShow -- show centered at currentpoint +/CenterCenterShow +{ + dup stringwidth pop -2 div TickFontSize -2 div rmoveto show +} def + +% (string) RightCenterShow -- show right-centered at currentpoint +/RightCenterShow +{ + dup stringwidth pop neg TickFontSize -2 div rmoveto show +} def + +% (string) LeftCenterShow -- show right-centered at currentpoint +/LeftCenterShow +{ + 0 TickFontSize -2 div rmoveto show +} def + +% Select ONE of these pairs of page dimensions + +% ISO A4-format paper +% /PageWidth 210 mm def +% /PageHeight 297 mm def + +% US A-format paper +/PageWidth 8.5 inch def +/PageHeight 11.0 inch def + +% Make grid lines half the normal thickness +currentlinewidth 0.5 mul setlinewidth + +% Title the grid +/Helvetica-Bold findfont TickFontSize scalefont setfont +PageWidth 2 div 25 moveto +(bboxgrid.ps [Version 1.01] [22 January 1994]) dup +CenterCenterShow + +PageWidth 2 div 780 moveto +CenterCenterShow + +% You can change this line to make a different grid. The values +% should all be multiples of 25. +% The values 50 50 525 700 are appropriate for an Apple LaserWriter II. +% x y width height Frame +50 50 525 700 Frame + +% label bottom horizontal axis at each end +50 30 moveto +(bp) CenterCenterShow +575 30 moveto +(bp) CenterCenterShow + +% label top horizontal axis at each end +50 770 moveto +(bp) CenterCenterShow +575 770 moveto +(bp) CenterCenterShow + +% label left vertical axis at each end +25 50 moveto +(bp) RightCenterShow +25 750 moveto +(bp) RightCenterShow + +% label right vertical axis at each end +600 50 moveto +(bp) LeftCenterShow +600 750 moveto +(bp) LeftCenterShow + +showpage diff --git a/macros/generic/epsf/epsf-doc.pdf b/macros/generic/epsf/epsf-doc.pdf Binary files differnew file mode 100644 index 0000000000..6d2ac5e85b --- /dev/null +++ b/macros/generic/epsf/epsf-doc.pdf diff --git a/macros/generic/epsf/epsf-doc.tex b/macros/generic/epsf/epsf-doc.tex new file mode 100644 index 0000000000..54074e4b5b --- /dev/null +++ b/macros/generic/epsf/epsf-doc.tex @@ -0,0 +1,659 @@ +\documentclass[DIV=9, pagesize=auto]{scrartcl} + +\usepackage{fixltx2e} +\usepackage{etex} +\usepackage{xspace} +\usepackage{lmodern} +\usepackage[T1]{fontenc} +\usepackage{textcomp} +\usepackage{microtype} +\usepackage[unicode=true]{hyperref} + +\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}} +\newcommand*{\Mail}[1]{\href{mailto:#1}{\texttt{<#1>}}} +\newcommand*{\pkg}[1]{\textsf{#1}} +\newcommand*{\cs}[1]{\texttt{\textbackslash#1}} +\makeatletter +\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}} +\makeatother +\newcommand*{\env}[1]{\texttt{#1}} +\newcommand*{\opt}[1]{\texttt{#1}} +\newcommand*{\meta}[1]{\textlangle\textsl{#1}\textrangle} +\newcommand*{\marg}[1]{\texttt{\{}\meta{#1}\texttt{\}}} +\newcommand*{\Beebe}{Nelson H. F. Beebe \Mail{beebe@math.utah.edu}\xspace} + +\addtokomafont{title}{\rmfamily} + +\title{The \pkg{epsf} package\thanks{This manual corresponds to \pkg{epsf}~v2.7.3, dated~23 July 2005.}} +\author{Tom Rokicki\\\mail{rokicki@cs.stanford.edu}} +\date{23 July 2005} + + +\begin{document} + +\maketitle + +\noindent +This file contains \TeX\ macros to include an +Encapsulated PostScript graphic. It works +by finding the bounding box comment, +calculating the correct scale values, and +inserting a vbox of the appropriate size at +the current position in the \TeX\ document. + +To use, simply use +% +\begin{verbatim} +\input epsf % somewhere early on in your TeX file + +% then where you want to insert a vbox for a figure: +\epsfbox{filename.ps} +\end{verbatim} + +Alternatively, you can supply your own +bounding box by +% +\begin{verbatim} +\epsfbox[0 0 30 50]{filename.ps} +\end{verbatim} +% +This will not read in the file, and will +instead use the bounding box you specify. + +The effect will be to typeset the figure as +a \TeX\ box, at the point of your \cmd{\epsfbox} +command. By default, the graphic will have +its `natural' width (namely the width of +its bounding box, as described in +\texttt{filename.ps}). The \TeX\ box will have depth +zero. + +You can enlarge or reduce the figure by +using\\ +\cmd{\epsfxsize\ = }\meta{dimen} \cmd{\epsfbox}\marg{filename.ps}\\ +or\\ +\cmd{\epsfysize\ = }\meta{dimen} \cmd{\epsfbox}\marg{filename.ps}\\ +instead. Then the width of the \TeX\ box will +be \cmd{\epsfxsize} and its height will be scaled +proportionately (or the height will be +\cmd{\epsfysize} and its width will be scaled +proportionately). + +The width (and height) is restored to zero +after each use, so \cmd{\epsfxsize} or \cmd{\epsfysize} +must be specified before \emph{each} use of +\cmd{\epsfbox}. + +A more general facility for sizing is +available by defining the \cmd{\epsfsize} macro. +Normally you can redefine this macro to do +almost anything. The first parameter is +the natural $x$~size of the PostScript +graphic, the second parameter is the +natural $y$~size of the PostScript graphic. +It must return the xsize to use, or 0 if +natural scaling is to be used. Common uses +include: +% +\begin{verbatim} + \epsfxsize % just leave the old value alone + 0pt % use the natural sizes + #1 % use the natural sizes + \hsize % scale to full width + 0.5#1 % scale to 50% of natural size + \ifnum #1 > \hsize \hsize \else #1\fi + % smaller of natural, hsize +\end{verbatim} + +If you want \TeX\ to report the size of the +figure (as a message on your terminal when +it processes each figure), use +`\cmd{\epsfverbosetrue'}. + +If you only want to get the bounding box +extents, without producing any output boxes +or \verb+\special{}+, then use \cmd{\epsfgetbb}\marg{filename}. +The bounding box corner coordinates are saved +in the macros \cmd{\epsfllx}, \cmd{\epsflly}, \cmd{\epsfurx}, +and \cmd{\epsfury} in PostScript units of big +points. + + +\section*{Revision history:} + +\begin{itemize} +\item \texttt{epsf.tex} macro file: + Originally written by Tomas Rokicki of + Radical Eye Software, 29 Mar 1989. + +\item Revised by Don Knuth, 3 Jan 1990. + +\item Revised by Tomas Rokicki, 18 Jul 1990. + + Accept bounding boxes with no space after + the colon. + +\item Revised by \Beebe, 03 Dec 1991 [2.0]. + + Add version number and date typeout. + + Use \verb+\immediate\write16+ instead of \cmd{\message} + to ensure output on new line. + + Handle nested EPS files. + + Handle \verb+%%BoundingBox: (atend)+ lines. + + Do not quit when blank lines are found. + + Add a few percents to remove generation of + spurious blank space. + + Move \cmd{\special} output to + \cmd{\epsfspecial}\marg{filename} so that other macro + packages can input this one, then change + the definition of \cmd{\epsfspecial} to match + another DVI driver. + + Move size computation to \cmd{\epsfsetsize} which + can be called by the user; the verbose + output of the bounding box and scaled width + and height happens here. + +\item Revised by \Beebe, 05 May 1992 [2.1]. + + \begin{sloppypar} + Wrap \verb+\leavevmode\hbox{}+ around \verb+\vbox{}+ with + the \cmd{\special} so that \verb+\epsffile{}+ can be + used inside \verb+\begin{center}...\end{center}+ + \end{sloppypar} + +\item Revised by \Beebe, 09 Dec 1992 [2.2]. + + Introduce \cmd{\epsfshow\{true,false\}} and + \cmd{\epsfframe\{true,false\}} macros; the latter + suppresses the insertion of the PostScript, + and instead just creates an empty box, + which may be handy for rapid prototyping. + +\item Revised by \Beebe, 14 Dec 1992 [2.3]. + + Add \cmd{\epsfshowfilename\{true,false\}}. When + \texttt{true}, and \cmd{\epsfshowfalse} is specified, the + PostScript file name will be displayed + centered in the figure box. + +\item Revised by \Beebe, 20 June 1993 [2.4]. + + Remove non-zero debug setting of \cmd{\epsfframemargin}, + and change margin handling to preserve EPS image + size and aspect ratio, so that the actual + box is $\cmd{\epsfxsize}+\cmd{\epsfframemargin}$ wide by + $\cmd{\epsfysize}+\cmd{\epsfframemargin}$ high. + Reduce output of \cmd{\epsfshowfilenametrue} to + just the bare file name. + +\item Revised by \Beebe, 13 July 1993 [2.5]. + + Add \cmd{\epsfframethickness} for control of + \cmd{\epsfframe} frame lines. + +\item Revised by \Beebe, 02 July 1996 [2.6] + + Add missing initialization \cmd{\epsfatendfalse}; + the lack of this resulted in the wrong + \texttt{BoundingBox} being picked up, mea culpa, sigh\ldots + +\item Revised by \Beebe, 25 October 1996 [2.7] + + Update to match changes in from dvips~5-600 + distribution: new user-accessible macros: + \cmd{\epsfclipon}, \cmd{\epsfclipoff}, \cmd{\epsfdrafton}, + \cmd{\epsfdraftoff}, change \cmd{\empty} to \cmd{\epsfempty}. + +\item Revised by \Beebe, 18 May 2002 [2.7.1] + + Add write statements to echo input file + names. Prior to that change, an error in + such a file could be quite hard to track + down: a long list of \TeX\ page numbers could + suddenly be followed by ``\TeX\ buffer + capacity'' exceeded, without any indication + of the file that was responsible. + +\item Revised by \Beebe, 16 May 2003 [2.7.2] + + Supply two critical percent characters that + were mistakenly omitted in version~2.7.1, + and resulted in a small amount of spurious + horizontal space. + +\item Revised by \Beebe,\\ Karl Berry + \Mail{karl@freefriends.org},\\ and Robin Fairbairns + \Mail{Robin.Fairbairns@cl.cam.ac.uk},\\ + 23 July 2005 [2.7.3] + + Add critical \verb+\hbox{}+ wrapper in \cmd{\epsfsetgraph} + so that \verb+\epsfbox{}+ does not conflict with + \LaTeX\ \env{center} environment when \verb+\epsfbox{}+ is + surrounded by other horizonal objects. + Improve macro readability by adding legal, + but invisible-in-typeset-output, spaces. + Ensure that verbose status reports come + inside \verb+(filename ...)+ list. + +\end{itemize} + +\end{document} + + + + +--------------------------------------------- + +--------------------------------------------- + +--------------------------------------------- + +--------------------------------------------- + +%%% } +%%% ==================================================================== + +%\immediate \write16 {This is `epsf.tex' v2.0 <02 Dec 1991>}% +%\immediate \write16 {This is `epsf.tex' v2.1 <05 May 1992>}% +%\immediate \write16 {This is `epsf.tex' v2.2 <09 Dec 1992>}% +%\immediate \write16 {This is `epsf.tex' v2.3 <14 Dec 1992>}% +%\immediate \write16 {This is `epsf.tex' v2.4 <20 June 1993>}% +%\immediate \write16 {This is `epsf.tex' v2.5 <13 July 1993>}% +%\immediate \write16 {This is `epsf.tex' v2.6 <02 July 1996>}% +%\immediate \write16 {This is `epsf.tex' v2.7 <25 October 1996>}% +%\immediate \write16 {This is `epsf.tex' v2.7.1 <18 May 2002>}% +%\immediate \write16 {This is `epsf.tex' v2.7.2 <16 May 2003>}% +\immediate \write16 {This is `epsf.tex' v2.7.3 <23 July 2005>}% +% +\newread \epsffilein % file to \read +\newif \ifepsfatend % need to scan to LAST %%BoundingBox comment? +\newif \ifepsfbbfound % success? +\newif \ifepsfdraft % use draft mode? +\newif \ifepsffileok % continue looking for the bounding box? +\newif \ifepsfframe % frame the bounding box? +\newif \ifepsfshow % show PostScript file, or just bounding box? +\epsfshowtrue % default is to display PostScript file +\newif \ifepsfshowfilename % show the file name if \epsfshowfalse specified? +\newif \ifepsfverbose % report what you're making? +\newdimen \epsfframemargin % margin between box and frame +\newdimen \epsfframethickness % thickness of frame rules +\newdimen \epsfrsize % vertical size before scaling +\newdimen \epsftmp % register for arithmetic manipulation +\newdimen \epsftsize % horizontal size before scaling +\newdimen \epsfxsize % horizontal size after scaling +\newdimen \epsfysize % vertical size after scaling +\newdimen \pspoints % conversion factor +% +\pspoints = 1bp % Adobe points are `big' +\epsfxsize = 0pt % default value, means `use natural size' +\epsfysize = 0pt % ditto +\epsfframemargin = 0pt % default value: frame box flush around picture +\epsfframethickness = 0.4pt % TeX's default rule thickness +% +\def \epsfbox #1{% + \global \def \epsfllx {72}% + \global \def \epsflly {72}% + \global \def \epsfurx {540}% + \global \def \epsfury {720}% + \def \lbracket {[}% + \def \testit {#1}% + \ifx \testit \lbracket + \let \next = \epsfgetlitbb + \else + \let \next = \epsfnormal + \fi + \next{#1}% +}% +% +% We use \epsfgetlitbb if the user specified an explicit bounding box, +% and \epsfnormal otherwise. Because \epsfgetbb can be called +% separately to retrieve the bounding box, we move the verbose +% printing the bounding box extents and size on the terminal to +% \epsfstatus. Therefore, when the user provided the bounding box, +% \epsfgetbb will not be called, so we must call \epsfsetsize and +% \epsfstatus ourselves. +% +\def \epsfgetlitbb #1#2 #3 #4 #5]#6{% + \epsfgrab #2 #3 #4 #5 .\\% + \epsfsetsize + \epsfstatus{#6}% + \epsfsetgraph{#6}% +}% +% +\def \epsfnormal #1{% + \epsfgetbb{#1}% + \epsfsetgraph{#1}% +}% +% +\def \epsfgetbb #1{% +% +% The first thing we need to do is to open the +% PostScript file, if possible. +% + \openin\epsffilein=#1 + \immediate \write16 {(#1}% + \ifeof \epsffilein + \errmessage{Could not open file #1, ignoring it}% + \else %process the file + {% %start a group to contain catcode changes + % Make all special characters, except space, to be of type + % `other' so we process the file in almost verbatim mode + % (TeXbook, p. 344). + \chardef \other = 12% + \def \do ##1{\catcode`##1=\other}% + \dospecials + \catcode `\ = 10% + \epsffileoktrue %true while we are looping + \epsfatendfalse %[02-Jul-1996]: add forgotten initialization + \loop %reading lines from the EPS file + \read \epsffilein to \epsffileline + \ifeof \epsffilein %then no more input + \epsffileokfalse %so set completion flag + \else %otherwise process one line + \expandafter \epsfaux \epsffileline :. \\% + \fi + \ifepsffileok + \repeat + \ifepsfbbfound + \else + \ifepsfverbose + \immediate \write16 {No BoundingBox comment found in % + file #1; using defaults}% + \fi + \fi + }% %end catcode changes + \closein\epsffilein + \fi %end of file processing + \epsfsetsize %compute size parameters + \epsfstatus{#1}% + \immediate \write16 {)}% +}% +% +% Clipping control: +\def \epsfclipon {\def \epsfclipstring { clip}}% +\def \epsfclipoff {\def \epsfclipstring {\ifepsfdraft \space clip\fi}}% +\epsfclipoff % default for dvips is OFF +% +% The special that is emitted by \epsfsetgraph comes from this macro. +% It is defined separately to allow easy customization by other +% packages that first \input epsf.tex, then redefine \epsfspecial. +% This macro is invoked in the lower-left corner of a box of the +% width and height determined from the arguments to \epsffile, or +% from the %%BoundingBox in the EPS file itself. +% +% This version is for dvips: +\def \epsfspecial #1{% + \epsftmp=10\epsfxsize + \divide \epsftmp by \pspoints + \ifnum \epsfrsize = 0% + \relax + \special{PSfile=\ifepsfdraft psdraft.ps\else#1\fi\space + llx=\epsfllx\space + lly=\epsflly\space + urx=\epsfurx\space + ury=\epsfury\space + rwi=\number\epsftmp + \epsfclipstring + }% + \else + \epsfrsize=10\epsfysize + \divide \epsfrsize by \pspoints + \special{PSfile=\ifepsfdraft psdraft.ps\else#1\fi\space + llx=\epsfllx\space + lly=\epsflly\space + urx=\epsfurx\space + ury=\epsfury\space + rwi=\number\epsftmp + rhi=\number\epsfrsize + \epsfclipstring + }% + \fi +}% +% +% \epsfframe macro adapted from the TeXbook, exercise 21.3, p. 223, 331. +% but modified to set the box width to the natural width, rather +% than the line width, and to include space for margins and rules +\def \epsfframe #1% +{% + % method for detecting latex suggested by Robin Fairbairns, May 2005. + \ifx \documentstyle \epsfundefined + \relax + \else +% \leavevmode % so we can put this inside + % a latex centered environment + % The \leavevmode breaks under plain when this is inside a box, + % because it forces the figure to be the entire \hsize. On the + % other hand, we need the \leavevmode for it to work in LaTeX, + % because the {center} environment works by adjusting TeX's + % paragraph parameters. + % + % Compare the LaTeX sequence + % \begin{center} + % \epsfbox{tip.eps}q + % \end{center} + % (needs the \leavevmode to put the q right next to the image) + % + % with the plain TeX sequence: + % \leftline{\vbox{\epsfbox{tip.eps}}q} + % (had the q all the way over to the right, when \leavevmode was used) + \fi + % + \setbox0 = \hbox{#1}% + \dimen0 = \wd0 % natural width of argument + \advance \dimen0 by 2\epsfframemargin % plus width of 2 margins + \advance \dimen0 by 2\epsfframethickness % plus width of 2 rule lines + \relax + \hbox{% + \vbox + {% + \hrule height \epsfframethickness depth 0pt + \hbox to \dimen0 + {% + \hss + \vrule width \epsfframethickness + \kern \epsfframemargin + \vbox {\kern \epsfframemargin \box0 \kern \epsfframemargin }% + \kern \epsfframemargin + \vrule width \epsfframethickness + \hss + }% end hbox + \hrule height 0pt depth \epsfframethickness + }% end vbox + }% end hbox + \relax +}% +% +\def \epsfsetgraph #1% +{% + % + % Make the vbox and stick in a \special that the DVI driver can + % parse. \vfil and \hfil are used to place the \special origin at + % the lower-left corner of the vbox. \epsfspecial can be redefined + % to produce alternate \special syntaxes. + % + \ifvmode \leavevmode \fi + \relax + \hbox{% so we can put this in \begin{center}...\end{center} + \ifepsfframe \expandafter \epsfframe \fi + {\vbox to\epsfysize + {% + \ifepsfshow + % output \special{} at lower-left corner of figure box + \vfil + \hbox to \epsfxsize{\epsfspecial{#1}\hfil}% + \else + \vfil + \hbox to\epsfxsize{% + \hss + \ifepsfshowfilename + {% + \epsfframemargin=3pt % local change of margin + \epsfframe{{\tt #1}}% + }% + \fi + \hss + }% + \vfil + \fi + }% + }}% + \relax + % + % Reset \epsfxsize and \epsfysize, as documented above. + % + \global \epsfxsize = 0pt + \global \epsfysize = 0pt +}% +% +% Now we have to calculate the scale and offset values to use. +% First we compute the natural sizes. +% +\def \epsfsetsize +{% + \epsfrsize = \epsfury \pspoints + \advance \epsfrsize by -\epsflly \pspoints + \epsftsize = \epsfurx \pspoints + \advance \epsftsize by -\epsfllx \pspoints +% +% If `epsfxsize' is 0, we default to the natural size of the picture. +% Otherwise we scale the graph to be \epsfxsize wide. +% + \epsfxsize = \epsfsize{\epsftsize}{\epsfrsize}% + \ifnum \epsfxsize = 0 + \ifnum \epsfysize = 0 + \epsfxsize = \epsftsize + \epsfysize = \epsfrsize + \epsfrsize = 0pt +% +% We have a sticky problem here: TeX doesn't do floating point arithmetic! +% Our goal is to compute y = rx/t. The following loop does this reasonably +% fast, with an error of at most about 16 sp (about 1/4000 pt). +% + \else + \epsftmp = \epsftsize + \divide \epsftmp by \epsfrsize + \epsfxsize = \epsfysize + \multiply \epsfxsize by \epsftmp + \multiply \epsftmp by \epsfrsize + \advance \epsftsize by -\epsftmp + \epsftmp = \epsfysize + \loop + \advance \epsftsize by \epsftsize + \divide \epsftmp by 2 + \ifnum \epsftmp > 0 + \ifnum \epsftsize < \epsfrsize + \else + \advance \epsftsize -\epsfrsize + \advance \epsfxsize \epsftmp + \fi + \repeat + \epsfrsize = 0pt + \fi + \else + \ifnum \epsfysize = 0 + \epsftmp = \epsfrsize + \divide \epsftmp by \epsftsize + \epsfysize = \epsfxsize + \multiply \epsfysize by \epsftmp + \multiply \epsftmp by \epsftsize + \advance \epsfrsize by -\epsftmp + \epsftmp = \epsfxsize + \loop + \advance \epsfrsize by \epsfrsize + \divide \epsftmp by 2 + \ifnum \epsftmp > 0 + \ifnum \epsfrsize < \epsftsize + \else + \advance \epsfrsize by -\epsftsize + \advance \epsfysize by \epsftmp + \fi + \repeat + \epsfrsize = 0pt + \else + \epsfrsize = \epsfysize + \fi + \fi +}% +% +% Issue some status messages if the user requested them +% +\def \epsfstatus #1{% arg = filename + \ifepsfverbose + \immediate \write16 {#1: BoundingBox: + llx = \epsfllx \space lly = \epsflly \space + urx = \epsfurx \space ury = \epsfury \space}% + \immediate \write16 {#1: scaled width = \the\epsfxsize \space + scaled height = \the\epsfysize}% + \fi +}% +% +% We still need to define the tricky \epsfaux macro. This requires +% a couple of magic constants for comparison purposes. +% +{\catcode`\%=12 \global \let \epsfpercent=%\global \def \epsfbblit {%BoundingBox}}% +\global \def \epsfatend{(atend)}% +% +% So we're ready to check for `%BoundingBox:' and to grab the +% values if they are found. +% +% If we find a line +% +% %%BoundingBox: (atend) +% +% then we ignore it, but set a flag to force parsing all of the +% file, so the last %%BoundingBox parsed will be the one used. This +% is necessary, because EPS files can themselves contain other EPS +% files with their own %%BoundingBox comments. +% +% If we find a line +% +% %%BoundingBox: llx lly urx ury +% +% then we save the 4 values in \epsfllx, \epsflly, \epsfurx, \epsfury. +% Then, if we have not previously parsed an (atend), we flag completion +% and can stop reading the file. Otherwise, we must keep on reading +% to end of file so that we find the values on the LAST %%BoundingBox. +\long \def \epsfaux#1#2:#3\\% +{% + \def \testit {#2}% % save second character up to just before colon + \ifx#1\epsfpercent % then first char is percent (quick test) + \ifx \testit \epsfbblit % then (slow test) we have %%BoundingBox + \epsfgrab #3 . . . \\% + \ifx \epsfllx\epsfatend % then ignore %%BoundingBox: (atend) + \global \epsfatendtrue + \else % else found %%BoundingBox: llx lly urx ury + \ifepsfatend % then keep parsing ALL %%BoundingBox lines + \else % else stop after first one parsed + \epsffileokfalse + \fi + \global \epsfbbfoundtrue + \fi + \fi + \fi +}% +% +% Here we grab the values and stuff them in the appropriate definitions. +% +\def \epsfempty {}% +\def \epsfgrab #1 #2 #3 #4 #5\\{% + \global \def \epsfllx {#1}\ifx \epsfllx\epsfempty + \epsfgrab #2 #3 #4 #5 .\\\else + \global \def \epsflly {#2}% + \global \def \epsfurx {#3}\global \def \epsfury {#4}\fi +}% +% +% We default the epsfsize macro. +% +\def \epsfsize #1#2{\epsfxsize}% +% +% Finally, another definition for compatibility with older macros. +% +\let \epsffile = \epsfbox +\endinput diff --git a/macros/generic/epsf/epsf.sty b/macros/generic/epsf/epsf.sty new file mode 120000 index 0000000000..727dfce299 --- /dev/null +++ b/macros/generic/epsf/epsf.sty @@ -0,0 +1 @@ +epsf.tex
\ No newline at end of file diff --git a/macros/generic/epsf/epsf.tex b/macros/generic/epsf/epsf.tex new file mode 100644 index 0000000000..847de77fb6 --- /dev/null +++ b/macros/generic/epsf/epsf.tex @@ -0,0 +1,653 @@ +%%% -*-TeX-*- +%%% ==================================================================== +%%% @TeX-file{ +%%% author = "Tom Rokicki", +%%% version = "2.7.4", +%%% date = "14 February 2011", +%%% time = "15:44:06 MST", +%%% filename = "epsf.tex", +%%% address = "Tom Rokicki +%%% Box 2081 +%%% Stanford, CA 94309 +%%% USA", +%%% telephone = "+1 415 855 9989", +%%% checksum = "29223 653 3100 27123", +%%% email = "rokicki@cs.stanford.edu (Internet)", +%%% codetable = "ISO/ASCII", +%%% copyright = "This file is freely redistributable and +%%% placed into the public domain by Tomas +%%% Rokicki.", +%%% keywords = "PostScript, TeX", +%%% license = "public domain", +%%% supported = "yes", +%%% abstract = "This file contains macros to support the +%%% inclusion of Encapsulated PostScript files +%%% in TeX documents.", +%%% docstring = "This file contains TeX macros to include an +%%% Encapsulated PostScript graphic. It works +%%% by finding the bounding box comment, +%%% calculating the correct scale values, and +%%% inserting a vbox of the appropriate size at +%%% the current position in the TeX document. +%%% +%%% To use, simply use +%%% +%%% \input epsf % somewhere early on in your TeX file +%%% +%%% % then where you want to insert a vbox for a figure: +%%% \epsfbox{filename.ps} +%%% +%%% Alternatively, you can supply your own +%%% bounding box by +%%% +%%% \epsfbox[0 0 30 50]{filename.ps} +%%% +%%% This will not read in the file, and will +%%% instead use the bounding box you specify. +%%% +%%% The effect will be to typeset the figure as +%%% a TeX box, at the point of your \epsfbox +%%% command. By default, the graphic will have +%%% its `natural' width (namely the width of +%%% its bounding box, as described in +%%% filename.ps). The TeX box will have depth +%%% zero. +%%% +%%% You can enlarge or reduce the figure by +%%% using +%%% +%%% \epsfxsize = <dimen> \epsfbox{filename.ps} +%%% or +%%% \epsfysize = <dimen> \epsfbox{filename.ps} +%%% +%%% instead. Then the width of the TeX box will +%%% be \epsfxsize and its height will be scaled +%%% proportionately (or the height will be +%%% \epsfysize and its width will be scaled +%%% proportionately). +%%% +%%% The width (and height) is restored to zero +%%% after each use, so \epsfxsize or \epsfysize +%%% must be specified before EACH use of +%%% \epsfbox. +%%% +%%% A more general facility for sizing is +%%% available by defining the \epsfsize macro. +%%% Normally you can redefine this macro to do +%%% almost anything. The first parameter is +%%% the natural x size of the PostScript +%%% graphic, the second parameter is the +%%% natural y size of the PostScript graphic. +%%% It must return the xsize to use, or 0 if +%%% natural scaling is to be used. Common uses +%%% include: +%%% +%%% \epsfxsize % just leave the old value alone +%%% 0pt % use the natural sizes +%%% #1 % use the natural sizes +%%% \hsize % scale to full width +%%% 0.5#1 % scale to 50% of natural size +%%% \ifnum #1 > \hsize \hsize \else #1\fi +%%% % smaller of natural, hsize +%%% +%%% If you want TeX to report the size of the +%%% figure (as a message on your terminal when +%%% it processes each figure), use +%%% `\epsfverbosetrue'. +%%% +%%% If you only want to get the bounding box +%%% extents, without producing any output boxes +%%% or \special{}, then use \epsfgetbb{filename}. +%%% The bounding box corner coordinates are saved +%%% in the macros \epsfllx, \epsflly, \epsfurx, +%%% and \epsfury in PostScript units of big +%%% points. +%%% +%%% Revision history: +%%% +%%% --------------------------------------------- +%%% epsf.tex macro file: +%%% Originally written by Tomas Rokicki of +%%% Radical Eye Software, 29 Mar 1989. +%%% +%%% --------------------------------------------- +%%% Revised by Don Knuth, 3 Jan 1990. +%%% +%%% --------------------------------------------- +%%% Revised by Tomas Rokicki, 18 Jul 1990. +%%% Accept bounding boxes with no space after +%%% the colon. +%%% +%%% --------------------------------------------- +%%% Revised by Nelson H. F. Beebe +%%% <beebe@math.utah.edu>, 03 Dec 1991 [2.0]. +%%% Add version number and date typeout. +%%% +%%% Use \immediate\write16 instead of \message +%%% to ensure output on new line. +%%% +%%% Handle nested EPS files. +%%% +%%% Handle %%BoundingBox: (atend) lines. +%%% +%%% Do not quit when blank lines are found. +%%% +%%% Add a few percents to remove generation of +%%% spurious blank space. +%%% +%%% Move \special output to +%%% \epsfspecial{filename} so that other macro +%%% packages can input this one, then change +%%% the definition of \epsfspecial to match +%%% another DVI driver. +%%% +%%% Move size computation to \epsfsetsize which +%%% can be called by the user; the verbose +%%% output of the bounding box and scaled width +%%% and height happens here. +%%% +%%% --------------------------------------------- +%%% Revised by Nelson H. F. Beebe +%%% <beebe@math.utah.edu>, 05 May 1992 [2.1]. +%%% Wrap \leavevmode\hbox{} around \vbox{} with +%%% the \special so that \epsffile{} can be +%%% used inside \begin{center}...\end{center} +%%% +%%% --------------------------------------------- +%%% Revised by Nelson H. F. Beebe +%%% <beebe@math.utah.edu>, 09 Dec 1992 [2.2]. +%%% Introduce \epsfshow{true,false} and +%%% \epsfframe{true,false} macros; the latter +%%% suppresses the insertion of the PostScript, +%%% and instead just creates an empty box, +%%% which may be handy for rapid prototyping. +%%% +%%% --------------------------------------------- +%%% Revised by Nelson H. F. Beebe +%%% <beebe@math.utah.edu>, 14 Dec 1992 [2.3]. +%%% Add \epsfshowfilename{true,false}. When +%%% true, and \epsfshowfalse is specified, the +%%% PostScript file name will be displayed +%%% centered in the figure box. +%%% +%%% --------------------------------------------- +%%% Revised by Nelson H. F. Beebe +%%% <beebe@math.utah.edu>, 20 June 1993 [2.4]. +%%% Remove non-zero debug setting of \epsfframemargin, +%%% and change margin handling to preserve EPS image +%%% size and aspect ratio, so that the actual +%%% box is \epsfxsize+\epsfframemargin wide by +%%% \epsfysize+\epsfframemargin high. +%%% Reduce output of \epsfshowfilenametrue to +%%% just the bare file name. +%%% +%%% --------------------------------------------- +%%% Revised by Nelson H. F. Beebe +%%% <beebe@math.utah.edu>, 13 July 1993 [2.5]. +%%% Add \epsfframethickness for control of +%%% \epsfframe frame lines. +%%% +%%% --------------------------------------------- +%%% Revised by Nelson H. F. Beebe +%%% <beebe@math.utah.edu>, 02 July 1996 [2.6] +%%% Add missing initialization \epsfatendfalse; +%%% the lack of this resulted in the wrong +%%% BoundingBox being picked up, mea culpa, sigh... +%%% +%%% --------------------------------------------- +%%% Revised by Nelson H. F. Beebe +%%% <beebe@math.utah.edu>, 25 October 1996 [2.7] +%%% Update to match changes in from dvips 5-600 +%%% distribution: new user-accessible macros: +%%% \epsfclipon, \epsfclipoff, \epsfdrafton, +%%% \epsfdraftoff, change \empty to \epsfempty. +%%% +%%% --------------------------------------------- +%%% Revised by Nelson H. F. Beebe +%%% <beebe@math.utah.edu>, 18 May 2002 [2.7.1] +%%% Add write statements to echo input file +%%% names. Prior to that change, an error in +%%% such a file could be quite hard to track +%%% down: a long list of TeX page numbers could +%%% suddenly be followed by ``TeX buffer +%%% capacity'' exceeded, without any indication +%%% of the file that was responsible. +%%% +%%% --------------------------------------------- +%%% Revised by Nelson H. F. Beebe +%%% <beebe@math.utah.edu>, 16 May 2003 [2.7.2] +%%% Supply two critical percent characters that +%%% were mistakenly omitted in version 2.7.1, +%%% and resulted in a small amount of spurious +%%% horizontal space. +%%% +%%% --------------------------------------------- +%%% Revised by Nelson H. F. Beebe +%%% <beebe@math.utah.edu>, 14 Feb 2011 [2.7.3] +%%% Add previously-missing \space in rwi +%%% assignments (bug reported 14-Feb-2011 by +%%% Stefan Rueger <s.rueger@open.ac.uk>). +%%% +%%% --------------------------------------------- +%%% Revised by Nelson H. F. Beebe +%%% <beebe@math.utah.edu>, Karl Berry +%%% <karl@freefriends.org>, and Robin Fairbairns +%%% <Robin.Fairbairns@cl.cam.ac.uk>, +%%% 23 July 2005 [2.7.3] +%%% Add critical \hbox{} wrapper in \epsfsetgraph +%%% so that \epsfbox{} does not conflict with +%%% LaTeX center environment when \epsfbox{} is +%%% surrounded by other horizonal objects. +%%% Improve macro readability by adding legal, +%%% but invisible-in-typeset-output, spaces. +%%% Ensure that verbose status reports come +%%% inside (filename ...) list. +%%% +%%% --------------------------------------------- +%%% The checksum field above contains a CRC-16 +%%% checksum as the first value, followed by +%%% the equivalent of the standard UNIX wc +%%% (word count) utility output of lines, +%%% words, and characters. This is produced by +%%% Robert Solovay's checksum utility.", +%%% } +%%% ==================================================================== + +%\immediate \write16 {This is `epsf.tex' v2.0 <02 Dec 1991>}% +%\immediate \write16 {This is `epsf.tex' v2.1 <05 May 1992>}% +%\immediate \write16 {This is `epsf.tex' v2.2 <09 Dec 1992>}% +%\immediate \write16 {This is `epsf.tex' v2.3 <14 Dec 1992>}% +%\immediate \write16 {This is `epsf.tex' v2.4 <20 June 1993>}% +%\immediate \write16 {This is `epsf.tex' v2.5 <13 July 1993>}% +%\immediate \write16 {This is `epsf.tex' v2.6 <02 July 1996>}% +%\immediate \write16 {This is `epsf.tex' v2.7 <25 October 1996>}% +%\immediate \write16 {This is `epsf.tex' v2.7.1 <18 May 2002>}% +%\immediate \write16 {This is `epsf.tex' v2.7.2 <16 May 2003>}% +%\immediate \write16 {This is `epsf.tex' v2.7.3 <23 July 2005>}% +\immediate \write16 {This is `epsf.tex' v2.7.4 <14 February 2011>}% +% +\newread \epsffilein % file to \read +\newif \ifepsfatend % need to scan to LAST %%BoundingBox comment? +\newif \ifepsfbbfound % success? +\newif \ifepsfdraft % use draft mode? +\newif \ifepsffileok % continue looking for the bounding box? +\newif \ifepsfframe % frame the bounding box? +\newif \ifepsfshow % show PostScript file, or just bounding box? +\epsfshowtrue % default is to display PostScript file +\newif \ifepsfshowfilename % show the file name if \epsfshowfalse specified? +\newif \ifepsfverbose % report what you're making? +\newdimen \epsfframemargin % margin between box and frame +\newdimen \epsfframethickness % thickness of frame rules +\newdimen \epsfrsize % vertical size before scaling +\newdimen \epsftmp % register for arithmetic manipulation +\newdimen \epsftsize % horizontal size before scaling +\newdimen \epsfxsize % horizontal size after scaling +\newdimen \epsfysize % vertical size after scaling +\newdimen \pspoints % conversion factor +% +\pspoints = 1bp % Adobe points are `big' +\epsfxsize = 0pt % default value, means `use natural size' +\epsfysize = 0pt % ditto +\epsfframemargin = 0pt % default value: frame box flush around picture +\epsfframethickness = 0.4pt % TeX's default rule thickness +% +\def \epsfbox #1{% + \global \def \epsfllx {72}% + \global \def \epsflly {72}% + \global \def \epsfurx {540}% + \global \def \epsfury {720}% + \def \lbracket {[}% + \def \testit {#1}% + \ifx \testit \lbracket + \let \next = \epsfgetlitbb + \else + \let \next = \epsfnormal + \fi + \next{#1}% +}% +% +% We use \epsfgetlitbb if the user specified an explicit bounding box, +% and \epsfnormal otherwise. Because \epsfgetbb can be called +% separately to retrieve the bounding box, we move the verbose +% printing the bounding box extents and size on the terminal to +% \epsfstatus. Therefore, when the user provided the bounding box, +% \epsfgetbb will not be called, so we must call \epsfsetsize and +% \epsfstatus ourselves. +% +\def \epsfgetlitbb #1#2 #3 #4 #5]#6{% + \epsfgrab #2 #3 #4 #5 .\\% + \epsfsetsize + \epsfstatus{#6}% + \epsfsetgraph{#6}% +}% +% +\def \epsfnormal #1{% + \epsfgetbb{#1}% + \epsfsetgraph{#1}% +}% +% +\def \epsfgetbb #1{% +% +% The first thing we need to do is to open the +% PostScript file, if possible. +% + \openin\epsffilein=#1 + \immediate \write16 {(#1}% + \ifeof \epsffilein + \errmessage{Could not open file #1, ignoring it}% + \else %process the file + {% %start a group to contain catcode changes + % Make all special characters, except space, to be of type + % `other' so we process the file in almost verbatim mode + % (TeXbook, p. 344). + \chardef \other = 12% + \def \do ##1{\catcode`##1=\other}% + \dospecials + \catcode `\ = 10% + \epsffileoktrue %true while we are looping + \epsfatendfalse %[02-Jul-1996]: add forgotten initialization + \loop %reading lines from the EPS file + \read \epsffilein to \epsffileline + \ifeof \epsffilein %then no more input + \epsffileokfalse %so set completion flag + \else %otherwise process one line + \expandafter \epsfaux \epsffileline :. \\% + \fi + \ifepsffileok + \repeat + \ifepsfbbfound + \else + \ifepsfverbose + \immediate \write16 {No BoundingBox comment found in % + file #1; using defaults}% + \fi + \fi + }% %end catcode changes + \closein\epsffilein + \fi %end of file processing + \epsfsetsize %compute size parameters + \epsfstatus{#1}% + \immediate \write16 {)}% +}% +% +% Clipping control: +\def \epsfclipon {\def \epsfclipstring { clip}}% +\def \epsfclipoff {\def \epsfclipstring {\ifepsfdraft \space clip\fi}}% +\epsfclipoff % default for dvips is OFF +% +% The special that is emitted by \epsfsetgraph comes from this macro. +% It is defined separately to allow easy customization by other +% packages that first \input epsf.tex, then redefine \epsfspecial. +% This macro is invoked in the lower-left corner of a box of the +% width and height determined from the arguments to \epsffile, or +% from the %%BoundingBox in the EPS file itself. +% +% This version is for dvips: +\def \epsfspecial #1{% + \epsftmp=10\epsfxsize + \divide \epsftmp by \pspoints + \ifnum \epsfrsize = 0% + \relax + \special{PSfile=\ifepsfdraft psdraft.ps\else#1\fi\space + llx=\epsfllx\space + lly=\epsflly\space + urx=\epsfurx\space + ury=\epsfury\space + rwi=\number\epsftmp\space + \epsfclipstring + }% + \else + \epsfrsize=10\epsfysize + \divide \epsfrsize by \pspoints + \special{PSfile=\ifepsfdraft psdraft.ps\else#1\fi\space + llx=\epsfllx\space + lly=\epsflly\space + urx=\epsfurx\space + ury=\epsfury\space + rwi=\number\epsftmp\space + rhi=\number\epsfrsize + \epsfclipstring + }% + \fi +}% +% +% \epsfframe macro adapted from the TeXbook, exercise 21.3, p. 223, 331. +% but modified to set the box width to the natural width, rather +% than the line width, and to include space for margins and rules +\def \epsfframe #1% +{% + % method for detecting latex suggested by Robin Fairbairns, May 2005. + \ifx \documentstyle \epsfundefined + \relax + \else +% \leavevmode % so we can put this inside + % a latex centered environment + % The \leavevmode breaks under plain when this is inside a box, + % because it forces the figure to be the entire \hsize. On the + % other hand, we need the \leavevmode for it to work in LaTeX, + % because the {center} environment works by adjusting TeX's + % paragraph parameters. + % + % Compare the LaTeX sequence + % \begin{center} + % \epsfbox{tip.eps}q + % \end{center} + % (needs the \leavevmode to put the q right next to the image) + % + % with the plain TeX sequence: + % \leftline{\vbox{\epsfbox{tip.eps}}q} + % (had the q all the way over to the right, when \leavevmode was used) + \fi + % + \setbox0 = \hbox{#1}% + \dimen0 = \wd0 % natural width of argument + \advance \dimen0 by 2\epsfframemargin % plus width of 2 margins + \advance \dimen0 by 2\epsfframethickness % plus width of 2 rule lines + \relax + \hbox{% + \vbox + {% + \hrule height \epsfframethickness depth 0pt + \hbox to \dimen0 + {% + \hss + \vrule width \epsfframethickness + \kern \epsfframemargin + \vbox {\kern \epsfframemargin \box0 \kern \epsfframemargin }% + \kern \epsfframemargin + \vrule width \epsfframethickness + \hss + }% end hbox + \hrule height 0pt depth \epsfframethickness + }% end vbox + }% end hbox + \relax +}% +% +\def \epsfsetgraph #1% +{% + % + % Make the vbox and stick in a \special that the DVI driver can + % parse. \vfil and \hfil are used to place the \special origin at + % the lower-left corner of the vbox. \epsfspecial can be redefined + % to produce alternate \special syntaxes. + % + \ifvmode \leavevmode \fi + \relax + \hbox{% so we can put this in \begin{center}...\end{center} + \ifepsfframe \expandafter \epsfframe \fi + {\vbox to\epsfysize + {% + \ifepsfshow + % output \special{} at lower-left corner of figure box + \vfil + \hbox to \epsfxsize{\epsfspecial{#1}\hfil}% + \else + \vfil + \hbox to\epsfxsize{% + \hss + \ifepsfshowfilename + {% + \epsfframemargin=3pt % local change of margin + \epsfframe{{\tt #1}}% + }% + \fi + \hss + }% + \vfil + \fi + }% + }}% + \relax + % + % Reset \epsfxsize and \epsfysize, as documented above. + % + \global \epsfxsize = 0pt + \global \epsfysize = 0pt +}% +% +% Now we have to calculate the scale and offset values to use. +% First we compute the natural sizes. +% +\def \epsfsetsize +{% + \epsfrsize = \epsfury \pspoints + \advance \epsfrsize by -\epsflly \pspoints + \epsftsize = \epsfurx \pspoints + \advance \epsftsize by -\epsfllx \pspoints +% +% If `epsfxsize' is 0, we default to the natural size of the picture. +% Otherwise we scale the graph to be \epsfxsize wide. +% + \epsfxsize = \epsfsize{\epsftsize}{\epsfrsize}% + \ifnum \epsfxsize = 0 + \ifnum \epsfysize = 0 + \epsfxsize = \epsftsize + \epsfysize = \epsfrsize + \epsfrsize = 0pt +% +% We have a sticky problem here: TeX doesn't do floating point arithmetic! +% Our goal is to compute y = rx/t. The following loop does this reasonably +% fast, with an error of at most about 16 sp (about 1/4000 pt). +% + \else + \epsftmp = \epsftsize + \divide \epsftmp by \epsfrsize + \epsfxsize = \epsfysize + \multiply \epsfxsize by \epsftmp + \multiply \epsftmp by \epsfrsize + \advance \epsftsize by -\epsftmp + \epsftmp = \epsfysize + \loop + \advance \epsftsize by \epsftsize + \divide \epsftmp by 2 + \ifnum \epsftmp > 0 + \ifnum \epsftsize < \epsfrsize + \else + \advance \epsftsize -\epsfrsize + \advance \epsfxsize \epsftmp + \fi + \repeat + \epsfrsize = 0pt + \fi + \else + \ifnum \epsfysize = 0 + \epsftmp = \epsfrsize + \divide \epsftmp by \epsftsize + \epsfysize = \epsfxsize + \multiply \epsfysize by \epsftmp + \multiply \epsftmp by \epsftsize + \advance \epsfrsize by -\epsftmp + \epsftmp = \epsfxsize + \loop + \advance \epsfrsize by \epsfrsize + \divide \epsftmp by 2 + \ifnum \epsftmp > 0 + \ifnum \epsfrsize < \epsftsize + \else + \advance \epsfrsize by -\epsftsize + \advance \epsfysize by \epsftmp + \fi + \repeat + \epsfrsize = 0pt + \else + \epsfrsize = \epsfysize + \fi + \fi +}% +% +% Issue some status messages if the user requested them +% +\def \epsfstatus #1{% arg = filename + \ifepsfverbose + \immediate \write16 {#1: BoundingBox: + llx = \epsfllx \space lly = \epsflly \space + urx = \epsfurx \space ury = \epsfury \space}% + \immediate \write16 {#1: scaled width = \the\epsfxsize \space + scaled height = \the\epsfysize}% + \fi +}% +% +% We still need to define the tricky \epsfaux macro. This requires +% a couple of magic constants for comparison purposes. +% +{\catcode`\%=12 \global \let \epsfpercent=%\global \def \epsfbblit {%BoundingBox}}% +\global \def \epsfatend{(atend)}% +% +% So we're ready to check for `%BoundingBox:' and to grab the +% values if they are found. +% +% If we find a line +% +% %%BoundingBox: (atend) +% +% then we ignore it, but set a flag to force parsing all of the +% file, so the last %%BoundingBox parsed will be the one used. This +% is necessary, because EPS files can themselves contain other EPS +% files with their own %%BoundingBox comments. +% +% If we find a line +% +% %%BoundingBox: llx lly urx ury +% +% then we save the 4 values in \epsfllx, \epsflly, \epsfurx, \epsfury. +% Then, if we have not previously parsed an (atend), we flag completion +% and can stop reading the file. Otherwise, we must keep on reading +% to end of file so that we find the values on the LAST %%BoundingBox. +\long \def \epsfaux#1#2:#3\\% +{% + \def \testit {#2}% % save second character up to just before colon + \ifx#1\epsfpercent % then first char is percent (quick test) + \ifx \testit \epsfbblit % then (slow test) we have %%BoundingBox + \epsfgrab #3 . . . \\% + \ifx \epsfllx\epsfatend % then ignore %%BoundingBox: (atend) + \global \epsfatendtrue + \else % else found %%BoundingBox: llx lly urx ury + \ifepsfatend % then keep parsing ALL %%BoundingBox lines + \else % else stop after first one parsed + \epsffileokfalse + \fi + \global \epsfbbfoundtrue + \fi + \fi + \fi +}% +% +% Here we grab the values and stuff them in the appropriate definitions. +% +\def \epsfempty {}% +\def \epsfgrab #1 #2 #3 #4 #5\\{% + \global \def \epsfllx {#1}\ifx \epsfllx\epsfempty + \epsfgrab #2 #3 #4 #5 .\\\else + \global \def \epsflly {#2}% + \global \def \epsfurx {#3}\global \def \epsfury {#4}\fi +}% +% +% We default the epsfsize macro. +% +\def \epsfsize #1#2{\epsfxsize}% +% +% Finally, another definition for compatibility with older macros. +% +\let \epsffile = \epsfbox +\endinput diff --git a/macros/generic/epsf/fndbadps b/macros/generic/epsf/fndbadps new file mode 100644 index 0000000000..bf91a71711 --- /dev/null +++ b/macros/generic/epsf/fndbadps @@ -0,0 +1,18 @@ +#!/bin/sh +# Find forbidden PostScript operators in the files specified +# on stdin. +# [21-May-1999] -- update with extended list for PostScript Level 3, +# from pp. 802--803 of the PostScript Language Reference +# Manual, 3rd edition, 1999. +# [29-Jun-1996] -- update to show matching bad operator +# [23-Oct-1992] + +# Level 2 list (19 operators): +# /banddevice|grestoreall|nulldevice|setpageparams|copypage|initclip|quit|setsccbatch|erasepage|initgraphics|renderbands|setscreen|exitserver|initmatrix|setdevice|settransfer|framedevice|note|setmatrix/ + +# Level 3 list (36 operators): +nawk ' +/^%/ {next} +match($0,/[^A-Za-z](banddevice|clear|cleardictstack|copypage|erasepage|executive|exitserver|framedevice|grestoreall|initclip|initgraphics|initmatrix|nulldevice|quit|renderbands|setblackgeneration|setcolorrendering|setcolorscreen|setcolortransfer|setflat|setglobal|setgstate|sethalftone|setmatrix|setoverprint|setpagedevice|setscreen|setshared|setsmoothness|settransfer|setundercolorremoval|startjob|statusdict|undefinefont|undefineresource|userdict)[^A-Za-z]/) { + print FILENAME ":" NR ": " $0 ": [" substr($0,RSTART,RLENGTH) "] illegal in EPS file" +}' $* diff --git a/macros/generic/epsf/okay/teps.eps b/macros/generic/epsf/okay/teps.eps new file mode 100644 index 0000000000..9c92e663a5 --- /dev/null +++ b/macros/generic/epsf/okay/teps.eps @@ -0,0 +1,186 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: psposter +x 1in +y 1in +w 2in +h 0.75in +p 20pt +fg navyblue +bd red +bg skyblue test of epsf.tex +%%CreationDate: Sat Jul 23 17:26:56 MDT 2005 +%%Creator: psposter Version 0.11 [13-Jan-2000] +%%For: Nelson H. F. Beebe <beebe@psi.math.utah.edu> +%%BoundingBox: 72 72 216 126 +%%DocumentMedia: A 612 792 0 () () +%%DocumentData: Clean7Bit +%%DocumentFonts: font Times-Bold +%%DocumentNeededResources: font Times-Bold +%%Orientation: Portrait +%%PageOrder: Ascend +%%Pages: 1 +%%EndComments +%======================================================================= +%%BeginProlog +/psposterdict 50 dict def +psposterdict begin +/inch { 72 mul } def +/BackgroundColor { 0.529412 0.807843 0.921569 } def % skyblue +/BaselineSkipFactor 1.2 def +/BorderColor { 1 0 0 } def % red +/BorderMargin 0 def +/BorderWidth 10 def +/CapHeight +{ + gsave newpath 0 0 moveto (M) true charpath pathbbox + exch pop sub neg exch pop grestore +} def +/ForegroundColor { 0 0 0.501961 } def % navyblue +/reencodePRIVATE { + dup length dict begin + {1 index /FID ne {def}{pop pop} ifelse} forall + %% Using default font encoding, perhaps: /Encoding StandardEncoding def + currentdict + end +} def +/findPRIVATE { + dup /FontType known { + dup /FontType get 3 ne { + dup /CharStrings known { + dup /CharStrings get /Thorn known { + true + }{ false } ifelse + }{ false } ifelse + }{ false } ifelse + }{ false } ifelse +} def +/LandscapeMode false def +/MarginWidth 0 def +/PageHeight 792 def +/PageWidth 612 def +/Height 54 def +/Width 144 def +/PointSize 19.9253 def +/ROTATE_0 {} def +/ROTATE_90 {Width 0 translate 90 rotate} bind def +/ROTATE_180 {Width Height translate 180 rotate} bind def +/ROTATE_270 {0 Height translate 270 rotate} bind def +/ScaleFactor 1 def +LandscapeMode +{ + /TextHeight Width MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def + /TextWidth Height MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def +} +{ + /TextHeight Height MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def + /TextWidth Width MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def +} +ifelse +/XOffset 72 def +/YOffset 72 def +% Center and show a string at the current point, leaving +% point at the center of the next line. +% Usage: (string) cshow +/cshow +{ + currentpoint /cpy exch def /cpx exch def + dup stringwidth pop 0.5 mul neg 0 rmoveto show + cpx cpy moveto + NewLine +} def +/max +{ + /a exch def + /b exch def + a b gt { a } { b } ifelse +} def +/min +{ + /a exch def + /b exch def + a b lt { a } { b } ifelse +} def +/TheFont /Times-Bold def +/TheFontPRIVATE /Times-Bold-PRIVATE def +TheFontPRIVATE TheFont findfont reencodePRIVATE definefont pop +% Set the font size so that longest PosterLines string fills the TextWidth +% Usage: setfontsize +/setfontsize +{ + TheFont findfont + findPRIVATE {reencodePRIVATE TheFontPRIVATE exch definefont} if + 10 scalefont setfont + % Set TheFontSize according to maximum string width + 0 PosterLines { stringwidth pop max } forall TextWidth exch div 10 mul + /TheFontSize exch def + % Adjust TheFontSize according to the number of text lines + LineCount TheFontSize mul BaselineSkipFactor mul + TextHeight div + dup 1 gt { TheFontSize exch div /TheFontSize exch def } { pop } ifelse + % NB: The following definition silently overrides the previous one + /TheFontSize PointSize def + /BaselineSkip BaselineSkipFactor TheFontSize mul def + TheFont findfont + findPRIVATE {reencodePRIVATE TheFontPRIVATE exch definefont} if + TheFontSize scalefont setfont +} def +/NewLine {0 BaselineSkip neg rmoveto} def +/PosterLines +[ + (test of epsf.tex) +] def +/LineCount PosterLines length 1 max def +end % psposterdict +%%EndProlog +%======================================================================= +%%BeginSetup +/#copies 1 def +%%EndSetup +%======================================================================= +%%Page: 1 1 +%%BeginPageSetup +psposterdict begin +XOffset YOffset translate +ScaleFactor dup scale +ROTATE_0 +end % psposterdict +%%EndPageSetup + +psposterdict begin +% Draw a frame box and fill it with the background color, and a border color. +BorderWidth setlinewidth +newpath +MarginWidth BorderWidth 0.5 mul add dup moveto +TextWidth BorderMargin 2 mul add BorderWidth add 0 rlineto +0 TextHeight BorderMargin 2 mul add BorderWidth add rlineto +TextWidth BorderMargin 2 mul add BorderWidth add neg 0 rlineto +closepath +BackgroundColor setrgbcolor gsave fill grestore +BorderColor setrgbcolor stroke + +0 0 0 setrgbcolor % revert to black + +% Set the clipping path to the text region +0 setlinewidth +newpath +MarginWidth BorderWidth add BorderMargin add dup moveto +TextWidth 0 rlineto +0 TextHeight rlineto +TextWidth neg 0 rlineto +closepath +clip + +% Move origin to text box center, since x = 0 is a convenient +% value for centering text. +LandscapeMode + { Height 0.5 mul Width 0.5 mul translate } + { Width 0.5 mul Height 0.5 mul translate } +ifelse +% Set font size so that the longest line just fills the TextWidth. +setfontsize +% Center the text vertically, such that the middle line has its text +% (rather than baseline distance) centered on a horizontal line +% passing through the center of the picture. +0 LineCount 0.5 mul BaselineSkip mul BaselineSkip sub moveto +0 BaselineSkip CapHeight sub 0.5 mul rmoveto +ForegroundColor setrgbcolor +% Typeset the poster text. +PosterLines { cshow } forall +end % psposterdict +showpage +%%PageTrailer +%======================================================================= +%%Trailer +%%EOF diff --git a/macros/generic/epsf/okay/tepsf.eps b/macros/generic/epsf/okay/tepsf.eps new file mode 100644 index 0000000000..c1a3954832 --- /dev/null +++ b/macros/generic/epsf/okay/tepsf.eps @@ -0,0 +1,186 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: psposter +x 1in +y 1in +w 2in +h 0.75in +p 20pt +fg navyblue +bg lightblue +bd skyblue test of epsf.tex +%%CreationDate: Sat Jul 23 17:29:32 MDT 2005 +%%Creator: psposter Version 0.11 [13-Jan-2000] +%%For: Nelson H. F. Beebe <beebe@psi.math.utah.edu> +%%BoundingBox: 72 72 216 126 +%%DocumentMedia: A 612 792 0 () () +%%DocumentData: Clean7Bit +%%DocumentFonts: font Times-Bold +%%DocumentNeededResources: font Times-Bold +%%Orientation: Portrait +%%PageOrder: Ascend +%%Pages: 1 +%%EndComments +%======================================================================= +%%BeginProlog +/psposterdict 50 dict def +psposterdict begin +/inch { 72 mul } def +/BackgroundColor { 0.678431 0.847059 0.901961 } def % lightblue +/BaselineSkipFactor 1.2 def +/BorderColor { 0.529412 0.807843 0.921569 } def % skyblue +/BorderMargin 0 def +/BorderWidth 10 def +/CapHeight +{ + gsave newpath 0 0 moveto (M) true charpath pathbbox + exch pop sub neg exch pop grestore +} def +/ForegroundColor { 0 0 0.501961 } def % navyblue +/reencodePRIVATE { + dup length dict begin + {1 index /FID ne {def}{pop pop} ifelse} forall + %% Using default font encoding, perhaps: /Encoding StandardEncoding def + currentdict + end +} def +/findPRIVATE { + dup /FontType known { + dup /FontType get 3 ne { + dup /CharStrings known { + dup /CharStrings get /Thorn known { + true + }{ false } ifelse + }{ false } ifelse + }{ false } ifelse + }{ false } ifelse +} def +/LandscapeMode false def +/MarginWidth 0 def +/PageHeight 792 def +/PageWidth 612 def +/Height 54 def +/Width 144 def +/PointSize 19.9253 def +/ROTATE_0 {} def +/ROTATE_90 {Width 0 translate 90 rotate} bind def +/ROTATE_180 {Width Height translate 180 rotate} bind def +/ROTATE_270 {0 Height translate 270 rotate} bind def +/ScaleFactor 1 def +LandscapeMode +{ + /TextHeight Width MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def + /TextWidth Height MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def +} +{ + /TextHeight Height MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def + /TextWidth Width MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def +} +ifelse +/XOffset 72 def +/YOffset 72 def +% Center and show a string at the current point, leaving +% point at the center of the next line. +% Usage: (string) cshow +/cshow +{ + currentpoint /cpy exch def /cpx exch def + dup stringwidth pop 0.5 mul neg 0 rmoveto show + cpx cpy moveto + NewLine +} def +/max +{ + /a exch def + /b exch def + a b gt { a } { b } ifelse +} def +/min +{ + /a exch def + /b exch def + a b lt { a } { b } ifelse +} def +/TheFont /Times-Bold def +/TheFontPRIVATE /Times-Bold-PRIVATE def +TheFontPRIVATE TheFont findfont reencodePRIVATE definefont pop +% Set the font size so that longest PosterLines string fills the TextWidth +% Usage: setfontsize +/setfontsize +{ + TheFont findfont + findPRIVATE {reencodePRIVATE TheFontPRIVATE exch definefont} if + 10 scalefont setfont + % Set TheFontSize according to maximum string width + 0 PosterLines { stringwidth pop max } forall TextWidth exch div 10 mul + /TheFontSize exch def + % Adjust TheFontSize according to the number of text lines + LineCount TheFontSize mul BaselineSkipFactor mul + TextHeight div + dup 1 gt { TheFontSize exch div /TheFontSize exch def } { pop } ifelse + % NB: The following definition silently overrides the previous one + /TheFontSize PointSize def + /BaselineSkip BaselineSkipFactor TheFontSize mul def + TheFont findfont + findPRIVATE {reencodePRIVATE TheFontPRIVATE exch definefont} if + TheFontSize scalefont setfont +} def +/NewLine {0 BaselineSkip neg rmoveto} def +/PosterLines +[ + (test of epsf.tex) +] def +/LineCount PosterLines length 1 max def +end % psposterdict +%%EndProlog +%======================================================================= +%%BeginSetup +/#copies 1 def +%%EndSetup +%======================================================================= +%%Page: 1 1 +%%BeginPageSetup +psposterdict begin +XOffset YOffset translate +ScaleFactor dup scale +ROTATE_0 +end % psposterdict +%%EndPageSetup + +psposterdict begin +% Draw a frame box and fill it with the background color, and a border color. +BorderWidth setlinewidth +newpath +MarginWidth BorderWidth 0.5 mul add dup moveto +TextWidth BorderMargin 2 mul add BorderWidth add 0 rlineto +0 TextHeight BorderMargin 2 mul add BorderWidth add rlineto +TextWidth BorderMargin 2 mul add BorderWidth add neg 0 rlineto +closepath +BackgroundColor setrgbcolor gsave fill grestore +BorderColor setrgbcolor stroke + +0 0 0 setrgbcolor % revert to black + +% Set the clipping path to the text region +0 setlinewidth +newpath +MarginWidth BorderWidth add BorderMargin add dup moveto +TextWidth 0 rlineto +0 TextHeight rlineto +TextWidth neg 0 rlineto +closepath +clip + +% Move origin to text box center, since x = 0 is a convenient +% value for centering text. +LandscapeMode + { Height 0.5 mul Width 0.5 mul translate } + { Width 0.5 mul Height 0.5 mul translate } +ifelse +% Set font size so that the longest line just fills the TextWidth. +setfontsize +% Center the text vertically, such that the middle line has its text +% (rather than baseline distance) centered on a horizontal line +% passing through the center of the picture. +0 LineCount 0.5 mul BaselineSkip mul BaselineSkip sub moveto +0 BaselineSkip CapHeight sub 0.5 mul rmoveto +ForegroundColor setrgbcolor +% Typeset the poster text. +PosterLines { cshow } forall +end % psposterdict +showpage +%%PageTrailer +%======================================================================= +%%Trailer +%%EOF diff --git a/macros/generic/epsf/okay/tepsf1.dvi b/macros/generic/epsf/okay/tepsf1.dvi Binary files differnew file mode 100644 index 0000000000..67912fbc70 --- /dev/null +++ b/macros/generic/epsf/okay/tepsf1.dvi diff --git a/macros/generic/epsf/okay/tepsf2.dvi b/macros/generic/epsf/okay/tepsf2.dvi Binary files differnew file mode 100644 index 0000000000..cf9f9ac541 --- /dev/null +++ b/macros/generic/epsf/okay/tepsf2.dvi diff --git a/macros/generic/epsf/okay/tepsf3.dvi b/macros/generic/epsf/okay/tepsf3.dvi Binary files differnew file mode 100644 index 0000000000..08b9fa27c1 --- /dev/null +++ b/macros/generic/epsf/okay/tepsf3.dvi diff --git a/macros/generic/epsf/teps.eps b/macros/generic/epsf/teps.eps new file mode 100644 index 0000000000..9c92e663a5 --- /dev/null +++ b/macros/generic/epsf/teps.eps @@ -0,0 +1,186 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: psposter +x 1in +y 1in +w 2in +h 0.75in +p 20pt +fg navyblue +bd red +bg skyblue test of epsf.tex +%%CreationDate: Sat Jul 23 17:26:56 MDT 2005 +%%Creator: psposter Version 0.11 [13-Jan-2000] +%%For: Nelson H. F. Beebe <beebe@psi.math.utah.edu> +%%BoundingBox: 72 72 216 126 +%%DocumentMedia: A 612 792 0 () () +%%DocumentData: Clean7Bit +%%DocumentFonts: font Times-Bold +%%DocumentNeededResources: font Times-Bold +%%Orientation: Portrait +%%PageOrder: Ascend +%%Pages: 1 +%%EndComments +%======================================================================= +%%BeginProlog +/psposterdict 50 dict def +psposterdict begin +/inch { 72 mul } def +/BackgroundColor { 0.529412 0.807843 0.921569 } def % skyblue +/BaselineSkipFactor 1.2 def +/BorderColor { 1 0 0 } def % red +/BorderMargin 0 def +/BorderWidth 10 def +/CapHeight +{ + gsave newpath 0 0 moveto (M) true charpath pathbbox + exch pop sub neg exch pop grestore +} def +/ForegroundColor { 0 0 0.501961 } def % navyblue +/reencodePRIVATE { + dup length dict begin + {1 index /FID ne {def}{pop pop} ifelse} forall + %% Using default font encoding, perhaps: /Encoding StandardEncoding def + currentdict + end +} def +/findPRIVATE { + dup /FontType known { + dup /FontType get 3 ne { + dup /CharStrings known { + dup /CharStrings get /Thorn known { + true + }{ false } ifelse + }{ false } ifelse + }{ false } ifelse + }{ false } ifelse +} def +/LandscapeMode false def +/MarginWidth 0 def +/PageHeight 792 def +/PageWidth 612 def +/Height 54 def +/Width 144 def +/PointSize 19.9253 def +/ROTATE_0 {} def +/ROTATE_90 {Width 0 translate 90 rotate} bind def +/ROTATE_180 {Width Height translate 180 rotate} bind def +/ROTATE_270 {0 Height translate 270 rotate} bind def +/ScaleFactor 1 def +LandscapeMode +{ + /TextHeight Width MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def + /TextWidth Height MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def +} +{ + /TextHeight Height MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def + /TextWidth Width MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def +} +ifelse +/XOffset 72 def +/YOffset 72 def +% Center and show a string at the current point, leaving +% point at the center of the next line. +% Usage: (string) cshow +/cshow +{ + currentpoint /cpy exch def /cpx exch def + dup stringwidth pop 0.5 mul neg 0 rmoveto show + cpx cpy moveto + NewLine +} def +/max +{ + /a exch def + /b exch def + a b gt { a } { b } ifelse +} def +/min +{ + /a exch def + /b exch def + a b lt { a } { b } ifelse +} def +/TheFont /Times-Bold def +/TheFontPRIVATE /Times-Bold-PRIVATE def +TheFontPRIVATE TheFont findfont reencodePRIVATE definefont pop +% Set the font size so that longest PosterLines string fills the TextWidth +% Usage: setfontsize +/setfontsize +{ + TheFont findfont + findPRIVATE {reencodePRIVATE TheFontPRIVATE exch definefont} if + 10 scalefont setfont + % Set TheFontSize according to maximum string width + 0 PosterLines { stringwidth pop max } forall TextWidth exch div 10 mul + /TheFontSize exch def + % Adjust TheFontSize according to the number of text lines + LineCount TheFontSize mul BaselineSkipFactor mul + TextHeight div + dup 1 gt { TheFontSize exch div /TheFontSize exch def } { pop } ifelse + % NB: The following definition silently overrides the previous one + /TheFontSize PointSize def + /BaselineSkip BaselineSkipFactor TheFontSize mul def + TheFont findfont + findPRIVATE {reencodePRIVATE TheFontPRIVATE exch definefont} if + TheFontSize scalefont setfont +} def +/NewLine {0 BaselineSkip neg rmoveto} def +/PosterLines +[ + (test of epsf.tex) +] def +/LineCount PosterLines length 1 max def +end % psposterdict +%%EndProlog +%======================================================================= +%%BeginSetup +/#copies 1 def +%%EndSetup +%======================================================================= +%%Page: 1 1 +%%BeginPageSetup +psposterdict begin +XOffset YOffset translate +ScaleFactor dup scale +ROTATE_0 +end % psposterdict +%%EndPageSetup + +psposterdict begin +% Draw a frame box and fill it with the background color, and a border color. +BorderWidth setlinewidth +newpath +MarginWidth BorderWidth 0.5 mul add dup moveto +TextWidth BorderMargin 2 mul add BorderWidth add 0 rlineto +0 TextHeight BorderMargin 2 mul add BorderWidth add rlineto +TextWidth BorderMargin 2 mul add BorderWidth add neg 0 rlineto +closepath +BackgroundColor setrgbcolor gsave fill grestore +BorderColor setrgbcolor stroke + +0 0 0 setrgbcolor % revert to black + +% Set the clipping path to the text region +0 setlinewidth +newpath +MarginWidth BorderWidth add BorderMargin add dup moveto +TextWidth 0 rlineto +0 TextHeight rlineto +TextWidth neg 0 rlineto +closepath +clip + +% Move origin to text box center, since x = 0 is a convenient +% value for centering text. +LandscapeMode + { Height 0.5 mul Width 0.5 mul translate } + { Width 0.5 mul Height 0.5 mul translate } +ifelse +% Set font size so that the longest line just fills the TextWidth. +setfontsize +% Center the text vertically, such that the middle line has its text +% (rather than baseline distance) centered on a horizontal line +% passing through the center of the picture. +0 LineCount 0.5 mul BaselineSkip mul BaselineSkip sub moveto +0 BaselineSkip CapHeight sub 0.5 mul rmoveto +ForegroundColor setrgbcolor +% Typeset the poster text. +PosterLines { cshow } forall +end % psposterdict +showpage +%%PageTrailer +%======================================================================= +%%Trailer +%%EOF diff --git a/macros/generic/epsf/tepsf.eps b/macros/generic/epsf/tepsf.eps new file mode 100644 index 0000000000..c1a3954832 --- /dev/null +++ b/macros/generic/epsf/tepsf.eps @@ -0,0 +1,186 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: psposter +x 1in +y 1in +w 2in +h 0.75in +p 20pt +fg navyblue +bg lightblue +bd skyblue test of epsf.tex +%%CreationDate: Sat Jul 23 17:29:32 MDT 2005 +%%Creator: psposter Version 0.11 [13-Jan-2000] +%%For: Nelson H. F. Beebe <beebe@psi.math.utah.edu> +%%BoundingBox: 72 72 216 126 +%%DocumentMedia: A 612 792 0 () () +%%DocumentData: Clean7Bit +%%DocumentFonts: font Times-Bold +%%DocumentNeededResources: font Times-Bold +%%Orientation: Portrait +%%PageOrder: Ascend +%%Pages: 1 +%%EndComments +%======================================================================= +%%BeginProlog +/psposterdict 50 dict def +psposterdict begin +/inch { 72 mul } def +/BackgroundColor { 0.678431 0.847059 0.901961 } def % lightblue +/BaselineSkipFactor 1.2 def +/BorderColor { 0.529412 0.807843 0.921569 } def % skyblue +/BorderMargin 0 def +/BorderWidth 10 def +/CapHeight +{ + gsave newpath 0 0 moveto (M) true charpath pathbbox + exch pop sub neg exch pop grestore +} def +/ForegroundColor { 0 0 0.501961 } def % navyblue +/reencodePRIVATE { + dup length dict begin + {1 index /FID ne {def}{pop pop} ifelse} forall + %% Using default font encoding, perhaps: /Encoding StandardEncoding def + currentdict + end +} def +/findPRIVATE { + dup /FontType known { + dup /FontType get 3 ne { + dup /CharStrings known { + dup /CharStrings get /Thorn known { + true + }{ false } ifelse + }{ false } ifelse + }{ false } ifelse + }{ false } ifelse +} def +/LandscapeMode false def +/MarginWidth 0 def +/PageHeight 792 def +/PageWidth 612 def +/Height 54 def +/Width 144 def +/PointSize 19.9253 def +/ROTATE_0 {} def +/ROTATE_90 {Width 0 translate 90 rotate} bind def +/ROTATE_180 {Width Height translate 180 rotate} bind def +/ROTATE_270 {0 Height translate 270 rotate} bind def +/ScaleFactor 1 def +LandscapeMode +{ + /TextHeight Width MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def + /TextWidth Height MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def +} +{ + /TextHeight Height MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def + /TextWidth Width MarginWidth 2 mul sub BorderWidth 2 mul sub BorderMargin 2 mul sub def +} +ifelse +/XOffset 72 def +/YOffset 72 def +% Center and show a string at the current point, leaving +% point at the center of the next line. +% Usage: (string) cshow +/cshow +{ + currentpoint /cpy exch def /cpx exch def + dup stringwidth pop 0.5 mul neg 0 rmoveto show + cpx cpy moveto + NewLine +} def +/max +{ + /a exch def + /b exch def + a b gt { a } { b } ifelse +} def +/min +{ + /a exch def + /b exch def + a b lt { a } { b } ifelse +} def +/TheFont /Times-Bold def +/TheFontPRIVATE /Times-Bold-PRIVATE def +TheFontPRIVATE TheFont findfont reencodePRIVATE definefont pop +% Set the font size so that longest PosterLines string fills the TextWidth +% Usage: setfontsize +/setfontsize +{ + TheFont findfont + findPRIVATE {reencodePRIVATE TheFontPRIVATE exch definefont} if + 10 scalefont setfont + % Set TheFontSize according to maximum string width + 0 PosterLines { stringwidth pop max } forall TextWidth exch div 10 mul + /TheFontSize exch def + % Adjust TheFontSize according to the number of text lines + LineCount TheFontSize mul BaselineSkipFactor mul + TextHeight div + dup 1 gt { TheFontSize exch div /TheFontSize exch def } { pop } ifelse + % NB: The following definition silently overrides the previous one + /TheFontSize PointSize def + /BaselineSkip BaselineSkipFactor TheFontSize mul def + TheFont findfont + findPRIVATE {reencodePRIVATE TheFontPRIVATE exch definefont} if + TheFontSize scalefont setfont +} def +/NewLine {0 BaselineSkip neg rmoveto} def +/PosterLines +[ + (test of epsf.tex) +] def +/LineCount PosterLines length 1 max def +end % psposterdict +%%EndProlog +%======================================================================= +%%BeginSetup +/#copies 1 def +%%EndSetup +%======================================================================= +%%Page: 1 1 +%%BeginPageSetup +psposterdict begin +XOffset YOffset translate +ScaleFactor dup scale +ROTATE_0 +end % psposterdict +%%EndPageSetup + +psposterdict begin +% Draw a frame box and fill it with the background color, and a border color. +BorderWidth setlinewidth +newpath +MarginWidth BorderWidth 0.5 mul add dup moveto +TextWidth BorderMargin 2 mul add BorderWidth add 0 rlineto +0 TextHeight BorderMargin 2 mul add BorderWidth add rlineto +TextWidth BorderMargin 2 mul add BorderWidth add neg 0 rlineto +closepath +BackgroundColor setrgbcolor gsave fill grestore +BorderColor setrgbcolor stroke + +0 0 0 setrgbcolor % revert to black + +% Set the clipping path to the text region +0 setlinewidth +newpath +MarginWidth BorderWidth add BorderMargin add dup moveto +TextWidth 0 rlineto +0 TextHeight rlineto +TextWidth neg 0 rlineto +closepath +clip + +% Move origin to text box center, since x = 0 is a convenient +% value for centering text. +LandscapeMode + { Height 0.5 mul Width 0.5 mul translate } + { Width 0.5 mul Height 0.5 mul translate } +ifelse +% Set font size so that the longest line just fills the TextWidth. +setfontsize +% Center the text vertically, such that the middle line has its text +% (rather than baseline distance) centered on a horizontal line +% passing through the center of the picture. +0 LineCount 0.5 mul BaselineSkip mul BaselineSkip sub moveto +0 BaselineSkip CapHeight sub 0.5 mul rmoveto +ForegroundColor setrgbcolor +% Typeset the poster text. +PosterLines { cshow } forall +end % psposterdict +showpage +%%PageTrailer +%======================================================================= +%%Trailer +%%EOF diff --git a/macros/generic/epsf/tepsf1.tex b/macros/generic/epsf/tepsf1.tex new file mode 100644 index 0000000000..d045f167cd --- /dev/null +++ b/macros/generic/epsf/tepsf1.tex @@ -0,0 +1,146 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Preamble + +\input epsf.tex + +\def \bs {\char`\\} + +\def \heading #1{\centerline{\bf #1}} + +\def \myfont {% + \baselineskip = 9.6pt + \font \rm = cmr8 at 8pt + \rm +} + +\def \noise +{% + Blah blah blah blah blah blah. Blah blah blah blah blah blah. Blah + blah blah blah blah blah. Blah blah blah blah blah blah +} + +\def \ARROWPICTURE {\llap{$\Rightarrow$}\PLAINPICTURE\rlap{$\Leftarrow$}} + +\def \PLAINPICTURE {\epsffile{tepsf.eps}} + +\parindent = 2em + +\parskip = 2ex plus 0.5ex minus 0.5ex + +%% Page size in mid-Atlantic units +\voffset = -0.5in + +\vsize = 9.5in + +\hsize = 12.5cm + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Document body + +\myfont + +\heading{Test of {\tt epsf.tex}} + +\noise + +This figure should be centered: + +\centerline{\PLAINPICTURE} + +\noise + +This figure should be left-adjusted: + +\leftline{\PLAINPICTURE} + +\noise + +This figure should be right-adjusted: + +\rightline{\PLAINPICTURE} + +\noise + +This figure should be centered with abutting arrows on the baseline: + +\centerline{\ARROWPICTURE} + +\noise + +This figure should be left-adjusted with abutting arrows on the +baseline, the leftmost of which is in the left margin on the baseline: + +\leftline{\ARROWPICTURE} + +\noise + +This figure should be right-adjusted with abutting arrows on the +baseline, the rightmost of which is in the right margin on the +baseline: + +\rightline{\ARROWPICTURE} + +\noise + +\vfill +\eject + +%% --------------------------------------------------------------------- + +\heading{Test of {\tt epsf.tex}} +\heading{with} +\heading{{\tt \bs epsfframetrue} and {\tt \bs epsfshowfalse} and + {\tt \bs epsfshowfilenametrue}} + +\epsfframetrue +\epsfshowfalse +\epsfshowfilenametrue +\epsfverbosetrue + +\noise + +This figure should be centered: + +\centerline{\PLAINPICTURE} + +\noise + +This figure should be left-adjusted: + +\leftline{\PLAINPICTURE} + +\noise + +This figure should be right-adjusted: + +\rightline{\PLAINPICTURE} + +\noise + +This figure should be centered with abutting arrows on the baseline: + +\centerline{\ARROWPICTURE} + +\noise + +This figure should be left-adjusted with abutting arrows on the +baseline, the leftmost of which is in the left margin on the baseline: + +\leftline{\ARROWPICTURE} + +\noise + +This figure should be right-adjusted with abutting arrows on the +baseline, the rightmost of which is in the right margin on the +baseline: + +\rightline{\ARROWPICTURE} + +\noise + +\vfill +\eject + +%% --------------------------------------------------------------------- + +\bye diff --git a/macros/generic/epsf/tepsf2.ltx b/macros/generic/epsf/tepsf2.ltx new file mode 100644 index 0000000000..7c8fd4c071 --- /dev/null +++ b/macros/generic/epsf/tepsf2.ltx @@ -0,0 +1,232 @@ +% -*-latex-*- +% Document name: /u/sy/beebe/tex/epsf/new/tepsf2.ltx +% Creator: Nelson H. F. Beebe [beebe@math.utah.edu] +% Creation Date: Sat Jul 23 14:51:49 2005 + +\ifx \documentclass \undefined % LaTeX 2.09 + \documentstyle{article} + \input {epsf.sty} +\else % LaTeX 2e + \documentclass{article} + \usepackage{epsf} +\fi + +\newcommand{\bs}{\char`\\} + +\newcommand {\heading} [1] {\centerline{\bf #1}} + +\newcommand {\myfont} +{ + \baselineskip = 9.6pt + \font \rm = cmr8 at 8pt + \rm +} + +\newcommand {\noise} +{% + Blah blah blah blah blah blah. Blah blah blah blah blah blah. Blah + blah blah blah blah blah. Blah blah blah blah blah blah +} + +\newcommand{\ARROWPICTURE}{% + \makebox[0pt][r]{$\Rightarrow$}% + \PLAINPICTURE + \makebox[0pt][l]{$\Leftarrow$}% +} + +\newcommand{\PLAINPICTURE}{% + \epsffile{tepsf.eps}% +} + +\setlength{\parindent} {2em} + +\setlength{\parskip} {2ex plus 0.5ex minus 0.5ex} + +\setlength{\topmargin} {0pt} + +\setlength{\headheight} {0pt} + +\setlength{\headsep} {0pt} + +\setlength{\leftmargin} {0pt} + +\setlength{\textheight} {9in} + +\setlength{\textwidth} {12.5cm} + +\begin{document} + +\myfont + +\heading{Test of {\tt \bs epsfbox} with {\tt \bs centerline}} + +\noise + +This figure should be centered: + +\centerline{\PLAINPICTURE{}} + +\noise + +This figure should be left-adjusted: + +\centerline{\PLAINPICTURE{}\hfill} + +\noise + +This figure should be right-adjusted: + +\centerline{\hfill \PLAINPICTURE{}} + +\noise + +This figure should be centered with abutting arrows on the baseline: + +\centerline{$\Rightarrow$\PLAINPICTURE{}$\Leftarrow$} + +\noise + +This figure should be left-adjusted with abutting arrows on the +baseline, the leftmost of which is in the left margin on the baseline: + +\centerline{\hbox to 0pt{\hss$\Rightarrow$}\PLAINPICTURE{}$\Leftarrow$ \hfill} + +\noise + +This figure should be right-adjusted with abutting arrows on the +baseline, the rightmost of which is in the right margin on the +baseline: + +\centerline{\hfill $\Rightarrow$\PLAINPICTURE{}\hbox to 0pt{$\Leftarrow$ \hss}} + +\noise + +%% --------------------------------------------------------------------- + +\newpage + +\heading{Test of {\tt \bs epsfbox} with {\tt center} environment} + +\noise + +This figure should be centered: + +\begin{center} + \PLAINPICTURE{} +\end{center} + +\noise + +This figure should be left-adjusted: + +\begin{flushleft} + \PLAINPICTURE{} +\end{flushleft} + +\noise + +This figure should be right-adjusted: + +\begin{flushright} + \PLAINPICTURE{} +\end{flushright} + +\noise + +This figure should be centered with abutting arrows on the baseline: + +\begin{center} + \ARROWPICTURE{} +\end{center} + +\noise + +This figure should be left-adjusted with abutting arrows on the +baseline, the leftmost of which is in the left margin on the +baseline:% + +\begin{flushleft} + \ARROWPICTURE{} +\end{flushleft} + +\noise + +This figure should be right-adjusted with abutting arrows on the +baseline, the rightmost of which is in the right margin on the +baseline: + +\begin{flushright} + \ARROWPICTURE{} +\end{flushright} + +\noise + +%% --------------------------------------------------------------------- + +\newpage + +\heading{Test of {\tt \bs epsfbox} with {\tt center} environment} +\heading{with} +\heading{{\tt \bs epsfframetrue} and {\tt \bs epsfshowfalse} and + {\tt \bs epsfshowfilenametrue}} + +\epsfframetrue +\epsfshowfalse +\epsfshowfilenametrue +\epsfverbosetrue + +\noise + +This figure should be centered: + +\begin{center} + \PLAINPICTURE{} +\end{center} + +\noise + +This figure should be left-adjusted: + +\begin{flushleft} + \PLAINPICTURE{} +\end{flushleft} + +\noise + +This figure should be right-adjusted: + +\begin{flushright} + \PLAINPICTURE{} +\end{flushright} + +\noise + +This figure should be centered with abutting arrows on the baseline: + +\begin{center} + \ARROWPICTURE{} +\end{center} + +\noise + +This figure should be left-adjusted with abutting arrows on the +baseline, the leftmost of which is in the left margin on the +baseline:% + +\begin{flushleft} + \ARROWPICTURE{} +\end{flushleft} + +\noise + +This figure should be right-adjusted with abutting arrows on the +baseline, the rightmost of which is in the right margin on the +baseline: + +\begin{flushright} + \ARROWPICTURE{} +\end{flushright} + +\noise + +\end{document} diff --git a/macros/generic/epsf/tepsf3.tex b/macros/generic/epsf/tepsf3.tex new file mode 100644 index 0000000000..24d2734b17 --- /dev/null +++ b/macros/generic/epsf/tepsf3.tex @@ -0,0 +1,108 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Preamble + +\input epsf.tex + +\def \bs {\char`\\} + +\def \heading #1{\centerline{\bf #1}} + +\def \myfont {% + \baselineskip = 9.6pt + \font \rm = cmr8 at 8pt + \rm +} + +\def \noise +{% + Blah blah blah blah blah blah. Blah blah blah blah blah blah. Blah + blah blah blah blah blah. Blah blah blah blah blah blah +} + +\def \ARROWPICTURE {\llap{$\Rightarrow$}\PLAINPICTURE\rlap{$\Leftarrow$}} + +\def \PLAINPICTURE {\epsffile{tepsf.eps}} + +\parindent = 2em + +\parskip = 2ex plus 0.5ex minus 0.5ex + +%% Page size in mid-Atlantic units +\voffset = -0.5in + +\vsize = 9.5in + +\hsize = 12.5cm + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Document body + +\myfont + +\heading{Test of {\tt epsf.tex}} + +\noise + +This figure should be centered: + +\centerline{XXX\vbox{\PLAINPICTURE}XXX} + +\noise + +This figure should be left-adjusted: + +\leftline{\vbox{\PLAINPICTURE}XXX} + +\noise + +This figure should be right-adjusted: + +\rightline{XXX\vbox{\PLAINPICTURE}} + +\noise + +This figure should be centered: + +\centerline{XXX\hbox{\PLAINPICTURE}XXX} + +\noise + +This figure should be left-adjusted: + +\leftline{\hbox{\PLAINPICTURE}XXX} + +\noise + +This figure should be right-adjusted: + +\rightline{XXX\hbox{\PLAINPICTURE}} + +\noise + +This figure should be centered with abutting arrows on the baseline: + +\centerline{\vbox{\ARROWPICTURE}} + +\noise + +This figure should be left-adjusted with abutting arrows on the +baseline, the leftmost of which is in the left margin on the baseline: + +\leftline{\vbox{\ARROWPICTURE}} + +\noise + +This figure should be right-adjusted with abutting arrows on the +baseline, the rightmost of which is in the right margin on the +baseline: + +\rightline{\vbox{\ARROWPICTURE}} + +\noise + +\vfill +\eject + +%% --------------------------------------------------------------------- + +\bye |