This is a patch file for dvips. Put it in the dvips directory and apply it with the command: patch -p0 < patch.version *** Makefile.orig Thu Aug 12 11:44:31 1993 --- Makefile Fri Apr 15 10:22:20 1994 *************** *** 143,149 **** pprescan.o papersiz.o flib.o color.o bbox.o emspecial.o all : afm2tfm dvips tex.pro texps.pro texc.pro special.pro finclude.pro \ ! color.pro crop.pro dvips : $(OBJ) $(CC) $(CFLAGS) $(OBJ) $(LIBS) $(FLIBS) -o dvips --- 144,150 ---- pprescan.o papersiz.o flib.o color.o bbox.o emspecial.o all : afm2tfm dvips tex.pro texps.pro texc.pro special.pro finclude.pro \ ! color.pro crop.pro poster.pro dvips : $(OBJ) $(CC) $(CFLAGS) $(OBJ) $(LIBS) $(FLIBS) -o dvips *************** *** 184,192 **** crop.pro : crop.lpro squeeze ./squeeze crop.pro install : afm2tfm dvips MakeTeXPK \ tex.pro texc.pro texps.pro special.pro finclude.pro color.pro \ ! crop.pro config.ps psfonts.map epsf.tex epsf.sty rotate.tex \ rotate.sty colordvi.tex colordvi.sty blackdvi.tex blackdvi.sty \ dvips.tex dvipsmac.tex dvips.1 afm2tfm.1 - mkdir $(BINDIR) --- 185,196 ---- crop.pro : crop.lpro squeeze ./squeeze crop.pro + poster.pro : poster.lpro squeeze + ./squeeze poster.pro + install : afm2tfm dvips MakeTeXPK \ tex.pro texc.pro texps.pro special.pro finclude.pro color.pro \ ! crop.pro poster.pro config.ps psfonts.map epsf.tex epsf.sty rotate.tex \ rotate.sty colordvi.tex colordvi.sty blackdvi.tex blackdvi.sty \ dvips.tex dvipsmac.tex dvips.1 afm2tfm.1 - mkdir $(BINDIR) *************** *** 204,209 **** --- 208,214 ---- $(INSTALL) -c -m 644 finclude.pro $(HEADERDIR) $(INSTALL) -c -m 644 color.pro $(HEADERDIR) $(INSTALL) -c -m 644 crop.pro $(HEADERDIR) + $(INSTALL) -c -m 644 poster.pro $(HEADERDIR) $(INSTALL) -c -m 644 config.ps $(CONFIGDIR)/$(CONFIGFILE) $(INSTALL) -c -m 644 psfonts.map $(CONFIGDIR) $(INSTALL) -c -m 644 epsf.tex $(TEXMACRODIR) *** dospecial.c.orig Wed Oct 20 21:41:37 1993 --- dospecial.c Fri Apr 15 10:22:21 1994 *************** *** 73,78 **** --- 73,84 ---- extern int prettycolumn ; extern Boolean disablecomments ; + /* Added for posters, HEP */ + extern Boolean makeposter ; + extern int nrows, ncols ; + extern int posterpages ; /* Each sheet of the poster requires a + ** collated copy. */ + #ifdef DEBUG extern integer debug_flag; #endif *************** *** 188,194 **** {"ury", Number}, {"rwi", Number}, {"rhi", Number}, ! {"clip", None}}; #ifdef VMS #ifndef __GNUC__ /* GNUC tolower is too simple */ --- 194,202 ---- {"ury", Number}, {"rwi", Number}, {"rhi", Number}, ! {"clip", None}, ! {"nrows", Number}, ! {"ncols", Number}}; #ifdef VMS #ifndef __GNUC__ /* GNUC tolower is too simple */ *************** *** 348,353 **** --- 356,375 ---- * or landscape: or such. */ + if (strncmp(p, "poster", 6)==0) { + makeposter = 1 ; + p += 6 ; + nrows = 1 ; + ncols = 1 ; + while ( (p=GetKeyVal(p, &j)) != NULL) { + if( j == 17 ) + nrows = ValNum ; + if( j == 18 ) + ncols = ValNum ; + } + posterpages = nrows * ncols ; + return ; + } if (strncmp(p, "landscape", 9)==0) { if (hpapersize || vpapersize) error( *************** *** 508,514 **** } return; } ! if (strncmp(p, "landscape", 9)==0 || strncmp(p, "header", 6)==0 || strncmp(p, "papersize", 9)==0 || *p=='!') return ; /* already handled in prescan */ /* IBM: color - begin changes */ --- 530,537 ---- } return; } ! if (strncmp(p, "poster", 6)==0 || ! strncmp(p, "landscape", 9)==0 || strncmp(p, "header", 6)==0 || strncmp(p, "papersize", 9)==0 || *p=='!') return ; /* already handled in prescan */ /* IBM: color - begin changes */ *** dvips.c.orig Sun Mar 6 19:06:30 1994 --- dvips.c Fri Apr 15 16:46:24 1994 *************** *** 16,25 **** --- 16,27 ---- /* and put in GNU_CC:[INCLUDE.LOCAL] */ #include "ctype.h" #include "descrip.h" + #include "ssdef.h" #else #include climsgdef #include ctype #include descrip + #include ssdef #endif #endif /* *************** *** 26,31 **** --- 28,34 ---- * First we define some globals. */ #ifdef VMS + static void vmscli (void); static char ofnme[252],infnme[252],pap[40],thh[20]; #endif fontdesctype *fonthead ; /* list of all fonts mentioned so far */ *************** *** 154,159 **** --- 157,165 ---- extern int dontmakefont ; struct papsiz *papsizes ; /* all available paper size */ int headersready ; /* ready to check headers? */ + Boolean makeposter ; /* each page is a poster */ + integer nrows, ncols ; /* poster size */ + integer posterpages = 1 ; /* how many poster sheets/page */ #if defined MSDOS || defined OS2 char *mfjobname = NULL; /* name of mfjob file if given */ FILE *mfjobfile = NULL; /* mfjob file for font making instructions */ *************** *** 161,170 **** --- 167,178 ---- #ifdef DEBUG integer debug_flag = 0; #endif /* DEBUG */ + #ifndef VMS char queryline[256]; /* interactive query of options */ int qargc; char *qargv[32]; char queryoptions; + #endif /* !VMS */ /* * This routine calls the following externals: */ *************** *** 413,418 **** --- 421,427 ---- } return (VOID *)qq ; } + #ifndef VMS /* this asks for a new set of arguments from the command line */ void queryargs() *************** *** 428,433 **** --- 437,443 ---- } qargv[qargc] = (char *)NULL; } + #endif /* !VMS */ /* * Finally, our main routine. *************** *** 1003,1010 **** --- 1013,1023 ---- (void)add_header(SPECIALHEADER) ; if (usescolor) /* IBM: color */ (void)add_header(COLORHEADER) ; + if (makeposter) + (void)add_header(POSTERHEADER) ; papsizes = (struct papsiz *)revlist((void *)papsizes) ; sects = sections ; + pagecopies *= posterpages ; totalpages *= collatedcopies ; if (sects == NULL || sects->next == NULL) { sectioncopies = collatedcopies ; *************** *** 1026,1032 **** initprinter(0) ; outbangspecials() ; } ! for (i=0; ispecdat, 0) ; } if (manualfeed) cmdout("@manualfeed") ; + if (makeposter) { + numout((integer)nrows) ; + numout((integer)ncols) ; + cmdout("@poster") ; + newline() ; + } if (landscape) cmdout("@landscape") ; if (numcopies != 1) { numout((integer)numcopies) ; *** paths.h.orig Sun Apr 25 20:02:52 1993 --- paths.h Fri Apr 15 10:22:23 1994 *************** *** 29,34 **** --- 29,35 ---- #define PSFONTHEADER "texps.pro" #define IFONTHEADER "finclude.pro" #define SPECIALHEADER "special.pro" + #define POSTERHEADER "poster.pro" #define COLORHEADER "color.pro" /* IBM: color */ #define CROPHEADER "crop.pro" #define PSMAPFILE "psfonts.map" *** poster.lpro.orig Fri Apr 15 10:22:23 1994 --- poster.lpro Fri Apr 15 10:22:24 1994 *************** *** 0 **** --- 1,150 ---- + % Functions for posters. + + % The basic idea, taken from the printposter program in the Blue Book, + % is to translate before printing each page, making sure that the + % desired part of the large page falls on the paper. Each poster page + % has a size given by the number of rows and columns of pieces of paper + % needed to print. Regardless of whether the document is landscape + % mode, rows go across the page, parallel with the lines of text, and + % columns go down the page. The poster mechanism is invoked from + % within a document by a \special of the form + % + % \special{poster nrows=x ncols=y} + % + % Each sheet of the poster requires a separate pass through the + % document. That is, a poster where each page is one row of sheets + % of paper high, and three columns wide, requires three passes + % through the document. All of the left edge sheets are printed + % first. Then all of the center sheets, followed by all of the + % right edge sheets are printed. The user then must collate the + % sheets for each page, cut off the edges of some of the sheets, + % and paste them together. + + TeXDict begin + + /inch {Resolution mul} N + + /leftmargin {0.5 inch} N + /rightmargin {0.5 inch} N + /botmargin {0.5 inch} N + /topmargin {0.5 inch} N + /ticklen {0.2 inch} N + /tickoffs {0.2 inch} N + + % Save poster dimensions in sheets of paper. The arguments are nrows + % and ncols as given by the user in the \special command. + + /@poster + { + /columns X + /rows X + } N + + % Re-defined bop. + + /bop % %t %d bop - -- begin a brand new page, %t=pageno %d=seqno + { + userdict /bop-hook known { bop-hook } if + /SI save N + @rigin + % + % Now we check the resolution. If it's correct, we use RV as V, + % otherwise we use QV. + % + 0 0 moveto + /V matrix currentmatrix + dup 1 get dup mul exch 0 get dup mul add .99 lt + {/QV} {/RV} ifelse load def + % pop pop + + postersheet + } N + + % Set clip path near the edges of the a sheet. This + % doesn't really buy you anything except to insure + % that the fiducial marks don't get covered up. + + /pageclip + { + leftmargin 1 inch sub tickoffs sub topmargin 1 inch sub tickoffs sub moveto + 0 pageheight tickoffs dup add add rlineto + pagewidth tickoffs dup add add 0 rlineto + 0 pageheight tickoffs dup add add neg rlineto + closepath clip + } N + + % Draw fiducial marks to help line things up once you + % have cut off the wasted paper. There is a little + % bit of overlap between what is printed on neighboring + % pagex, so the cuts don't have to be precise. + % We suppress the marks where there is no joint between + % sheets, i.e. where they would not get covered up. + + /fiducials + { + save + leftmargin 1 inch sub topmargin 1 inch sub pageheight add translate + 0.2 setlinewidth + + rowcount 0 eq colcount 0 eq and not % Upper left mark + { + newpath 0 pageheight tickoffs add neg moveto 0 ticklen neg rlineto stroke + newpath tickoffs neg pageheight neg moveto ticklen neg 0 rlineto stroke + } + if + + rowcount 0 eq colcount columns 1 sub eq and not % Upper right mark + { + newpath pagewidth pageheight tickoffs add neg moveto + 0 tickoffs neg rlineto stroke + newpath pagewidth tickoffs add pageheight neg moveto + tickoffs 0 rlineto stroke + } + if + + rowcount rows 1 sub eq colcount 0 eq and not % Lower left mark + { + newpath 0 tickoffs moveto 0 ticklen rlineto stroke + newpath tickoffs neg 0 moveto ticklen neg 0 rlineto stroke + } + if + + rowcount rows 1 sub eq colcount columns 1 sub eq and not % Lower right mark + { + newpath pagewidth tickoffs moveto 0 ticklen rlineto stroke + newpath pagewidth tickoffs add 0 moveto ticklen 0 rlineto stroke + } + if + + restore + } N + + % Given a sheet counter, figure out which row and column this sheet + % is in, and translate so that the appropriate part of the page + % falls on the paper. Put down fiducial marks where cuts need to be + % made when pasting the poster together. + + /postersheet + { /seq X + + seq rows columns mul mod /sheet X + + hsize Resolution mul 72 div leftmargin sub rightmargin sub /pagewidth X + vsize VResolution mul 72 div topmargin sub botmargin sub /pageheight X + + % Given the sheet count, which row and column are we on? + % Note that (0,0) is the upper left, and (columns-1,rows-1) is the + % lower right. + + sheet columns idiv /rowcount exch N + sheet columns mod /colcount exch N + + fiducials + pageclip + pagewidth colcount neg mul + pageheight rowcount neg mul + translate + + } N + + end *** vms/vaxvms.c.orig Fri Apr 15 15:57:14 1994 --- vms/vaxvms.c Fri Apr 15 15:57:20 1994 *************** *** 133,139 **** long UNGETC(char c, FILE *fp); int GETCHAR(void); int READ(int file_desc, char *buffer, int nbytes); ! char *GETENV(char *name); char *getlogin(void); long tell(int handle); int unlink(char *filename); --- 133,139 ---- long UNGETC(char c, FILE *fp); int GETCHAR(void); int READ(int file_desc, char *buffer, int nbytes); ! char* GETENV(const char *name); char *getlogin(void); long tell(int handle); int unlink(char *filename); *************** *** 318,324 **** /**********************************************************************/ /*-->getenv*/ char* ! GETENV(char *name) { char* p; char* result; --- 318,324 ---- /**********************************************************************/ /*-->getenv*/ char* ! GETENV(const char *name) { char* p; char* result; *** vms/vms.h.orig Fri Apr 15 15:43:56 1994 --- vms/vms.h Fri Apr 15 15:43:59 1994 *************** *** 8,13 **** --- 8,16 ---- #define ftell vms_ftell #define fseek vms_fseek #endif /* __DECC */ + #ifdef getchar + #undef getchar + #endif #define getchar vms_getchar #define getenv vms_getenv #define ungetc vms_ungetc *** vms/vmscli.c.orig Wed Oct 20 16:40:19 1993 --- vms/vmscli.c Fri Apr 15 17:04:32 1994 *************** *** 4,10 **** #include ssdef #endif /* this code is included into dvips.c; don't compile it separately. */ ! int vmscli() {long int k,scnt; int length,status,maxdrift,jext; float offset,conversion; --- 4,10 ---- #include ssdef #endif /* this code is included into dvips.c; don't compile it separately. */ ! void vmscli (void) {long int k,scnt; int length,status,maxdrift,jext; float offset,conversion; *************** *** 388,393 **** --- 388,394 ---- if(status == CLI$_PRESENT) { (void)fprintf(stderr, banner) ; help() ; + exit() ; } status = cli$present(&qual34);