⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 4.30.linboli.ps

📁 是multiuser detection 这本书的习题解答, 很有用的书.
💻 PS
📖 第 1 页 / 共 5 页
字号:
%! 
% The following defines procedures assumed and used by program "dvi2ps"
%
% $Header: tex.ps,v 1.15 88/01/21 23:44:40 van Exp $
%
% Original By:  Neal Holtz, Carleton University, Ottawa, Canada
%		<holtz@cascade.carleton.cdn>
%		<holtz%cascade.carleton.cdn@ubc.csnet>
%		June, 1985
% Seriously hacked by Van Jacobson, LBL
%		<van@lbl-csam.arpa>

/TeXDict 200 dict def   % define a working dictionary
TeXDict begin           % start using it.
                        % units are in "dots" (300/inch)
/Resolution 300 def
/Inch  {Resolution mul} def  % converts inches to internal units

/Mtrx 6 array def

%%%%%%%%%%%%%%%%%%%%% Page setup (user) options %%%%%%%%%%%%%%%%%%%%%%%%

% dvi2ps will output coordinates in the TeX system ([0,0] 1" down and in
% from top left, with y +ive downward).  The default PostScript system
% is [0,0] at bottom left, y +ive up.  The Many Matrix Machinations in
% the following code are an attempt to reconcile that. The intent is to
% specify the scaling as 1 and have only translations in the matrix to
% properly position the text.  Caution: the default device matrices are
% *not* the same in all PostScript devices; that should not matter in most 
% of the code below (except for lanscape mode -- in that, rotations of
% -90 degrees resulted in the the rotation matrix [ e 1 ]
%                                                 [ 1 e ]
% where the "e"s were almost exactly but not quite unlike zeros.

/@letter
  { 
%   letter 
    initmatrix
    72 Resolution div dup neg scale          % set scaling to 1.
    310 -3005 translate      % move origin to top (these are not exactly 1"
    Mtrx currentmatrix pop   % and -10" because margins aren't set exactly right)
    /@TeXSave save def
  } def
        % note mode is like letter, except it uses less VM
/@note
  { note initmatrix
    72 Resolution div dup neg scale          % set scaling to 1.
    310 -3005 translate                      % move origin to top
    Mtrx currentmatrix pop
    /@TeXSave save def
  } def

/@landscape
  { 
%   letter
    initmatrix
    72 Resolution div dup neg scale          % set scaling to 1.
    [0 -1 1 0 0 0] concat
    300 310 translate                       % move origin to top
    Mtrx currentmatrix pop
    /@TeXSave save def
  } def

/@legal
  { legal initmatrix
    72 Resolution div dup neg scale          % set scaling to 1.
    295 -3880 translate                      % move origin to top
    Mtrx currentmatrix pop
    /@TeXSave save def
  } def

/@manualfeed
   { statusdict /manualfeed true put
   } def

/@duplex
   { statusdict begin /setduplexmode where { pop true setduplexmode } if end
   } def

% n @copies -   set number of copies
/@copies
   { /#copies exch def
   } def

%%%%%%%%%%%%%%%%%%%% Procedure Defintions %%%%%%%%%%%%%%%%%%%%%%%%%%

% id @newfont -		initialize a new font dictionary
/@newfont
  { /newname exch def
    /xscale exch def            % these two lines are added here for scaling
    /yscale xscale neg def
    newname 7 dict def          % allocate new font dictionary
    newname load begin
        /FontType 3 def
        /FontMatrix [xscale 0 0 yscale 0 0] def
        /FontBBox [0 0 1 1] def
        /BitMaps 128 array def
        /BuildChar {CharBuilder} def
        /Encoding 128 array def
        0 1 127 {Encoding exch /.undef put} for
        end
    newname newname load definefont pop
  } def


% the following is the only character builder we need.  it looks up the
% char data in the BitMaps array, and paints the character if possible.
% char data  -- a bitmap descriptor -- is an array of length 6, of 
%          which the various slots are:

/ch-image {ch-data 0 get} def   % the hex string image
/ch-width {ch-data 1 get} def   % the number of pixels across
/ch-height {ch-data 2 get} def  % the number of pixels tall
/ch-xoff  {ch-data 3 get} def   % number of pixels below origin
/ch-yoff  {ch-data 4 get} def   % number of pixels to left of origin
/ch-tfmw  {ch-data 5 get} def   % spacing to next character

% fontdict ch Charbuilder -     -- image one character
/CharBuilder
  { /ch-code exch def           % save the char code
    /font-dict exch def         % and the font dict.
    /ch-data font-dict /BitMaps get ch-code get def   % get the bitmap
    ch-data null eq not {
	ch-tfmw 0 ch-xoff neg ch-yoff neg
	ch-width ch-xoff sub ch-height ch-yoff sub
	setcachedevice
        ch-width ch-height true [1 0  0 1  ch-xoff ch-yoff]
	{ch-image} imagemask
    } if
} def


% fontdict @sf -        -- make that the current font
/@sf { setfont } def

% in the following, the font-cacheing mechanism requires that
% a name unique in the particular font be generated

% char-data ch @dc -    -- define a new character bitmap in current font
/@dc
  { /ch-code exch def
    dup 0 get
    length 2 lt
      { pop [ <00> 1 1 0 0 8.00 ] } % replace <> with null
    if
    /ch-data exch def
    currentfont /BitMaps get ch-code ch-data put
    % generate a unique name simply from the character code
    currentfont /Encoding get ch-code dup (   ) cvs cvn put
  } def

/@DRAFTF { gsave initmatrix newpath
       /Helvetica-Bold findfont setfont
       (Draft) dup stringwidth pop 8.875 exch div dup 72 mul dup scale
       52.3 rotate 2.5 exch div -.35 translate
       0.95 setgray
       0 0 moveto show
       grestore } def
/@DRAFTM { gsave initmatrix newpath
       /Helvetica-Bold findfont 72 scalefont setfont
       0.95 setgray
       576 702 moveto
       (Draft) stringwidth exch neg exch neg rmoveto
       (Draft) show
       grestore } def

% n @bop0 -              -- begin the char def section of a new page
/@bop0 { pop } def

% n @bop1 -              -- begin a brand new page
/@bop1 { pop Mtrx setmatrix /SaveImage save def } def

/@draft {
    /@bop1
	  { 1 le {@DRAFTF} {@DRAFTM} ifelse
	    Mtrx setmatrix
	    /SaveImage save def
	  } def
} def

% - @eop -              -- end a page
/@eop { showpage SaveImage restore } def

% - @start -            -- start everything
/@start { @letter /@TeXSave save def } def

% - @end -              -- done the whole shebang
/@end { end } def

% x y p -               -- move to position
/p { moveto } bind def

% x r -                 -- move right
/r { 0 rmoveto } bind def

% string s -            -- show the string
/s { show } bind def

% x string m -            -- move right then show string
/m { exch 0 rmoveto show } bind def

% ch c -                -- show the character (code given)
/c { c-string dup 0 4 -1 roll put show } bind def

/c-string ( ) def

% dx dy ru -   -- set a rule (rectangle)
/ru
  { /dy exch neg def    % because dy is height up from bottom
    /dx exch def
    /x currentpoint /y exch def def   % remember current point
    newpath x y moveto
    dx 0 rlineto
    0 dy rlineto
    dx neg 0 rlineto
    closepath fill
    x y moveto
  } bind def

/@MacSetUp
  { userdict /md known  % if md is defined
      { userdict /md get type /dicttype eq      % and if it is a dictionary
	{
	md begin                             % then redefine some stuff
	/letter {} def
	/note {} def
	/legal {} def
	/od{txpose
	    1 0 mtx defaultmatrix dtransform exch atan/pa exch def
	    newpath clippath mark
	    {transform{itransform moveto}}
	    {transform{itransform lineto}}
	    { 6 -2 roll transform
	      6 -2 roll transform
	      6 -2 roll transform
	      { itransform 6 2 roll
		itransform 6 2 roll
		itransform 6 2 roll
		curveto
	      }
	    }
	    {{closepath}}
	    pathforall newpath counttomark array astore /gc xdf
	    pop ct 39 0 put
	    10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack}if
	}def
	/txpose{
	    pxs pys scale ppr aload pop
	    por {
		noflips {
		    pop exch neg exch translate pop 1 -1 scale
		}if
		xflip yflip and {
		    pop exch neg exch translate 180 rotate 1 -1 scale
		    ppr 3 get ppr 1 get neg sub neg ppr 2 get
		    ppr 0 get neg sub neg translate
		}if 
		xflip yflip not and {
		    pop exch neg exch translate pop 180 rotate
		    ppr 3 get ppr 1 get neg sub neg 0 translate
		}if
		yflip xflip not and {
		    ppr 1 get neg ppr 0 get neg translate
		}if
	    }
	    {
		noflips {
		    translate pop pop 270 rotate 1 -1 scale
		}if
		xflip yflip and {
		    translate pop pop 90 rotate 1 -1 scale
		    ppr 3 get ppr 1 get neg sub neg ppr 2 get
		    ppr 0 get neg sub neg translate
		}if
		xflip yflip not and {
		    translate pop pop 90 rotate ppr 3 get
		    ppr 1 get neg sub neg 0 translate
		}if
		yflip xflip not and {
		    translate pop pop 270 rotate ppr 2 get
		    ppr 0 get neg sub neg 0 exch translate
		}if
	    }ifelse
	    scaleby96 {
		ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy
		translate .96 dup scale neg exch neg exch translate
	    }if
	}def
	/cp {pop pop showpage pm restore}def
        end
      }if
    } if    
  } def


% All software, documentation, and related files in this distribution of
% psfig/tex are Copyright (c) 1987 Trevor J. Darrell
%
% Permission is granted for use and non-profit distribution of psfig/tex 
% providing that this notice be clearly maintained, but the right to
% distribute any portion of psfig/tex for profit or as part of any commercial
% product is specifically reserved for the author.
%
%
% psfigTeX PostScript Prolog
% $Header: tex.ps,v 1.15 88/01/21 23:44:40 van Exp $
%
/psf$TeXscale { 65536 div } def

/DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecap
currentlinejoin currentdash currentgray currentmiterlimit ] cvx def

