% \iffalse meta-comment
%
% Copyright (C) 1989--1993 by Frank Mittelbach, Rainer Schoepf.
% All rights reserved.
% 
% This file is part of the NFSS2 (New Font Selection Scheme) package.
% 
%  This 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.
% 
% 
% IMPORTANT NOTICE:
% 
% For error reports in case of UNCHANGED versions see readme files.
% 
% Please do not request updates from us directly.  Distribution is
% done through Mail-Servers and TeX organizations.
% 
% You are not allowed to change this file.  You may however copy
% this file to a file with a different name and then change the copy
% if you obey the restrictions on file changes described in
% readme.mz.
% 
% You are allowed to distribute this file under the condition that
% it is distributed together with all files mentioned in readme.mz8.
% If you receive only some of these files from someone, complain!
% 
% You are NOT ALLOWED to distribute this file alone.  You are NOT
% ALLOWED to take money for the distribution or use of either this
% file or a changed version, except for a nominal charge for copying
% etc.
% \fi
\def\filename{nfeuler}
\def\fileversion{v2.0c}
\def\filedate{93/05/13}
\def\docdate {93/05/13}

%\iffalse
%
%% File `nfeuler.dtx'.
%% Copyright (C) 1992 Frank Jensen, all rights reserved.
%% Copyright (C) 1993 Frank Jensen and Mittelbach,
%%                    all rights reserved.
%
%\fi
% \CheckSum{306}
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
% \title{The {\tt nfeuler} style option for NFSS2}
% \author{Frank Jensen\thanks{Updates by
% Frank Mittelbach}}
%
% \maketitle
%
% \MakeShortVerb\|
%
% \section{Introduction}
%
% This style option sets things up for using the AMS Euler family of
% fonts for math in \LaTeX\ documents.  The AMS Euler family was
% designed by Hermann Zapf, commissioned by the American Mathematical
% Society.
%
% This style option is based on Knuth's macros for the book ``Concrete
% Mathematics''~\cite{concrete}.  Knuth's macros can be found through
% anonymous ftp to {\tt labrea.stanford.edu}: look for the file {\tt
% gkpmac.tex} on directory {\tt pub/tex/local/lib}.  The Euler fonts can
% be found through anonymous ftp to {\tt e-math.ams.org}: look on
% directory {\tt ams/amsfonts}.
%
% This style file defines two new math alphabet identifiers,
% \verb+\scr+ (Euler Script) and \verb+\frak+ (Euler Fraktur).  The
% original meaning of \verb+\mathcal+ is preserved, but the user can
% convert all calligraphic letters to Euler Script by giving the
% following command in the preamble:
% $$\hbox{\verb+\renewcommand{\mathcal}{\scr}+}
% $$
%
%
% \StopEventually{
% \begin{thebibliography}{1}
%    \bibitem{concrete}  {\sc R. L. Graham, D. E. Knuth, and O.
%    Patashnik}. {\it Concrete Mathematics}, Addison-Wesley, 1989.
%    \bibitem{concrete-tug} {\sc D. E. Knuth}. Typesetting Concrete
%    Mathematics.  {\sl TUGboat\/} 10(1):31--36, 1989.
% \end{thebibliography}
% }
%
% \section{The Implementation}
%
% First, we announce the style option.
%    \begin{macrocode}
%<*style>
\typeout{Style option `\filename' \fileversion\space <\filedate>
         (FJ,FMi)}
%    \end{macrocode}
%
% This style option requires the NFSS2.
%    \begin{macrocode}
\@ifundefined{DeclareFontShape}
     {\@ifundefined{selectfont}
        {\@latexerr{The `nfeuler' style option can only be used
                    with the new^^Jfont selection scheme}\@eha}
        {\@latexerr{The `nfeuler' style option can only be used
                    with the new^^Jfont selection scheme *release 2*}
                   {Your format contains NFSS release 1, but this style
                    option was^^Jdeveloped for release 2.}
        }
      \endinput}
     {}
