% tpslifonts.sty,v 1.8 2003/03/28 16:05:03 stephanlehmke Exp
%  
% TeXPower bundle - dynamic online presentations with LaTeX
% Copyright (C) 1999-2002 Stephan Lehmke
% 
% This program 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.
% 
% This program 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.
%
%=======================================================================================================================
% File: tpslifonts.sty
%
% Configure text and math fonts for using L. Lamports ``slifonts'' lcmss etc.
%
% This package is part of the TeXPower bundle, to be found at
% 
% http://texpower.sourceforge.net/
%
%=======================================================================================================================
% Author: Stephan Lehmke <Stephan.Lehmke@cs.uni-dortmund.de>
%
% v0.1  Aug 10, 2001 First version for the pre-alpha release of texpower.
%
% v0.2  Nov 17, 2001 Added support for stmaryrd fonts.
%
% v0.3  Oct 18, 2002 Rewritten to go without .fd files.
%                    Euler package dependence changed to eulervm.
%                    Added support for ams, lasy, wasysym, rsfs, dstroke fonts.
%
% v0.4  Mar 25, 2003 Added support for cmbright math.
%
% v0.5  Mar 26, 2003 Added support for T1 encoding.
%

\NeedsTeXFormat{LaTeX2e}

\ProvidesPackage%
{tpslifonts}%
[2003/03/26 v0.5 Configure `slifonts'.]


%=======================================================================================================================

\RequirePackage{ifthen}


%=======================================================================================================================
% Options and general setup.

% The following options are for configuring different variations of math fonts. 

% lcmss text fonts have very high `small letters', making normal-size fonts look small and difficult to read. 
% The option scaleupmath (scaleuptt) will scale up math (typewriter) fonts slightly so they harmonize a little more with
% text fonts. 

\DeclareOption{scaleupmath}
{\providecommand\TPSFmathscale{1.15}\providecommand\TPSFeulerscale{1.1}\providecommand\TPSFcmbrscale{1.1}}

\DeclareOption{scaleuptt}{\providecommand\TPSFttscale{1.2}}

% The option sansmath sets sans serif math fonts as far as possible (no free font for letters exists).

\newboolean{TPSFsansmath}
\DeclareOption{sansmath}{\setboolean{TPSFsansmath}{true}}

% The option sansmathletters works only in conjunction with sansmath and sets sans serif math letters no matter what
% (not typographically satisfying). 

\newboolean{TPSFsansmathletters}
\DeclareOption{sansmathletters}{\setboolean{TPSFsansmathletters}{true}}

% The option eulermathletters works only in conjunction with sansmath and sets euler math letters (not typographically
% satisfying).  

\newboolean{TPSFeulermathletters}
\DeclareOption{eulermathletters}{\setboolean{TPSFeulermathletters}{true}}

% The option eulermath sets euler math fonts (slightly adapted from the eulervm package to match lcmss better).  

\newboolean{TPSFeulermath}
\DeclareOption{eulermath}{\setboolean{TPSFeulermath}{true}}

% The option eulerdigits works only in conjunction with eulermath and sets the euler-digits option of the eulervm
% package.   

\newboolean{TPSFeulerdigits}
\DeclareOption{eulerdigits}{\setboolean{TPSFeulerdigits}{true}\PassOptionsToPackage{euler-digits}{eulervm}}

% The option cmbrightmath sets cmbright math fonts (slightly adapted from the cmbright package to match lcmss better).  

\newboolean{TPSFcmbrightmath}
\DeclareOption{cmbrightmath}{\setboolean{TPSFcmbrightmath}{true}}

% The option lcmssops works only in conjunction with cmbrightmath and sets lcmss operator names, digits and upper case
% greek letters.

\newboolean{TPSFlcmssops}
\DeclareOption{lcmssops}{\setboolean{TPSFlcmssops}{true}}


%-----------------------------------------------------------------------------------------------------------------------
% Process options.

\ProcessOptions

\@ifundefined{TPSFmathscale}{\let\TPSFmathscale\@undefined\let\mathscale@TPSF\empty}
{\edef\mathscale@TPSF{[\TPSFmathscale]}}

\@ifundefined{TPSFeulerscale}{\let\TPSFeulerscale\@undefined\let\eulerscale@TPSF\empty}
{\edef\eulerscale@TPSF{[\TPSFeulerscale]}}

\@ifundefined{TPSFcmbrscale}{\let\TPSFcmbrscale\@undefined\let\cmbrscale@TPSF\empty}
{\edef\cmbrscale@TPSF{[\TPSFcmbrscale]}}

\@ifundefined{TPSFttscale}{\let\TPSFttscale\@undefined\let\ttscale@TPSF\empty}
{\edef\ttscale@TPSF{[\TPSFttscale]}}


%-----------------------------------------------------------------------------------------------------------------------
% Configure Text fonts.

% Regular Text.

\DeclareFontFamily{OT1}{lcmss}{\hyphenchar\font45 }
\DeclareFontShape{OT1}{lcmss}{m}{n}{%
  <->s*lcmss8%
  }{}
\DeclareFontShape{OT1}{lcmss}{m}{In}{%
 <->s*ilcmss8%
 }{}
\DeclareFontShape{OT1}{lcmss}{m}{sl}{%
  <->s*lcmssi8%
  }{}
\DeclareFontShape{OT1}{lcmss}{m}{Isl}{%
  <->s*ilcmssi8%
  }{}
\DeclareFontShape{OT1}{lcmss}{m}{it}{%
  <->sub*lcmss/m/sl}{}
\DeclareFontShape{OT1}{lcmss}{m}{Iit}{%
  <->sub*lcmss/m/Isl}{}
\DeclareFontShape{OT1}{lcmss}{bx}{n}{%
  <->s*lcmssb8%
  }{}
\DeclareFontShape{OT1}{lcmss}{bx}{In}{%
  <->s*ilcmssb8%
  }{}
\DeclareFontShape{OT1}{lcmss}{b}{n}{%
  <->sub*lcmss/bx/n}{}
\DeclareFontShape{OT1}{lcmss}{m}{ui}{%
  <->sub*cmr/m/ui}{}
\DeclareFontShape{OT1}{lcmss}{bx}{ui}{%
  <->sub*cmr/m/ui}{}

\DeclareFontFamily{T1}{lcmss}{}
\DeclareFontShape{T1}{lcmss}{m}{n}{%
  <->s*eclq8%
  }{}
\DeclareFontShape{T1}{lcmss}{m}{In}{%
 <->s*ieclq8%
 }{}
\DeclareFontShape{T1}{lcmss}{m}{sl}{%
  <->s*ecli8%
  }{}
\DeclareFontShape{T1}{lcmss}{m}{Isl}{%
  <->s*iecli8%
  }{}
\DeclareFontShape{T1}{lcmss}{m}{it}{%
  <->sub*lcmss/m/sl}{}
\DeclareFontShape{T1}{lcmss}{m}{Iit}{%
  <->sub*lcmss/m/Isl}{}
\DeclareFontShape{T1}{lcmss}{bx}{n}{%
  <->s*eclb8%
  }{}
\DeclareFontShape{T1}{lcmss}{bx}{In}{%
  <->s*ieclb8%
  }{}
\DeclareFontShape{T1}{lcmss}{bx}{sl}{%
  <->s*eclo8%
  }{}
\DeclareFontShape{T1}{lcmss}{bx}{Isl}{%
  <->s*ieclo8%
  }{}
\DeclareFontShape{T1}{lcmss}{bx}{it}{%
      <->sub*lcmss/bx/sl}{}
\DeclareFontShape{T1}{lcmss}{bx}{Iit}{%
      <->sub*lcmss/bx/Isl}{}
\DeclareFontShape{T1}{lcmss}{b}{n}{%
  <->sub*lcmss/bx/n}{}
\DeclareFontShape{T1}{lcmss}{m}{ui}{%
  <->sub*cmr/m/ui}{}
\DeclareFontShape{T1}{lcmss}{bx}{ui}{%
  <->sub*cmr/m/ui}{}

% Typewriter.

\DeclareFontFamily{OT1}{lcmtt}{\hyphenchar\font\m@ne}
\DeclareFontShape{OT1}{lcmtt}{m}{n}{%
  <->s*\ttscale@TPSF cmtt8%
  }{}
\DeclareFontShape{OT1}{lcmtt}{m}{it}{%
  <->s*\ttscale@TPSF cmitt10%
  }{}
\DeclareFontShape{OT1}{lcmtt}{m}{sl}{
  <->s*\ttscale@TPSF     cmsltt10
  }{}
\DeclareFontShape{OT1}{lcmtt}{m}{sc}{
  <->s*\ttscale@TPSF     cmtcsc10
  }{}
\DeclareFontShape{OT1}{lcmtt}{m}{ui}
{<->sub * lcmtt/m/it}{}
\DeclareFontShape{OT1}{lcmtt}{bx}{n}
{<->sub * lcmtt/m/n}{}
\DeclareFontShape{OT1}{lcmtt}{bx}{it}
{<->sub * lcmtt/m/it}{}
\DeclareFontShape{OT1}{lcmtt}{bx}{ui}
{<->sub * lcmtt/m/it}{}

\DeclareFontFamily{T1}{lcmtt}{\hyphenchar\font\m@ne}
\DeclareFontShape{T1}{lcmtt}{m}{n}{%
  <->s*\ttscale@TPSF ecltt8%
  }{}
  \DeclareFontShape{T1}{lcmtt}{m}{In}{%
  <->s*\ttscale@TPSF iecltt8%
  }{}
\DeclareFontShape{T1}{lcmtt}{m}{it}{%
  <->s*\ttscale@TPSF ecit0800%
  }{}
\DeclareFontShape{T1}{lcmtt}{m}{sl}{
  <->s*\ttscale@TPSF     ecst0800
  }{}
\DeclareFontShape{T1}{lcmtt}{m}{sc}{
  <->s*\ttscale@TPSF     ectc0800
  }{}
\DeclareFontShape{T1}{lcmtt}{m}{ui}
{<->sub * lcmtt/m/it}{}
\DeclareFontShape{T1}{lcmtt}{bx}{n}
{<->sub * lcmtt/m/n}{}
\DeclareFontShape{T1}{lcmtt}{bx}{it}
{<->sub * lcmtt/m/it}{}
\DeclareFontShape{T1}{lcmtt}{bx}{ui}
{<->sub * lcmtt/m/it}{}

% Encoding ``mTT'' is used by cmtt.sty.

\@ifundefined{T@mTT}{}
{%
  \DeclareFontFamily{mTT}{lcmtt}{\hyphenchar\font\m@ne}
  \DeclareFontShape{mTT}{lcmtt}{m}{n}{
    <->s*\ttscale@TPSF cmtt8
  }{}
  \DeclareFontShape{mTT}{lcmtt}{m}{it}{
    <->s*\ttscale@TPSF cmitt10
  }{}
  \DeclareFontShape{mTT}{lcmtt}{m}{sl}{
    <->s*\ttscale@TPSF cmsltt10
  }{}
  \DeclareFontShape{mTT}{lcmtt}{m}{sc}{
    <->s*\ttscale@TPSF cmtcsc10
  }{}
  \DeclareFontShape{mTT}{lcmtt}{m}{ui}  {<->sub * lcmtt/m/it} {}
  \DeclareFontShape{mTT}{lcmtt}{bx}{n}{<->sub*lcmtt/m/n}{}
  \DeclareFontShape{mTT}{lcmtt}{bx}{it} {<->sub * lcmtt/m/it} {}
  \DeclareFontShape{mTT}{lcmtt}{bx}{ui} {<->sub * lcmtt/m/it} {}
}

% The cmbright package also sets text fonts, so if cmbright math is requested, we load the cmbright package first and
% then overwrite the text font settings.

\ifthenelse{\boolean{TPSFcmbrightmath}}
{%
  \RequirePackage[standard-baselineskips]{cmbright}%
}

% Set text fonts.

\renewcommand{\familydefault}{\sfdefault}% Main text font is sans serif.
\renewcommand{\sfdefault}{lcmss}%          Choose lcmss as sans serif font.
\renewcommand{\ttdefault}{lcmtt}%          Adapt typewriter font to look better with lcmss.

%-----------------------------------------------------------------------------------------------------------------------
% Configure Math fonts.

% If the eulermath option is given, configure Euler Math Fonts.

\ifthenelse{\boolean{TPSFeulermath}}
{%
  \RequirePackage{eulervm}
  \DeclareFontFamily{U}{zeur}{\skewchar \font =127}
  \DeclareFontShape{U}{zeur}{m}{n}{
    <6->s*\eulerscale@TPSF zeurm7
    <-6>s*\eulerscale@TPSF zeurm5
  }{}
  \DeclareFontShape{U}{zeur}{b}{n}{
    <6->s*\eulerscale@TPSF zeurb7
    <-6>s*\eulerscale@TPSF zeurb5
  }{}
  \DeclareFontShape{U}{zeur}{bx}{n}{<->ssub * zeur/b/n}{}
  \DeclareFontFamily{U}{zeus}{\skewchar \font =176}
  \DeclareFontShape{U}{zeus}{m}{n}{
    <6->s*\mathscale@TPSF zeusm7
    <-6>s*\mathscale@TPSF zeusm5
  }{}
  \DeclareFontShape{U}{zeus}{b}{n}{
    <6->s*\mathscale@TPSF zeusb7
    <-6>s*\mathscale@TPSF zeusb5
  }{}
  \DeclareFontShape{U}{zeus}{bx}{n}{<->ssub * zeus/b/n}{}
  \DeclareFontFamily{U}{zeuex}{}
  \DeclareFontShape{U}{zeuex}{m}{n}{
    <->s*\mathscale@TPSF zeuex10
  }{}
  \def\tpc@ncel#1#2{\m@th\ooalign{$\hfil#1/\hfil$\crcr$#1#2$}}
  \def\neq{\mathrel{\m@th\mathpalette\tpc@ncel=}}
  \DeclareFontFamily{OML}{lcmm}{\skewchar\font127}
  \DeclareFontShape{OML}{lcmm}{m}{it}{%
    <-6>s*\mathscale@TPSF    cmmi5
    <6-7>s*\mathscale@TPSF   cmmi6
    <7-8>s*\mathscale@TPSF   cmmi7
    <8->s*\mathscale@TPSF    cmmi8%
  }{}
  \DeclareFontShape{OML}{lcmm}{b}{it}{%
    <-7>s*\mathscale@TPSF    cmmib5
    <7->s*\mathscale@TPSF    cmmib7%
  }{}
  \DeclareSymbolFont{auxletters}{OML}{lcmm}{m}{it}
  \SetSymbolFont{auxletters}{bold}{OML}{lcmm}{b}{it}
  \DeclareMathSymbol{<}{\mathrel}{auxletters}{"3C}
  \DeclareMathSymbol{>}{\mathrel}{auxletters}{"3E}
}
{% 

% If the cmbrightmath option is given, configure cmbright math fonts.

  \ifthenelse{\boolean{TPSFcmbrightmath}}
  {%
    % If the lcmssops option is given, take operators from lcmss.
    \ifthenelse{\boolean{TPSFlcmssops}}
    {%
      \SetSymbolFont{operators}{normal}{OT1}{lcmss}{m}{n}%
      \SetSymbolFont{operators}{bold}{OT1}{lcmss}{bx}{n}%
    }
    {%
      % Otherwise, take operators from cmbright.
      \DeclareFontFamily{OT1}{lcmbr}{\hyphenchar\font45}
      \DeclareFontShape{OT1}{lcmbr}{m}{n}{%
        <->s*\cmbrscale@TPSF cmbr8%
      }{}
      \DeclareFontShape{OT1}{lcmbr}{bx}{n}{%
        <->s*\cmbrscale@TPSF cmbrbx10%
      }{}
      \DeclareFontFamily{T1}{lcmbr}{}
      \DeclareFontShape{T1}{lcmbr}{m}{n}{%
        <->s*\cmbrscale@TPSF embr8%
      }{}
      \DeclareFontShape{T1}{lcmbr}{bx}{n}{%
        <->s*\cmbrscale@TPSF cbbx10%
      }{}
      \SetSymbolFont{operators}   {normal}{OT1}{lcmbr} {m}{n}
      \SetSymbolFont{operators}   {bold}  {OT1}{lcmbr} {bx}{n}
    }
    \DeclareFontFamily{OML}{cmbrm}{\skewchar\font 127}
    \DeclareFontShape{OML}{cmbrm}{m}{it}{%
      <->s*\cmbrscale@TPSF cmbrmi8%
    }{}
    \DeclareFontShape{OML}{cmbrm}{b}{it}{%
      <->s*\cmbrscale@TPSF cmbrmb10%
    }{}
    \DeclareFontFamily{OMS}{cmbrs}{\skewchar\font 48}
    \DeclareFontShape{OMS}{cmbrs}{m}{n}{%
      <->s*\cmbrscale@TPSF cmbrsy8%
    }{}
    \DeclareFontFamily{OMX}{lcmex}{}
    \DeclareFontShape{OMX}{lcmex}{m}{n}{%
      <->s*\mathscale@TPSF     cmex10%
    }{}
    \SetSymbolFont{letters}     {normal}{OML}{cmbrm} {m}{it}
    \SetSymbolFont{symbols}     {normal}{OMS}{cmbrs}{m}{n}
    \SetSymbolFont{largesymbols}{normal}{OMX}{lcmex}{m}{n}
    \SetSymbolFont{letters}     {bold}  {OML}{cmbrm} {b}{it}
  }
  {% Otherwise, configure Computer Modern Math Fonts

% Letters, symbols, and large symbols are always taken from cm, scaled as needed.

\DeclareFontFamily{OML}{lcmm}{\skewchar\font127}
\DeclareFontShape{OML}{lcmm}{m}{it}{%
  <-6>s*\mathscale@TPSF    cmmi5
  <6-7>s*\mathscale@TPSF   cmmi6
  <7-8>s*\mathscale@TPSF   cmmi7
  <8->s*\mathscale@TPSF    cmmi8%
}{}
\DeclareFontShape{OML}{lcmm}{b}{it}{%
  <-7>s*\mathscale@TPSF    cmmib5
  <7->s*\mathscale@TPSF    cmmib7%
}{}
\DeclareFontFamily{OMS}{lcmsy}{\skewchar\font48}
\DeclareFontShape{OMS}{lcmsy}{m}{n}{%
  <-6>s*\mathscale@TPSF    cmsy5
  <6-7>s*\mathscale@TPSF   cmsy6
  <7-8>s*\mathscale@TPSF   cmsy7
  <8->s*\mathscale@TPSF    cmsy8%
}{}
\DeclareFontShape{OMS}{lcmsy}{b}{n}{%
  <-7>s*\mathscale@TPSF    cmbsy5
  <7->s*\mathscale@TPSF    cmbsy7%
}{}
\DeclareFontFamily{OMX}{lcmex}{}
\DeclareFontShape{OMX}{lcmex}{m}{n}{%
  <->s*\mathscale@TPSF     cmex10%
}{}

\SetSymbolFont{letters}     {normal}{OML}{lcmm} {m}{it}
\SetSymbolFont{symbols}     {normal}{OMS}{lcmsy}{m}{n}
\SetSymbolFont{largesymbols}{normal}{OMX}{lcmex}{m}{n}
\SetSymbolFont{letters}     {bold}  {OML}{lcmm} {b}{it}
\SetSymbolFont{symbols}     {bold}  {OMS}{lcmsy}{b}{n}


% If the sansmath option is given, take operators from lcmss.

\ifthenelse{\boolean{TPSFsansmath}}
{%
  \SetSymbolFont{operators}{normal}{OT1}{lcmss}{m}{n}%
  \SetSymbolFont{operators}{bold}{OT1}{lcmss}{bx}{n}%
  
% lcmm is just another word for cmm, so math letters will look just like with cmr...
% When one of the options eulermathletters or sansmathletters is given, an attempt is made to substitute something more
% suitable. 

  \ifthenelse{\boolean{TPSFeulermathletters}}
  {%
    \DeclareFontFamily{U}{leur}{\skewchar \font =127}
    \DeclareFontShape{U}{leur}{m}{n}{
      <6->s*\eulerscale@TPSF zeurm7
      <-6>s*\eulerscale@TPSF zeurm5
      }{}
    \DeclareFontShape{U}{leur}{b}{n}{
      <6->s*\eulerscale@TPSF zeurb7
      <-6>s*\eulerscale@TPSF zeurb5
      }{}
    \DeclareSymbolFont{euletters}{U}{leur}{m}{n}
    \SetSymbolFont{euletters}{bold}{U}{leur}{b}{n}
    \DeclareMathSymbol{a}{\mathalpha}{euletters}{`a}
    \DeclareMathSymbol{b}{\mathalpha}{euletters}{`b}
    \DeclareMathSymbol{c}{\mathalpha}{euletters}{`c}
    \DeclareMathSymbol{d}{\mathalpha}{euletters}{`d}
    \DeclareMathSymbol{e}{\mathalpha}{euletters}{`e}
    \DeclareMathSymbol{f}{\mathalpha}{euletters}{`f}
    \DeclareMathSymbol{g}{\mathalpha}{euletters}{`g}
    \DeclareMathSymbol{h}{\mathalpha}{euletters}{`h}
    \DeclareMathSymbol{i}{\mathalpha}{euletters}{`i}
    \DeclareMathSymbol{j}{\mathalpha}{euletters}{`j}
    \DeclareMathSymbol{k}{\mathalpha}{euletters}{`k}
    \DeclareMathSymbol{l}{\mathalpha}{euletters}{`l}
    \DeclareMathSymbol{m}{\mathalpha}{euletters}{`m}
    \DeclareMathSymbol{n}{\mathalpha}{euletters}{`n}
    \DeclareMathSymbol{o}{\mathalpha}{euletters}{`o}
    \DeclareMathSymbol{p}{\mathalpha}{euletters}{`p}
    \DeclareMathSymbol{q}{\mathalpha}{euletters}{`q}
    \DeclareMathSymbol{r}{\mathalpha}{euletters}{`r}
    \DeclareMathSymbol{s}{\mathalpha}{euletters}{`s}
    \DeclareMathSymbol{t}{\mathalpha}{euletters}{`t}
    \DeclareMathSymbol{u}{\mathalpha}{euletters}{`u}
    \DeclareMathSymbol{v}{\mathalpha}{euletters}{`v}
    \DeclareMathSymbol{w}{\mathalpha}{euletters}{`w}
    \DeclareMathSymbol{x}{\mathalpha}{euletters}{`x}
    \DeclareMathSymbol{y}{\mathalpha}{euletters}{`y}
    \DeclareMathSymbol{z}{\mathalpha}{euletters}{`z}
    \DeclareMathSymbol{A}{\mathalpha}{euletters}{`A}
    \DeclareMathSymbol{B}{\mathalpha}{euletters}{`B}
    \DeclareMathSymbol{C}{\mathalpha}{euletters}{`C}
    \DeclareMathSymbol{D}{\mathalpha}{euletters}{`D}
    \DeclareMathSymbol{E}{\mathalpha}{euletters}{`E}
    \DeclareMathSymbol{F}{\mathalpha}{euletters}{`F}
    \DeclareMathSymbol{G}{\mathalpha}{euletters}{`G}
    \DeclareMathSymbol{H}{\mathalpha}{euletters}{`H}
    \DeclareMathSymbol{I}{\mathalpha}{euletters}{`I}
    \DeclareMathSymbol{J}{\mathalpha}{euletters}{`J}
    \DeclareMathSymbol{K}{\mathalpha}{euletters}{`K}
    \DeclareMathSymbol{L}{\mathalpha}{euletters}{`L}
    \DeclareMathSymbol{M}{\mathalpha}{euletters}{`M}
    \DeclareMathSymbol{N}{\mathalpha}{euletters}{`N}
    \DeclareMathSymbol{O}{\mathalpha}{euletters}{`O}
    \DeclareMathSymbol{P}{\mathalpha}{euletters}{`P}
    \DeclareMathSymbol{Q}{\mathalpha}{euletters}{`Q}
    \DeclareMathSymbol{R}{\mathalpha}{euletters}{`R}
    \DeclareMathSymbol{S}{\mathalpha}{euletters}{`S}
    \DeclareMathSymbol{T}{\mathalpha}{euletters}{`T}
    \DeclareMathSymbol{U}{\mathalpha}{euletters}{`U}
    \DeclareMathSymbol{V}{\mathalpha}{euletters}{`V}
    \DeclareMathSymbol{W}{\mathalpha}{euletters}{`W}
    \DeclareMathSymbol{X}{\mathalpha}{euletters}{`X}
    \DeclareMathSymbol{Y}{\mathalpha}{euletters}{`Y}
    \DeclareMathSymbol{Z}{\mathalpha}{euletters}{`Z}
  }
  {%
    \ifthenelse{\boolean{TPSFsansmathletters}}
    {%
      \DeclareSymbolFont{sansletters}{OT1}{lcmss}{m}{sl}%
      \DeclareMathSymbol{a}{\mathalpha}{sansletters}{`a}
      \DeclareMathSymbol{b}{\mathalpha}{sansletters}{`b}
      \DeclareMathSymbol{c}{\mathalpha}{sansletters}{`c}
      \DeclareMathSymbol{d}{\mathalpha}{sansletters}{`d}
      \DeclareMathSymbol{e}{\mathalpha}{sansletters}{`e}
      \DeclareMathSymbol{f}{\mathalpha}{sansletters}{`f}
      \DeclareMathSymbol{g}{\mathalpha}{sansletters}{`g}
      \DeclareMathSymbol{h}{\mathalpha}{sansletters}{`h}
      \DeclareMathSymbol{i}{\mathalpha}{sansletters}{`i}
      \DeclareMathSymbol{j}{\mathalpha}{sansletters}{`j}
      \DeclareMathSymbol{k}{\mathalpha}{sansletters}{`k}
      \DeclareMathSymbol{l}{\mathalpha}{sansletters}{`l}
      \DeclareMathSymbol{m}{\mathalpha}{sansletters}{`m}
      \DeclareMathSymbol{n}{\mathalpha}{sansletters}{`n}
      \DeclareMathSymbol{o}{\mathalpha}{sansletters}{`o}
      \DeclareMathSymbol{p}{\mathalpha}{sansletters}{`p}
      \DeclareMathSymbol{q}{\mathalpha}{sansletters}{`q}
      \DeclareMathSymbol{r}{\mathalpha}{sansletters}{`r}
      \DeclareMathSymbol{s}{\mathalpha}{sansletters}{`s}
      \DeclareMathSymbol{t}{\mathalpha}{sansletters}{`t}
      \DeclareMathSymbol{u}{\mathalpha}{sansletters}{`u}
      \DeclareMathSymbol{v}{\mathalpha}{sansletters}{`v}
      \DeclareMathSymbol{w}{\mathalpha}{sansletters}{`w}
      \DeclareMathSymbol{x}{\mathalpha}{sansletters}{`x}
      \DeclareMathSymbol{y}{\mathalpha}{sansletters}{`y}
      \DeclareMathSymbol{z}{\mathalpha}{sansletters}{`z}
      \DeclareMathSymbol{A}{\mathalpha}{sansletters}{`A}
      \DeclareMathSymbol{B}{\mathalpha}{sansletters}{`B}
      \DeclareMathSymbol{C}{\mathalpha}{sansletters}{`C}
      \DeclareMathSymbol{D}{\mathalpha}{sansletters}{`D}
      \DeclareMathSymbol{E}{\mathalpha}{sansletters}{`E}
      \DeclareMathSymbol{F}{\mathalpha}{sansletters}{`F}
      \DeclareMathSymbol{G}{\mathalpha}{sansletters}{`G}
      \DeclareMathSymbol{H}{\mathalpha}{sansletters}{`H}
      \DeclareMathSymbol{I}{\mathalpha}{sansletters}{`I}
      \DeclareMathSymbol{J}{\mathalpha}{sansletters}{`J}
      \DeclareMathSymbol{K}{\mathalpha}{sansletters}{`K}
      \DeclareMathSymbol{L}{\mathalpha}{sansletters}{`L}
      \DeclareMathSymbol{M}{\mathalpha}{sansletters}{`M}
      \DeclareMathSymbol{N}{\mathalpha}{sansletters}{`N}
      \DeclareMathSymbol{O}{\mathalpha}{sansletters}{`O}
      \DeclareMathSymbol{P}{\mathalpha}{sansletters}{`P}
      \DeclareMathSymbol{Q}{\mathalpha}{sansletters}{`Q}
      \DeclareMathSymbol{R}{\mathalpha}{sansletters}{`R}
      \DeclareMathSymbol{S}{\mathalpha}{sansletters}{`S}
      \DeclareMathSymbol{T}{\mathalpha}{sansletters}{`T}
      \DeclareMathSymbol{U}{\mathalpha}{sansletters}{`U}
      \DeclareMathSymbol{V}{\mathalpha}{sansletters}{`V}
      \DeclareMathSymbol{W}{\mathalpha}{sansletters}{`W}
      \DeclareMathSymbol{X}{\mathalpha}{sansletters}{`X}
      \DeclareMathSymbol{Y}{\mathalpha}{sansletters}{`Y}
      \DeclareMathSymbol{Z}{\mathalpha}{sansletters}{`Z}
    }
    {}%
  }%
}
{% No sansmath, take operators from cmr.
  \DeclareFontFamily{OT1}{lcmr}{\hyphenchar\font45 }
  \DeclareFontShape{OT1}{lcmr}{m}{n}{%
    <-6>s*\mathscale@TPSF    cmr5
    <6-7>s*\mathscale@TPSF   cmr6
    <7-8>s*\mathscale@TPSF   cmr7
    <8->s*\mathscale@TPSF    cmr8%
  }{}
  \DeclareFontShape{OT1}{lcmr}{bx}{n}{%
    <-6>s*\mathscale@TPSF    cmbx5
    <6-7>s*\mathscale@TPSF   cmbx6
    <7-8>s*\mathscale@TPSF   cmbx7
    <8->s*\mathscale@TPSF    cmbx8%
  }{}
  \SetSymbolFont{operators}   {normal}{OT1}{lcmr} {m}{n}
  \SetSymbolFont{operators}   {bold}  {OT1}{lcmr} {bx}{n}
}%
}%
}

% Configure lasy fonts.

\newboolean{TPSFlasy}

\@ifpackageloaded{latexsym}
{%
  \setboolean{TPSFlasy}{true}
  \DeclareFontFamily{U}{lasy}{}
  \DeclareFontShape{U}{lasy}{m}{n}{%
    <-6>s*\mathscale@TPSF    lasy5
    <6-7>s*\mathscale@TPSF   lasy6
    <7-8>s*\mathscale@TPSF   lasy7
    <8->s*\mathscale@TPSF    lasy8%
  }{}
  \DeclareFontShape{U}{lasy}{b}{n}{%
    <->s*\mathscale@TPSF    lasyb10%
  }{}
}
{}
  
% Configure stmryrd fonts.

\newboolean{TPSFstmaryrd}

\@ifpackageloaded{stmaryrd}
{%
  \setboolean{TPSFstmaryrd}{true}
  \DeclareFontFamily{U}{stmry}{}
  \DeclareFontShape{U}{stmry}{m}{n}
  {
    <-6>s*\mathscale@TPSF    stmary5
    <6-7>s*\mathscale@TPSF   stmary6
    <7-8>s*\mathscale@TPSF   stmary7
    <8->s*\mathscale@TPSF    stmary8
  }{}
}
{}
  
% Configure wasysym fonts

\newboolean{TPSFwasysym}

\@ifpackageloaded{wasysym}
{%
  \setboolean{TPSFwasysym}{true}
  \DeclareFontFamily{U}{wasy}{}
  \DeclareFontShape{U}{wasy}{m}{n}{%
    <-6>s*\mathscale@TPSF    wasy5
    <6-7>s*\mathscale@TPSF   wasy6
    <7-8>s*\mathscale@TPSF   wasy7
    <8->s*\mathscale@TPSF    wasy8%
  }{}
  \DeclareFontShape{U}{wasy}{b}{n}{<->s*\mathscale@TPSF  wasyb10}{}
}

% Configure ams fonts

\newboolean{TPSFamsfonts}

\@ifpackageloaded{amsfonts}
{%
  \setboolean{TPSFamsfonts}{true}
  \DeclareFontFamily{U}{euf}{}%
  \DeclareFontShape{U}{euf}{m}{n}{%
    <-6>s*\mathscale@TPSF    eufm5
    <6->s*\mathscale@TPSF    eufm7%
  }{}%
  \DeclareFontShape{U}{euf}{b}{n}{%
    <-6>s*\mathscale@TPSF    eufb5
    <6->s*\mathscale@TPSF    eufb7%
  }{}%
  \ifthenelse{\boolean{TPSFcmbrightmath}}
  {%
    \AtBeginDocument{%
      \DeclareFontFamily{U}{msa}{}
      \DeclareFontShape{U}{msa}{m}{n}{%
        <->s*\mathscale@TPSF    cmbras8%
      }{}
      \DeclareFontFamily{U}{msb}{}
      \DeclareFontShape{U}{msb}{m}{n}{%
        <->s*\mathscale@TPSF    cmbrbs8%
      }{}
    }
  }
  {%
    \DeclareFontFamily{U}{msa}{}
    \DeclareFontShape{U}{msa}{m}{n}{%
      <-6>s*\mathscale@TPSF    msam5
      <6->s*\mathscale@TPSF    msam7%
    }{}
    \DeclareFontFamily{U}{msb}{}
    \DeclareFontShape{U}{msb}{m}{n}{%
      <-6>s*\mathscale@TPSF    msbm5
      <6->s*\mathscale@TPSF    msbm7%
    }{}
  }
}{}%

% Configure rsfs fonts

\newboolean{TPSFrsfs}

\@ifpackageloaded{mathrsfs}
{%
  \setboolean{TPSFrsfs}{true}
  \DeclareFontFamily{U}{rsfs}{\skewchar\font127 }
  \DeclareFontShape{U}{rsfs}{m}{n}{%
    <-6>s*\mathscale@TPSF   rsfs5
    <6->s*\mathscale@TPSF   rsfs7%
  }{}%
}{}%

% Configure rsfs fonts

\newboolean{TPSFdstroke}

\@ifpackageloaded{dsfont}
{%
  \setboolean{TPSFdstroke}{true}
  \ifthenelse{\boolean{TPSFsansmath}\or\boolean{TPSFeulermath}\or\boolean{TPSFcmbrightmath}}
  {%
    \DeclareMathAlphabet{\mathds}{U}{dsss}{m}{n}
    \DeclareFontFamily{U}{dsss}{}
    \DeclareFontShape{U}{dsss}{m}{n}{%
      <->s*\mathscale@TPSF    dsss8%
    }{}%
  }
  {%
    \DeclareMathAlphabet{\mathds}{U}{dsrom}{m}{n}
    \DeclareFontFamily{U}{dsrom}{}
    \DeclareFontShape{U}{dsrom}{m}{n}{%
      <->s*\mathscale@TPSF    dsrom8%
    }{}
  }
}{}%


% Local Variables: 
% fill-column: 120
% TeX-master: "dummy"
% End: 

%%
%% End of file `tpslifonts.sty'.