%  x y bb-llx bb-lly bb-urx bb-ury startFig -
/startTexFig {
	/psf$SavedState save def
	userdict maxlength dict begin
	currentpoint transform

	DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap
		setlinewidth setmatrix

	itransform moveto

	/psf$ury exch psf$TeXscale def
	/psf$urx exch psf$TeXscale def
	/psf$lly exch psf$TeXscale def
	/psf$llx exch psf$TeXscale def
	/psf$y exch psf$TeXscale def
	/psf$x exch psf$TeXscale def
	
	currentpoint /psf$cy exch def /psf$cx exch def

	/psf$sx psf$x psf$urx psf$llx sub div def 	% scaling for x
	/psf$sy psf$y psf$ury psf$lly sub div def	% scaling for y

	psf$sx psf$sy scale			% scale by (sx,sy)

	psf$cx psf$sx div psf$llx sub
	psf$cy psf$sy div psf$ury sub translate
        clear % added by JB Wang
	
	/DefFigCTM matrix currentmatrix def

	/initmatrix {
		DefFigCTM setmatrix
	} def
	/defaultmatrix {
		DefFigCTM exch copy
	} def

	/initgraphics {
		DocumentInitState setmiterlimit setgray setdash 
			setlinejoin setlinecap setlinewidth setmatrix
		DefFigCTM setmatrix
	} def

	/showpage {
		initgraphics
	} def
	/erasepage {
	} def
	/copypage {
		initgraphics
	} def
	@MacSetUp
} def

