| 1 |
%% $Id: xy.sty,v 3.10 2011/03/14 20:14:00 krisrose Exp $ |
| 2 |
%% |
| 3 |
%% ``Xy-pic as LaTeX 2.09 style option and LaTeX 2e package''. |
| 4 |
%% Copyright (c) 1993-1996 Kristoffer H. Rose <[email protected]> |
| 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-2011 Kristoffer H. Rose <[email protected]> |
| 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, see http://www.gnu.org/licenses/. |
| 22 |
|
| 23 |
% Load Xy-pic with catcode of @ set as it will be in user text: |
| 24 |
\count255=\the\catcode`\@ {\catcode`\@=11 \xdef\xystycatcode{\the\count255}} |
| 25 |
\makeatletter |
| 26 |
|
| 27 |
% REPAIR bug of the 2e version of AMS-LaTeX where \makeatother is broken... |
| 28 |
\ifx\@ifpackageloaded\undefined \makeatother |
| 29 |
\else \@ifpackageloaded{amstex}{\catcode`\@=\active}{\makeatother}\fi |
| 30 |
|
| 31 |
\input xy |
| 32 |
|
| 33 |
% That is all unless this is called as a LaTeX2e `native mode' package. Is |
| 34 |
% there an official way to check this? Anyway, this seems to work: |
| 35 |
\makeatletter |
| 36 |
\ifx\if@compatibility\undefined \catcode`\@=\xystycatcode \endinput \fi |
| 37 |
|
| 38 |
% Ensure that we are *really* running LaTeX2e...! |
| 39 |
\NeedsTeXFormat{LaTeX2e} |
| 40 |
|
| 41 |
% So we can check for pdfTeX. |
| 42 |
\RequirePackage{ifpdf} |
| 43 |
|
| 44 |
% This file provides the current version of Xy-pic! |
| 45 |
\edef\next{% |
| 46 |
\noexpand\ProvidesPackage{xy}[\xydate\space Xy-pic version \xyversion]}\next |
| 47 |
|
| 48 |
% Recognise some standard LaTeX2e class options (cf. old `LaTeX Companion' p.317): |
| 49 |
\DeclareOption{cmactex}{\xyoption{dvips}} % Thomas Kiffe's CMacTeX uses dvips |
| 50 |
\DeclareOption{dvips}{\xyoption{dvips}\xyoption{ps}} |
| 51 |
\DeclareOption{dvitops}{\xyoption{dvitops}\xyoption{ps}} |
| 52 |
\DeclareOption{emtex}{\xyoption{emtex}} |
| 53 |
\DeclareOption{ln}{\xywarning@{`ln' DVI driver not yet fully supported}} |
| 54 |
\DeclareOption{oztex}{\xyoption{oztex}} |
| 55 |
\DeclareOption{textures}{\xyoption{textures}} |
| 56 |
\DeclareOption{xdvi}{\xyoption{xdvi}} |
| 57 |
|
| 58 |
% Recognise standard aliases for the pdf option. |
| 59 |
\DeclareOption{pdftex}{\xyoption{pdf}} |
| 60 |
\DeclareOption{dvipdfm}{\xyoption{pdf}} |
| 61 |
\DeclareOption{dvipdfmx}{\xyoption{pdf}} |
| 62 |
|
| 63 |
% This is special. |
| 64 |
\DeclareOption{colour}{\xyoption{color}} % :-) |
| 65 |
|
| 66 |
% This (obsolete) cmtip style option should be activated after loading: |
| 67 |
\DeclareOption{cmtip}{\xyoption{cmtip}\UseComputerModernTips} |
| 68 |
|
| 69 |
% Pass the desired tip size if defined |
| 70 |
\DeclareOption{10pt}{\xywithoption{tips}{\def\tipsize@@{10}}} |
| 71 |
\DeclareOption{11pt}{\xywithoption{tips}{\def\tipsize@@{11}}} |
| 72 |
\DeclareOption{12pt}{\xywithoption{tips}{\def\tipsize@@{12}}} |
| 73 |
|
| 74 |
% Other options are just loaded. |
| 75 |
\DeclareOption*{\edef\next{\noexpand\xyoption{\CurrentOption}}\next} |
| 76 |
|
| 77 |
% Reinstall catcode of @... |
| 78 |
\catcode`\@=\xystycatcode |
| 79 |
|
| 80 |
% ...and process the options. |
| 81 |
\ProcessOptions\relax |
| 82 |
|
| 83 |
% Now, if no backend is loaded but we can generate PDF, do. |
| 84 |
\ifpdf\makeatletter |
| 85 |
\ifx\xydriversloaded@@\xydriversloaded@none |
| 86 |
\makeatother\xyoption{pdf}\fi\fi |
| 87 |
|
| 88 |
% That's all. |
| 89 |
\endinput |
| 90 |
|
| 91 |
% $Log: xy.sty,v $ |
| 92 |
% Revision 3.10 2011/03/14 20:14:00 krisrose |
| 93 |
% Preparing for release 3.8.6. |
| 94 |
% |
| 95 |
% Revision 3.9 2010/06/10 18:45:49 krisrose |
| 96 |
% Reference to GPL by URL. |
| 97 |
% |
| 98 |
% Revision 3.8 2010/04/28 07:14:30 krisrose |
| 99 |
% New Xy-pic home page installed. |
| 100 |
% |
| 101 |
% Revision 3.7 2010/04/26 01:45:23 krisrose |
| 102 |
% First proper integration of xypdf into Xy-pic "make dist". |
| 103 |
% |
| 104 |
% Revision 3.6 2010/04/25 21:48:06 krisrose |
| 105 |
% First proper integration of xypdf into Xy-pic "make dist". |
| 106 |
% |
| 107 |
% Revision 3.5 2010/04/20 20:36:43 krisrose |
| 108 |
% Documentation updates. |
| 109 |
% |
| 110 |
% Revision 3.4 2010/04/16 06:06:52 krisrose |
| 111 |
% Preparing for a new release... |
| 112 |
% |
| 113 |
% Revision 3.3 1996/12/19 03:31:56 krisrose |
| 114 |
% Maintenance release |
| 115 |
% |
| 116 |
% Revision 3.1 1995/09/05 20:31:32 kris |
| 117 |
% Releasing! |
| 118 |
% |
| 119 |
% Revision 3.0 1995/07/07 20:14:21 kris |
| 120 |
% Major release w/new User's Guide! |
| 121 |
% |
| 122 |
% Revision 2.13 1995/07/04 15:11:17 kris |
| 123 |
% Ready to release v3? |
| 124 |
% |
| 125 |
% Revision 2.12 1994/10/25 11:34:25 kris |
| 126 |
% Interim release just before v3 [works with AMS-LaTeX 1.2]... |
| 127 |
% |
| 128 |
% Revision 2.9 1994/06/09 14:59:19 kris |
| 129 |
% Release 3beta. |
| 130 |
% |
| 131 |
% Revision 2.8 1994/04/08 04:30:00 kris |
| 132 |
% Second (bug fix) 3alpha release. |
| 133 |
% |
| 134 |
% Revision 2.7 1994/03/08 02:06:01 kris |
| 135 |
% Release 3alpha. |
| 136 |
% |
| 137 |
% New for version 2.7. |