diff options
author | Karl Berry <karl@freefriends.org> | 2013-07-22 22:06:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-07-22 22:06:24 +0000 |
commit | 730f0f077f73f09896b995953daad44d73895172 (patch) | |
tree | 897f4d552ee2dbf0b473c98d04410afbf4806eee | |
parent | a300dddd47206af864800f785096da3ea60f027e (diff) |
mweights (22jul13)
git-svn-id: svn://tug.org/texlive/trunk@31268 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/mweights/README | 52 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mweights/mweights.sty | 87 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpkg-ctan-check | 2 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/mweights.tlpsrc | 0 |
5 files changed, 141 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/mweights/README b/Master/texmf-dist/doc/latex/mweights/README new file mode 100644 index 00000000000..3c1a228a08d --- /dev/null +++ b/Master/texmf-dist/doc/latex/mweights/README @@ -0,0 +1,52 @@ +This is the README for the mweights package, version 2013-07-21. + +Many font families available for use with LaTeX have multiple +weights, especially when originally aimed at use on the web. For +example, Linux Libertine has both bold and semibold; Cabin, a +sans-serif family, has four weights (regular, medium, semibold, +bold); SourceCodePro, a monospaced family, has seven weights. + +Traditionally the type1-oriented support packages for such fonts +re-define the standard \mddefault or \bfdefault macros. But this can +create difficulties if the weight desired for one font family isn't +available for another font family, or if it differs from the weight +desired for another font family. For example, there is no medium +weight font for Linux Libertine so that setting \mddefault to mb for +use with Cabin will be problematic for Libertine. And \bfdefault +cannot be both sb for use with Cabin and b for use with Libertine, +or vice versa. + +This package provides a solution to these difficulties. The basic +idea (due to Michael Sharpe) is that font packages should *not* +re-define \mddefault or \bfdefault; instead they should define as +many of the following macros as is appropriate: + +\mdseries@rm +\mdseries@sf +\mdseries@tt + +\bfseries@rm +\bfseries@sf +\bfseries@tt + +For example, + +\def\mdseries@sf{mb} +\def\bfseries@sf{b} + +would be appropriate definitions for using a sans font such as Cabin +with medium and bold, and + +\def\bfseries@rm{sb} + +would be appropriate for using a Roman font such as Libertine +with semibold. These macros should always be fully expanded; if +necessary, \edef should be used. + +The package re-defines standard selection commands for series +(\mdseries and \bfseries) and family (\rmfamily, \sffamily, +\ttfamily) to use the macros. It should be a RequiredPackage (for +type1 font use only) in any such font package. + +The package is licensed under the terms of the LaTeX Project Public +License. The maintainer is Bob Tennent (rdt at cs.queensu.ca). 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 diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 16ce2040ac9..eb050515d39 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -317,7 +317,7 @@ my @TLP_working = qw( multicap multienv multiexpand multirow multido multiobjective munich musixguit musixtex musixtex-fonts musuos muthesis - mversion mwcls mwe mxedruli + mversion mwcls mwe mweights mxedruli mychemistry mycv mylatexformat nag nameauth namespc nanumtype1 natbib nath nature navigator ncclatex ncctools diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index 31667219cd8..01681566f72 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -524,6 +524,7 @@ depend multiexpand depend multirow depend mversion depend mwe +depend mweights depend mycv depend mylatexformat depend nag diff --git a/Master/tlpkg/tlpsrc/mweights.tlpsrc b/Master/tlpkg/tlpsrc/mweights.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/mweights.tlpsrc |