%% $Id: latin1.sty,v 3.4 1997/05/18 03:04:44 krisrose Exp $
%%
%% TeX 3 support for ISO 8859-1 (Latin 1) characters.
%% Copyright (c) 1990-1997	Kristoffer H. Rose	<krisrose@brics.dk>
%%
%% This file is  not part of the Xy-pic package for graphs and diagrams in
%% TeX but is distributed with it on the same conditions.
%%
%% 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, write to the Free Software Foundation, Inc.,
%% 675 Mass Ave, Cambridge, MA 02139, USA.

% NOTE: THIS FILE CONTAINS NON-ASCII 8BIT CHARACTERS!

% USAGE: This should be input using the command
%
%	\input latin1
%
% This will then make those ISO 8859-1 (Latin 1) characters that are present
% in plain TeX available, and for AMS-TeX users, those available there as
% well (these are marked %%AMS below).

% First we pull the standard trick of dropping out if already loaded or if
% this is not TeX 3...
%
\ifx\inputlineno\undefined
 \errhelp{You may continue but some things will not typeset right.}%
 \errmessage{latin1.sty requires TeX version 3---please update}%
 \endinput\fi
\expandafter\ifx\csname latin1.tex\endcsname\relax
\else \message{[already loaded]}\endinput \fi
\expandafter\edef\csname latin1.tex\endcsname{%
   \catcode`\noexpand\@\the\catcode`\@\space
   \expandafter\let\csname latin1.tex\endcsname=\noexpand\empty}
\catcode`\@=11
%
% Next we define some shorthands that users might like as well.
%
\def\forcemathdef#1#2{\gdef#1{\relax\ifmmode#2\else{$#2$}\fi}}
\def\forcemathchardef#1="#2#3#4#5{\forcemathdef#1{\mathchar"#2#3#4#5 }}
%
\def\mathtextdef#1#2#3{%
 \gdef#1{\relax\ifmmode\def\next{#2}\else\def\next{#3}\fi\next}}
%
\def\missingchardef#1{\gdef#1{\space}}
%
%	Code for slashed fractions [from TeXcercise 11.6]:
%
\def\slashedfrac#1#2{\hbox{\kern.1em %
 \raise.5ex\hbox{\the\scriptfont0 #1}\kern-.11em %
 /\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}}
%
%	Assumes that columns 3-8 are already set up as ASCII.
%
%	ISO 8859-1 column 10
%
\catcode`\ =\active \let =~
\catcode`\Ą=\active \chardefĄ='074
\catcode`\˘=\active
 \forcemathdef˘{\mathord{\mathpalette\c@ncel{\fam=0\mkern2mu c}}}
