Skip to content

Commit

Permalink
MyriadPro: define smallfrac and slantfrac only of math is modified
Browse files Browse the repository at this point in the history
  • Loading branch information
sebschub committed Jan 21, 2012
1 parent 00e76ec commit d4fdeb3
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions tex/MyriadPro.dtx
Expand Up @@ -444,7 +444,11 @@
% \end{tabular} % \end{tabular}
% %
% \medskip\noindent % \medskip\noindent
% Note that \emph{only} figures can be used for \meta{numerator} and \meta{denominator}. % Note that \emph{only} figures can be used for \meta{numerator} and
% \meta{denominator}. For compatability reasons with other packages, both commands are
% defined only if \pkg{MyriadPro} is used with math support either for
% normal or sans math. With the \option{sansmath} option, Myriad Pro
% figures are only shown if a sans mathversion is active.
% %
% \section{Language support} % \section{Language support}
% %
Expand Down Expand Up @@ -1311,25 +1315,25 @@
% %
% We define commands to convert numbers to numerator figures and denominator figures. % We define commands to convert numbers to numerator figures and denominator figures.
% \begin{macrocode} % \begin{macrocode}
\def\@for@tok#1:=#2\do#3{% \def\My@for@tok#1:=#2\do#3{%
\expandafter\def\expandafter\@fortmp\expandafter{#2}% \expandafter\def\expandafter\@fortmp\expandafter{#2}%
\ifx\@fortmp\@empty \else \ifx\@fortmp\@empty \else
\expandafter\@forloop@tok#2\@nil\@nil\@@#1{#3}% \expandafter\My@forloop@tok#2\@nil\@nil\@@#1{#3}%
\fi} \fi}
\def\@forloop@tok#1#2#3\@@#4#5{% \def\My@forloop@tok#1#2#3\@@#4#5{%
\def#4{#1}% \def#4{#1}%
\ifx #4\@nnil \else \ifx #4\@nnil \else
#5% #5%
\def#4{#2}% \def#4{#2}%
\ifx #4\@nnil \else \ifx #4\@nnil \else
#5\@iforloop@tok #3\@@#4{#5}% #5\My@iforloop@tok #3\@@#4{#5}%
\fi\fi} \fi\fi}
\def\@iforloop@tok#1#2\@@#3#4{% \def\My@iforloop@tok#1#2\@@#3#4{%
\def#3{#1}% \def#3{#1}%
\ifx #3\@nnil \ifx #3\@nnil
\expandafter\@fornoop \expandafter\@fornoop
\else \else
#4\relax\expandafter\@iforloop@tok #4\relax\expandafter\My@iforloop@tok
\fi \fi
#2\@@#3{#4}} #2\@@#3{#4}}
% %
Expand All @@ -1340,7 +1344,7 @@
\newcommand*\My@superior@fig[1]{{\My@extra@font\My@@superior@fig{#1}}} \newcommand*\My@superior@fig[1]{{\My@extra@font\My@@superior@fig{#1}}}
\newcommand*\My@inferior@fig[1]{{\My@extra@font\My@@inferior@fig{#1}}} \newcommand*\My@inferior@fig[1]{{\My@extra@font\My@@inferior@fig{#1}}}
\newcommand*\My@@numerator@fig[1]{% \newcommand*\My@@numerator@fig[1]{%
\@for@tok\@nf@fig:=#1\do{% \My@for@tok\@nf@fig:=#1\do{%
\ifcase\@nf@fig \ifcase\@nf@fig
\char'00% \char'00%
\or\char'01% \or\char'01%
Expand All @@ -1357,7 +1361,7 @@
\fi \fi
}} }}
\newcommand*\My@@denominator@fig[1]{% \newcommand*\My@@denominator@fig[1]{%
\@for@tok\@nf@fig:=#1\do{% \My@for@tok\@nf@fig:=#1\do{%
\ifcase\@nf@fig \ifcase\@nf@fig
\char'20% \char'20%
\or\char'21% \or\char'21%
Expand All @@ -1374,7 +1378,7 @@
\fi \fi
}} }}
\newcommand*\My@@superior@fig[1]{% \newcommand*\My@@superior@fig[1]{%
\@for@tok\@nf@fig:=#1\do{% \My@for@tok\@nf@fig:=#1\do{%
\ifcase\@nf@fig \ifcase\@nf@fig
\char'60% \char'60%
\or\char'61% \or\char'61%
Expand All @@ -1391,7 +1395,7 @@
\fi \fi
}} }}
\newcommand*\My@@inferior@fig[1]{% \newcommand*\My@@inferior@fig[1]{%
\@for@tok\@nf@fig:=#1\do{% \My@for@tok\@nf@fig:=#1\do{%
\ifcase\@nf@fig \ifcase\@nf@fig
\char'100% \char'100%
\or\char'101% \or\char'101%
Expand All @@ -1417,7 +1421,9 @@
#1% #1%
\fi} \fi}
% \end{macrocode} % \end{macrocode}
% |\smallfrac| and |\slantfrac| assemble numerical fractions. % |\smallfrac| and |\slantfrac| assemble numerical fractions. To
% ensure not overwriting existing commands, they are only defined if
% mathversion reacting commands are available.
% \begin{macrocode} % \begin{macrocode}
\newcommand*\My@smallfrac[2]{% \newcommand*\My@smallfrac[2]{%
\leavevmode \leavevmode
Expand All @@ -1435,8 +1441,10 @@
\box\@tempboxa} \box\@tempboxa}
\newcommand*\My@slantfrac[2]{% \newcommand*\My@slantfrac[2]{%
{\My@extra@font\My@@numerator@fig{#1}\kern-0.15em/\kern-0.14em\My@@denominator@fig{#2}}} {\My@extra@font\My@@numerator@fig{#1}\kern-0.15em/\kern-0.14em\My@@denominator@fig{#2}}}
\mdsy@DeclareRobustCommandArg{smallfrac}{2}{\Myensure@text{\kern0.06em\My@smallfrac{#1}{#2}\kern0.09em}} \if@My@Math@Symbols@
\mdsy@DeclareRobustCommandArg{slantfrac}{2}{\Myensure@text{\kern0.06em\My@slantfrac{#1}{#2}\kern0.09em}} \mdsy@DeclareRobustCommandArg{smallfrac}{2}{\Myensure@text{\kern0.06em\My@smallfrac{#1}{#2}\kern0.09em}}
\mdsy@DeclareRobustCommandArg{slantfrac}{2}{\Myensure@text{\kern0.06em\My@slantfrac{#1}{#2}\kern0.09em}}
\fi
% \end{macrocode} % \end{macrocode}
% %
% \subsection{Additional symbols} % \subsection{Additional symbols}
Expand Down

0 comments on commit d4fdeb3

Please sign in to comment.