%    \end{macrocode}
%
% \section{Font and other definitions}
%
% The AMS Euler family consists of: Euler Roman (medium and bold),
% Euler Fraktur (medium and bold), Euler Script (medium and bold), and
% Euler Extension. The |.fd| files for them are defined in the
% |amsfonts.fdd| file.
%
% The Euler Roman fonts replace the CM Math Italic fonts; this is math
% symbol font `letters':
%    \begin{macrocode}
\DeclareSymbolFont{letters}{U}{eur}{m}{n}
\SetSymbolFont{letters}{bold}{U}{eur}{b}{n}
%    \end{macrocode}
%
% In math mode, digits should come from the Euler Roman fonts. We make
% them type |\mathalpha| which means that they can vary with math
% alphabets.
%    \begin{macrocode}
\DeclareMathSymbol{0}{\mathalpha}{letters}{"30}
\DeclareMathSymbol{1}{\mathalpha}{letters}{"31}
\DeclareMathSymbol{2}{\mathalpha}{letters}{"32}
\DeclareMathSymbol{3}{\mathalpha}{letters}{"33}
\DeclareMathSymbol{4}{\mathalpha}{letters}{"34}
\DeclareMathSymbol{5}{\mathalpha}{letters}{"35}
\DeclareMathSymbol{6}{\mathalpha}{letters}{"36}
\DeclareMathSymbol{7}{\mathalpha}{letters}{"37}
\DeclareMathSymbol{8}{\mathalpha}{letters}{"38}
\DeclareMathSymbol{9}{\mathalpha}{letters}{"39}
%    \end{macrocode}
% Same for uppercase greek letters:
%    \begin{macrocode}
\DeclareMathSymbol{\Gamma}  {\mathord}{letters}{"00}
\DeclareMathSymbol{\Delta}  {\mathord}{letters}{"01}
\DeclareMathSymbol{\Theta}  {\mathord}{letters}{"02}
\DeclareMathSymbol{\Lambda} {\mathord}{letters}{"03}
\DeclareMathSymbol{\Xi}     {\mathord}{letters}{"04}
\DeclareMathSymbol{\Pi}     {\mathord}{letters}{"05}
\DeclareMathSymbol{\Sigma}  {\mathord}{letters}{"06}
\DeclareMathSymbol{\Upsilon}{\mathord}{letters}{"07}
\DeclareMathSymbol{\Phi}    {\mathord}{letters}{"08}
\DeclareMathSymbol{\Psi}    {\mathord}{letters}{"09}
\DeclareMathSymbol{\Omega}  {\mathord}{letters}{"0A}
%    \end{macrocode}
% Euler doesn't have the special variants of \verb+\sigma+ and 
% \verb+\rho+:
%    \begin{macrocode}
\let\varsigma=\sigma
\let\varrho=\rho
%    \end{macrocode}
%
% \subsection{Euler Fraktur}
%
% \begin{macro}{\frak}
% These fonts get their own math symbol font and alphabet:
%    \begin{macrocode}
\DeclareSymbolFont{eulerfrak}{U}{euf}{m}{n}
\SetSymbolFont{eulerfrak}{bold}{U}{euf}{b}{n}
\DeclareSymbolFontAlphabet{\euler@fraktur}{eulerfrak}
%    \end{macrocode}
% \end{macro}
% The following characters come from this math symbol font:
%    \begin{macrocode}
\DeclareMathSymbol{-}{\mathbin}{eulerfrak}{"2D}
\DeclareMathSymbol{!}{\mathord}{eulerfrak}{"21}
\DeclareMathSymbol{(}{\mathopen}{eulerfrak}{"28} 
\DeclareMathSymbol{)}{\mathclose}{eulerfrak}{"29} 
\DeclareMathSymbol{[}{\mathopen}{eulerfrak}{"5B}
\DeclareMathSymbol{]}{\mathclose}{eulerfrak}{"5D}
\DeclareMathSymbol{=}{\mathrel}{eulerfrak}{"3D}

\DeclareMathDelimiter{(}{eulerfrak}{"28}{largesymbols}{"00}
\DeclareMathDelimiter{)}{eulerfrak}{"29}{largesymbols}{"01}
\DeclareMathDelimiter{[}{eulerfrak}{"5B}{largesymbols}{"02}
\DeclareMathDelimiter{]}{eulerfrak}{"5D}{largesymbols}{"03}
%    \end{macrocode}
%
% \subsection{Euler Script}
%
% \begin{macro}{\scr}
% These fonts also get their own math group:
%    \begin{macrocode}
\DeclareSymbolFont{eulerscript}{U}{eus}{m}{n}
\SetSymbolFont{eulerscript}{bold}{U}{eus}{b}{n}
\DeclareSymbolFontAlphabet{\scr}{eulerscript}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Euler Extension}
%
% We allocate a new math group for this font:
%    \begin{macrocode}
\DeclareSymbolFont{eulerextension}{U}{euex}{m}{n}
%    \end{macrocode}
% This font contains some alternative versions of some Computer Modern
% symbols.
%    \begin{macrocode}
\DeclareMathSymbol{\intop} {\mathop}{eulerextension}{"52}
\DeclareMathSymbol{\ointop}{\mathop}{eulerextension}{"48}
\DeclareMathSymbol{\coprod}{\mathop}{eulerextension}{"60}
\DeclareMathSymbol{\prod}  {\mathop}{eulerextension}{"51}
\DeclareMathSymbol{\sum}   {\mathop}{eulerextension}{"50}
\DeclareMathSymbol{\braceld}{\mathord}{eulerextension}{"7A} 
\DeclareMathSymbol{\bracerd}{\mathord}{eulerextension}{"7B}
\DeclareMathSymbol{\bracelu}{\mathord}{eulerextension}{"7C} 
\DeclareMathSymbol{\braceru}{\mathord}{eulerextension}{"7D}
\DeclareMathSymbol{\infty}  {\mathord}{eulerextension}{"31}

\DeclareMathSymbol{\nearrow}{\mathrel}{eulerextension}{"25}
\DeclareMathSymbol{\searrow}{\mathrel}{eulerextension}{"26}
\DeclareMathSymbol{\nwarrow}{\mathrel}{eulerextension}{"2D}
\DeclareMathSymbol{\swarrow}{\mathrel}{eulerextension}{"2E}
\DeclareMathSymbol{\Leftrightarrow}{\mathrel}{eulerextension}{"2C}
\DeclareMathSymbol{\Leftarrow}{\mathrel}{eulerextension}{"28}
\DeclareMathSymbol{\Rightarrow}{\mathrel}{eulerextension}{"29}
\DeclareMathSymbol{\leftrightarrow}{\mathrel}{eulerextension}{"24}
\DeclareMathSymbol{\leftarrow}{\mathrel}{eulerextension}{"20} 
\let\gets=\leftarrow
\DeclareMathSymbol{\rightarrow}{\mathrel}{eulerextension}{"21} 
\let\to=\rightarrow

\DeclareMathDelimiter\uparrow{\mathrel}    
                        {eulerextension}{"22}{largesymbols}{"78}
\DeclareMathDelimiter\downarrow{\mathrel}  
                        {eulerextension}{"23}{largesymbols}{"79}
\DeclareMathDelimiter\updownarrow{\mathrel}
                        {eulerextension}{"6C}{largesymbols}{"3F}
\DeclareMathDelimiter\Uparrow{\mathrel}    
                        {eulerextension}{"2A}{largesymbols}{"7E}
\DeclareMathDelimiter\Downarrow{\mathrel} 
                        {eulerextension}{"2B}{largesymbols}{"7F}
\DeclareMathDelimiter\Updownarrow{\mathrel}
                        {eulerextension}{"6D}{largesymbols}{"77}

\DeclareMathSymbol{\leftharpoonup}   {\mathrel}{eulerextension}{"18}
\DeclareMathSymbol{\leftharpoondown} {\mathrel}{eulerextension}{"19}
\DeclareMathSymbol{\rightharpoonup}  {\mathrel}{eulerextension}{"1A}
\DeclareMathSymbol{\rightharpoondown}{\mathrel}{eulerextension}{"1B}
%    \end{macrocode}
%
% \section{More math}
%
% Here are some more characters that should be taken from the Euler
% Script and Extension fonts:
%    \begin{macrocode}
\DeclareMathSymbol{\aleph}{\mathord}{eulerscript}{"40}
%\DeclareMathSymbol{\leq}{\mathrel}{eulerscript}{"14} 
%\let\le=\leq % seems to have been eliminated
%\DeclareMathSymbol{\geq}{\mathrel}{eulerscript}{"15} 
%\let\ge=\geq % ditto
\DeclareMathSymbol{\Re}{\mathord}{eulerscript}{"3C}
\DeclareMathSymbol{\Im}{\mathord}{eulerscript}{"3D}
%    \end{macrocode}
%    Unfortunately this is quite a messy mixture of fonts:
%    \begin{macrocode}
\DeclareMathDelimiter\lbrace{\mathopen}  {eulerscript}{"66}
                                         {eulerextension}{"08}
\DeclareMathDelimiter\rbrace{\mathclose} {eulerscript}{"67}
                                         {eulerextension}{"09}
\DeclareMathDelimiter\vert{\mathord}     {eulerscript}{"6A}
                                         {largesymbols}{"0C}
\DeclareMathDelimiter\backslash{\mathord}{eulerscript}{"6E}
                                         {largesymbols}{"0F}
\let\}=\rbrace
\let\{=\lbrace
%    \end{macrocode}
%
% \begin{macro}{\Relbar}\begin{macro}{\relbar}
% \begin{macro}{\rightarrowfill}\begin{macro}{\leftarrowfill}
% Actually, we also need the CM Roman ({\tt cmr}) family: we need the
% equals sign for the double arrows!
% Apparently, we also need the minus sign for single arrows (Knuth
% didn't do this).
%    \begin{macrocode}
\DeclareSymbolFont{cmrgroup}{T1}{cmr}{m}{n}
\let\Relbar\undefined                           % why is Relbar
                                                % defined in plain as
                                                % a macro???
\DeclareMathSymbol{\Relbar}{\mathrel}{cmrgroup}{"3D}
%    \end{macrocode}
%    since the cmr `-' is only used in the definitions below we can
%    declare it being type ord and save a few \verb|\mathord| tokens
%    in the definitions.
%    \begin{macrocode}
\DeclareMathSymbol{\cmr@minus}{\mathord}{symbols}{00}
\def\relbar{\mathrel{\smash\cmr@minus}}
          % \smash, because - has the same height as +
