summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-09-18 22:35:12 +0000
committerKarl Berry <karl@freefriends.org>2010-09-18 22:35:12 +0000
commite2f4e4cbb4f7bb5e4c29d57bc37c3cc8090104fc (patch)
treedb38530d31b26472d5e63619a1a1daf43feb0809 /Master/texmf-dist/tex/latex
parent1891cc4c24d7ce1ce1d8f334204f0af27d496c15 (diff)
mh update (18sep10)
git-svn-id: svn://tug.org/texlive/trunk@19794 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/mh/cmbase.sym2
-rw-r--r--Master/texmf-dist/tex/latex/mh/flexisym.sty9
-rw-r--r--Master/texmf-dist/tex/latex/mh/mathpazo.sym2
-rw-r--r--Master/texmf-dist/tex/latex/mh/mathptmx.sym2
-rw-r--r--Master/texmf-dist/tex/latex/mh/mathtools.sty43
-rw-r--r--Master/texmf-dist/tex/latex/mh/msabm.sym2
-rw-r--r--Master/texmf-dist/tex/latex/mh/xfrac.sty542
7 files changed, 389 insertions, 213 deletions
diff --git a/Master/texmf-dist/tex/latex/mh/cmbase.sym b/Master/texmf-dist/tex/latex/mh/cmbase.sym
index 386127d32f8..f811f76a7c9 100644
--- a/Master/texmf-dist/tex/latex/mh/cmbase.sym
+++ b/Master/texmf-dist/tex/latex/mh/cmbase.sym
@@ -9,7 +9,7 @@
%% This is a generated file.
%%
%% Copyright (C) 1997-2003 by Michael J. Downes
-%% Copyright (C) 2007-2008 by Morten Hoegholm <mh.ctan@gmail.com>
+%% Copyright (C) 2007-2010 by Morten Hoegholm <mh.ctan@gmail.com>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
diff --git a/Master/texmf-dist/tex/latex/mh/flexisym.sty b/Master/texmf-dist/tex/latex/mh/flexisym.sty
index b370beb1744..f2ad4ff76ec 100644
--- a/Master/texmf-dist/tex/latex/mh/flexisym.sty
+++ b/Master/texmf-dist/tex/latex/mh/flexisym.sty
@@ -9,7 +9,7 @@
%% This is a generated file.
%%
%% Copyright (C) 1997-2003 by Michael J. Downes
-%% Copyright (C) 2007-2008 by Morten Hoegholm <mh.ctan@gmail.com>
+%% Copyright (C) 2007-2010 by Morten Hoegholm <mh.ctan@gmail.com>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -29,7 +29,7 @@
%% cmbase.sym, mathpazo.sym, mathptmx.sym, msabm.sym.
%%
\RequirePackage{expl3}[2009/08/05]
-\ProvidesExplPackage{flexisym}{2009/08/07}{0.97a}{Make math characters macros}
+\ProvidesExplPackage{flexisym}{2010/09/17}{0.97b}{Make math characters macros}
\edef\do{%
\noexpand\AtEndOfPackage{%
@@ -239,7 +239,10 @@
\catcode\z@=\active
\def\DeclareFlexSymbol#1#2#3#4{%
\begingroup
- \cs_set:Npx\@tempb{\exp_not:N\@sym\exp_not:N#1\exp_not:c{math_sym_#2:Nn}\exp_not:c{mg@#3}{#4}}%
+ \cs_set_protected:Npx\@tempb{
+ \exp_not:N\@sym\exp_not:N#1\exp_not:c{math_sym_#2:Nn}
+ \exp_not:c{mg@#3}{#4}
+ }
\ifcat\exp_not:N#1\relax
\sym@global\let#1\@tempb
\else
diff --git a/Master/texmf-dist/tex/latex/mh/mathpazo.sym b/Master/texmf-dist/tex/latex/mh/mathpazo.sym
index 153e95756ec..4bc07eae902 100644
--- a/Master/texmf-dist/tex/latex/mh/mathpazo.sym
+++ b/Master/texmf-dist/tex/latex/mh/mathpazo.sym
@@ -9,7 +9,7 @@
%% This is a generated file.
%%
%% Copyright (C) 1997-2003 by Michael J. Downes
-%% Copyright (C) 2007-2008 by Morten Hoegholm <mh.ctan@gmail.com>
+%% Copyright (C) 2007-2010 by Morten Hoegholm <mh.ctan@gmail.com>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
diff --git a/Master/texmf-dist/tex/latex/mh/mathptmx.sym b/Master/texmf-dist/tex/latex/mh/mathptmx.sym
index 5b9ee0bd877..3a538fd5350 100644
--- a/Master/texmf-dist/tex/latex/mh/mathptmx.sym
+++ b/Master/texmf-dist/tex/latex/mh/mathptmx.sym
@@ -9,7 +9,7 @@
%% This is a generated file.
%%
%% Copyright (C) 1997-2003 by Michael J. Downes
-%% Copyright (C) 2007-2008 by Morten Hoegholm <mh.ctan@gmail.com>
+%% Copyright (C) 2007-2010 by Morten Hoegholm <mh.ctan@gmail.com>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
diff --git a/Master/texmf-dist/tex/latex/mh/mathtools.sty b/Master/texmf-dist/tex/latex/mh/mathtools.sty
index 989ed7e6fd6..79a2a3ddeed 100644
--- a/Master/texmf-dist/tex/latex/mh/mathtools.sty
+++ b/Master/texmf-dist/tex/latex/mh/mathtools.sty
@@ -27,8 +27,8 @@
%% mathtools.sty, mathtools.pdf, mathtools.ins, mathtools.drv.
%%
\ProvidesPackage{mathtools}%
- [2010/07/11 v1.08 mathematical typesetting tools (MH)]
-\RequirePackage{keyval,calc,graphicx}
+ [2010/07/21 v1.08b mathematical typesetting tools (MH)]
+\RequirePackage{keyval,calc}
\RequirePackage{mhsetup}[2007/12/03]
\MHInternalSyntaxOn
\def\MT_options_name:{mathtools}
@@ -559,7 +559,7 @@
\newcommand*\DeclarePairedDelimiter[3]{%
\@ifdefinable{#1}{
\@namedef{MT_delim_\MH_cs_to_str:N #1 _star:}##1
- {\left#2 ##1 \right #3}%
+ {\mathopen{}\mathclose\bgroup\left#2 ##1 \aftergroup\egroup\right #3}%
\@xp\@xp\@xp
\newcommand
\@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar:\endcsname
@@ -575,33 +575,47 @@
}
}
\def\MHempty{}
-\def\DeclarePairedDelimiterX#1[#2]#3#4#5#6{%
+\def\DeclarePairedDelimiterX#1[#2]#3#4#5{%
\@ifdefinable{#1}{
- \ifnum#2>8\relax
- \PackageError{mathtools}{No~ more~ than~ 8~ arguments}{}
+ \ifnum#2>9\relax
+ \PackageError{mathtools}{No~ more~ than~ 9~ arguments}{}
\else
\ifnum#2<1\relax
\PackageError{mathtools}{Macro~ need~ 1~ or~ more~ arguments}{}
\fi
\fi
- % store the argument number in a temp counter
- \@tempcnta=#2
\@xp\@xp\@xp
\newcommand
\@xp\csname MT_delim_\MH_cs_to_str:N #1 _star:\endcsname
- [\@tempcnta]
+ [#2]
{
- \left#3 #6 \right#4
+ \begingroup
+ \def\delimsize{\middle}
+ \mathopen{}\mathclose\bgroup\left#3 #5 \aftergroup\egroup\right#4
+ \endgroup
}
- \advance\@tempcnta by 1
\@xp\@xp\@xp
\newcommand
\@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar:\endcsname
- [\@tempcnta][\MHempty]
+ [1][\MHempty]
+ {
+ \begingroup
+ \def\delimsize{##1}
+ \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar_inner:}
+ }
+ \@xp\@xp\@xp
+ \newcommand
+ \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar_inner:\endcsname
+ [#2]
{
- \mathopen{\let\MHempty\@gobble\@nameuse {\MH_cs_to_str:N ##1 l} #3}
+ \mathopen{%
+ \let\MHempty\@gobble
+ \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize l\endcsname #3}
#5
- \mathclose{\let\MHempty\@gobble\@nameuse {\MH_cs_to_str:N ##1 r} #4}
+ \mathclose{%
+ \let\MHempty\@gobble
+ \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize r\endcsname #4}
+ \endgroup
}
\DeclareRobustCommand{#1}{
\@ifstar
@@ -877,6 +891,7 @@
\def\MH_ndownarrow: {%
\mathrel{\mathpalette\MH_nrotarrow:NN\nleftarrow} }
\AtBeginDocument{%
+ \RequirePackage{graphicx}%
\@ifundefined{nrightarrow}{%
\providecommand\nuparrow{%
\PackageError{mathtools}{\string\nuparrow\space~ is~
diff --git a/Master/texmf-dist/tex/latex/mh/msabm.sym b/Master/texmf-dist/tex/latex/mh/msabm.sym
index d24fc7fd864..17594c405ab 100644
--- a/Master/texmf-dist/tex/latex/mh/msabm.sym
+++ b/Master/texmf-dist/tex/latex/mh/msabm.sym
@@ -9,7 +9,7 @@
%% This is a generated file.
%%
%% Copyright (C) 1997-2003 by Michael J. Downes
-%% Copyright (C) 2007-2008 by Morten Hoegholm <mh.ctan@gmail.com>
+%% Copyright (C) 2007-2010 by Morten Hoegholm <mh.ctan@gmail.com>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
diff --git a/Master/texmf-dist/tex/latex/mh/xfrac.sty b/Master/texmf-dist/tex/latex/mh/xfrac.sty
index f5d92e5b979..1a6d0ff7d60 100644
--- a/Master/texmf-dist/tex/latex/mh/xfrac.sty
+++ b/Master/texmf-dist/tex/latex/mh/xfrac.sty
@@ -8,15 +8,13 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2004, 2008, 2009 by Morten Hoegholm <mh.ctan@gmail.com>
+%% Copyright (C) 2004, 2008-2010 by Morten Hoegholm <mh.ctan@gmail.com>
%%
%% 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 1.3c 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".
%%
@@ -27,214 +25,374 @@
%% xfrac.sty, xfrac.pdf, xfrac.ins, xfrac.drv.
%%
\RequirePackage{expl3}[2009/08/05]
-\ProvidesExplPackage{xfrac}{2009/08/10}{0.2a}{Text fractions}
-\RequirePackage{textcomp,graphicx,amstext}
-\RequirePackage{template}[2008/08/03]
-\RequirePackage{xparse}[2008/08/03]
-\bool_new:N \g_cm_recommended_bool
-\DeclareOption{cm-recommended}
- { \bool_gset_true:N \g_cm_recommended_bool }
-\DeclareOption{cm-standard}
- { \bool_gset_false:N \g_cm_recommended_bool }
-\ExecuteOptions{cm-recommended}
-\ProcessOptions\relax
-\box_new:N \l_xfrac_temp_box
+\ProvidesExplPackage{xfrac}{2010/02/02}{0.3}{Text fractions}
+\RequirePackage { amstext , graphicx , l3keys2e , textcomp , xtemplate }
+\keys_define:nn { xfrac } {
+ cm-recommended .choice:,
+ cm-recommended /
+ false .code:n =
+ { \bool_set_true:N \l_xfrac_cm_std_bool },
+ cm-recommended /
+ true .code:n =
+ { \bool_set_false:N \l_xfrac_cm_std_bool },
+ cm-recommended .default:n = { true },
+ cm-standard .bool_set:N = \l_xfrac_cm_std_bool
+}
+\ProcessKeysOptions { xfrac }
\box_new:N \l_xfrac_slash_box
-\DeclareTemplateType{xfrac}{3}
-\DeclareTemplate{xfrac}{text}{3}{
- numerator-font = n [\f@family] \xfrac_numeratorfont:,
- numerator-format = f1 [#1] \xfrac_numeratorformat:n,
- slash-symbol = n [\textfractionsolidus]
- \xfrac_slashsymbol:,
- slash-symbol-font = n [\f@family] \xfrac_slashsymbolfont:,
- slash-symbol-format = f1 [#1] \xfrac_slashsymbolformat:n,
- denominator-font = n [\f@family] \xfrac_denominatorfont:,
- denominator-format = f1 [#1] \xfrac_denominatorformat:n,
- h-scale = n [1] \xfrac_hscale:,
- v-scale = n [1] \xfrac_vscale:,
- scale-factor = n [.83333] \xfrac_scalefactor:,
- scale-relative = s [true]
- { \cs_set:Npn \xfrac_relscale: {\box_ht:N\l_xfrac_slash_box}}
- { \cs_set:Npn \xfrac_relscale: {
- \dim_eval:n { \box_ht:N\l_xfrac_temp_box + \box_dp:N\l_xfrac_temp_box }} },
- scaling = s [true]
- {\cs_set:Npn\xfrac_fontscale: {
- \fontsize{\xfrac_scalefactor: \xfrac_relscale:}{\c_zero_dim}\selectfont}}
- { \cs_set_eq:NN \xfrac_fontscale: \prg_do_nothing: },
- numerator-top-sep = L [\c_max_dim] \l_xfrac_numeratortopsep_fdim,
- numerator-bot-sep = L [\c_max_dim] \l_xfrac_numeratorbotsep_fdim,
- denominator-bot-sep = L [\c_max_dim] \l_xfrac_denominatorbotsep_fdim,
- slash-right-kern = L [0pt] \l_xfrac_slashrightsep_fdim,
- slash-left-kern = L [0pt] \l_xfrac_slashleftsep_fdim,
- slash-right-mkern = n [-2mu] \l_xfrac_slashrightmsep_fmu,
- slash-left-mkern = n [-1mu] \l_xfrac_slashleftmsep_fmu,
- math-mode = s [false] { \cs_set_eq:NN \xfrac_math: \ensuremath }
- { \cs_set_eq:NN \xfrac_math: \use:n },
- phantom = n [8] \xfrac_phantom:,
-}{
- \DoParameterAssignments
- \mode_if_math:TF{
- \cs_set_eq:NN \xfrac_textormath: \text
- \cs_set:Npx \xfrac_slashfontchange: {\tex_fam:D \xfrac_slashsymbolfont: }
- \cs_set:Npx \xfrac_numeratorfontchange: {\tex_fam:D \xfrac_numeratorfont: }
- \cs_set:Npx \xfrac_denominatorfontchange: {\tex_fam:D \xfrac_denominatorfont: }
- }{
- \cs_set_eq:NN \xfrac_textormath: \mbox
- \cs_set:Npn\xfrac_slashfontchange: {
- \fontfamily{\xfrac_slashsymbolfont: }\selectfont}
- \cs_set:Npn\xfrac_numeratorfontchange: {
- \fontfamily{\xfrac_numeratorfont: }\selectfont}
- \cs_set:Npn\xfrac_denominatorfontchange: {
- \fontfamily{\xfrac_denominatorfont: }\selectfont}
+\box_new:N \l_xfrac_tmp_box
+\cs_new:Npn \xfrac_tmp:w { }
+\dim_new:N \l_xfrac_denominator_bot_sep_dim
+\dim_new:N \l_xfrac_numerator_bot_sep_dim
+\dim_new:N \l_xfrac_numerator_top_sep_dim
+\dim_new:N \l_xfrac_slash_left_sep_dim
+\dim_new:N \l_xfrac_slash_right_sep_dim
+\tl_new:N \l_xfrac_denominator_font_tl
+\tl_new:N \l_xfrac_hscale_tl
+\tl_new:N \l_xfrac_numerator_font_tl
+\tl_new:N \l_xfrac_phantom_tl
+\tl_new:N \l_xfrac_scale_factor_tl
+\tl_new:N \l_xfrac_slash_left_msep_tl
+\tl_new:N \l_xfrac_slash_right_msep_tl
+\tl_new:N \l_xfrac_slash_symbol_tl
+\tl_new:N \l_xfrac_slash_symbol_font_tl
+\tl_new:N \l_xfrac_vscale_tl
+\cs_new_nopar:Npn \xfrac_fontscale:
+\cs_new:Npn \xfrac_math:n #1 { }
+\cs_new_nopar:Npn \xfrac_denominator_font_change: { }
+\cs_new:Npn \xfrac_denominator_format:n #1 { }
+\cs_new_nopar:Npn \xfrac_numerator_font_change: { }
+\cs_new:Npn \xfrac_numerator_format:n #1 { }
+\cs_new_nopar:Npn \xfrac_relscale: { }
+\cs_new_nopar:Npn \xfrac_slash_symbol_font_change: { }
+\cs_new:Npn \xfrac_slash_symbol_format:n #1 { }
+\cs_new:Npn \xfrac_text_or_math:n #1 { }
+\DeclareObjectType { xfrac } { 3 }
+\DeclareTemplateInterface { xfrac } { text } { 3 } {
+ denominator-bot-sep : length = \c_max_dim ,
+ denominator-font : tokenlist = \f@family ,
+ denominator-format : function 1 = #1 ,
+ h-scale : tokenlist = 1 ,
+ math-mode : choice { false , true }
+ = false ,
+ numerator-font : tokenlist = \f@family ,
+ numerator-format : function 1 = #1 ,
+ numerator-bot-sep : length = \c_max_dim ,
+ numerator-top-sep : length = \c_max_dim ,
+ phantom : tokenlist = 8 ,
+ scale-factor : tokenlist = 0.83333 ,
+ scale-relative : choice { false , true }
+ = true ,
+ scaling : choice { false , true }
+ = true ,
+ slash-left-kern : length = 0 pt ,
+ slash-left-mkern : tokenlist = -2 mu ,
+ slash-right-kern : length = 0 pt ,
+ slash-right-mkern : tokenlist = -1 mu ,
+ slash-symbol : tokenlist = \textfractionsolidus ,
+ slash-symbol-font : tokenlist = \f@family ,
+ slash-symbol-format : function 1 = #1 ,
+ v-scale : tokenlist = 1 ,
+}
+\DeclareTemplateCode { xfrac } { text } { 3 }
+ {
+ denominator-bot-sep = \l_xfrac_denominator_bot_sep_dim ,
+ denominator-font = \l_xfrac_denominator_font_tl ,
+ denominator-format = \xfrac_denominator_format:n ,
+ h-scale = \l_xfrac_hscale_tl ,
+ math-mode =
+ {
+ false = \cs_set_eq:NN \xfrac_math:n \use:n,
+ true = \cs_set_eq:NN \xfrac_math:n \ensuremath
+ },
+ numerator-font = \l_xfrac_numerator_font_tl ,
+ numerator-format = \xfrac_numerator_format:n ,
+ numerator-bot-sep = \l_xfrac_numerator_bot_sep_dim ,
+ numerator-top-sep = \l_xfrac_numerator_top_sep_dim ,
+ phantom = \l_xfrac_phantom_tl ,
+ scale-factor = \l_xfrac_scale_factor_tl ,
+ scale-relative =
+ {
+ false =
+ \cs_set_nopar:Npn \xfrac_relscale:
+ {
+ \dim_eval:n
+ {
+ \box_ht:N \l_xfrac_tmp_box
+ + \box_dp:N \l_xfrac_tmp_box
+ }
+ },
+ true =
+ \cs_set_nopar:Npn \xfrac_relscale:
+ { \box_ht:N \l_xfrac_slash_box }
+ },
+ scaling =
+ {
+ false = \cs_set_eq:NN \xfrac_fontscale: \prg_do_nothing:,
+ true =
+ \cs_set_nopar:Npn \xfrac_fontscale:
+ {
+ \fontsize { \l_xfrac_scale_factor_tl \xfrac_relscale: }
+ { \c_zero_dim }
+ \selectfont
+ }
+ },
+ slash-left-kern = \l_xfrac_slash_left_sep_dim ,
+ slash-left-mkern = \l_xfrac_slash_left_msep_tl ,
+ slash-right-kern = \l_xfrac_slash_right_sep_dim ,
+ slash-right-mkern = \l_xfrac_slash_right_msep_tl ,
+ slash-symbol = \l_xfrac_slash_symbol_tl ,
+ slash-symbol-font = \l_xfrac_slash_symbol_font_tl ,
+ slash-symbol-format = \xfrac_slash_symbol_format:n ,
+ v-scale = \l_xfrac_vscale_tl
}
- \xfrac_textormath: {
- \m@th
- \sbox\l_xfrac_temp_box {\xfrac_math: {\vphantom{(}}}
- \sbox\l_xfrac_slash_box {
- \xfrac_math: {
- \xfrac_slashsymbolformat:n {
- \xfrac_math: {
- \xfrac_slashfontchange:
- \IfValueTF{#2}{#2}{\xfrac_slashsymbol: }
- }
- }
- }
- }
- \dim_compare:nNnTF \l_xfrac_numeratortopsep_fdim = \c_max_dim
- {
- \dim_compare:nNnTF \l_xfrac_numeratorbotsep_fdim = \c_max_dim
+ {
+ \AssignTemplateKeys
+ \mode_if_math:TF
{
- \cs_set:Npn\xfrac_next: {\raisebox{\box_ht:N\l_xfrac_slash_box
- -\box_dp:N\l_xfrac_slash_box-\height}}
- }{
- \cs_set:Npn\xfrac_next: {\raisebox{\l_xfrac_numeratorbotsep_fdim }}
+ \cs_set_eq:NN \xfrac_text_or_math:n \text
+ \cs_set_nopar:Npx \xfrac_denominator_font_change:
+ { \tex_fam:D \l_xfrac_denominator_font_tl }
+ \cs_set_nopar:Npx \xfrac_numerator_font_change:
+ { \tex_fam:D \l_xfrac_numerator_font_tl }
+ \cs_set_nopar:Npx \xfrac_slash_symbol_font_change:
+ { \tex_fam:D \l_xfrac_slash_symbol_font_tl }
}
- }
- {
- \dim_compare:nNnTF \l_xfrac_numeratorbotsep_fdim = \c_max_dim
{
- \cs_set:Npn\xfrac_next: {
- \raisebox{
- \box_ht:N\l_xfrac_slash_box - \l_xfrac_numeratortopsep_fdim
- - \height
+ \cs_set_eq:NN \xfrac_text_or_math:n \mbox
+ \cs_set_nopar:Npn \xfrac_denominator_font_change:
+ {
+ \fontfamily { \l_xfrac_denominator_font_tl }
+ \selectfont
+ }
+ \cs_set_nopar:Npn \xfrac_numerator_font_change:
+ {
+ \fontfamily { \l_xfrac_numerator_font_tl }
+ \selectfont
+ }
+ \cs_set_nopar:Npn \xfrac_slash_symbol_font_change:
+ {
+ \fontfamily { \l_xfrac_slash_symbol_font_tl }
+ \selectfont
}
- }
}
+ \xfrac_text_or_math:n
{
- \PackageError{xfrac}
- {You~ have~ specified~ both~ numerator-top-sep~ and~
- numerator-bot-sep}
- {I~ will~ pretend~ you~ didn't~ specify~ any~ of ~them}
- \cs_set:Npn\xfrac_next: {\raisebox{\box_ht:N\l_xfrac_slash_box
- -\box_dp:N\l_xfrac_slash_box-\height}}
- }
- }
- \xfrac_next: {
- \xfrac_fontscale:
- \xfrac_numeratorformat:n {
- \scalebox{\xfrac_hscale: }[\xfrac_vscale: ]
- { \xfrac_math:{ \xfrac_numeratorfontchange:
- {\vphantom{\xfrac_phantom: }#1} } }
- }
- }
- \xfrac_math: { % THIS IS JUST WRONG!
- \mode_if_math:TF { \mskip \l_xfrac_slashrightmsep_fmu }
- {\hskip \l_xfrac_slashrightsep_fdim}
- }
- \usebox\l_xfrac_slash_box
- \xfrac_math: {
- \mode_if_math:TF {
- \mskip \l_xfrac_slashleftmsep_fmu
- }{
- \hskip \l_xfrac_slashleftsep_fdim
- } }
- \dim_compare:nNnTF \l_xfrac_denominatorbotsep_fdim=\c_max_dim
- { \raisebox{-\box_dp:N \l_xfrac_slash_box} }
- {
- \raisebox{\l_xfrac_denominatorbotsep_fdim}
- }
- {
- \xfrac_fontscale:
- \xfrac_denominatorformat:n {
- \scalebox{\xfrac_hscale:}[\xfrac_vscale:]
- { \xfrac_math: { \xfrac_denominatorfontchange:
- {\vphantom{\xfrac_phantom: }#3} } }
+ \m@th
+ \hbox_set:Nn \l_xfrac_tmp_box
+ { \xfrac_math:n { \vphantom { ( ) } } }
+ \hbox_set:Nn \l_xfrac_slash_box
+ {
+ \xfrac_math:n
+ {
+ \xfrac_slash_symbol_format:n
+ {
+ \xfrac_math:n
+ {
+ \xfrac_slash_symbol_font_change:
+ \IfNoValueTF {#2}
+ { \l_xfrac_slash_symbol_tl } {#2}
+ }
+ }
+ }
+ }
+ \cs_set_nopar:Npn \xfrac_tmp:w
+ {
+ \raisebox
+ {
+ \box_ht:N \l_xfrac_slash_box
+ - \box_dp:N \l_xfrac_slash_box
+ - \height
+ }
+ }
+ \dim_compare:nNnTF
+ { \l_xfrac_numerator_top_sep_dim } = { \c_max_dim }
+ {
+ \dim_compare:nNnF
+ { \l_xfrac_numerator_bot_sep_dim } = { \c_max_dim }
+ {
+ \cs_set_nopar:Npn \xfrac_tmp:w
+ {
+ \raisebox
+ { \dim_use:N \l_xfrac_numerator_bot_sep_dim }
+ }
+ }
+ }
+ {
+ \dim_compare:nNnTF
+ { \l_xfrac_numerator_bot_sep_dim } = { \c_max_dim }
+ {
+ \cs_set_nopar:Npn \xfrac_tmp:w
+ {
+ \raisebox
+ {
+ \box_ht:N \l_xfrac_slash_box
+ - \dim_use:N \l_xfrac_numerator_top_sep_dim
+ - \height
+ }
+ }
+ }
+ {
+ \msg_error:nn { xfrac }
+ { over-specified-numerator-sep }
+ }
+ }
+ \xfrac_tmp:w
+ {
+ \xfrac_fontscale:
+ \xfrac_numerator_format:n
+ {
+ \scalebox { \l_xfrac_hscale_tl } [ \l_xfrac_vscale_tl ]
+ {
+ \xfrac_math:n
+ {
+ \xfrac_numerator_font_change:
+ {
+ \vphantom { \l_xfrac_phantom_tl }
+ #1
+ }
+ }
+ }
+ }
+ }
+ \xfrac_math:n
+ { % THIS IS JUST WRONG!
+ \mode_if_math:TF
+ { \tex_mskip:D \l_xfrac_slash_right_msep_tl }
+ { \tex_hskip:D \l_xfrac_slash_right_sep_dim }
+ }
+ \box_use:N \l_xfrac_slash_box
+ \xfrac_math:n
+ {
+ \mode_if_math:TF
+ { \tex_mskip:D \l_xfrac_slash_left_msep_tl }
+ { \tex_hskip:D \l_xfrac_slash_left_sep_dim }
+ }
+ \dim_compare:nNnTF
+ { \l_xfrac_denominator_bot_sep_dim } = { \c_max_dim }
+ {
+ \cs_set_nopar:Npn \xfrac_tmp:w
+ { \raisebox { - \box_dp:N \l_xfrac_slash_box } }
+ }
+ {
+ \cs_set_nopar:Npn \xfrac_tmp:w
+ {
+ \raisebox
+ { \dim_use:N \l_xfrac_denominator_bot_sep_dim }
+ }
+ }
+ \xfrac_tmp:w
+ {
+ \xfrac_fontscale:
+ \xfrac_denominator_format:n
+ {
+ \scalebox { \l_xfrac_hscale_tl } [ \l_xfrac_vscale_tl ]
+ {
+ \xfrac_math:n
+ {
+ \xfrac_denominator_font_change:
+ {
+ \vphantom { \l_xfrac_phantom_tl }
+ #3
+ }
+ }
+ }
+ }
+ }
}
- }
}
+\DeclareRestrictedTemplate { xfrac } { text } { math } {
+ numerator-font = \number \fam ,
+ slash-symbol = / ,
+ slash-symbol-font = \number \fam ,
+ denominator-font = \number \fam ,
+ scale-factor = 0.7 ,
+ scale-relative = false ,
+ scaling = true ,
+ numerator-top-sep = 0 pt ,
+ denominator-bot-sep = 0 pt ,
+ math-mode = true ,
+ phantom = (
}
-\DeclareRestrictedTemplate{xfrac}{math}{text}{
- numerator-font = \number\fam,
- slash-symbol = /,
- slash-symbol-font = \number\fam,
- denominator-font = \number\fam,
- scale-factor = 0.7,
- scale-relative = false,
- scaling = true,
- numerator-top-sep = 0pt,
- denominator-bot-sep = 0pt,
- math-mode = true,
- phantom = (,
-}
-\DeclareInstance{xfrac}{default}{text}{ }
-\DeclareInstance{xfrac}{mathdefault}{math}{ }
-\DeclareCollectionInstance{plainmath}{xfrac}{mathdefault}{math}{
- denominator-bot-sep=0pt,
- numerator-bot-sep=0pt,
- numerator-top-sep=\c_max_dim,
- scale-factor = 1,
- scale-relative = false,
- scaling = true,
- slash-right-mkern=0mu,
- slash-left-mkern=0mu,
+\DeclareInstance { xfrac } { default } { text } { }
+\DeclareInstance { xfrac } { mathdefault } { math } { }
+\DeclareCollectionInstance { plainmath } { xfrac } { mathdefault }
+ { math }{
+ denominator-bot-sep = 0 pt ,
+ numerator-bot-sep = 0 pt ,
+ numerator-top-sep = \c_max_dim ,
+ scale-factor = 1 ,
+ scale-relative = false ,
+ scaling = true ,
+ slash-right-mkern = 0mu ,
+ slash-left-mkern = 0mu
}
-\DeclareInstance{xfrac}{cmr}{text}{
- denominator-bot-sep=0pt,
- numerator-top-sep=\DelayEvaluation{.2ex},
- slash-left-kern=\DelayEvaluation{-.1em},
- slash-right-kern=\DelayEvaluation{-.1em},
+\DeclareInstance { xfrac } { cmr } { text } {
+ denominator-bot-sep = 0 pt ,
+ numerator-top-sep = 0.2 ex ,
+ slash-left-kern = -0.1 em ,
+ slash-right-kern = -0.1 em
}
-\DeclareInstance{xfrac}{cmss}{text}{
- denominator-bot-sep=0pt,
- numerator-top-sep=\DelayEvaluation{.2ex},
- slash-left-kern=\DelayEvaluation{-.1em},
- slash-right-kern=\DelayEvaluation{-.1em},
+\DeclareInstance { xfrac } { cmss } { text } {
+ denominator-bot-sep = 0 pt ,
+ numerator-top-sep = 0.2 ex ,
+ slash-left-kern = -0.1 em ,
+ slash-right-kern = -0.1 em
}
-\DeclareInstance{xfrac}{cmtt}{text}{
- denominator-bot-sep=0pt,
- numerator-top-sep=\DelayEvaluation{.2ex},
- slash-left-kern=\DelayEvaluation{-.1em},
- slash-right-kern=\DelayEvaluation{-.1em},
+\DeclareInstance { xfrac } { cmtt } { text } {
+ denominator-bot-sep = 0 pt ,
+ numerator-top-sep = 0.2 ex ,
+ slash-left-kern = -0.1 em ,
+ slash-right-kern = -0.1 em
}
-\DeclareCollectionInstance{cm-recommended}{xfrac}{cmr}{text}{
- slash-symbol-font = ptm,
+\bool_if:NF \l_xfrac_cm_std_bool
+ {
+ \DeclareInstance { xfrac } { cmr } { text }
+ { slash-symbol-font = ptm }
+ \DeclareInstance { xfrac } { cmss } { text }
+ { slash-symbol-font = ptm }
+ \DeclareInstance { xfrac } { cmtt } { text }
+ { slash-symbol-font = ppl }
+ }
+\DeclareInstance { xfrac } { lmr } { text } {
+ denominator-bot-sep = 0 pt ,
+ numerator-top-sep = 0.1 ex ,
+ slash-left-kern = -0.15 em ,
+ slash-right-kern = -0.15 em
}
-\DeclareCollectionInstance{cm-recommended}{xfrac}{cmss}{text}{
- slash-symbol-font = ptm,
+\DeclareInstance { xfrac } { lmss } { text } {
+ denominator-bot-sep = 0 pt ,
+ numerator-top-sep = 0 pt ,
+ slash-left-kern = -0.15 em ,
+ slash-right-kern = -0.15 em
}
-\DeclareCollectionInstance{cm-recommended}{xfrac}{cmtt}{text}{
- slash-symbol-font = ppl,
+\DeclareInstance { xfrac } { lmtt } { text } {
+ denominator-bot-sep = 0 pt ,
+ numerator-top-sep = 0 pt ,
+ slash-left-kern = -0.15 em ,
+ slash-right-kern = -0.15 em
}
-\bool_if:NT \g_cm_recommended_bool
- {\UseCollection{xfrac}{cm-recommended}}
-\DeclareDocumentCommand \sfrac {o mom}{
+\msg_new:nnnn { xfrac } { over-specified-numerator-sep }
+ {You have specified both numerator-top-sep and numerator-bot-sep}
+ {I will pretend that you didn't specify either of them}
+\NewDocumentCommand \sfrac { o m o m } {
\mode_if_math:TF
-{
- \cs_set:Npx \xfrac_next: {mathfam\number\fam}
- \IfExistsInstanceTF{xfrac}{\xfrac_next: }
- {\UseInstance{xfrac}{\xfrac_next: }}
- {\UseInstance{xfrac}{mathdefault}}
- {#2}{#3}{#4}
-}
-{
- \IfExistsInstanceTF{xfrac}{#1}
- {\UseInstance{xfrac}{#1}{#2}{#3}{#4}}
- {\IfExistsInstanceTF{xfrac}{\f@family}
- {\UseInstance{xfrac}{\f@family}}
- {\UseInstance{xfrac}{default}}
- {#2}{#3}{#4}
+ {
+ \IfInstanceExistTF { xfrac } { mathfam \number \fam }
+ { \UseInstance { xfrac } { mathfam \number \fam } }
+ { \UseInstance { xfrac } { mathdefault } }
+ {#2} {#3} {#4}
+ }
+ {
+ \IfInstanceExistTF { xfrac } {#1}
+ { \UseInstance { xfrac } {#1} }
+ {
+ \IfInstanceExistTF { xfrac } { \f@family }
+ { \UseInstance { xfrac } { \f@family } }
+ { \UseInstance { xfrac } { default } }
+ }
+ {#2} {#3} {#4}
}
- }
}
\endinput
%%