|
1 %% xypdftex.tex from $Id: xypdftex.doc,v $ |
|
2 %% |
|
3 %% Xy-pic ``pdf-TeX'' driver interface option. |
|
4 %% Copyright (c) 1999-1999 Ross Moore <ross@mpce.mq.edu.au> |
|
5 %% |
|
6 %% This file is part of the Xy-pic package for graphs and diagrams in TeX. |
|
7 %% See the companion README and INSTALL files for further information. |
|
8 %% Copyright (c) 1991-1999 Kristoffer H. Rose <krisrose@brics.dk> |
|
9 %% |
|
10 %% The Xy-pic package is free software; you can redistribute it and/or modify |
|
11 %% it under the terms of the GNU General Public License as published by the |
|
12 %% Free Software Foundation; either version 2 of the License, or (at your |
|
13 %% option) any later version. |
|
14 %% |
|
15 %% The Xy-pic package is distributed in the hope that it will be useful, but |
|
16 %% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
|
17 %% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
18 %% for more details. |
|
19 %% |
|
20 %% You should have received a copy of the GNU General Public License along |
|
21 %% with this package; if not, write to the Free Software Foundation, Inc., |
|
22 %% 675 Mass Ave, Cambridge, MA 02139, USA. |
|
23 %% |
|
24 \ifx\xyloaded\undefined \input xy \fi |
|
25 \xyprovide{pdftex}{pdf-TeX driver}{\stripRCS$Revision: 3.8 $}% |
|
26 {Ross Moore}{ross@mpce.mq.edu.au}% |
|
27 {Mathematics Department, Macquarie University, NSW~2109, Australia} |
|
28 \xydef@\pdfTeX@@#1{\dvimessage@{pdf-TeX}{#1}} |
|
29 \newdriver{% |
|
30 \xyaddsupport{color}\pdftexColor@@ |
|
31 \xyaddsupport{crayon}\pdftexCrayon@@ |
|
32 % \xyaddsupport{pdf}\pdftexPDF@@ |
|
33 % \xyaddsupport{rotate}\pdftexRotate@@ |
|
34 \xyaddsupport{line}\pdftexLine@@ |
|
35 % \xyaddsupport{frame}\pdftexFrames@@ |
|
36 % \xyaddsupport{tile}\pdftexTiles@@ |
|
37 \xyaddsupport{cmtip}\relax |
|
38 } |
|
39 %\xydef@\pdfTeXcolor@push#1{\special{pdfcolor push}\special{pdfcolor #1}} |
|
40 \xydef@\pdfTeXcolor@push#1{\edef\pdfsaved@color{\pdfcurrent@color}% |
|
41 \def\pdfcurrent@color{#1}\special{#1}}%%%<<<<<<--- WRONG ! |
|
42 \xydef@\pdfTeXcolor@pop{\let\pdfcurrent@color\pdfsaved@color |
|
43 \expandafter\special\expandafter{\pdfsaved@color}} |
|
44 \xydef@\pdfTeXcolours@{\pdftexPDFtypes@ |
|
45 % \let\xylocalColor@=\xystackcolor@ |
|
46 % \let\xycolor@push=\pdfTeXcolor@push |
|
47 % \let\xycolor@pop=\pdfTeXcolor@pop |
|
48 \def\xycolor@{\xycolor@@}% |
|
49 \expandafter\ifx\csname xypdf-pdfloaded\endcsname\empty\DN@{% |
|
50 \xyinputorelse@{xypdf-c}{\xydrivernoload@{pdf-c}}% |
|
51 \if@pdf@known\installPDFcolor@ }\else\DN@{}\fi \next@ |
|
52 \ifx\xycolor@@\xyNoColor@ \let\xycolor@@=\xycolor@raw@@\fi |
|
53 \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\pdftexCrayon@@{}}% |
|
54 \else\let\next@=\xystandardcolors@ \fi \next@ |
|
55 \let\xycolorwarning@=\relax \pdfTeX@@{color}% |
|
56 \let\pdftexColor@@=\relax |
|
57 \let\UnloadColor@@=\NopdfTeXcolor@ |
|
58 } |
|
59 \xydef@\pdftexColor@@{\pdfTeXcolours@} |
|
60 \xydef@\NopdfTeXcolor@{% |
|
61 \let\xylocalColor@=\xyNoColor@@ |
|
62 \let\xycolor@=\xyNoColor@ |
|
63 \let\xycolorwarning@=\xycolorwarning@@ |
|
64 \let\pdftexColor@@=\pdfTeXcolours@ |
|
65 \let\UnloadColor@@=\UnloadColor@ |
|
66 } |
|
67 \xydef@\pdftexCrayon@@{\pdftexColor@@\pdftexCrayon@} |
|
68 \xydef@\pdftexCrayon@{\installCrayolaColors@}% |
|
69 \xydef@\pdftexPDF@@{\if@pdf@known\pdftexPDF@} |
|
70 \xydef@\pdftexPDFunload@{\if@pdf@known\UnloadPDF@ |
|
71 \let\UnloadPDF@@=\UnloadPDF@ |
|
72 \let\pdftexPDF@@=\pdftexPDF@ } |
|
73 \xydef@\pdftexPDFtypes@{% |
|
74 \xyinputorelse@{xypdfpdf}{\xydrivernoload@{pdfpdf}}% |
|
75 \ifx\PDFspecial@@\pdfTeXspecial@\else |
|
76 \let\PDFspecial@@=\pdfTeXspecial@ |
|
77 \let\PDFmacro@@=\pdfTeXmacro@ |
|
78 \let\PDFdict@@=\pdfTeXdict@ |
|
79 \let\PDFraw@@=\pdfTeXraw@ |
|
80 \let\PDFinclude@@=\pdfTeXinclude@ |
|
81 \let\PDFspecialdict@@=\pdfTeXspecialDict@ |
|
82 \let\xyPDFobeylines@@=\obeypdfTeXlines@ |
|
83 \pdfTeX@@{PDF}% |
|
84 \fi \pdftexCurrpt@ } |
|
85 \xydef@\pdfTeXspecial@#1{\if@pdf@known\firstPDF@@\pdfobj{#1}\pdflastobj} |
|
86 \xydef@\pdfTeXmacro@#1{\pdfobj{#1}} |
|
87 \xydef@\pdfTeXdict@#1{\pdfnames{#1}} |
|
88 \xydef@\pdfTeXspecialDict@#1{\pdfnames{#1}} |
|
89 \xydef@\pdfTeXinclude@#1{\if@pdf@known\firstPDF@@\special{prePDFfile #1}} |
|
90 \xydef@\pdfTeXraw@#1{\if@pdf@known\firstPDF@@\pdfliteral{#1}}% |
|
91 {\catcode`\^^M=\active% |
|
92 \gdef\next{\catcode`\^^M=\active \let^^M=\par% |
|
93 \let\PDFspecial@@=\pdfTeXdict@ \obeyspaces}} |
|
94 \xylet@\obeypdfTeXlines@=\next |
|
95 \xydef@\pdftexCurrpt@{\let\xyPDFcurrpt@@=\pdftexCurrpt@@}% |
|
96 \xydef@\pdftexCurrpt@@{\PDFspecial@@{xyi}\PDFraw@@{userdict begin xyx end}}%%%%%<<<<<--- here |
|
97 \xydef@\pdftexPDF@{\pdftexPDFtypes@ |
|
98 \let\pdftexPDF@@=\relax |
|
99 \let\UnloadPDF@@=\pdftexPDFunload@ |
|
100 \let\installxypdf@@=\relax \if@pdf@known\installxypdf@ } |
|
101 \xydef@\pdftexRotate@@{\pdftexRotate@} |
|
102 \xydef@\pdftexRotate@{\pdftexPDFtypes@ |
|
103 \expandafter\ifx\csname xypdf-pdfloaded\endcsname\empty\DN@{% |
|
104 \xyinputorelse@{xypdf-r}{\xydrivernoload@{pdf-r}}% |
|
105 \xyRotScale@@ \if@pdf@known\installPDFrotscale@ }% |
|
106 \else\DN@{\xydriverfail@{rotations are}\if@pdf@known\UnloadRotate@\relax}\fi |
|
107 \next@} |
|
108 \xydef@\pdftexLine@@{\pdftexLine@} |
|
109 \xydef@\pdftexLine@{\pdftexPDFtypes@ |
|
110 \expandafter\ifx\csname xypdf-pdfloaded\endcsname\empty\DN@{% |
|
111 \xyinputorelse@{xypdf-l}{\xydrivernoload@{pdf-l}}% |
|
112 \if@pdf@known\installPDFline@ }% |
|
113 \else\DN@{\xydriverfail@{line-widths are}\if@pdf@known\UnloadLine@\relax}\fi |
|
114 \next@ } |
|
115 \xydef@\pdftexFrames@@{\pdftexFrames@} |
|
116 \xydef@\pdftexFrames@{\pdftexPDFtypes@ |
|
117 \expandafter\ifx\csname xypdf-pdfloaded\endcsname\empty\DN@{% |
|
118 \xyinputorelse@{xypdf-f}{\xydrivernoload@{pdf-f}}% |
|
119 \if@pdf@known\installPDFframes@ }% |
|
120 \else\DN@{\xydriverfail@{frames are}\if@pdf@known\UnloadPDFframes@\relax}\fi |
|
121 \next@ } |
|
122 \xydef@\pdftexTiles@@{\pdftexTiles@} |
|
123 \xydef@\pdftexTiles@{\pdftexPDFtypes@ |
|
124 \expandafter\ifx\csname xypdf-pdfloaded\endcsname\empty\DN@{% |
|
125 \xyinputorelse@{xypdf-t}{\xydrivernoload@{pdf-t}}% |
|
126 \if@pdf@known\installPDFpatterns@ \xystandardpatterns@}% |
|
127 \else\DN@{\xydriverfail@{Patterns are}\if@pdf@known\UnloadPDFpatterns@\relax}\fi |
|
128 \next@ } |
|
129 \xydef@\if@pdf@known#1{\ifx\undefined#1\else\expandafter#1\fi} |
|
130 \xyendinput |
|
131 |
|
132 |