\def\rightarrowfill{$\m@th\cmr@minus\mkern-6mu%
  \cleaders\hbox{$\mkern-2mu\cmr@minus\mkern-2mu$}\hfill
  \mkern-6mu\mathord\rightarrow$}
\def\leftarrowfill{$\m@th\mathord\leftarrow\mkern-6mu%
  \cleaders\hbox{$\mkern-2mu\cmr@minus\mkern-2mu$}\hfill
  \mkern-6mu\cmr@minus$}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% Also, we should let math symbol font `operators' be the same as the
% text fonts.  (It doesn't have to be CM Roman anymore, since the
% uppercase greek letters are now taken from the Euler Roman fonts.)
%    \begin{macrocode}
\DeclareSymbolFont{operators}{\encodingdefault}%
                             {\rmdefault}{\mediumseriesdefault}
                                           {\normalshapedefault}
\SetSymbolFont{operators}{bold}{\encodingdefault}%
                             {\rmdefault}{\bfdefault}
                                           {\normalshapedefault}
%    \end{macrocode}
% Note that these parameters must have been defined at the time the
% {\tt nfeuler} style option is being read (any elegant way around this
% restriction?).
%
% \section{Footnotes}
%
% \begin{macro}{\@makefnmark}\begin{macro}{\@makefntext}
% Footnote numbers are not math entities, so they should be produced
% by digits from the text font.
%    \begin{macrocode}
\def\@makefnmark{\hbox{$\mathgroup\symoperators^{\@thefnmark}\m@th$}}
\long\def\@makefntext#1{\parindent 1em\noindent
      \hbox to1.8em{\hss$\mathgroup\symoperators^{\@thefnmark}\m@th$}#1}
%</style>
%    \end{macrocode}
% The definition of the last macro is the same in all the main
% \LaTeX\ styles.  Note, however that \verb=letter.sty= and
% \verb=slides.sty= define this macro differently, so the use of the
% {\tt nfeuler} style option will change the appearance of footnotes in
% such documents.
% \end{macro}\end{macro}
%
% \DeleteShortVerb\|
% \Finale
% \endinput
%
% The driver file:
%    \begin{macrocode}
%<+driver>\documentstyle[doc]{article}
%<+driver>
%<+driver>% dimensions from ltugboat.sty:
%<+driver>
%<+driver>\setlength\textwidth{31pc} 
%<+driver>\setlength\textheight{54pc}
%<+driver>\setlength{\parindent}{0pt}
%<+driver>\setlength{\parskip}{2pt plus 1pt minus 1pt}
%<+driver>\setlength{\oddsidemargin}{8pc} 
%<+driver>\setlength{\marginparwidth}{8pc}
%<+driver>\setlength{\topmargin}{-2.5pc} 
%<+driver>\setlength{\headsep}{20pt}
%<+driver>\setlength{\columnsep}{1.5pc} 
%<+driver>\setlength{\columnwidth}{18.75pc}
%<+driver>
%<+driver>\EnableCrossrefs         
%<+driver>%\DisableCrossrefs % Say \DisableCrossrefs if index is ready
%<+driver>
%<+driver>\RecordChanges     % Gather update information
%<+driver>
%<+driver>\CodelineIndex     % Index code by line number
%<+driver>
%<+driver>%\OnlyDescription  % comment out for implementation details
%<+driver>%\OldMakeindex     % use if your MakeIndex is pre-v2.9
%<+driver>\begin{document}
%<+driver>   \DocInput{nfeuler.dtx}
%<+driver>\end{document}
%    \end{macrocode}

\endinput
