.tex 5.39 KB
\ pre@mathstyle.ins 
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation for package: mathstyle}
\Msg{************************************************************************}

\keepsilent
\askforoverwritefalse

\preamble

This is a generated file.

Copyright (C) 1997-2003 by Michael J. Downes
Copyright (C) 2007-2011 by Morten Hoegholm et al
Copyright (C) 2007-2014 by Lars Madsen
Copyright (C) 2007-2014 by Will Robertson
Copyright (C) 2015 by Will Robertson, Joseph Wright

This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
version 1.3 of this license or (at your option) any later
version. The latest version of this license is in
   http://www.latex-project.org/lppl.txt
and version 1.3 or later is part of all distributions of
LaTeX version 2005/12/01 or later.

This work has the LPPL maintenance status "maintained".

The Current Maintainer of this work is Will Robertson.

This work consists of the main source file mathstyle.dtx
and the derived files
   mathstyle.sty, mathstyle.pdf, mathstyle.ins.

\endpreamble

\generate{%
  \file{mathstyle.ins}{\from{mathstyle.dtx}{install}}%
  \usedir{tex/latex/breqn}%
  \file{mathstyle.sty}{\from{mathstyle.dtx}{package}}%
}

\obeyspaces
\Msg{************************************************************************}
\Msg{*}
\Msg{* To finish the installation you have to move the following}
\Msg{* file into a directory searched by TeX:}
\Msg{*}
\Msg{*     mathstyle.sty}
\Msg{*}
\Msg{* Happy TeXing!}
\Msg{*}
\Msg{************************************************************************}

\endbatchfile
\ post@mathstyle.ins 
atop
\@saveprimitive\above\@@above
\@saveprimitive\overwithdelims\@@overwithdelims
\@saveprimitive\atopwithdelims\@@atopwithdelims
\@saveprimitive\abovewithdelims\@@abovewithdelims
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname directlua\endcsname\relax
  \DeclareRobustCommand{\displaystyle}{%
    \@@displaystyle \chardef\mathstyle\z@}
  \DeclareRobustCommand{\textstyle}{%
    \@@textstyle \chardef\mathstyle\tw@}
  \DeclareRobustCommand{\scriptstyle}{%
    \@@scriptstyle \chardef\mathstyle4 }
  \DeclareRobustCommand{\scriptscriptstyle}{%
    \@@scriptscriptstyle \chardef\mathstyle6 }
\fi
\begingroup \catcode`\
=7\relax \catcode`\_=8\relax % just in case
\lowercase{\endgroup
\let\@@superscript=
 \let\@@subscript=_
}%
\begingroup \catcode`\
=12\relax \catcode`\_=12\relax % just in case
\lowercase{\endgroup
\let\@@superscript@other=
 \let\@@subscript@other=_
}%
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname directlua\endcsname\relax
  \def\subsupstyle{%
    \ifnum\mathstyle<5 \chardef\mathstyle4 %
    \else \chardef\mathstyle6 %
    \fi
  }
\else
  \def\subsupstyle{}
\fi
\let\mathsup=\@@superscript
\let\mathsub=\@@subscript
\def\sb#1{\mathsub{\protect\subsupstyle#1}}%
\def\sp#1{\mathsup{\protect\subsupstyle#1}}%
\def\mathchoice{%
  \relax\ifcase\mathstyle
    \expandafter\@firstoffour % Display
  \or
    \expandafter\@firstoffour % Cramped display
  \or
    \expandafter\@secondoffour % Text
  \or
    \expandafter\@secondoffour % Cramped text
  \or
    \expandafter\@thirdoffour % Script
  \or
    \expandafter\@thirdoffour % Cramped script
  \else
    \expandafter\@fourthoffour % (Cramped) Scriptscript
  \fi
}
\providecommand\@firstoffour[4]{#1}
\providecommand\@secondoffour[4]{#2}
\providecommand\@thirdoffour[4]{#3}
\providecommand\@fourthoffour[4]{#4}
\DeclareRobustCommand\genfrac[6]{%
  {#1\fracstyle
    {\begingroup #5\endgroup
      \csname @@\ifx\maxdimen#4\maxdimen over\else above\fi
        \if @#2@\else withdelims\fi\endcsname #2#3#4\relax
     #6}%
  }%
}
\renewcommand{\frac}{\genfrac{}{}{}{}}
\providecommand{\dfrac}{}
\providecommand{\tfrac}{}
\renewcommand{\dfrac}{\genfrac\displaystyle{}{}{}}
\renewcommand{\tfrac}{\genfrac\textstyle{}{}{}}
\providecommand{\binom}{}
\providecommand{\tbinom}{}
\providecommand{\dbinom}{}
\renewcommand{\binom}{\genfrac{}(){0pt}}
\renewcommand{\dbinom}{\genfrac\displaystyle(){0pt}}
\renewcommand{\tbinom}{\genfrac\textstyle(){0pt}}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname directlua\endcsname\relax
  \def\fracstyle{%
    \ifcase\mathstyle
      \chardef\mathstyle=\@ne
    \or
      \chardef\mathstyle=\@ne
    \or
      \chardef\mathstyle=\tw@
    \or
      \chardef\mathstyle=\tw@
    \else
      \chardef\mathstyle=\thr@@
    \fi
  }
\else
  \def\fracstyle{}
\fi
\def\currentmathstyle{%
  \ifcase\mathstyle
    \@@displaystyle
  \or
    \@@displaystyle
  \or
    \@@textstyle
  \or
    \@@textstyle
  \or
    \@@scriptstyle
  \or
    \@@scriptstyle
  \else
    \@@scriptscriptstyle
  \fi}
\DeclareOption{mathactivechars}{%
 %  \catcode`\
=12\relax
 %  \catcode`\_=12\relax
\AtBeginDocument{\catcode`\
=12\relax \catcode`\_=12\relax}%
}
\DeclareOption{activechars}{%
 %  \catcode`\
=13\relax
 %  \catcode`\_=13\relax
\AtBeginDocument{\catcode`\
=13\relax \catcode`\_=13\relax}%
}
\DeclareOption{noactivechars}{%
 %  \catcode`\
=7\relax
 %  \catcode`\_=8\relax
\AtBeginDocument{\catcode`\
=7\relax \catcode`\_=8\relax}%
}
\ExecuteOptions{mathactivechars}
\ProcessOptions\relax
\ifnum\catcode`\
=13\relax
  \let
=\sp \let_=\sb
\else
  \mathcode`\
="8000\relax
  \mathcode`\_="8000\relax
  \begingroup
    \catcode`\
=\active
    \catcode`\_=\active
    \global\let
=\sp
    \global\let_=\sb
  \endgroup
\fi
\ post@mathstyle.sty