summaryrefslogtreecommitdiff
path: root/macros/generic/diagrams/xypic/texinputs/xy.sty
blob: 29218a0a269240ab08a6e6b1124a349655859b25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
%% $Id: xy.sty,v 3.10 2011/03/14 20:14:00 krisrose Exp $
%%
%% ``Xy-pic as LaTeX 2.09 style option and LaTeX 2e package''.
%% Copyright (c) 1993-1996      Kristoffer H. Rose      <krisrose@tug.org>
%%
%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
%% See the companion README and INSTALL files for further information.
%% Copyright (c) 1991-2011      Kristoffer H. Rose      <krisrose@tug.org>
%%
%% The Xy-pic package is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published by the
%% Free Software Foundation; either version 2 of the License, or (at your
%% option) any later version.
%%
%% The Xy-pic package is distributed in the hope that it will be useful, but
%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
%% or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
%% for more details.
%%
%% You should have received a copy of the GNU General Public License along
%% with this package; if not, see http://www.gnu.org/licenses/.

% Load Xy-pic with catcode of @ set as it will be in user text:
\count255=\the\catcode`\@ {\catcode`\@=11 \xdef\xystycatcode{\the\count255}}
\makeatletter

% REPAIR bug of the 2e version of AMS-LaTeX where \makeatother is broken...
\ifx\@ifpackageloaded\undefined \makeatother
\else \@ifpackageloaded{amstex}{\catcode`\@=\active}{\makeatother}\fi

\input xy

% That is all unless this is called as a LaTeX2e `native mode' package.  Is
% there an official way to check this?  Anyway, this seems to work:
\makeatletter
\ifx\if@compatibility\undefined \catcode`\@=\xystycatcode \endinput \fi

% Ensure that we are *really* running LaTeX2e...!
\NeedsTeXFormat{LaTeX2e}

% So we can check for pdfTeX.
\RequirePackage{ifpdf}

% This file provides the current version of Xy-pic!
\edef\next{%
 \noexpand\ProvidesPackage{xy}[\xydate\space Xy-pic version \xyversion]}\next

% Recognise some standard LaTeX2e class options (cf. old `LaTeX Companion' p.317):
\DeclareOption{cmactex}{\xyoption{dvips}} % Thomas Kiffe's CMacTeX uses dvips
\DeclareOption{dvips}{\xyoption{dvips}\xyoption{ps}}
\DeclareOption{dvitops}{\xyoption{dvitops}\xyoption{ps}}
\DeclareOption{emtex}{\xyoption{emtex}}
\DeclareOption{ln}{\xywarning@{`ln' DVI driver not yet fully supported}}
\DeclareOption{oztex}{\xyoption{oztex}}
\DeclareOption{textures}{\xyoption{textures}}
\DeclareOption{xdvi}{\xyoption{xdvi}}

% Recognise standard aliases for the pdf option.
\DeclareOption{pdftex}{\xyoption{pdf}}
\DeclareOption{dvipdfm}{\xyoption{pdf}}
\DeclareOption{dvipdfmx}{\xyoption{pdf}}

% This is special.
\DeclareOption{colour}{\xyoption{color}} % :-)

% This (obsolete) cmtip style option should be activated after loading:
\DeclareOption{cmtip}{\xyoption{cmtip}\UseComputerModernTips}

% Pass the desired tip size if defined
\DeclareOption{10pt}{\xywithoption{tips}{\def\tipsize@@{10}}}
\DeclareOption{11pt}{\xywithoption{tips}{\def\tipsize@@{11}}}
\DeclareOption{12pt}{\xywithoption{tips}{\def\tipsize@@{12}}}

% Other options are just loaded.
\DeclareOption*{\edef\next{\noexpand\xyoption{\CurrentOption}}\next}

% Reinstall catcode of @...
\catcode`\@=\xystycatcode

% ...and process the options.
\ProcessOptions\relax

% Now, if no backend is loaded but we can generate PDF, do.
\ifpdf\makeatletter
 \ifx\xydriversloaded@@\xydriversloaded@none
  \makeatother\xyoption{pdf}\fi\fi

% That's all.
\endinput

% $Log: xy.sty,v $
% Revision 3.10  2011/03/14 20:14:00  krisrose
% Preparing for release 3.8.6.
%
% Revision 3.9  2010/06/10 18:45:49  krisrose
% Reference to GPL by URL.
%
% Revision 3.8  2010/04/28 07:14:30  krisrose
% New Xy-pic home page installed.
%
% Revision 3.7  2010/04/26 01:45:23  krisrose
% First proper integration of xypdf into Xy-pic "make dist".
%
% Revision 3.6  2010/04/25 21:48:06  krisrose
% First proper integration of xypdf into Xy-pic "make dist".
%
% Revision 3.5  2010/04/20 20:36:43  krisrose
% Documentation updates.
%
% Revision 3.4  2010/04/16 06:06:52  krisrose
% Preparing for a new release...
%
% Revision 3.3  1996/12/19 03:31:56  krisrose
% Maintenance release
%
% Revision 3.1  1995/09/05  20:31:32  kris
% Releasing!
%
% Revision 3.0  1995/07/07  20:14:21  kris
% Major release w/new User's Guide!
%
% Revision 2.13  1995/07/04  15:11:17  kris
% Ready to release v3?
%
% Revision 2.12  1994/10/25  11:34:25  kris
% Interim release just before v3 [works with AMS-LaTeX 1.2]...
%
% Revision 2.9  1994/06/09  14:59:19  kris
% Release 3beta.
%
% Revision 2.8  1994/04/08  04:30:00  kris
% Second (bug fix) 3alpha release.
%
% Revision 2.7  1994/03/08  02:06:01  kris
% Release 3alpha.
%
% New for version 2.7.