\catcode`\Ł=\active \forcemathchardefŁ="0424
\catcode`\¤=\active \missingchardef¤		%%Missing: currency
\catcode`\Ľ=\active \defĽ{\yen}			%%AMS (msam)
\catcode`\Ś=\active \missingchardefŚ		%%Missing: brokenbar
\catcode`\§=\active \def§{\S}
\catcode`\¨=\active \mathtextdef¨\ddot\"
\catcode`\Š=\active \defŠ{\copyright}
\def\copyright{{\ooalign{\hfil\raise.07ex\hbox{c}\hfil\crcr\mathhexbox20D}}}
\catcode`\Ş=\active \forcemathdefŞ{^{\textrm{\b a}}}
\catcode`\Ť=\active \missingchardefŤ		%%Missing: guillemotleft
\catcode`\Ź=\active \forcemathchardefŹ="023A
\catcode`\­=\active \missingchardef­
\catcode`\Ž=\active \defŽ{\circledR}		%%AMS (msam)
\catcode`\Ż=\active \mathtextdefŻ\bar\B		%%AMS
%
%	ISO 8859-1 column 11
%
\catcode`\°=\active \forcemathdef°{^\circ}
\catcode`\ą=\active \forcemathchardefą="2206
\catcode`\˛=\active \forcemathdef˛{^2}
\catcode`\ł=\active \forcemathdefł{^3}
\catcode`\´=\active \let´=\'
\catcode`\ľ=\active \forcemathchardefľ="0116
\catcode`\ś=\active \defś{\P}
\catcode`\ˇ=\active \forcemathchardefˇ="2201
\catcode`\¸=\active \let¸=\c
\catcode`\š=\active \forcemathdefš{^1}
\catcode`\ş=\active \forcemathdefş{^{\textrm{\b o}}}
\catcode`\ť=\active \missingchardefť		%%Missing: guillemotright
\catcode`\ź=\active \defź{\slashedfrac14}
\catcode`\˝=\active \def˝{\slashedfrac12}
\catcode`\ž=\active \defž{\slashedfrac34}
\catcode`\ż=\active \chardefż='076
%
%	ISO 8859-1 columns 12-15, by letter:
%
\catcode`\ŕ=\active \defŕ{\`a}
\catcode`\Ŕ=\active \defŔ{\`A}
\ifx\inputlineno\undefined\else\uccode`\ŕ=`\Ŕ \lccode`\Ŕ=`\ŕ \fi
\catcode`\á=\active \defá{\'a}
\catcode`\Á=\active \defÁ{\'A}
\ifx\inputlineno\undefined\else\uccode`\á=`\Á \lccode`\Á=`\á \fi
\catcode`\â=\active \defâ{\^a}
\catcode`\Â=\active \defÂ{\^A}
\ifx\inputlineno\undefined\else\uccode`\â=`\Â \lccode`\Â=`\â \fi
\catcode`\ă=\active \defă{\~a}
\catcode`\Ă=\active \defĂ{\~A}
\ifx\inputlineno\undefined\else\uccode`\ă=`\Ă \lccode`\Ă=`\ă \fi
\catcode`\ä=\active \defä{\"a}
\catcode`\Ä=\active \defÄ{\"A}
\ifx\inputlineno\undefined\else\uccode`\ä=`\Ä \lccode`\Ä=`\ä \fi
\catcode`\ĺ=\active \letĺ=\aa
\catcode`\Ĺ=\active \letĹ=\AA
\ifx\inputlineno\undefined\else\uccode`\ĺ=`\Ĺ \lccode`\Ĺ=`\ĺ \fi
%
\catcode`\ć=\active \chardefć="1A
\catcode`\Ć=\active \chardefĆ="1D
\ifx\inputlineno\undefined\else\uccode`\ć=`\Ć \lccode`\Ć=`\ć \fi
\uccode"1A="1D \lccode"1D="1A % Scandinavian...
%
\catcode`\ç=\active \defç{\c c}
\catcode`\Ç=\active \defÇ{\c C}
\ifx\inputlineno\undefined\else\uccode`\ç=`\Ç \lccode`\Ç=`\ç \fi
%
\catcode`\č=\active \defč{\`e}
\catcode`\Č=\active \defČ{\`E}
\ifx\inputlineno\undefined\else\uccode`\č=`\Č \lccode`\Č=`\č \fi
\catcode`\é=\active \defé{\'e}
\catcode`\É=\active \defÉ{\'E}
\ifx\inputlineno\undefined\else\uccode`\é=`\É \lccode`\É=`\é \fi
\catcode`\ę=\active \defę{\^e}
\catcode`\Ę=\active \defĘ{\^E}
\ifx\inputlineno\undefined\else\uccode`\ę=`\Ę \lccode`\Ę=`\ę \fi
\catcode`\ë=\active \defë{\"e}
\catcode`\Ë=\active \defË{\"E}
\ifx\inputlineno\undefined\else\uccode`\ë=`\Ë \lccode`\Ë=`\ë \fi
%
\catcode`\ě=\active \defě{\`\i}
\catcode`\Ě=\active \defĚ{\`I}
\ifx\inputlineno\undefined\else\uccode`\ě=`\Ě \lccode`\Ě=`\ě \fi
\catcode`\í=\active \defí{\'\i}
\catcode`\Í=\active \defÍ{\'I}
\ifx\inputlineno\undefined\else\uccode`\í=`\Í \lccode`\Í=`\í \fi
\catcode`\î=\active \defî{\^\i}
\catcode`\Î=\active \defÎ{\^I}
\ifx\inputlineno\undefined\else\uccode`\î=`\Î \lccode`\Î=`\î \fi
\catcode`\ď=\active \defď{\"\i}
\catcode`\Ď=\active \defĎ{\"I}
\ifx\inputlineno\undefined\else\uccode`\ď=`\Ď \lccode`\Ď=`\ď \fi
%
\catcode`\Đ=\active \missingchardefĐ		%%Missing: Eth
\catcode`\đ=\active \missingchardefđ		%%Missing: eth
\ifx\inputlineno\undefined\else\uccode`\Đ=`\đ \lccode`\đ=`\Đ \fi
%
\catcode`\ń=\active \defń{\~n}
\catcode`\Ń=\active \defŃ{\~N}
\ifx\inputlineno\undefined\else\uccode`\ń=`\Ń \lccode`\Ń=`\ń \fi
%
\catcode`\ň=\active \defň{\`o}
\catcode`\Ň=\active \defŇ{\`O}
\ifx\inputlineno\undefined\else\uccode`\ň=`\Ň \lccode`\Ň=`\ň \fi
\catcode`\ó=\active \defó{\'o}
\catcode`\Ó=\active \defÓ{\'O}
\ifx\inputlineno\undefined\else\uccode`\ó=`\Ó \lccode`\Ó=`\ó \fi
\catcode`\ô=\active \defô{\^o}
\catcode`\Ô=\active \defÔ{\^O}
\ifx\inputlineno\undefined\else\uccode`\ô=`\Ô \lccode`\Ô=`\ô \fi
\catcode`\ő=\active \defő{\^o}
\catcode`\Ő=\active \defŐ{\^O}
\ifx\inputlineno\undefined\else\uccode`\ő=`\Ő \lccode`\Ő=`\ő \fi
\catcode`\ö=\active \defö{\"o}
\catcode`\Ö=\active \defÖ{\"O}
\ifx\inputlineno\undefined\else\uccode`\ö=`\Ö \lccode`\Ö=`\ö \fi
\catcode`\ř=\active \chardefř="1C
\catcode`\Ř=\active \chardefŘ="1F
\ifx\inputlineno\undefined\else\uccode`\ř=`\Ř \lccode`\Ř=`\ř \fi
\uccode"1C="1F \lccode"1F="1C % I'm Danish!
%
\catcode`\ů=\active \defů{\`u}
\catcode`\Ů=\active \defŮ{\`U}
\ifx\inputlineno\undefined\else\uccode`\ů=`\Ů \lccode`\Ů=`\ů \fi
\catcode`\ú=\active \defú{\'u}
\catcode`\Ú=\active \defÚ{\'U}
\ifx\inputlineno\undefined\else\uccode`\ú=`\Ú \lccode`\Ú=`\ú \fi
\catcode`\ű=\active \defű{\^u}
\catcode`\Ű=\active \defŰ{\^U}
\ifx\inputlineno\undefined\else\uccode`\ű=`\Ű \lccode`\Ű=`\ű \fi
\catcode`\ü=\active \defü{\"u}
\catcode`\Ü=\active \defÜ{\"U}
\ifx\inputlineno\undefined\else\uccode`\ü=`\Ü \lccode`\Ü=`\ü \fi
%
\catcode`\Ý=\active \defÝ{\'Y}
\catcode`\ý=\active \defý{\'y}
\ifx\inputlineno\undefined\else\uccode`\Ý=`\ý \lccode`\ý=`\Ý \fi
\catcode`\˙=\active \def˙{\"y}
%
\catcode`\Ţ=\active \missingchardefŢ		%%Missing: Thorn
\catcode`\ţ=\active \missingchardefţ		%%Missing: thorn
\ifx\inputlineno\undefined\else\uccode`\ţ=`\Ţ \lccode`\Ţ=`\ţ \fi
%
\catcode`\ß=\active \letß=\ss
%
%	ISO 8859-1 columns 12-15, symbols:
%
\catcode`\×=\active \forcemathchardef×="2202
\catcode`\÷=\active \forcemathchardef÷="2204
%
\csname latin1.tex\endcsname

% $Log: latin1.sty,v $
% Revision 3.4  1997/05/18 03:04:44  krisrose
% Package, now...
%
% 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.8  1994/11/07  04:40:31  kris
% Abandoned.
%
% Revision 2.7  1994/03/08  02:06:01  kris
% Release 3alpha.
%
% New for Xy-pic 2.7 based on latin1.doc of the XPPT distribution.
