summaryrefslogtreecommitdiff
path: root/fonts/sansmathaccent/sansmathaccent.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /fonts/sansmathaccent/sansmathaccent.sty
Initial commit
Diffstat (limited to 'fonts/sansmathaccent/sansmathaccent.sty')
-rw-r--r--fonts/sansmathaccent/sansmathaccent.sty107
1 files changed, 107 insertions, 0 deletions
diff --git a/fonts/sansmathaccent/sansmathaccent.sty b/fonts/sansmathaccent/sansmathaccent.sty
new file mode 100644
index 0000000000..f7f06374fb
--- /dev/null
+++ b/fonts/sansmathaccent/sansmathaccent.sty
@@ -0,0 +1,107 @@
+% sansmathaccent.sty, version 2
+%
+% Fixes a problem with accent placement in beamer and sfmath
+%
+% author: Ariel Barton
+%
+% Copyright Ariel Barton, 2012, 2013
+%
+% 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.
+% The latest version of the license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2003/06/01 or later.
+%
+% This work has the LPPL maintenance status "author-maintained".
+%
+% The complete list of files considered part of this work is in
+% the file `sansmathaccent.pdf' and its source code `sansmathaccent.tex'.
+%
+\ProvidesPackage{sansmathaccent}[2013/03/28]
+
+\def\sansmathaccent@warning{sansmathaccent is not a standalone package; it should be used with beamer or sfmath}
+
+\@ifpackageloaded{bm}{\PackageWarning{sansmathaccent}{Please load bm after loading sansmathaccent}}
+
+\providecommand\beamer@font@check{
+ % Code borrowed from beamerbasefont
+ % to see if we are using any font packages
+ \def\beamer@cmr{cmr}
+ \edef\beamer@fmdef{\mathfamilydefault}
+ % supress for standard cm
+ \ifx\beamer@fmdef\beamer@cmr\beamer@suppressreplacementstrue\fi
+ % supress for mathtime serif and math minion serif
+ \@ifpackageloaded{arevmath}{\ifbeamer@sansmath\else\beamer@suppressreplacementstrue\fi}{}
+ \@ifpackageloaded{hvmath}{\ifbeamer@sansmath\else\beamer@suppressreplacementstrue\fi}{}
+ \@ifpackageloaded{kpfonts}{\ifbeamer@sansmath\else\beamer@suppressreplacementstrue\fi}{}
+ \@ifpackageloaded{lucidabr}{\ifbeamer@sansmath\else\beamer@suppressreplacementstrue\fi}{}
+ \@ifpackageloaded{lucimatx}{\ifbeamer@sansmath\else\beamer@suppressreplacementstrue\fi}{}
+ \@ifpackageloaded{mathpmnt}{\ifbeamer@sansmath\else\beamer@suppressreplacementstrue\fi}{}
+ \@ifpackageloaded{mathpple}{\ifbeamer@sansmath\else\beamer@suppressreplacementstrue\fi}{}
+ \@ifpackageloaded{mathtime}{\ifbeamer@sansmath\else\beamer@suppressreplacementstrue\fi}{}
+ \@ifpackageloaded{mtpro}{\ifbeamer@sansmath\else\beamer@suppressreplacementstrue\fi}{}
+ \@ifpackageloaded{mtpro2}{\ifbeamer@sansmath\else\beamer@suppressreplacementstrue\fi}{}
+}
+
+% Check to see if we are a Beamer document
+\@ifpackageloaded{beamerbasefont}{%
+ \def\sansmathaccent@warning{}
+
+ % Ensure proper placement of accents with bm
+ % but don't waste a mathgroup unless we will in fact use
+ % bm and pureletters
+ \IfFileExists{filehook.sty}{
+ \RequirePackage{filehook}
+ \AtBeginOfFile{bm.sty}{
+ \beamer@font@check \ifbeamer@suppressreplacements\else
+ \DeclareSymbolFont{pureletters}{OT1}{mathkerncmss}{m}{sl}
+ \SetSymbolFont{pureletters}{bold}{OT1}{mathkerncmss}{bx}{sl}
+ \fi
+ }
+ }{
+ \DeclareSymbolFont{pureletters}{OT1}{mathkerncmss}{m}{sl}
+ \SetSymbolFont{pureletters}{bold}{OT1}{mathkerncmss}{bx}{sl}
+ \PackageWarning{sansmathaccent}{Could not find 'filehooks' package: one mathgroup may be wasted}
+ }
+
+ \AtBeginDocument{
+ \ifbeamer@suppressreplacements\else
+ % Check to see if we are using cmss for math
+ \def\sansmathaccent@cmss{cmss}
+ \ifx\beamer@fmdef\sansmathaccent@cmss
+ % Use properly kerned alphabets
+ \DeclareSymbolFont{pureletters}{OT1}{mathkerncmss}{m}{sl}%
+ \ifx\mv@bold\@undefined\else % Compatibility with the bm package
+ \SetSymbolFont{pureletters}{bold}{OT1}{mathkerncmss}{bx}{sl}
+ \fi
+ \else
+ % If we are using sans serif, but not cmss, for math,
+ % make sure bm doesn't accidentally end up using bold cmss
+ \ifx \symboldpureletters \undefined \else
+ \DeclareSymbolFont{boldpureletters}{\encodingdefault} {\mathfamilydefault}{bx}{it}
+ \fi
+ \fi
+ \fi
+}
+}{}
+
+% Check to see if we are a sfmath document
+% This is less fancy, because sfmath doesn't delay with AtBeginDocument
+\@ifpackageloaded{sfmath}{%
+ \def\sansmathaccent@warning{}
+ \edef\tmp@sfdefault{\math@sfdefault}
+ \def\tmp@compare{cmss}
+ \ifx\tmp@sfdefault\tmp@compare % Check to see if we are using cmss for math
+ \DeclareSymbolFont{SFMath}{OT1}{mathkerncmss}{m}{sl}
+ \SetSymbolFont{SFMath}{normal}{OT1}{mathkerncmss}{m}{sl}
+ \SetSymbolFont{SFMath}{bold}{OT1}{mathkerncmss}{bx}{sl}
+ \fi
+}{}
+
+
+\ifx \sansmathaccent@warning\empty \else
+ \PackageWarning{sansmathaccent}{\sansmathaccent@warning}
+\fi \ No newline at end of file