% llx lly urx ury doclip -	(args in figure coordinates)
/doclip {
	currentpoint 6 2 roll
	newpath 4 copy
	4 2 roll moveto
	6 -1 roll exch lineto
	exch lineto
	exch lineto
	closepath clip
	newpath
	moveto
} def

% - endTexFig -
/endTexFig { end psf$SavedState restore } def


%%%% Additions by LA Carr to reencode Adobe fonts as TeX fonts (almost)
%%%% Based on routine in LaserWriter Cookbook
/ReEncodeForTeX
  { /newfontname exch def
    /basefontname exch def
    /TeXstr 30 string def

    /basefontdict basefontname findfont def
    /newfont basefontdict maxlength dict def
    basefontdict
      { exch dup /FID ne
	  { dup /Encoding eq
	    { exch dup length array copy
	        newfont 3 1 roll put }
	    { exch newfont 3 1 roll put }
	    ifelse
	  }
	{ pop pop }
	ifelse
      } forall

      basefontdict /MathFontName known not
        { 
	  /TeXvec basefontname TeXstr cvs (Courier) search
	    { pop pop pop TeXcourvec }
	    { pop TeXnormalvec }
	  ifelse def
          TeXvec aload pop

          TeXvec length 2 idiv
	    { newfont /Encoding get 3 1 roll put }
	  repeat
	}
      if

      newfontname newfont definefont pop
  } def

/TeXnormalvec
	[ 8#014 /fi 8#015 /fl 8#020 /dotlessi 8#022 /grave 8#023 /acute
	  8#024 /caron 8#025 /breve 8#026 /macron 8#027 /ring 8#030 /cedilla
	  8#031 /germandbls 8#032 /ae 8#033 /oe 8#034 /oslash 8#035 /AE
	  8#036 /OE 8#037 /Oslash 8#042 /quotedblright 8#074 /exclamdown
	  8#076 /questiondown 8#134 /quotedblleft 8#136 /circumflex
	  8#137 /dotaccent 8#173 /endash 8#174 /emdash 8#175 /hungarumlat
	  8#176 /tilde 8#177 /dieresis ] def
/TeXcourvec
	[ 8#016 /exclamdown 8#017 /questiondown 8#020 /dotlessi 8#022 /grave
	  8#023 /acute 8#024 /caron 8#025 /breve 8#026 /macron 8#027 /ring
	  8#030 /cedilla 8#031 /germandbls 8#032 /ae 8#033 /oe 8#034 /oslash
	  8#035 /AE 8#036 /OE 8#037 /Oslash 8#074 /less 8#076 /greater
	  8#134 /backslash 8#136 /circumflex 8#137 /underscore 8#173 /braceleft
	  8#174 /bar 8#175 /braceright 8#177 /dieresis ] def

/TeXPSmakefont {	% defines a routine for generating PS fonts, fudged!
	/TeXsize exch def findfont 
	[ TeXsize 0 0 TeXsize neg 0 0 ] makefont
} def

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -