diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-12 23:58:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-12 23:58:49 +0000 |
commit | c32ca6ab2242447b7af4575fefd2be00054436fd (patch) | |
tree | 2be93df9894d2e71c3a8a126b6924fefcce2dd20 | |
parent | ccd366ccd137427fe4ea68d07ea149b5c29c7579 (diff) |
maybemath
git-svn-id: svn://tug.org/texlive/trunk@1076 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/tex/latex/maybemath/maybemath.sty | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/maybemath/maybemath.sty b/Master/texmf-dist/tex/latex/maybemath/maybemath.sty new file mode 100644 index 00000000000..0b88a0c127f --- /dev/null +++ b/Master/texmf-dist/tex/latex/maybemath/maybemath.sty @@ -0,0 +1,51 @@ +\ProvidesPackage{maybemath}[2004/11/29] +\RequirePackage{bm} + +%% A few commands for making math fonts bold or italic +%% according to the context of surrounding text. It is +%% particularly useful for avoiding problems with math +%% boldness in section titles causing unwanted boldness +%% in e.g. the table of contents. +%% +%% Thanks to Viet-Trung Luu on comp.text.tex for providing +%% the first steps to solving this problem. +%% +%% This material is subject to the LaTeX Project Public License. +%% See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html +%% for the details of that license. +%% +%% Author: Andy Buckley <andy@insectnation.org> + + +%% Use the bold symbol if reqd for math fonts +\DeclareRobustCommand{\maybebm}[1]{% + \def\boldname{b}% + \def\boldexname{bx}% + \ifx\f@series\boldname% + \boldsymbol{#1}% + \else\ifx\f@series\boldexname% + \boldsymbol{#1}% + \else% + #1% + \fi\fi% +} + +%% Use \mathrm if not in italic context +%% (``backward logic'' for a reason) +\def\italname{it}% +\DeclareRobustCommand{\maybeit}[1]{% + \ifx\f@shape\italname% + {#1}% + \else% + {\mathrm{#1}}% + \fi% +} + +%% Maybe-italic subscript shifting +\DeclareRobustCommand{\maybeitsubscript}[1]{% + \ifx\f@shape\italname% + {\!\!#1}% + \else% + {#1}% + \fi% +}
\ No newline at end of file |