summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mweights
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-07-22 22:06:24 +0000
committerKarl Berry <karl@freefriends.org>2013-07-22 22:06:24 +0000
commit730f0f077f73f09896b995953daad44d73895172 (patch)
tree897f4d552ee2dbf0b473c98d04410afbf4806eee /Master/texmf-dist/tex/latex/mweights
parenta300dddd47206af864800f785096da3ea60f027e (diff)
mweights (22jul13)
git-svn-id: svn://tug.org/texlive/trunk@31268 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/mweights')
-rw-r--r--Master/texmf-dist/tex/latex/mweights/mweights.sty87
1 files changed, 87 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/mweights/mweights.sty b/Master/texmf-dist/tex/latex/mweights/mweights.sty
new file mode 100644
index 00000000000..f6303f71a14
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/mweights/mweights.sty
@@ -0,0 +1,87 @@
+\ProvidesPackage{mweights}
+ [2013/07/21 (Bob Tennent) Support package for multiple-weight font packages. ]
+
+\AtBeginDocument{%
+ % Define any undefined \mdseries@rm etc.
+ % Defined \mdseries@rm etc. assumed to be fully expanded!
+ \ifdefined\mdseries@rm\else\edef\mdseries@rm{\mddefault}\fi
+ \ifdefined\bfseries@rm\else\edef\bfseries@rm{\bfdefault}\fi
+ \ifdefined\mdseries@sf\else\edef\mdseries@sf{\mddefault}\fi
+ \ifdefined\bfseries@sf\else\edef\bfseries@sf{\bfdefault}\fi
+ \ifdefined\mdseries@tt\else\edef\mdseries@tt{\mddefault}\fi
+ \ifdefined\bfseries@tt\else\edef\bfseries@tt{\bfdefault}\fi
+
+ % In case any unexpanded macros present in \rmdefault, etc
+ \edef\rmdef@ult{\rmdefault}
+ \edef\sfdef@ult{\sfdefault}
+ \edef\ttdef@ult{\ttdefault}
+ \edef\bfdef@ult{\bfdefault}
+ \edef\mddef@ult{\mddefault}
+}
+
+\DeclareRobustCommand\bfseries{%
+\not@math@alphabet\bfseries\mathbf
+\ifx\f@family\rmdef@ult\fontseries\bfseries@rm
+\else\ifx\f@family\sfdef@ult\fontseries\bfseries@sf
+\else\ifx\f@family\ttdef@ult\fontseries\bfseries@tt
+\else\fontseries\bfdefault\fi\fi\fi\selectfont}%
+
+\DeclareRobustCommand\mdseries{%
+\not@math@alphabet\mdseries\relax
+\ifx\f@family\rmdef@ult\fontseries\mdseries@rm
+\else\ifx\f@family\sfdef@ult\fontseries\mdseries@sf
+\else\ifx\f@family\ttdef@ult\fontseries\mdseries@tt
+\else\fontseries\mddefault\fi\fi\fi\selectfont}
+
+\DeclareRobustCommand\rmfamily{%
+\not@math@alphabet\rmfamily\mathrm
+% change the current series before changing the family
+\ifx\f@family\sfdef@ult
+ \ifx\f@series\mdseries@sf\fontseries\mdseries@rm
+ \else\ifx\f@series\bfseries@sf\fontseries\bfseries@rm
+ \else\ifx\f@series\mddef@ult\fontseries\mdseries@rm
+ \else\ifx\f@series\bfdef@ult\fontseries\bfseries@rm
+ \fi\fi\fi\fi
+\else\ifx\f@family\ttdef@ult
+ \ifx\f@series\mdseries@tt\fontseries\mdseries@rm
+ \else\ifx\f@series\bfseries@tt\fontseries\bfseries@rm
+ \else\ifx\f@series\mddef@ult\fontseries\mdseries@rm
+ \else\ifx\f@series\bfdef@ult\fontseries\bfseries@rm
+ \fi\fi\fi\fi
+\fi\fi\fontfamily\rmdefault\selectfont}
+
+\DeclareRobustCommand\sffamily{%
+\not@math@alphabet\sffamily\mathsf
+% change the current series before changing the family
+\ifx\f@family\rmdef@ult
+ \ifx\f@series\mdseries@rm\fontseries\mdseries@sf
+ \else\ifx\f@series\bfseries@rm\fontseries\bfseries@sf
+ \else\ifx\f@series\mddef@ult\fontseries\mdseries@sf
+ \else\ifx\f@series\bfdef@ult\fontseries\bfseries@sf
+ \fi\fi\fi\fi
+\else\ifx\f@family\ttdef@ult
+ \ifx\f@series\mdseries@tt\fontseries\mdseries@sf
+ \else\ifx\f@series\bfseries@tt\fontseries\bfseries@sf
+ \else\ifx\f@series\mddef@ult\fontseries\mdseries@sf
+ \else\ifx\f@series\bfdef@ult\fontseries\bfseries@sf
+ \fi\fi\fi\fi
+\fi\fi\fontfamily\sfdefault\selectfont}
+
+\DeclareRobustCommand\ttfamily{%
+\not@math@alphabet\ttfamily\mathtt
+% change the current series before changing the family
+\ifx\f@family\rmdef@ult
+ \ifx\f@series\mdseries@rm\fontseries\mdseries@tt
+ \else\ifx\f@series\bfseries@rm\fontseries\bfseries@tt
+ \else\ifx\f@series\mddef@ult\fontseries\mdseries@tt
+ \else\ifx\f@series\bfdef@ult\fontseries\bfseries@tt
+ \fi\fi\fi\fi
+\else\ifx\f@family\sfdef@ult
+ \ifx\f@series\mdseries@sf\fontseries\mdseries@tt
+ \else\ifx\f@series\bfseries@sf\fontseries\bfseries@tt
+ \else\ifx\f@series\mddef@ult\fontseries\mdseries@tt
+ \else\ifx\f@series\bfdef@ult\fontseries\bfseries@tt
+ \fi\fi\fi\fi
+\fi\fi\fontfamily\ttdefault\selectfont}
+
+\endinput