diff options
author | Karl Berry <karl@freefriends.org> | 2006-12-26 22:59:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-12-26 22:59:27 +0000 |
commit | 2503beec69ff30090720f0148d220f7363a674ef (patch) | |
tree | a421af941e00298ee5fa4bd4b401f7faa6bc9e02 /Master/texmf-dist/tex/latex/ltxmisc/sansmath.sty | |
parent | f3cd1dc8b933fb284a989eb978e81126308c58f5 (diff) |
ltxmisc update
git-svn-id: svn://tug.org/texlive/trunk@2948 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ltxmisc/sansmath.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/ltxmisc/sansmath.sty | 85 |
1 files changed, 57 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/latex/ltxmisc/sansmath.sty b/Master/texmf-dist/tex/latex/ltxmisc/sansmath.sty index 8fe92456b3a..bc757537179 100644 --- a/Master/texmf-dist/tex/latex/ltxmisc/sansmath.sty +++ b/Master/texmf-dist/tex/latex/ltxmisc/sansmath.sty @@ -1,6 +1,6 @@ % LaTeX package sansmath: typeset sans-serif math using `text' fonts. % -\ProvidesPackage{sansmath}[2003/12/14 \space ver 0.5 Donald Arseneau] +\ProvidesPackage{sansmath}[2006/11/10 \space ver 0.7 Donald Arseneau] % % Donald Arseneau, asnd@triumf.ca, Vancouver, Canada. % @@ -37,6 +37,13 @@ % One should also investigate using Euler for ALL MATH in the document, % using package `euler' instead of this one! % +% OT1 encoding is normally required to get the uppercase greek letters, +% but if you use the [EULERGREEK] option or don't use any uppercase greek +% letters, then you are welcome to define \sansmathencoding *before* +% loading this package. There is also a package option [T1] to perform +% that particuler definition. Note the comment above about only cmms +% being good; even the T1-encoded ec fonts are poor substitutes. +% % This package achieves math-italic by reloading the slanted version % of the text sans-serif font, and changing a fontdimen parameter % (spaceskip). This causes the italic correction to be applied between @@ -44,14 +51,42 @@ % (Why does a sans font have these ligatures anyway?) At this point, % nothing is done about this bug. -\DeclareMathAlphabet{\mathsfsl}{OT1}{\sfdefault}{m}{sl} +\providecommand\sansmathencoding{OT1} +\DeclareOption{T1}{ + \def\sansmathencoding{T1} +} + +\let\EulGreek\relax +\let\EuUCGreek\relax +\DeclareOption{EULERGREEK}{ + \ExecuteOptions{eulergreek} + \def\EuUCGreek{% + \@euG\Gamma \@euG\Delta \@euG\Theta \@euG\Lambda \@euG\Xi \@euG\Pi + \@euG\Sigma \@euG\Upsilon \@euG\Phi \@euG\Psi \@euG\Omega +}} +\DeclareOption{eulergreek}{ + \def\EulGreek{% + \ifnum\alpha<\@eugreekOffset + \@eug\alpha \@eug\beta \@eug\gamma \@eug\delta \@eug\epsilon + \@eug\zeta \@eug\eta \@eug\theta \@eug\iota \@eug\kappa \@eug\lambda + \@eug\mu \@eug\nu \@eug\xi \@eug\pi \@eug\rho \@eug\sigma \@eug\tau + \@eug\upsilon \@eug\phi \@eug\chi \@eug\psi \@eug\omega + \@eug\varepsilon \@eug\vartheta \@eug\varpi \@eug\varphi + \EuUCGreek + \let\varrho\rho \let\varsigma\sigma % Euler's missing variants + \fi +}} + +\ProcessOptions + +\DeclareMathAlphabet{\mathsfsl}{\sansmathencoding}{\sfdefault}{m}{sl} \DeclareOldFontCommand{\sfsl}{\normalfont\sffamily\slshape}{\mathsfsl} -\DeclareMathAlphabet{\mathsfbf}{OT1}{\sfdefault}{bx}{sl} +\DeclareMathAlphabet{\mathsfbf}{\sansmathencoding}{\sfdefault}{bx}{sl} \DeclareOldFontCommand{\sfbf}{\normalfont\sffamily\bfseries}{\mathsfbf} \DeclareMathVersion{sans} -\SetMathAlphabet{\mathrm} {sans}{OT1}{\sfdefault}{m}{n} -\SetMathAlphabet{\mathsfsl}{sans}{OT1}{\sfdefault}{m}{sl} +\SetMathAlphabet{\mathrm} {sans}{\sansmathencoding}{\sfdefault}{m}{n} +\SetMathAlphabet{\mathsfsl}{sans}{\sansmathencoding}{\sfdefault}{m}{sl} \SetSymbolFont {operators}{sans}{OT1}{\sfdefault}{m}{n} % The cmm and cmsy are too light for cmss. I tried {b} for the next @@ -59,7 +94,7 @@ \SetSymbolFont {letters} {sans}{OML}{cmm} {m}{it} \SetSymbolFont {symbols} {sans}{OMS}{cmsy}{m}{n} -\SetMathAlphabet{\mathsfbf}{sans}{OT1}{\sfdefault}{bx}{n} +\SetMathAlphabet{\mathsfbf}{sans}{\sansmathencoding}{\sfdefault}{bx}{n} \DeclareMathSymbol{0}{\mathord}{operators}{`0} \DeclareMathSymbol{1}{\mathord}{operators}{`1} @@ -81,28 +116,6 @@ %\DeclareMathSymbol{=}{\mathrel}{operators}{`\=} -\let\EulGreek\relax -\let\EuUCGreek\relax -\DeclareOption{EULERGREEK}{ - \ExecuteOptions{eulergreek} - \def\EuUCGreek{% - \@euG\Gamma \@euG\Delta \@euG\Theta \@euG\Lambda \@euG\Xi \@euG\Pi - \@euG\Sigma \@euG\Upsilon \@euG\Phi \@euG\Psi \@euG\Omega -}} -\DeclareOption{eulergreek}{ - \def\EulGreek{% - \ifnum\alpha<\@eugreekOffset - \@eug\alpha \@eug\beta \@eug\gamma \@eug\delta \@eug\epsilon - \@eug\zeta \@eug\eta \@eug\theta \@eug\iota \@eug\kappa \@eug\lambda - \@eug\mu \@eug\nu \@eug\xi \@eug\pi \@eug\rho \@eug\sigma \@eug\tau - \@eug\upsilon \@eug\phi \@eug\chi \@eug\psi \@eug\omega - \@eug\varepsilon \@eug\vartheta \@eug\varpi \@eug\varrho - \@eug\varsigma \@eug\varphi - \EuUCGreek - \fi -}} -\ProcessOptions - \ifx\EulGreek\relax\else \DeclareSymbolFont{EulerGreek}{U}{eur}{m}{n} \SetSymbolFont{EulerGreek}{sans}{U}{eur}{m}{n} @@ -172,3 +185,19 @@ \let\sansm@every@math\relax +% Repair of a LaTeX bug that has not been fixed in 5 years. +% Latex bug: latex/3357 + +\def \@fontswitch #1#2{% + \ifmmode + \let \math@bgroup \relax + \def \math@egroup ##1{% + \let \math@bgroup \@@math@bgroup + \let \math@egroup \@@math@egroup + ##1}% + #2\relax + \else + #1% + \fi +} + |