summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/typeface
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 /macros/latex/contrib/typeface
Initial commit
Diffstat (limited to 'macros/latex/contrib/typeface')
-rw-r--r--macros/latex/contrib/typeface/README56
-rw-r--r--macros/latex/contrib/typeface/typeface-all-rm.bat111
-rw-r--r--macros/latex/contrib/typeface/typeface-all-rm.pdfbin0 -> 17847763 bytes
-rw-r--r--macros/latex/contrib/typeface/typeface-test.tex135
-rw-r--r--macros/latex/contrib/typeface/typeface.cfg320
-rw-r--r--macros/latex/contrib/typeface/typeface.pdfbin0 -> 443645 bytes
-rw-r--r--macros/latex/contrib/typeface/typeface.sty5355
-rw-r--r--macros/latex/contrib/typeface/typeface.tex1067
8 files changed, 7044 insertions, 0 deletions
diff --git a/macros/latex/contrib/typeface/README b/macros/latex/contrib/typeface/README
new file mode 100644
index 0000000000..421ede7545
--- /dev/null
+++ b/macros/latex/contrib/typeface/README
@@ -0,0 +1,56 @@
+
+The Typeface Package v0.1 (2012/05/28) Prerelease - release for review
+======================================================================
+
+The typeface package provides a relatively easy-to-use facility for
+setting up default roman, sans serif, typewriter, math, symbols and
+lining/text figures Type1 fonts in LaTeX documents. Its purpose is to
+make it easy to choose, mix and match fonts from among the main Type1
+font sets available at CTAN. Other Type1 fonts can be readily
+incorporated into typeface package management by modifying the provided
+configuration file.
+
+Ignoring the typographic dubiousness of this example, the following code
+will initialise \rmdefault to the light, old style figures variant of KP
+Fonts, \sfdefault to Helvetica, and \ttdefault to Luxi Mono typewriter.
+Math fonts will be initialised to Math Design with Charter text. In the
+process, math fonts and Helvetica will be automatically scaled to the
+ex-height of KP Fonts. Luxi Mono will be scaled to 90% of its design
+size.
+
+ \useackage[typeface=kpfonts:light,
+ sanstypeface=helvetica,
+ monotypeface=luxi:scale:0.9,
+ textfigures=oldstylefigures,
+ mathtypeface=mathdesign:charter,
+ ]{typeface}
+
+The typeface package contains the following files:
+
+ - README - the package README file (this document)
+ - typeface.pdf - the package manual
+ - typeface.tex - the package manual source code
+ - typeface.sty - the typeface package
+ - typeface.cfg - installation customisation and reconfiguration file
+ - typeface-test.tex - typeface package test harness
+ - typeface-test-all-rm.pdf - a very large font exhibits file (~16MB)
+ - typeface-test-all-rm.bat - the MS-DOS script used to produce the file above
+
+See the documentation `typeface.pdf' for further details.
+
+Change history
+--------------
+ - v0.1 (2012/05/28) Prerelease - release for review
+
+License
+-------
+
+Copyright 2012 Geoffrey Jones <geoffrey.jones@uqconnect.edu.au>
+
+Distributable under the LaTeX Project Public License, version 1.3c or
+higher (your choice). The latest version of this license is at:
+http://www.latex-project.org/lppl.txt
+
+This work is "maintained" (per LPPL maintenance status) by Geoffrey Jones.
+
+
diff --git a/macros/latex/contrib/typeface/typeface-all-rm.bat b/macros/latex/contrib/typeface/typeface-all-rm.bat
new file mode 100644
index 0000000000..6b20847028
--- /dev/null
+++ b/macros/latex/contrib/typeface/typeface-all-rm.bat
@@ -0,0 +1,111 @@
+REM @echo OFF
+Setlocal ENABLEEXTENSIONS
+
+REM Set TeXLive or MiKTeX path
+REM Set PATH=I:\TexLive\2011\bin\win32;%PATH%
+
+REM Uses latexmk, which requires perl.
+
+latexmk -jobname=rm001 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{default}\newcommand\TFTESTdebug{true}\input{%%S}" typeface-test
+latexmk -jobname=rm002 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{default}\newcommand\TFTESTfontencoding{OT1}\input{%%S}" typeface-test
+latexmk -jobname=rm003 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{garamond}\newcommand\TFTESTdebug{true}\newcommand\TFTESTtextfigures{kpfonts:spacing:-30}\newcommand\TFTESTsanstypeface{bera}\newcommand\TFTESTmonotypeface{luxi}\newcommand\TFTESTmathtypeface{mathdesign:charter:greekuppercase:upright}\newcommand\TFTESTsymbolstypeface{default}\input{%%S}" typeface-test
+latexmk -jobname=rm004 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{garamond}\newcommand\TFTESTdebug{true}\newcommand\TFTESTtextfigures{kpfonts:scale:1}\newcommand\TFTESTsanstypeface{bera:scale:1}\newcommand\TFTESTmonotypeface{luxi:scale:1}\newcommand\TFTESTmathtypeface{mathdesign:charter:greekuppercase:upright:scale:1}\newcommand\TFTESTsymbolstypeface{default}\input{%%S}" typeface-test
+latexmk -jobname=rm005 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adfbaskervald}\input{%%S}" typeface-test
+latexmk -jobname=rm006 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adfbaskervald:lig}\input{%%S}" typeface-test
+latexmk -jobname=rm007 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adfberenis}\input{%%S}" typeface-test
+latexmk -jobname=rm008 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adfberenis:lig:tab}\newcommand\TFTESTtextfigures{osf}\newcommand\TFTESTmathtypeface{gfsdidot}\input{%%S}" typeface-test
+latexmk -jobname=rm009 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adfelectrum}\input{%%S}" typeface-test
+latexmk -jobname=rm010 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adfelectrum:lig}\newcommand\TFTESTtextfigures{osf}\input{%%S}" typeface-test
+latexmk -jobname=rm011 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adfromande}\input{%%S}" typeface-test
+latexmk -jobname=rm012 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adfromande:alt}\input{%%S}" typeface-test
+latexmk -jobname=rm013 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adfventuris}\input{%%S}" typeface-test
+latexmk -jobname=rm014 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adfventuris:2}\newcommand\TFTESTmathtypeface{fourier}\input{%%S}" typeface-test
+latexmk -jobname=rm015 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adfventuris:old}\input{%%S}" typeface-test
+latexmk -jobname=rm016 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{ae}\newcommand\TFTESTmathtypeface{euler}\input{%%S}" typeface-test
+latexmk -jobname=rm017 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{antpol}\newcommand\TFTESTmathtypeface{anttor}\input{%%S}" typeface-test
+latexmk -jobname=rm018 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{antpol:light}\newcommand\TFTESTtextfigures{osf}\newcommand\TFTESTmathtypeface{iwona:light}\input{%%S}" typeface-test
+latexmk -jobname=rm019 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{anttor}\newcommand\TFTESTtextfigures{osf}\newcommand\TFTESTmathtypeface{euler}\input{%%S}" typeface-test
+latexmk -jobname=rm020 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{anttor:light}\newcommand\TFTESTmathtypeface{anttor}\input{%%S}" typeface-test
+latexmk -jobname=rm021 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{anttor:light}\newcommand\TFTESTmathtypeface{anttor:condensed}\input{%%S}" typeface-test
+latexmk -jobname=rm022 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{augie}\input{%%S}" typeface-test
+latexmk -jobname=rm023 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{auriocus}\input{%%S}" typeface-test
+latexmk -jobname=rm024 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{beraserif}\input{%%S}" typeface-test
+latexmk -jobname=rm025 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{bitstreamcharter}\TFTESTtextfigures{libertine}\newcommand\TFTESTmathtypeface{mathdesign}\input{%%S}" typeface-test
+latexmk -jobname=rm026 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{cmbright}\newcommand\TFTESTmathtypeface{cmbright}\input{%%S}" typeface-test
+latexmk -jobname=rm027 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{cmdunhill}\input{%%S}" typeface-test
+latexmk -jobname=rm028 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{cmfibonacci}\input{%%S}" typeface-test
+latexmk -jobname=rm029 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{computermodern}\newcommand\TFTESTmathtypeface{ams}\input{%%S}" typeface-test
+latexmk -jobname=rm030 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{computermodern}\newcommand\TFTESTtextfigures{osf}\newcommand\TFTESTmathtypeface{ams}\newcommand\TFTESTfontencoding{OT1}\input{%%S}" typeface-test
+latexmk -jobname=rm031 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{concrete}\newcommand\TFTESTmathtypeface{concrete}\input{%%S}" typeface-test
+latexmk -jobname=rm032 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{dayrom}\input{%%S}" typeface-test
+latexmk -jobname=rm033 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{dayrom:s}\input{%%S}" typeface-test
+latexmk -jobname=rm034 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{dejavu}\input{%%S}" typeface-test
+latexmk -jobname=rm035 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{dejavu:condensed}\input{%%S}" typeface-test
+latexmk -jobname=rm036 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{droid}\input{%%S}" typeface-test
+latexmk -jobname=rm037 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{europeanmodern}\newcommand\TFTESTmathtypeface{ams}\input{%%S}" typeface-test
+latexmk -jobname=rm038 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{europeanmodern}\newcommand\TFTESTtextfigures{osf}\newcommand\TFTESTmathtypeface{euler}\input{%%S}" typeface-test
+latexmk -jobname=rm039 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{gfsartemisia}\input{%%S}" typeface-test
+latexmk -jobname=rm040 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{gfsartemisia}\newcommand\TFTESTtextfigures{osf}\newcommand\TFTESTmathtypeface{anttor:condensed:light}\input{%%S}" typeface-test
+latexmk -jobname=rm041 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{gfsbodoni}\input{%%S}" typeface-test
+latexmk -jobname=rm042 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{gfsdidot}\input{%%S}" typeface-test
+latexmk -jobname=rm043 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{gfsneohellenic}\newcommand\TFTESTmathtypeface{cmbright}\input{%%S}" typeface-test
+latexmk -jobname=rm044 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{gyrebonum}\input{%%S}" typeface-test
+latexmk -jobname=rm045 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{gyrepagella}\newcommand\TFTESTtextfigures{palatino}\newcommand\TFTESTmathtypeface{pazo}\input{%%S}" typeface-test
+latexmk -jobname=rm046 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{gyreschola}\newcommand\TFTESTmathtypeface{mathdesign}\input{%%S}" typeface-test
+latexmk -jobname=rm047 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{gyretermes}\newcommand\TFTESTsymbolstypeface{mathabx}\input{%%S}" typeface-test
+latexmk -jobname=rm048 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{iwona}\newcommand\TFTESTmathtypeface{iwona}\input{%%S}" typeface-test
+latexmk -jobname=rm049 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{iwona:light}\newcommand\TFTESTtextfigures{osf}\newcommand\TFTESTmathtypeface{iwona:light}\input{%%S}" typeface-test
+latexmk -jobname=rm050 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{jamtimes}\newcommand\TFTESTmathtypeface{ams}\input{%%S}" typeface-test
+latexmk -jobname=rm051 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{kerkis}\input{%%S}" typeface-test
+latexmk -jobname=rm052 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{kpfonts}\newcommand\TFTESTtextfigures{osf}\newcommand\TFTESTsanstypeface{kpfonts:lsf}\input{%%S}" typeface-test
+latexmk -jobname=rm053 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{kpfonts:largesmallcaps}\input{%%S}" typeface-test
+latexmk -jobname=rm054 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{kpfonts:light}\input{%%S}" typeface-test
+latexmk -jobname=rm055 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{kpfonts:light:nofligatures}\newcommand\TFTESTtextfigures{liningfigures}\input{%%S}" typeface-test
+latexmk -jobname=rm056 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{kpfonts:oldstyle}\input{%%S}" typeface-test
+latexmk -jobname=rm057 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{kpfonts:veryoldstyle}\input{%%S}" typeface-test
+latexmk -jobname=rm058 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{kurier}\newcommand\TFTESTmathtypeface{kurier}\input{%%S}" typeface-test
+latexmk -jobname=rm059 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{latinmodern}\input{%%S}" typeface-test
+latexmk -jobname=rm060 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{latinmodern:boldsc}\input{%%S}" typeface-test
+latexmk -jobname=rm061 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{libertine}\newcommand\TFTESTsanstypeface{biolinum:scale:1}\newcommand\TFTESTmathtypeface{pazo}\input{%%S}" typeface-test
+latexmk -jobname=rm062 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{libertine}\newcommand\TFTESTtextfigures{osf}\newcommand\TFTESTsanstypeface{arial:scale:uppercase}\newcommand\TFTESTmathtypeface{adobeminionpro:lf}\input{%%S}" typeface-test
+latexmk -jobname=rm063 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{lucidabright}\newcommand\TFTESTmathtypeface{pazo}\input{%%S}" typeface-test
+latexmk -jobname=rm064 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{lucidabright:lucidasmallscale}\newcommand\TFTESTtextfigures{osf}\input{%%S}" typeface-test
+latexmk -jobname=rm065 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{newcenturyschoolbook}\newcommand\TFTESTmathtypeface{fourier}\input{%%S}" typeface-test
+latexmk -jobname=rm066 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{palatino}\newcommand\TFTESTmathtypeface{pazo}\input{%%S}" typeface-test
+latexmk -jobname=rm067 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{palatino}\newcommand\TFTESTtextfigures{osf}\newcommand\TFTESTmathtypeface{fourier}\input{%%S}" typeface-test
+latexmk -jobname=rm068 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{ptserif}\input{%%S}" typeface-test
+latexmk -jobname=rm069 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{pxfonts}\input{%%S}" typeface-test
+latexmk -jobname=rm070 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{times}\newcommand\TFTESTmathtypeface{mtpro:lite}\input{%%S}" typeface-test
+latexmk -jobname=rm071 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{times}\newcommand\TFTESTmathtypeface{mathptmx}\input{%%S}" typeface-test
+latexmk -jobname=rm072 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{txfonts}\input{%%S}" typeface-test
+latexmk -jobname=rm073 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{txfonts:new}\newcommand\TFTESTmathtypeface{txfonts:new:varg:cmintegrals:cmbraces}\input{%%S}" typeface-test
+latexmk -jobname=rm074 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{uncial}\TFTESTmathtypeface{arev}\input{%%S}" typeface-test
+latexmk -jobname=rm075 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{urwantiqua}\newcommand\TFTESTmathtypeface{mtpro}\input{%%S}" typeface-test
+latexmk -jobname=rm076 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{urwbookman}\newcommand\TFTESTmathtypeface{pazo}\input{%%S}" typeface-test
+latexmk -jobname=rm077 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{urwgaramond}\newcommand\TFTESTmathtypeface{mathdesign}\input{%%S}" typeface-test
+latexmk -jobname=rm078 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{urwgaramond}\newcommand\TFTESTmathtypeface{mathdesign}\newcommand\TFTESTtextfigures{palatino}\input{%%S}" typeface-test
+latexmk -jobname=rm079 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{urwnimbus}\newcommand\TFTESTsanstypeface{urwnimbus}\input{%%S}" typeface-test
+latexmk -jobname=rm080 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{utopia}\newcommand\TFTESTmathtypeface{mathdesign}\input{%%S}" typeface-test
+latexmk -jobname=rm081 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{utopia}\newcommand\TFTESTtextfigures{libertine:spacing:-10}\newcommand\TFTESTmathtypeface{mtpro}\input{%%S}" typeface-test
+latexmk -jobname=rm082 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{zapfchancery}\input{%%S}" typeface-test
+latexmk -jobname=rm083 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adobebembo}\input{%%S}" typeface-test
+latexmk -jobname=rm084 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adobecaslon}\input{%%S}" typeface-test
+latexmk -jobname=rm085 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adobegaramond}\input{%%S}" typeface-test
+latexmk -jobname=rm086 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adobegranjon}\input{%%S}" typeface-test
+latexmk -jobname=rm087 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adobejanson}\newcommand\TFTESTmathtypeface{fourier}\input{%%S}" typeface-test
+latexmk -jobname=rm088 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adobejenson}\newcommand\TFTESTmathtypeface{adobeminionpro}\input{%%S}" typeface-test
+latexmk -jobname=rm089 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adobejenson}\newcommand\TFTESTtextfigures{adobesabon}\newcommand\TFTESTmathtypeface{pazo}\input{%%S}" typeface-test
+latexmk -jobname=rm090 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adobelucida}\newcommand\TFTESTmathtypeface{arev}\input{%%S}" typeface-test
+latexmk -jobname=rm091 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adobeminionpro}\newcommand\TFTESTmathtypeface{adobeminionpro}\input{%%S}" typeface-test
+latexmk -jobname=rm092 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adobesabon}\newcommand\TFTESTmathtypeface{adobeminionpro}\input{%%S}" typeface-test
+latexmk -jobname=rm093 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{adobetimesexpert}\newcommand\TFTESTmathtypeface{mtpro}\input{%%S}" typeface-test
+latexmk -jobname=rm094 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{hoeflertext}\input{%%S}" typeface-test
+latexmk -jobname=rm095 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{linotypedidot}\newcommand\TFTESTmathtypeface{mathdesign}\input{%%S}" typeface-test
+latexmk -jobname=rm096 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{linotypesabon}\newcommand\TFTESTtextfigures{adobeminionpro:spacing:-20}\input{%%S}" typeface-test
+latexmk -jobname=rm097 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{linotypesabon}\newcommand\TFTESTtextfigures{adobeminionpro:spacing:0:lkern:-50:rkern:50}\input{%%S}" typeface-test
+latexmk -jobname=rm098 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{linotypesabon}\newcommand\TFTESTtextfigures{adobeminionpro:spacing:200}\input{%%S}" typeface-test
+latexmk -jobname=rm099 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{linotypesabon}\newcommand\TFTESTtextfigures{adobeminionpro:spacing:20}\input{%%S}" typeface-test
+latexmk -jobname=rm100 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{linotypetimesten}\newcommand\TFTESTmathtypeface{mtpro}\input{%%S}" typeface-test
+latexmk -jobname=rm101 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{monotypescotchroman}\input{%%S}" typeface-test
+latexmk -jobname=rm102 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{ebgaramond}\newcommand\TFTESTtextfigures{osf}\newcommand\TFTESTmathtypeface{adobeminionpro:lsf}\input{%%S}" typeface-test
+latexmk -jobname=rm103 -silent -f -pdf -pdflatex="pdflatex %%O \newcommand\TFTESTfontfamily{rm}\newcommand\TFTESTtypeface{vgaramond}\newcommand\TFTESTtextfigures{osf}\newcommand\TFTESTmathtypeface{mathdesign}\input{%%S}" typeface-test \ No newline at end of file
diff --git a/macros/latex/contrib/typeface/typeface-all-rm.pdf b/macros/latex/contrib/typeface/typeface-all-rm.pdf
new file mode 100644
index 0000000000..75ddc32aca
--- /dev/null
+++ b/macros/latex/contrib/typeface/typeface-all-rm.pdf
Binary files differ
diff --git a/macros/latex/contrib/typeface/typeface-test.tex b/macros/latex/contrib/typeface/typeface-test.tex
new file mode 100644
index 0000000000..2a7550dacd
--- /dev/null
+++ b/macros/latex/contrib/typeface/typeface-test.tex
@@ -0,0 +1,135 @@
+%-------- Typeface Package Test Harness -- User-configurable Section ----------
+%
+\providecommand*\TFTESTdocumentclass{article} % or memoir, scrartcl, etc.
+
+\providecommand*\TFTESTfontfamily{rm} % set to rm, sf or tt
+\providecommand*\TFTESTfontsize{10pt} % 11pt, 12pt, others if memoir
+\providecommand*\TFTESTpapersize{a4paper}
+
+\providecommand*\TFTESTfontencoding{default}
+\providecommand*\TFTESTinputencoding{default}
+\providecommand*\TFTESTtextcomp{default}
+\providecommand*\TFTESTcmap{default}
+\providecommand*\TFTESTtypeface{default}
+\providecommand*\TFTESTtextfigures{default}
+\providecommand*\TFTESTsanstypeface{default}
+\providecommand*\TFTESTmonotypeface{default}
+\providecommand*\TFTESTmathtypeface{default}
+\providecommand*\TFTESTsymbolstypeface{default}
+\providecommand*\TFTESTfontloadorder{default}
+
+\providecommand*\TFTESTdebug{false}
+\providecommand*\TFTESTprintmathfonts{false}
+\providecommand*\TFTESTincludemicrotype{true}
+%
+%--------------- End User-configurable Section --------------------------------
+
+% Note that this document attempts to typeset text in many font weights,
+% widths, shapes, variants, encodings and sizes. It calls on, e.g.,
+% \oldstylenums regardless of loaded font. Line lengths in tables do not take
+% account of actual page line width. Thus, depending on the font families you
+% load, you should expect to receive several, if not many, warnings and
+% overfull boxes. Do not be concerned (unless, of course, something is
+% actually wrong).
+
+\documentclass[\TFTESTfontsize,\TFTESTpapersize]{\TFTESTdocumentclass}
+\usepackage[margin=1.0cm,
+ %showframe,
+ ]{geometry}
+
+\usepackage{ifthen}
+\usepackage{parskip}
+
+% Microtype is required for substitute figures letterspacing in textnums
+% environments (advance usage). However, note that microtype doesn't partner
+% well with bitmap fonts, especially if any scaling is involved. In these
+% cases, microtype will very likely throw "auto expansion is only possible
+% with scalable fonts" errors.
+\ifthenelse{\equal{\TFTESTincludemicrotype}{true}}{
+ \usepackage[verbose=errors]{microtype}
+}{}
+
+\usepackage[
+ fontencoding=\TFTESTfontencoding,
+ inputencoding=\TFTESTinputencoding,
+ textcomp=\TFTESTtextcomp,
+ cmap=\TFTESTcmap,
+ typeface=\TFTESTtypeface,
+ textfigures=\TFTESTtextfigures,
+ mathtypeface=\TFTESTmathtypeface,
+ symbolstypeface=\TFTESTsymbolstypeface,
+ sanstypeface=\TFTESTsanstypeface,
+ monotypeface=\TFTESTmonotypeface,
+ fontloadorder=\TFTESTfontloadorder,
+ debug=\TFTESTdebug,
+ printinfo=true,
+]{typeface}
+
+% Redefine equation numbering simply for testing's sake
+\DeclareRobustCommand*\theequation{%
+ \ifthenelse{\equal{\TFTESTfontfamily}{rm}}{%
+ \protect\begin{textnums}3.\arabic{equation}\protect\end{textnums}%
+ }{%
+ \ifthenelse{\equal{\TFTESTfontfamily}{sf}}{%
+ 4.\arabic{equation}%
+ }{% \TFTESTfontfamily=tt
+ 5.\arabic{equation}%
+ }%
+ }%
+}
+
+% While we're at it, redefine our equation numbering presentation
+% format, again for testing's sake
+\makeatletter\def\@eqnnum{{(\theequation)}}\makeatother
+
+\usepackage{bookmark}[2010/04/08]
+
+\ifthenelse{\equal{\TFTESTfontfamily}{rm}}{
+ \newcommand*\TFbookmark{\rmprintname}
+}{
+ \ifthenelse{\equal{\TFTESTfontfamily}{sf}}
+ {\newcommand*\TFbookmark{\sfprintname}}
+ {\newcommand*\TFbookmark{\ttprintname}}
+}
+
+\ifthenelse{\equal{\TFTESTfontfamily}{rm}}
+ {\def\typeface{typeface}\def\typefacename{\textrm{\TFTESTtypeface}}}{}%
+\ifthenelse{\equal{\TFTESTfontfamily}{sf}}
+ {\def\typeface{sanstypeface}\def\typefacename{\textsf{\TFTESTsanstypeface}}}{}%
+\ifthenelse{\equal{\TFTESTfontfamily}{tt}}
+ {\def\typeface{monotypeface}\def\typefacename{\texttt{\TFTESTmonotypeface}}}{}%
+
+\begin{document}
+ \hypertarget{\TFbookmark}{}
+ \bookmark[dest=\TFbookmark, level=0]{\TFbookmark}
+ \pagestyle{empty}
+ \raggedbottom
+ \section*{Test page: \typeface\(=\)\typefacename \space{(\TFTESTfontsize)}}
+ \tfprintpackageoptions%
+ \tfprintinfo%
+ \tfprinttext{\TFTESTfontfamily}%
+ \tfprintfigures{\TFTESTfontfamily}%
+ \tfprintmathsample{\TFTESTfontfamily}%
+ \tfprintmathalphabets{\TFTESTfontfamily}%
+ \ifthenelse{\equal{\TFTESTprintmathfonts}{true}}{\tfprintmathfonts}{}%
+ \tfprinttextsample{\TFTESTfontfamily}%
+ \tfprinttextalphabets%
+ {\noindent\footnotesize{\rmfamily\selectfont $footnotesize$footnotesize}%
+ {\sffamily\selectfont footnotesize}%
+ {\ttfamily\selectfont footnotesize}%
+ {\rmfamily\selectfont$0123456789$\begin{textnums}0123456789\end{textnums}}%
+ {\sffamily\selectfont\begin{textnums}0123456789\end{textnums}}%
+ {\ttfamily\selectfont\begin{textnums}0123456789\end{textnums}}}\\%
+ {\normalsize{\rmfamily\selectfont $Normal$Normal}%
+ {\sffamily\selectfont Normal}%
+ {\ttfamily\selectfont Normal}%
+ {\rmfamily\selectfont$0123456789$\begin{textnums}0123456789\end{textnums}}%
+ {\sffamily\selectfont\begin{textnums}0123456789\end{textnums}}%
+ {\ttfamily\selectfont\begin{textnums}0123456789\end{textnums}}}\\%
+ {\Large{\rmfamily\selectfont $Large$Large}%
+ {\sffamily\selectfont Large}%
+ {\ttfamily\selectfont Large}%
+ {\rmfamily\selectfont$0123456789$\begin{textnums}0123456789\end{textnums}}%
+ {\sffamily\selectfont\begin{textnums}0123456789\end{textnums}}%
+ {\mbox{\ttfamily\selectfont\begin{textnums}0123456789\end{textnums}}}}\\%
+\end{document}
diff --git a/macros/latex/contrib/typeface/typeface.cfg b/macros/latex/contrib/typeface/typeface.cfg
new file mode 100644
index 0000000000..9921673066
--- /dev/null
+++ b/macros/latex/contrib/typeface/typeface.cfg
@@ -0,0 +1,320 @@
+% $Id: typeface.cfg 905 2012-06-18 03:44:37Z Geoffrey $
+%
+\ProvidesFile{\TF@CONFIGFILE}
+ [2012/03/05 \TF@PACKAGENAME\space package configuration file]
+
+% Provide some EXTRA encoding choices to typeface package users at
+% this site. NB, internal code, so comma not colon-separated lists.
+%------------------------------------------------------------------
+% % in this example, make sure xxenc.def and yyenc.def exist
+% % or fontenc will complain
+% \renewcommand*\tf@fontencodingchoices{XX,XY}
+
+% Redefine site default typefaces. Here are some typographically dubious
+% examples. Note that since these definitions literally substitute for
+% users' package options if not explicitly provided, ensure your syntax
+% is correct -- package (sub)options lists should be colon not
+% comma-separated.
+%-----------------------------------------------------------------------
+% \renewcommand*\TF@DEFAULTRMFONT{kpfonts:veryoldstyle:largesmallcaps}
+% \renewcommand*\TF@DEFAULTSFFONT{helv:scale:0.75}
+% \renewcommand*\TF@DEFAULTTTFONT{luxi}
+% \renewcommand*\TF@DEFAULTMATHFONT{iwona:light:condensed}
+% \renewcommand*\TF@DEFAULTSYMBOLSFONT{ams}
+% \renewcommand*\TF@DEFAULTTEXTFIGURESFONT{palatino:spacing:20:lkern:-20:rkern:5}
+
+% Ditto here. Possibly useful for configuring locales, e.g.,
+%-----------------------------------------------------------
+% \renewcommand*\TF@DEFAULTFONTENCODING{EU1:T1}
+% \renewcommand*\TF@DEFAULTINPUTENCODING{dontload}
+% \renewcommand*\TF@DEFAULTTEXTCOMP{safe}
+% \renewcommand*\TF@DEFAULTCMAP{ignore}
+
+% Redefine in-built debug colours
+%--------------------------------
+% \renewcommand*\TF@DEBUG@COLOUR@TS{purple}
+% \renewcommand*\TF@DEBUG@COLOUR@SC{magenta}
+% \renewcommand*\TF@DEBUG@COLOUR@JF{green}
+% \renewcommand*\TF@DEBUG@COLOUR@XF{red}
+% \renewcommand*\TF@DEBUG@COLOUR@LININGNUMS{olive}
+% \renewcommand*\TF@DEBUG@COLOUR@RM{Indigo}
+% \renewcommand*\TF@DEBUG@COLOUR@SF{Maroon}
+% \renewcommand*\TF@DEBUG@COLOUR@TT{Green}
+% \renewcommand*\TF@DEBUG@COLOUR@MATH{ProcessBlue}
+% \renewcommand*\TF@DEBUG@COLOUR@XFNAME{\TF@DEBUG@COLOUR@XF}
+
+% Examples \beforeloadingXXX and \afterloadingXXX,
+% where XXX is symbols, math, rm, sf, tt or textfigures
+%--------------------------------------------------------
+% \newcommand*\beforeloadingmath{
+% \ifthenelse{\equal{\tf@mathfont}{amsfonts}}{
+% % undefine the following to prevent amsfonts namespace clashes
+% \tf@undefinecommands{\underrightarrow,\underleftarrow}
+% \TF@PackageDebugInfoNoLine[\TF@CONFIGFILE]{%
+% Blew away \string\underrightarrow\space and
+% \string\underleftarrow\MessageBreak
+% symbols before loading amsfonts package}
+% }{}
+% }
+
+% User-supplied typeface definitions for the typeface package
+%============================================================
+% The \newtypeface command can be used to introduce new
+% fonts to typeface package management. The command accepts
+% one optional and four required parameters:
+% #1: [<optional comma-separated list of aliases for typeface name>]
+% #2: {<typeface name>}
+% #3: {<human-readable typeface name (its print name)>}
+% #4: {<typeface family: rm, sf, tt, math, symbol or textfigures>}
+% #5: {<typeface initialisation code>}
+%---------------------------------------------------------------------
+
+% Example typeface definitions follow. Most of these involve
+% commercial fonts that will need to be purchased and installed.
+%
+% NB, bear in mind that unless you override it using the `fontloadorder'
+% package option (which you should vigorously try to avoid) the
+% typeface package loads fonts in this order:
+% textfigures, symbols, math, rm, sf, tt
+% This will make a difference if your code loads and doesn't properly
+% account for packages that override font setups configured earlier in
+% the chain (best if you can keep your code free of side effects, as
+% in the examples below).
+%
+% Use debug-instrumented command \tf@usefontpackage in preference to
+% \usepackage whenever loading font packages, not using it at other times.
+%-------------------------------------------------------------------------
+
+% Adobe American Typewriter (strictly speaking, not a monospaced font)
+\newtypeface[americantypewriter,americantt,att]{adobeamericantypewriter}
+ {Adobe American Typewriter}{tt}{
+ % the \scaletypeface command, below, requires compatible *pat.fd files
+ \scaletypeface{tt}{\newcommand*\pat@scale{\tf@ttscalefactor}}
+ \renewcommand{\ttdefault}{pat}
+}
+
+% Adobe Bembo
+\newtypeface[bembo]{adobebembo}{Adobe Bembo}{rm}{
+ \renewcommand*\rmdefault{pbb}
+ \tf@SCencodedosf
+}
+
+% Adobe Caslon
+\newtypeface{adobecaslon}{Adobe Caslon}{rm}{
+ \renewcommand*\rmdefault{pac}
+ \tf@SCencodedosf
+}
+
+% Adobe Garamond
+\newtypeface{adobegaramond}{Adobe Garamond}{rm}{
+ \renewcommand*\rmdefault{pad}
+ \tf@SCencodedosf
+}
+
+% Adobe Gill Sans
+\newtypeface[adobegill,gillsans,gill]{adobegillsans}{Adobe Gill Sans}{sf}{
+ % the \scaletypeface command, below, requires compatible *pgs.fd files
+ \scaletypeface{sf}{\newcommand*\pgs@scale{\tf@sfscalefactor}}
+ \renewcommand*\sfdefault{pgs}
+}
+
+% Adobe Granjon
+\newtypeface{adobegranjon}{Adobe Granjon}{rm}{
+ \renewcommand*\rmdefault{pgj}
+ \tf@SCencodedosf
+}
+
+% Adobe Janson. NB, this is Adobe Janson, NOT Adobe Jenson!
+\newtypeface{adobejanson}{Adobe Janson}{rm}{
+ \renewcommand*\rmdefault{pjn}
+ \tf@SCencodedosf
+}
+
+% Adobe Jenson. NB, this is Adobe Jenson, NOT Adobe Janson!
+\newtypeface{adobejenson}{Adobe Jenson}{rm}{
+ \renewcommand*\rmdefault{paj}
+ \TF@NativeOSFError
+}
+
+% Adobe Lucida
+\newtypeface{adobelucida}{Adobe Lucida}{rm}{
+ \renewcommand*\rmdefault{plc}
+ \TF@NativeOSFError
+}
+
+% Adobe Myriad Pro
+\newtypeface{adobemyriadpro}{Adobe Myriad Pro}{sf}{
+ \tf@ifsuboption{osf}{\tf@sffontoptions}{
+ % Myriad Pro has an OSF variant (depending on your installation)
+ \renewcommand*\sfdefault{Myriad-OsF}
+ \xdef\tf@sfprintname{\tf@sfprintname\ OSF}
+ }{
+ \renewcommand*\sfdefault{Myriad-LF}
+ }
+}
+
+% Adobe Sabon
+\newtypeface{adobesabon}{Adobe Sabon}{rm}{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}}{
+ \renewcommand*\rmdefault{psbj} % Native old style figures
+ \tf@define@liningfigures{psb}
+ }{
+ \renewcommand*\rmdefault{psb} % Lining figures
+ }
+ \tf@define@oldstylenums@cmd{psbj}
+}
+
+% Adobe Sabon text figures
+\newtypeface{adobesabon}{Adobe Sabon}{textfigures}{
+ \tf@initialisetextfiguresfont{T1}
+ \tf@DeclareOsfFontShape{m}{n} {psbr9d}
+ \tf@DeclareOsfFontShape{m}{sc} {psbrc9d}
+ \tf@DeclareOsfFontShape{m}{it} {psbri9d}
+ \tf@DeclareOsfFontShape{m}{sl} {psbri9d}
+ \tf@DeclareOsfFontShape{b}{n} {psbb9d}
+ \tf@DeclareOsfFontShape{b}{it} {psbbi9d}
+ \tf@DeclareOsfFontShape{b}{sl} {psbbi9d}
+ \tf@DeclareOsfFontShape{bx}{n} {psbb9d}
+ \tf@DeclareOsfFontShape{bx}{it}{psbbi9d}
+ \tf@DeclareOsfFontShape{bx}{sl}{psbbi9d}
+}
+
+% Adobe Times Roman Expert (with true smallcaps and oldstyle figures)
+% NB, if you receive `Package textcomp warning: Oldstyle digits unavailable
+% for family ptmj' (or ptmx), you might try loading the typeface
+% package with option `textcomp=force', e.g,
+% \usepackage[typeface=timesexpert,textcomp=force,...]{typeface}
+\newtypeface[timesx]{adobetimesexpert}{Adobe Times Roman Expert}{rm}{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}}{
+ \renewcommand*\rmdefault{ptmj} % Native old style figures
+ \tf@define@liningfigures{ptmx}
+ }{
+ \renewcommand*\rmdefault{ptmx} % Lining figures
+ }
+}
+
+\newtypeface[timesx]{adobetimesexpert}{Adobe Times Roman Expert}{textfigures}{
+ \tf@initialisetextfiguresfont{T1}
+ \tf@DeclareOsfFontShape{m}{n} {ptmr9d}
+ \tf@DeclareOsfFontShape{m}{sc} {ptmrc9d}
+ \tf@DeclareOsfFontShape{m}{it} {ptmri9d}
+ \tf@DeclareOsfFontShape{m}{sl} {ptmri9d}
+ \tf@DeclareOsfFontShape{b}{n} {ptmb9d}
+ \tf@DeclareOsfFontShape{b}{sc} {ptmbc9d}
+ \tf@DeclareOsfFontShape{b}{it} {ptmbi9d}
+ \tf@DeclareOsfFontShape{b}{sl} {ptmbi9d}
+ \tf@DeclareOsfFontShape{bx}{n} {ptmb9d}
+ \tf@DeclareOsfFontShape{bx}{sc}{ptmbc9d}
+ \tf@DeclareOsfFontShape{bx}{it}{ptmbi9d}
+ \tf@DeclareOsfFontShape{bx}{sl}{ptmbi9d}
+}
+
+% Adobe Trade Gothic
+\newtypeface[atg,tradegothic]{adobetradegothic}{Adobe Trade Gothic}{sf}{
+ % the \scaletypeface command, below, requires compatible *ptg.fd files
+ \scaletypeface{sf}{\newcommand*\ptg@scale{\tf@sfscalefactor}}
+ \renewcommand*\sfdefault{ptg}
+}
+
+\newtypeface{ebgaramond}{EB Garamond}{rm}{
+ % OTF's available at http://www.georgduffner.at/ebgaramond/
+ % Converted to type1 using autoinst (but I screwed up ligatures
+ % conversion on my copy somewhere along the way).
+ % Note that it's early days for this font, e.g., no bold, bold-italic,
+ % and extremely poor italic correction. Nevertheless, what there is
+ % right now is very attractive and shows considerable promise.
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}}{
+ \renewcommand*\rmdefault{EBGaramond-OsF} % Native old style figures
+ \tf@define@liningfigures{EBGaramond-LF}
+ }{
+ \renewcommand*\rmdefault{EBGaramond-LF} % Lining figures
+ }
+ \tf@define@oldstylenums@cmd{EBGaramond-OsF}
+}
+
+% Emigre Mrs Eaves
+\newtypeface{mrseaves}{Mrs Eaves}{rm}{
+ \renewcommand*\bfdefault{b}
+ \renewcommand*\mddefault{m}
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}}{
+ \renewcommand*\rmdefault{MrsEavesOT-OsF} % Native old style figures
+ \tf@define@liningfigures{MrsEavesOT-LF}
+ }{
+ \renewcommand*\rmdefault{MrsEavesOT-LF} % Lining figures
+ }
+ \tf@define@oldstylenums@cmd{MrsEavesOT-OsF}
+}
+
+% Hoefler & Frere-Jones Hoefler Text
+\newtypeface[hoefler]{hoeflertext}{Hoefler Text}{rm}{
+ \renewcommand*\rmdefault{eht} % TODO: configure lf for HOEFLER TEXT ALT.
+ \tf@define@liningfigures{ptm} % Until then, use Times lf instead. Urggh.
+ \tf@define@oldstylenums@cmd{eht} % Redefine \oldstylenums to suit.
+}
+
+\newtypeface[hoefler]{hoeflertext}{Hoefler Text}{textfigures}{
+ \tf@initialisetextfiguresfont{T1}
+ \tf@DeclareOsfFontShape{m}{n} {ehtr8t}
+ \tf@DeclareOsfFontShape{m}{sc} {ehtrc8t}
+ \tf@DeclareOsfFontShape{m}{sl} {ehtro8t}
+ \tf@DeclareOsfFontShape{m}{it} {ehtri8t}
+ \tf@DeclareOsfFontShape{b}{n} {ehtb8t}
+ \tf@DeclareOsfFontShape{b}{sc} {ehtbc8t}
+ \tf@DeclareOsfFontShape{b}{sl} {ehtbo8t}
+ \tf@DeclareOsfFontShape{b}{it} {ehtbi8t}
+ \tf@DeclareOsfFontShape{eb}{n} {ehtc8t}
+ \tf@DeclareOsfFontShape{eb}{sc}{ehtcc8t}
+ \tf@DeclareOsfFontShape{eb}{sl}{ehtco8t}
+ \tf@DeclareOsfFontShape{eb}{it}{ehtci8t}
+ \tf@DeclareOsfFontShape{bx}{n} {ehtb8t}
+ \tf@DeclareOsfFontShape{bx}{sc}{ehtbc8t}
+ \tf@DeclareOsfFontShape{bx}{sl}{ehtbo8t}
+ \tf@DeclareOsfFontShape{bx}{it}{ehtbi8t}
+}
+
+% Linotype Didot
+\newtypeface[ldidot]{linotypedidot}{Linotype Didot}{rm}{
+ \renewcommand*\rmdefault{ldo}
+ \tf@SCencodedosf
+}
+
+% Linotype Sabon
+\newtypeface[lsabon]{linotypesabon}{Linotype Sabon}{rm}{
+ \renewcommand*\rmdefault{lsb}
+ \TF@NativeOSFError
+}
+
+% Linotype Times Ten
+\newtypeface[timesten]{linotypetimesten}{Linotype Times Ten}{rm}{
+ \renewcommand*\rmdefault{ltt}
+ \TF@NativeOSFError
+}
+
+% Monotype Scotch Roman. Ha ha! Might look good in an ancient history thesis!
+\newtypeface[scotchroman]{monotypescotchroman}{Monotype Scotch Roman}{rm}{
+ \renewcommand*\rmdefault{ms1}
+ \TF@NativeOSFError
+}
+
+\newtypeface[vgaramond,varoquaux]{varoquauxgaramond}
+ {URW Garamond (Varoquaux)}{rm}{
+ % Modded set of URW Garamond fonts (possibly) available at
+ % http://gael-varoquaux.info/computers/garamond/index.html
+ % This fontset provides several advantages over URW Garamond, including:
+ % smallcaps, osf and long tailed Q. However, like URW Garamond, there are
+ % weaknesses. Adobe Garamond offers another alternative.
+ \renewcommand*\rmdefault{ggm}\normalfont
+ \tf@define@liningfigures{ugm}
+ \TF@NativeLFError
+}
+
+% Verdana truetype font (see verdana package for further details)
+\newtypeface{verdana}{Verdana}{sf}{
+ \tf@ifsuboption{nofligatures}{\tf@sffontoptions}{
+ \renewcommand{\sfdefault}{vnax} % if f-ligatures cause problems
+ }{
+ \renewcommand{\sfdefault}{vna}
+ }
+}
+
+%-------- End typeface.cfg ----------------------------------------------------
diff --git a/macros/latex/contrib/typeface/typeface.pdf b/macros/latex/contrib/typeface/typeface.pdf
new file mode 100644
index 0000000000..4978d203b7
--- /dev/null
+++ b/macros/latex/contrib/typeface/typeface.pdf
Binary files differ
diff --git a/macros/latex/contrib/typeface/typeface.sty b/macros/latex/contrib/typeface/typeface.sty
new file mode 100644
index 0000000000..3a4ae254d7
--- /dev/null
+++ b/macros/latex/contrib/typeface/typeface.sty
@@ -0,0 +1,5355 @@
+% $Id: typeface.sty 904 2012-06-16 13:32:38Z Geoffrey $
+%
+% typeface.sty Copyright (C) 2012 Geoffrey Jones
+%
+% This package (typeface.sty and optional configuration file, typeface.cfg)
+% simplifies setting up rmdefault, sfdefault, ttdefault, symbols and math type1
+% format (postscript) fonts. It is designed to allow users the widest latitude
+% in mixing and matching whatever combination they might desire from these.
+%
+% Recommendations:
+% 1. Compile with pdflatex or variants like lualatex for best results
+% (although since fontspec is a mainstay in lua, you might prefer to
+% stick with that package -- see lualatex-doc in your installation or
+% from internet download). Some type1 fonts do not render properly in
+% pdfxelatex compiled documents. Compiling to dvi rather
+% than directly to pdf can prove an `interesting' idea.
+%
+% Requires:
+% 1. Requires e-TeX.
+% 2. Ensure that microtype is already loaded if (and only if) text figures
+% substitute font letter spacing is desired (advanced usage). However,
+% note that microtype generally doesn't partner well with bitmap fonts,
+% especially if any scaling is involved. Should you select bitmap fonts
+% (concrete, cmbright, etc.), microtype will very likely throw "auto
+% expansion is only possible with scalable fonts" errors. Bottom line:
+% either avoid bitmap fonts (for example, install hfbright to configure
+% a type1 variant of cmbright), or avoid microtype.
+%
+% Restrictions:
+% 1. This package is most suited to pdfLaTeX, and not particularly to
+% other TeX formats where, in any event, it would be swimming against
+% their particular tides. However, it has been demonstrated to work
+% (depending on your definition of `work') in LuaTeX and in more
+% restricted circumstances under XeTeX. If using XeTeX, the
+% fontspec package would make far and away the better choice.
+%
+% Programming conventions:
+% 1. All commands in this package begin with `\tf@', `\TF@', usw. As far
+% as I know, of all the usual packages, classes, etc., only LaTeX's
+% math text size macro (\tf@size) and table files (`\tf@EXT' where EXT
+% is toc, lof, lot, etc) co-claim this namespace.
+% 2. \TF@XXX is a constant (of sorts, since users can redefine many of these).
+% 3. \TF@Xxx overrides standard mixed-case commands, e.g., \TF@PackageInfo
+% wrappers \PackageInfo.
+% 4. Many internal commands can be overridden by pre-defining them in the
+% package configuration file (\TF@CONFIGFILE, usually `typeface.cfg').
+% 5. \tf@@xxx commands are, if not strictly local to a command, volatile
+% across the scope of this package.
+%
+% 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 this license is in
+% http://www.latex-project.org/lppl.txt and version 1.3 or later is part of
+% all distributions of LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Original Author of this work is Geoffrey Jones.
+% The Current Maintainer of this work is Geoffrey Jones.
+% =============================================================================
+\NeedsTeXFormat{LaTeX2e}[2009/09/24]
+
+\newcommand*\TF@PACKAGENAME{typeface}
+\newcommand*\TF@CONFIGFILE{\TF@PACKAGENAME.cfg}
+\xdef\TF@CONFIGFILE{\TF@CONFIGFILE}
+
+\ProvidesPackage{\TF@PACKAGENAME}
+ [2012/06/11 (prerelease) Type1 font load management pkg (GJ)]
+
+\RequirePackage{ifetex}
+\NeedsETeX
+
+\RequirePackage{etexcmds} % renames e-tex \unexpanded to \etex@unexpanded
+\RequirePackage{etoolbox} % used extensively throughout this package
+\RequirePackage{ifthenx} % ifthen package plus extensions
+
+\RequirePackage{iftex} % TODO: have we properly incorporated this?
+\RequirePackage{ifpdf}
+
+% Package-wide constants
+%-----------------------
+% User-reconfigurable constants
+\providecommand*\TF@AUXFILENAME{\jobname.tf}
+
+% Defaults used whenever the user either 1) does not explicitly define a
+% typeface option or 2) explicitly specifies `default' (or whatever
+% \TF@DEFAULT happens to be). Users can specify site specific defaults
+% by including statements like:
+% \renewcommand*\TF@DEFAULTRMFONT{kpfonts:veryoldstyle:light}, or
+% \renewcommand*\TF@DEFAULTFONTENCODING{T5}
+% in their configuration file \TF@CONFIGFILE. See the bundled configuration
+% file for further examples.
+\newcommand*\TF@DEFAULT{default} % this pair should almost
+\newcommand*\TF@DEFAULTPRINTNAME{Default} % certainly never be redefined!
+
+\newcommand*\TF@DONTLOAD{dontload} % generally synonyms
+\newcommand*\TF@IGNORE{ignore}
+
+\newcommand*\TF@DEFAULTRMFONT{\TF@DEFAULT}
+\newcommand*\TF@DEFAULTSFFONT{\TF@DEFAULT}
+\newcommand*\TF@DEFAULTTTFONT{\TF@DEFAULT}
+\newcommand*\TF@DEFAULTMATHFONT{\TF@DEFAULT}
+\newcommand*\TF@DEFAULTSYMBOLSFONT{\TF@DEFAULT}
+\newcommand*\TF@DEFAULTTEXTFIGURESFONT{\TF@DEFAULT}
+
+\newcommand*\TF@DEFAULTFONTENCODING{T1}
+\newcommand*\TF@DEFAULTINPUTENCODING{utf8}
+\newcommand*\TF@DEFAULTTEXTCOMP{full}
+\newcommand*\TF@DEFAULTCMAP{resetfonts}
+
+\newcommand*\TF@DEBUG@COLOUR@TS{purple}
+\newcommand*\TF@DEBUG@COLOUR@SC{magenta}
+\newcommand*\TF@DEBUG@COLOUR@JF{green}
+\newcommand*\TF@DEBUG@COLOUR@XF{red}
+\newcommand*\TF@DEBUG@COLOUR@LININGNUMS{olive}
+\newcommand*\TF@DEBUG@COLOUR@RM{Indigo}
+\newcommand*\TF@DEBUG@COLOUR@SF{Maroon}
+\newcommand*\TF@DEBUG@COLOUR@TT{Green}
+\newcommand*\TF@DEBUG@COLOUR@MATH{ProcessBlue}
+\newcommand*\TF@DEBUG@COLOUR@XFNAME{\TF@DEBUG@COLOUR@XF}
+
+% Non-reconfigurable constants -- see after aux file load,
+% below, for especially constant constants.
+
+% Package-wide variables and pre-initialised commands
+%----------------------------------------------------
+% Global macros -- stubs created here, code populated further below
+\newcommand*\tf@fontencodingchoices{} % package option choice lists are
+\newcommand*\tf@inputencodingchoices{} % initially empty; they are configured
+\newcommand*\tf@textcompchoices{} % below, or via configuration file
+\newcommand*\tf@cmapchoices{} % \TF@CONFIGFILE
+\newcommand*\tf@rmtypefacechoices{}
+\newcommand*\tf@sftypefacechoices{}
+\newcommand*\tf@tttypefacechoices{}
+\newcommand*\tf@mathtypefacechoices{}
+\newcommand*\tf@symbolstypefacechoices{}
+\newcommand*\tf@textfigurestypefacechoices{}
+
+\newcommand*\tf@loadrmtypeface{} % created here, populated by
+\newcommand*\tf@loadsftypeface{} % expansions of \newtypeface font
+\newcommand*\tf@loadtttypeface{} % definitions below and in user
+\newcommand*\tf@loadmathtypeface{} % customisation file \TF@CONFIGFILE
+\newcommand*\tf@loadsymbolstypeface{}
+\newcommand*\tf@loadtextfigurestypeface{}
+
+\newcommand*\tf@rmdefault{\rmdefault}
+\newcommand*\tf@sfdefault{\sfdefault}
+\newcommand*\tf@ttdefault{\ttdefault}
+
+\newcommand*\tf@rationalisefontnames{} % typeface aliases management command
+\newcommand*\tf@empty@sfcnt@hook{} % empty font size function hook
+
+% Volatiles
+\newcommand*\tf@@listseparator{} % for lists constructed on the fly
+
+% Helper commands (heaps of them)
+% ===============================
+
+% Info messaging commands
+%------------------------
+\newcommand*\TF@PackageInfo[2][\TF@PACKAGENAME]{%
+ \PackageInfo{#1}{#2}%
+}
+
+\newcommand*\TF@PackageInfoNoLine[2][\TF@PACKAGENAME]{%
+ \PackageInfo{#1}{#2\@gobble}%
+}
+
+\newcommand*\TF@PackageDebugInfo[2][\TF@PACKAGENAME]{%
+ \ifbool{tf@debug}{\TF@PackageInfo[#1]{#2}}{}%
+}
+
+\newcommand*\TF@PackageDebugInfoNoLine[2][\TF@PACKAGENAME]{%
+ \ifbool{tf@debug}{\TF@PackageInfoNoLine[#1]{#2}}{}%
+}
+
+\newcommand*\TF@PackageWarning[2][\TF@PACKAGENAME]{%
+ \PackageWarning{#1}{#2}%
+}
+
+\newcommand*\TF@PackageWarningNoLine[2][\TF@PACKAGENAME]{%
+ \PackageWarningNoLine{#1}{#2}%
+}
+
+\newcommand*\TF@PackageError[3][\TF@PACKAGENAME]{%
+ \PackageError{#1}{#2}{#3}%
+}
+
+\newcommand*\TF@ChoiceOptionError[2]{%
+ \PackageError{\TF@PACKAGENAME}{Unexpected option `#1=#2' ignored}{}%
+}
+
+% etoolbox command wrappers
+%--------------------------
+\newcommand\tf@patchcmd[3]{
+ \patchcmd{#1}{#2}{#3}
+ {\TF@PackageInfo{Patched \string #1}}
+ {\TF@PackageError{Failed to patch \string #1}{}}
+}
+
+\newcommand*\tf@newbool[2]{\newbool{#1}\setbool{#1}{#2}}
+
+% globally undefine each command in a list of commands
+\newcommand*\tf@undefinecommands[1]{\forcsvlist{\tf@undefinecommand}{#1}}
+\newcommand*\tf@undefinecommand[1]{\global\undef{#1}}
+
+% \usepackage wrapper command for (and only for) loading font packages
+% in \newtypeface commands (below and in extension file \TF@CONFIGFILE)
+%----------------------------------------------------------------------
+\newcommand*\tf@usefontpackage[2][]{%
+ \@ifpackageloaded{#2}{
+ % Note that we often pre-pass options to packages using
+ % \PassOptionsToPackage. Thus, we can't just test for
+ % empty options ([#1]==[]) and proceed if so. Given that,
+ % we stop in all cases of the target package already being
+ % loaded.
+ \TF@PackageWarningNoLine{%
+ Package `#2' is already loaded. You should\MessageBreak
+ probably sort this out before proceeding. Did\MessageBreak
+ you load `#2' before this package? Do you\MessageBreak
+ need to revise your `fontloadorder' suboptions?\MessageBreak
+ What would you like to do?}
+ }{
+ \TF@PackageDebugInfo{\string\usepackage[#1]{#2}}
+ \usepackage[#1]{#2}
+ }
+}
+
+% A few little throwaway helpers
+%-------------------------------
+% Discard all but the six leftmost characters of a string
+\def\tf@strleftvi#1{%
+ \expandafter\tf@@strleftvi#1\@empty\@empty\@empty\@empty\@empty\@empty\@nil%
+}
+\def\tf@@strleftvi#1#2#3#4#5#6#7\@nil{#1#2#3#4#5#6}
+
+% Round up the provided floating point number and truncate to, at most,
+% six characters (including minus sign and/or decimal point)
+\def\tf@roundvi#1{%
+ \edef\tf@@temp{\strip@pt\dimexpr#1pt+0.00005pt\relax}%
+ \expandafter\tf@strleftvi\expandafter{\tf@@temp000000}%
+}
+
+\def\tf@roundvi@pt#1{%
+ \edef\tf@@temp{\strip@pt\dimexpr#1+0.00005pt\relax}%
+ \expandafter\tf@strleftvi\expandafter{\tf@@temp000000}pt%
+}
+
+% Colon-separated value list commands
+%------------------------------------
+% Helper test: \tf@ifsuboption tests whether item #1 is a member of
+% colon-separated list #2. #2 will generally be \tf@XXfontoptions, where
+% XX is one of rm, sf, tt, math, symbols or textfigures. Example usage:
+% \tf@ifsuboption{light}{\tf@sffontoptions}{<true part>}{<false part>}
+% The list item immediately following #1 is saved in \tf@nextsuboption.
+\tf@newbool{tf@suboptionfound}{false}
+\newcommand*\tf@nextsuboption{}
+\DeclareListParser{\tf@doColonSeparatedList}{:} % refer etoolbox package
+
+\newcommand*\tf@ifsuboption[2]{%
+ % #1 item name, #2 item list
+ % side effects: 1) sets boolean tf@suboptionfound,
+ % 2) sets \tf@nextsuboption to next suboption in #2
+ \edef\tf@suboption{#1}%
+ \xdef\tf@nextsuboption{}%
+ \boolfalse{tf@suboptionfound}%
+ \renewcommand*\do[1]{%
+ \ifbool{tf@suboptionfound}%
+ {\xdef\tf@nextsuboption{##1}\listbreak}{}%
+ \ifthenelse{\equal{\tf@suboption}{##1}}%
+ {\booltrue{tf@suboptionfound}}{}%
+ }%
+ \expandafter\tf@doColonSeparatedList\expandafter{#2}%
+ \ifbool{tf@suboptionfound}%
+ {\expandafter\@firstoftwo}%
+ {\expandafter\@secondoftwo}%
+}
+
+% Replace first #1 (to-be-replaced item) with #2 (new item) in #3 (item list)
+% (Note, no parm safety checking or messaging on failure.)
+\newcommand*\tf@replacesuboption[3]{%
+ \edef\tf@originallist{#3}
+ \patchcmd{#3}{#1}{#2}{%
+ \TF@PackageDebugInfo{Replaced item `\string#1' with item `\string#2'
+ in list [\tf@originallist]}%
+ }{}%
+}
+
+% Count the number of times item appears in the colon-separated item list
+\newcounter{tf@suboptioncount}
+\newcommand*\tf@suboptioncount[2]{%
+ % #1 item name
+ % #2 item list
+ % side effect: sets counter tf@suboptioncount
+ \setcounter{tf@suboptioncount}{0}%
+ \renewcommand*\do[1]{%
+ \ifthenelse{\equal{#1}{##1}}{\stepcounter{tf@suboptioncount}}{}%
+ }%
+ \expandafter\tf@doColonSeparatedList\expandafter{#2}%
+}
+
+% Count the number of non-empty items in the colon-separated item list
+\newcommand*\tf@suboptionitemscount[1]{%
+ % #1 item list
+ % side effect: sets counter tf@suboptioncount
+ \setcounter{tf@suboptioncount}{0}%
+ \renewcommand*\do[1]{\stepcounter{tf@suboptioncount}}%
+ \expandafter\tf@doColonSeparatedList\expandafter{#1}%
+}
+
+% Auxiliary file management
+% =========================
+\newcommand*\tf@initialise@auxfile{%
+ \@ifundefined{tf@@auxfilehandle}{%
+ \newwrite\tf@@auxfilehandle%
+ \tf@newbool{tf@auxfileopen}{false}%
+ \ifbool{@filesw}{%
+ \TF@PackageDebugInfoNoLine{Opening auxiliary file \TF@AUXFILENAME..}%
+ \immediate\openout\tf@@auxfilehandle=\TF@AUXFILENAME%
+ \booltrue{tf@auxfileopen}%
+ }{%
+ \TF@PackageWarningNoLine{Auxiliary file output disabled,\MessageBreak
+ `\TF@AUXFILENAME' not written}%
+ }%
+ }{}%
+}
+
+\newcommand*\tf@writeauxfile[1]{
+ \AtBeginDocument{%
+ \ifbool{@filesw}{%
+ \tf@initialise@auxfile%
+ \TF@PackageDebugInfoNoLine{%
+ Writing `#1' to auxiliary file \TF@AUXFILENAME..}%
+ \@bsphack%
+ {\let\protect\string\immediate\write\tf@@auxfilehandle{#1}}%
+ \@esphack%
+ }{}%
+ }
+}
+
+\tf@newbool{tf@auxfilechanged}{false}
+\tf@newbool{tf@sffontdirty}{false} % set these two if we need second run
+\tf@newbool{tf@ttfontdirty}{false} % to ensure they are accurately scaled
+\newcommand*\tf@notifyauxfiledirty[1]{
+ \ifthenelse{\equal{#1}{sf}}{\global\booltrue{tf@sffontdirty}}{}
+ \ifthenelse{\equal{#1}{tt}}{\global\booltrue{tf@ttfontdirty}}{}
+ \notbool{tf@auxfilechanged}{
+ \global\booltrue{tf@auxfilechanged}
+ \ifbool{@filesw}{
+ \TF@PackageWarningNoLine{%
+ Auxiliary file `\TF@AUXFILENAME' has changed.\MessageBreak
+ You need to recompile `\jobname.tex' again}
+ }{}
+ }{}
+}
+
+\AtEndOfPackage{
+ \AtBeginDocument{%
+ \ifbool{tf@auxfileopen}{%
+ \TF@PackageDebugInfoNoLine{Closing auxiliary file \TF@AUXFILENAME..}%
+ \immediate\closeout\tf@@auxfilehandle%
+ \boolfalse{tf@auxfileopen}%
+ }{}%
+ }
+}
+
+% \newtypeface typeface definition command. This is this package's central
+% customisation command. Users can use this command to a) extend the range of
+% typeface package managed fonts or b) override the font definitions set out
+% below. User font (re)definitions should be placed in customisation file
+% \TF@CONFIGFILE (see example customisation file provided with this package).
+% ===========================================================================
+\newcommand\newtypeface[5][]{%
+ % #1: [<optional comma-separated list of aliases for typeface name>]
+ % #2: {<typeface name>}
+ % #3: {<typeface human-readable print name>}
+ % NB, #3 can be empty, in which case the user must explicitly define
+ % the font's print name macro (e.g., \tf@rmprintname) in the code in #5
+ % #4: {<typeface family: rm, sf, tt, math, symbols or textfigures>}
+ % #5: {<typeface initialisation code>}, e.g.,
+ % {\renewcommand*\rmdefault{ppl}} or {\tf@usefontpackage{helv}...}
+ % Note that, for better integration and debugging, users should load
+ % font packages using \tf@usefontpackage rather than \usepackage (however,
+ % continuing to use \usepackage for loading non-font packages outside
+ % \newtypeface definitions).
+ %
+ \ifthenelse{\equal{#4}{rm}
+ \OR\equal{#4}{sf}
+ \OR\equal{#4}{tt}
+ \OR\equal{#4}{math}
+ \OR\equal{#4}{symbols}
+ \OR\equal{#4}{textfigures}}{
+
+ \def\do{} % pre-initialised stub
+ \ifcsundef{tf@#4font@#2}{
+
+ % Add any (optional #1) fontname aliases to the list of valid typeface
+ % package choices. Also, build helper macro \tf@rationalisefontnames
+ % (invoked once, further below).
+ \renewcommand*\do[1]{
+ \expandafter\g@addto@macro\csname tf@#4typefacechoices\endcsname{##1,}
+ \g@addto@macro\tf@rationalisefontnames{%
+ % fyi, \tf@#4font is created by \tf@parsefontname, defined way below
+ % e.g., \tf@rmfont is created by \tf@parsefontname{rm}
+ \ifthenelse{\equal{\csname tf@#4font\endcsname}{##1}}{
+ \expandafter\def\csname tf@#4font\endcsname{#2}
+ }{}
+ }
+ }
+ \docsvlist{#1} % iterate \do over each typeface alias in #1
+
+ % Add #2 to the \tf@#4typefacechoices comma separated list
+ \expandafter\g@addto@macro\csname tf@#4typefacechoices\endcsname{#2,}
+
+ % Add #2 to the \tf@load#4typeface command
+ \expandafter\g@addto@macro\csname tf@load#4typeface\endcsname{
+ \ifthenelse{\equal{\csname tf@#4font\endcsname}{#2}}
+ {\csname tf@#4font@#2\endcsname}
+ {}
+ }
+
+ % Construct \tf@#4font@#2, the font initialisation command
+ % invoked by \tf@load#4typeface, just defined above
+ \expandafter\providecommand\csname tf@#4font@#2\endcsname{#5}
+
+ % Prepend some debug code to the macro
+ \expandafter\pretocmd\expandafter{\csname tf@#4font@#2\endcsname}
+ {\TF@PackageDebugInfo{Loading #4 typeface `#2'...}}{}{}
+
+ % Prepend the font print name to the macro (so long as #3 the print
+ % name isn't empty, otherwise whatever code invokes \newtypeface
+ % will explicitly need to take care of this itself)
+ \ifthenelse{\NOT\equal{#3}{}}{
+ \expandafter\pretocmd\expandafter{\csname tf@#4font@#2\endcsname}
+ {\expandafter\def\csname tf@#4printname\endcsname{#3}}{}{}
+ }{}
+
+ % Restore \DeclareSizeFunction if we redefined it in
+ % \tf@initialisetextfiguresfont (defined below)
+ \ifthenelse{\equal{#4}{textfigures}}{
+ \expandafter\apptocmd\expandafter{\csname tf@#4font@#2\endcsname}{
+ \ifthenelse{\NOT\isundefined{\oldDeclareSizeFunction}}
+ {\let\DeclareSizeFunction\oldDeclareSizeFunction}{}
+ }{}{}
+ }{}
+
+ % Record our package-managed \rmdefault, \sfdefault, \ttdefault
+ \expandafter\apptocmd\expandafter{\csname tf@#4font@#2\endcsname}{
+ \xdef\tf@rmdefault{\rmdefault}
+ \xdef\tf@sfdefault{\sfdefault}
+ \xdef\tf@ttdefault{\ttdefault}
+ }{}{}
+
+ % Have the macro register itself as and whenever it happens to be invoked
+ \expandafter\g@addto@macro\csname tf@#4font@#2\endcsname{%
+ \expandafter\def\csname tf@#4fontloadcommand\endcsname{tf@#4font@#2}%
+ }
+
+ % Finally, ensure our macro is restricted to the document preamble
+ \expandafter\@onlypreamble\csname tf@#4font@#2\endcsname
+ }{
+ % User has included their own definition for standard typeface #2
+ % in the #4 family (or they included multiple definitions for one
+ % of their own typefaces) in their config file.
+ \TF@PackageDebugInfo{%
+ Encountered multiple definitions for `#2' in\MessageBreak
+ the `#4' family. This is OK, however note that the\MessageBreak
+ first definition takes precedence while subsequent\MessageBreak
+ definitions are ignored}
+ }
+ }{
+ \TF@PackageError{user configuration error: second\MessageBreak
+ mandatory argument to \string\newtypeface\ should\MessageBreak
+ be one of [rm,sf,tt,math,symbols,textfigures]}{}
+ }
+}
+
+% User typeface scale command -- useful in the body of the initialisation
+% code passed to the \newtypeface command (see examples below)
+\newcommand*\scaletypeface[2]{
+ % #1: sf, tt or textfigures
+ % #2: any scaling code recognised by the font definition (.fd) file
+ \ifthenelse{\equal{\csname tf@#1scalemethod\endcsname}{\TF@FX@SCALE}}{
+ #2
+ \booltrue{tf@#1scaledatloadtime}
+ }{}
+}
+
+% Load package configuration file \TF@CONFIGFILE. This file may contain
+% 1) user-defined fonts specifications (\newtypeface commands), and
+% 2) overrides of constants in the code block immediately above.
+%----------------------------------------------------------------------
+\IfFileExists{\TF@CONFIGFILE}{
+ \TF@PackageInfoNoLine{Loading configuration file `\TF@CONFIGFILE'...}
+ \input{\TF@CONFIGFILE}
+ \TF@PackageInfoNoLine{...completed loading configuration file
+ `\TF@CONFIGFILE'}
+}{
+ \TF@PackageInfoNoLine{%
+ User typeface definition file `\TF@CONFIGFILE'\MessageBreak
+ cannot be found (`\TF@CONFIGFILE' not loaded)}
+}
+
+% Non-reconfigurable enums -- (re)defined after config file load
+%---------------------------------------------------------------
+\newcommand*\TF@IMPLICITDEFAULT {0} % pkg option kv unspecified
+\newcommand*\TF@EXPLICITDEFAULT {1} % pkg option kv explicitly = \TF@DEFAULT
+\newcommand*\TF@EXPLICITOTHER {2} % pkg option kv explicitly = something else
+
+\newcommand*\TF@OSF@LF{0} % lining figures
+\newcommand*\TF@OSF@NF{1} % native font -- do nothing
+\newcommand*\TF@OSF@JF{2} % native OSF 'j' (or equiv) font family
+\newcommand*\TF@OSF@XF{3} % substitute font
+\newcommand*\TF@OSF@TS{4} % TS1 encoding
+\newcommand*\TF@OSF@SC{5} % small caps
+
+\newcommand*\TF@UNSCALED{1} % unitary scaling factor -- must be 1, not 1.0 etc.
+
+\newcommand*\TF@ER@SCALE{0} % user error
+\newcommand*\TF@NO@SCALE{1} % don't scale font; equiv, scale to \TF@UNSCALED
+\newcommand*\TF@FX@SCALE{2} % scale font to fixed positive real number
+\newcommand*\TF@EX@SCALE{3} % scale font to rm font ex height
+\newcommand*\TF@LC@SCALE{4} % scale font to rm font lowercase letters height
+\newcommand*\TF@UC@SCALE{5} % scale font to rm font uppercase letters height
+\newcommand*\TF@FG@SCALE{6} % scale font to rm font figures height
+
+\newcommand*\TF@DEFAULTFONTLOADORDER{textfigures:symbols:math:rm:sf:tt}
+
+% Package options processing
+% ==========================
+\RequirePackage{xkeyval}
+
+% Roman (default body text) typeface selection.
+% Save <string> in \tf@rmfontname, given user options:
+% `typeface=<string>' or `rm=<string>'
+%-----------------------------------------------------
+\newcommand*\tf@rmfontname{\TF@DEFAULT}
+\newcommand*\tf@rmfontdefaultstatus{\TF@IMPLICITDEFAULT}
+
+\newcommand*\tf@define@key@typeface{
+ \define@key{TF}{typeface}[]{
+ \renewcommand*\tf@rmfontname{##1}
+ \renewcommand*\tf@rmfontdefaultstatus{\TF@EXPLICITOTHER}
+ % only partially initialised here -- complete initialisation below
+ }
+}
+\tf@define@key@typeface
+
+% As above but using synonym `rm=' instead
+\tf@patchcmd{\tf@define@key@typeface}{typeface}{rm}
+\tf@define@key@typeface
+
+% Sans serif typeface selection
+% Save <string> in \tf@sffontname, given user options:
+% `sanstypeface=<string>' or `sf=<string>'
+%-----------------------------------------------------
+\newcommand*\tf@sffontname{\TF@DEFAULT}
+\newcommand*\tf@sffontdefaultstatus{\TF@IMPLICITDEFAULT}
+
+\newcommand*\tf@define@key@sftypeface{
+ \define@key{TF}{sanstypeface}[]{
+ \renewcommand*\tf@sffontname{##1}
+ \renewcommand*\tf@sffontdefaultstatus{\TF@EXPLICITOTHER}
+ % only partially initialised here -- complete initialisation below
+ }
+}
+\tf@define@key@sftypeface
+
+% As above but using synonym `sf=' instead
+\tf@patchcmd{\tf@define@key@sftypeface}{sanstypeface}{sf}
+\tf@define@key@sftypeface
+
+% Monospaced (typewriter) typeface selection
+% Save <string> in \tf@ttfontname, given user options:
+% `monotypeface=<string>' or `tt=<string>'
+%-----------------------------------------------------
+\newcommand*\tf@ttfontname{\TF@DEFAULT}
+\newcommand*\tf@ttfontdefaultstatus{\TF@IMPLICITDEFAULT}
+
+\newcommand*\tf@define@key@tttypeface{
+ \define@key{TF}{monotypeface}[]{
+ \renewcommand*\tf@ttfontname{##1}
+ \renewcommand*\tf@ttfontdefaultstatus{\TF@EXPLICITOTHER}
+ % only partially initialised here -- complete initialisation below
+ }
+}
+\tf@define@key@tttypeface
+
+% As above but using synonym `tt=' instead
+\tf@patchcmd{\tf@define@key@tttypeface}{monotypeface}{tt}
+\tf@define@key@tttypeface
+
+% Math typeface selection
+% Save <string> in \tf@mathfontname, given user options:
+% `mathtypeface=<string>' or `math=<string>'
+%-------------------------------------------------------
+\newcommand*\tf@mathfontname{\TF@DEFAULT}
+\newcommand*\tf@mathfontdefaultstatus{\TF@IMPLICITDEFAULT}
+
+\newcommand*\tf@define@key@mathtypeface{
+ \define@key{TF}{mathtypeface}[]{
+ \renewcommand*\tf@mathfontname{##1}
+ \renewcommand*\tf@mathfontdefaultstatus{\TF@EXPLICITOTHER}
+ % only partially initialised here -- complete initialisation below
+ }
+}
+\tf@define@key@mathtypeface
+
+% As above but using synonym `math=' instead
+\tf@patchcmd{\tf@define@key@mathtypeface}{mathtypeface}{math}
+\tf@define@key@mathtypeface
+
+% Symbols typeface selection
+% Save <string> in \tf@symbolsfontname, given user options:
+% `symbolstypeface=<string>' or `sym=<string>'
+%---------------------------------------------------------
+\newcommand*\tf@symbolsfontname{\TF@DEFAULT}
+\newcommand*\tf@symbolsfontdefaultstatus{\TF@IMPLICITDEFAULT}
+
+\newcommand*\tf@define@key@symbolstypeface{
+ \define@key{TF}{symbolstypeface}[]{
+ \renewcommand*\tf@symbolsfontname{##1}
+ \renewcommand*\tf@symbolsfontdefaultstatus{\TF@EXPLICITOTHER}
+ % only partially initialised here -- complete initialisation below
+ }
+}
+\tf@define@key@symbolstypeface
+
+% As above but using synonym `sym=' instead
+\tf@patchcmd{\tf@define@key@symbolstypeface}{symbolstypeface}{sym}
+\tf@define@key@symbolstypeface
+
+% Text figures (aka old style figures, aka lowercase roman numerals).
+% Depending on your body text typeface, you can choose to source text
+% figures from its old style font or from one of a limited number of
+% entirely different substitute typefaces.
+%--------------------------------------------------------------------
+\newcommand*\tf@textfiguresfontname{\TF@DEFAULT}
+\newcommand*\tf@textfiguresfontdefaultstatus{\TF@IMPLICITDEFAULT}
+
+\newcommand*\tf@define@key@textfigurestypeface{
+ \define@key{TF}{textfigures}[]{
+ \renewcommand*\tf@textfiguresfontname{##1}
+ \renewcommand*\tf@textfiguresfontdefaultstatus{\TF@EXPLICITOTHER}
+ % only partially initialised here -- complete initialisation below
+ }
+}
+\tf@define@key@textfigurestypeface
+
+% Font encodings. Note that fontenc is one of only a rare number of
+% packages that can be loaded multiple times.
+%
+% Typeface package option `fontencoding=<encs>' where <encs> is:
+% 1) <empty>, in which case typeface will load the fontenc package
+% with option \TF@DEFAULTFONTENCODING (as defined above or redefined in
+% \TF@CONFIGFILE). This value is implied if the user does not explicitly
+% set the this package's `fontencoding' option.
+% 2) `ignore' or `dontload' (or whatever the values of `\TF@IGNORE' or
+% `\TF@DONTLOAD' happen to be). In which case typeface does not load
+% fontenc.
+% 3) a colon-separated list of items drawn from comma-separated list
+% \tf@fontencodingchoices (reader, are you listening up? <encs> is, like
+% all all other multi-valued package options that can be passed to this
+% package, colon-separated; \tf@fontencodingchoices is an internally
+% coded list, thus comma-separated). The allowable set of <encs> choices,
+% \tf@fontencodingchoices, is initialised below with possible additions
+% in defined in \TF@CONFIGFILE. Font encoding choice items are passed to
+% fontenc in the order that they appear in <encs>.
+% Special value `default' (or whatever the value of \TF@DEFAULT happens
+% to be), gets translated in the process to \TF@DEFAULTFONTENCODING
+% (defined above or in \TF@CONFIGFILE).
+% Note that the ***last*** (or most recently processed) item passed to
+% fontenc becomes the current default font encoding. So, e.g., T1 is
+% assigned to \encodingdefault when typeface is passed option
+% `fontencoding=LGR:T1'.
+%
+% NB, the cause of LaTeX compiler error:
+% LaTeX Error: Unknown option `YYY' for package `typeface'
+% is forgetting that multi-valued package options (suboptions) are
+% colon, NOT comma, separated. Instead of writing package option
+% ...,fontencoding=XXX,YYY,...
+% the user should instead have written
+% ...,fontencoding=XXX:YYY,...
+%----------------------------------------------------------------------------
+\newcommand*\tf@fontencodingstring{}
+\newcommand*\tf@fontencodingdefaultstatus{}
+
+\define@key{TF}{fontencoding}[]{
+ \renewcommand*\tf@fontencodingstring{#1}
+ % only partially initialised here -- complete initialisation below
+}
+
+% List of common font encodings drawn from around the place, e.g.,
+% from `encguide.pdf'. You can add your own options to this list
+% by including:
+% \renewcommand\tf@fontencodingchoices{<choice,...>}
+% in configuration file \TF@CONFIGFILE. It won't hurt if you repeat
+% any choices here.
+\g@addto@macro\tf@fontencodingchoices{,%
+ \TF@DEFAULT,%
+ EU1,EU2,L7X,LAE,LFE,LGR,LHE,LM1,LV1,LY1,%
+ OML,OMS,OMX,OT1,OT2,OT4,OT6,%
+ T1,T2A,T2B,T2C,T3,T4,T5,T6,T7,%
+ TS1,TS2,TS3,U,X1,X2,%
+}
+
+% Inputenc package options -- see comments with fontencoding
+%-----------------------------------------------------------
+\newcommand*\tf@inputencodingstring{}
+\newcommand*\tf@inputencodingdefaultstatus{}
+
+\define@key{TF}{inputencoding}[]{
+ \renewcommand*\tf@inputencodingstring{#1}
+ % only partially initialised here -- complete initialisation below
+}
+
+\g@addto@macro\tf@inputencodingchoices{,%
+ \TF@DEFAULT,%
+ ascii,latin1,latin2,latin3,latin4,latin5,latin9,latin10,%
+ decmulti,applemac,macce,next,cp850,cp852,cp858,cp437,%
+ cp437de,cp865,cp1250,cp1252,cp1257,ansinew,utf8,utf8x,%
+}
+
+% Textcomp package options -- see comments with fontencoding
+%-----------------------------------------------------------
+\newcommand*\tf@textcompstring{}
+\newcommand*\tf@textcompdefaultstatus{}
+
+\define@key{TF}{textcomp}[]{
+ \renewcommand*\tf@textcompstring{#1}
+ % only partially initialised here -- complete initialisation below
+}
+
+\g@addto@macro\tf@textcompchoices{,%
+ \TF@DEFAULT,safe,euro,full,almostfull,warn,force,%
+}
+
+% Cmap package options -- see comments with fontencoding
+%-------------------------------------------------------
+\newcommand*\tf@cmapstring{}
+\newcommand*\tf@cmapdefaultstatus{}
+
+\define@key{TF}{cmap}[]{
+ \renewcommand*\tf@cmapstring{#1}
+ % only partially initialised here -- complete initialisation below
+}
+
+\g@addto@macro\tf@cmapchoices{,%
+ \TF@DEFAULT,resetfonts,noresetfonts,%
+}
+
+% Font load order. Default font load order is:
+% textfigures -> symbols -> math -> rm -> sf -> tt
+% (or as specified in \TF@DEFAULTFONTLOADORDER, above)
+%
+% 1. package option loadorder allows users to indicate (albeit strongly
+% indicate) their preferred font load order. We do our best to honour
+% the user's preference, but may occasionally choose to disregard it.
+% 2. users should do their best to avoid using this option lest doing so
+% lead to brittle code (seemingly innocuous changes to document code
+% leading to unexpected problems). However, this option might prove
+% useful, especially in cases where math/symbols load ordering can
+% strongly affect results.
+%-----------------------------------------------------------------------
+\newcommand*\tf@fontloadorder{\TF@DEFAULTFONTLOADORDER}
+\tf@newbool{tf@fontloadorderimplicit}{true}
+
+\define@key{TF}{fontloadorder}[\TF@DEFAULTFONTLOADORDER]{
+ \renewcommand*\tf@fontloadorder{#1}
+ \boolfalse{tf@fontloadorderimplicit}
+}
+
+% Output extra info in log files and coloured text when debugging
+%----------------------------------------------------------------
+\tf@newbool{tf@debug}{false}
+\tf@newbool{tf@debugimplicit}{true}
+
+\define@choicekey+{TF}{debug}[]{true,false}[true]
+ {\setbool{tf@debug}{#1}\boolfalse{tf@debugimplicit}}
+ {\TF@ChoiceOptionError{debug}{#1}}
+
+% Enabling print info commands will pull in packages we generally don't use
+%--------------------------------------------------------------------------
+\tf@newbool{tf@printinfo}{false}
+\tf@newbool{tf@printinfoimplicit}{true}
+
+\define@choicekey+{TF}{printinfo}[]{true,false}[true]
+ {\setbool{tf@printinfo}{#1}\boolfalse{tf@printinfoimplicit}}
+ {\TF@ChoiceOptionError{printinfo}{#1}}
+
+% Finished declaring package options -- process them
+%---------------------------------------------------
+\TF@PackageDebugInfo{Processing package options...}
+\ProcessOptionsX<TF>\relax
+
+% Set default options; reset or complain about those that don't make sense
+% ========================================================================
+\TF@PackageDebugInfo{Reconfiguring and error-checking user options...}
+
+% Package options validation -- typeface/rm, sanstypeface/sf, monotypeface/tt,
+% mathtypeface/math, symbolstypeface/sym, textfigures
+\newcommand*\tf@reconfigurefontoption[1]{
+ % Set font defaults if a) user did not explicitly specify a desired font
+ % or b) explicitly specified `default' (or whatever \TF@DEFAULT is defined
+ % to be) instead.
+ % #1 is rm, sf, tt, math, symbols or textfigures
+ \ifthenelse{\equal{\csname tf@#1fontname\endcsname}{}}{
+ \expandafter\xdef\csname tf@#1fontname\endcsname{\TF@DEFAULT}
+ \expandafter\xdef\csname tf@#1fontdefaultstatus\endcsname
+ {\TF@IMPLICITDEFAULT}
+ }{}
+
+ \ifthenelse{\equal{\csname tf@#1fontname\endcsname}{\TF@DEFAULT}
+ \AND\equal{\csname tf@#1fontdefaultstatus\endcsname}{\TF@EXPLICITOTHER}}{
+ \expandafter\xdef\csname tf@#1fontdefaultstatus\endcsname
+ {\TF@EXPLICITDEFAULT}
+ }{}
+
+ \ifthenelse{\equal{\csname tf@#1fontname\endcsname}{\TF@DEFAULT}}{
+ \MakeUppercase{\xdef\noexpand\tf@@tmp{TF@DEFAULT#1FONT}}
+ \expandafter\xdef\csname tf@#1fontname\endcsname
+ {\csname\tf@@tmp\endcsname}
+ }{}
+}
+\forcsvlist{\tf@reconfigurefontoption}{rm,sf,tt,math,symbols,textfigures}
+
+% Shared fontencoding, inputencoding, textcomp, cmap options validation
+% routine. Apologies for the jabberwocky code -- it was this or repeat
+% the entire block several times.
+\newcommand*\tf@@pkgoptionsvalidation[1]{
+ % #1: fontencoding, inputencoding, textcomp or cmap
+ \expandafter\def\csname tf@#1\endcsname{}
+ \edef\tf@@optionstring{\csname tf@#1string\endcsname}
+ \MakeUppercase{\xdef\noexpand\tf@@tmp{TF@DEFAULT#1}}
+ \xdef\TF@@DEFAULTOPTION{\csname\tf@@tmp\endcsname}
+
+ % Set (preliminary) defaultstatus depending on what the user specified
+ \ifthenelse{\equal{\tf@@optionstring}{}}{
+ \expandafter\def\csname tf@#1defaultstatus\endcsname{\TF@IMPLICITDEFAULT}
+ }{
+ \ifthenelse{\equal{\tf@@optionstring}{\TF@DEFAULT}}
+ {\expandafter\def\csname tf@#1defaultstatus\endcsname{\TF@EXPLICITDEFAULT}}
+ {\expandafter\def\csname tf@#1defaultstatus\endcsname{\TF@EXPLICITOTHER}}
+ }
+
+ % Ensure each suboption in option string matches an item
+ % in the relevant options choices list
+ \tf@newbool{tf@#1match}{false}
+ \tf@newbool{tf@#1dontload}{false}
+ \newcounter{tf@#1suboptionscount}
+ \setcounter{tf@#1suboptionscount}{0}
+ \renewcommand*\tf@@listseparator{}
+
+ \def\tf@@innerdo##1{
+ \boolfalse{tf@#1match}
+ \ifthenelse{\equal{##1}{\tf@@option}}
+ {\booltrue{tf@#1match}\listbreak}{}
+ }
+
+ \def\do##1{
+ \ifthenelse{\equal{##1}{\TF@DONTLOAD}\OR\equal{##1}{\TF@IGNORE}}{
+ \booltrue{tf@#1dontload}
+ \expandafter\def\csname tf@#1\endcsname{\TF@DONTLOAD}
+ }{
+ \xdef\tf@@option{##1}
+ \xdef\tf@@options{\csname tf@#1choices\endcsname}
+ \expandafter\forcsvlist\expandafter\tf@@innerdo\expandafter{\tf@@options}
+ \ifbool{tf@#1match}{
+ \ifthenelse{\equal{##1}{\TF@DEFAULT}}{
+ % translate user suboption \TF@DEFAULT (usually `default')
+ % to appropriate value, setting default status accordingly
+ \expandafter\xdef\csname tf@#1\endcsname{%
+ \csname tf@#1\endcsname\tf@@listseparator\TF@@DEFAULTOPTION}
+ \expandafter\xdef\csname tf@#1primary\endcsname
+ {\TF@@DEFAULTOPTION}% fontenc only
+ \expandafter\xdef\csname tf@#1defaultstatus\endcsname
+ {\TF@EXPLICITDEFAULT}
+ }{
+ \expandafter\xdef\csname tf@#1\endcsname{%
+ \csname tf@#1\endcsname\tf@@listseparator##1}
+ \expandafter\xdef\csname tf@#1primary\endcsname{##1}% fontenc only
+ \expandafter\xdef\csname tf@#1defaultstatus\endcsname
+ {\TF@EXPLICITOTHER}
+ }
+ \renewcommand*\tf@@listseparator{,}
+ }{
+ \TF@PackageError{%
+ Suboption `##1' in `#1=\tf@@optionstring'\MessageBreak
+ is not valid. Setting `#1=\TF@@DEFAULTOPTION'}{}
+ \expandafter\xdef\csname tf@#1string\endcsname{}
+ \listbreak
+ }
+ }
+ \stepcounter{tf@#1suboptionscount}
+ }
+ \expandafter\tf@doColonSeparatedList\expandafter{\tf@@optionstring}
+
+ \ifthenelse{\value{tf@#1suboptionscount} > 1}{
+ \expandafter\xdef\csname tf@#1defaultstatus\endcsname{\TF@EXPLICITOTHER}
+ }{}
+
+ % Option-specific error handling
+ \ifthenelse{\equal{#1}{fontencoding}}{
+ \ifthenelse{\boolean{tf@fontencodingdontload}
+ \AND\value{tf@fontencodingsuboptionscount} > 1}{
+ \TF@PackageError{%
+ #1 suboptions `\TF@DONTLOAD' and `\TF@IGNORE'\MessageBreak
+ do not mix with other suboptions. Package option\MessageBreak
+ `#1=\tf@@optionstring' is not valid.\MessageBreak
+ Setting `#1=\TF@@DEFAULTOPTION'}{}
+ \expandafter\xdef\csname tf@#1string\endcsname{}
+ }{}
+ }{% inputencoding, textcomp and cmap options
+ \ifthenelse{\value{tf@#1suboptionscount} > 1}{
+ \TF@PackageError{%
+ Package option `#1=\tf@@optionstring' is\MessageBreak
+ not valid. `#1' does not accept multiple\MessageBreak
+ suboptions. Setting `#1=\TF@@DEFAULTOPTION'}{}
+ \expandafter\xdef\csname tf@#1string\endcsname{}
+ }{}
+ }
+
+ \edef\tf@@optionstring{\csname tf@#1string\endcsname}
+ \ifthenelse{\equal{\tf@@optionstring}{}}{
+ \expandafter\xdef\csname tf@#1\endcsname{\TF@@DEFAULTOPTION}
+ \expandafter\xdef\csname tf@#1primary\endcsname{\TF@@DEFAULTOPTION}
+ }{}
+}
+\forcsvlist{\tf@@pkgoptionsvalidation}{fontencoding,inputencoding,textcomp,cmap}
+
+% Package options validation -- fontloadorder
+\xdef\tf@fontloadorder{\tf@fontloadorder:} % <-- insert guard
+ \tf@ifsuboption{textfigures}{\tf@fontloadorder}{\relax}
+ {\tf@replacesuboption{textfigure}{textfigures}{\tf@fontloadorder}}
+ \tf@ifsuboption{symbols}{\tf@fontloadorder}{\relax}
+ {\tf@replacesuboption{symbol}{symbols}{\tf@fontloadorder}}
+ \tf@replacesuboption{maths}{math}{\tf@fontloadorder}
+ \tf@replacesuboption{roman}{rm}{\tf@fontloadorder}
+ \tf@replacesuboption{sans}{sf}{\tf@fontloadorder}
+ \tf@replacesuboption{mono}{tt}{\tf@fontloadorder}
+ \tf@replacesuboption{teletype}{tt}{\tf@fontloadorder}
+\def\tf@stripguard#1:\@empty#2\relax{#1} % <-- strip guard
+\xdef\tf@fontloadorder{\expandafter%
+ \tf@stripguard\tf@fontloadorder\@empty\relax}
+
+\ifthenelse{\equal{\tf@fontloadorder}{\TF@DEFAULT}}
+ {\xdef\tf@fontloadorder{\TF@DEFAULTFONTLOADORDER}}{} % NB, not \newcommand
+
+% Check whether the font load order list is under or over complete
+\newcommand*\tf@fontloadordercomplete[1]{
+ \tf@ifsuboption{#1}{\tf@fontloadorder}{
+ \tf@suboptioncount{#1}{\tf@fontloadorder}
+ \ifthenelse{\thetf@suboptioncount > 1}{
+ \TF@PackageError{Suboption `#1' appears more than once in\MessageBreak
+ `fontloadorder=\tf@fontloadorder'.\MessageBreak
+ Setting `fontloadorder=\TF@DEFAULT'}{}
+ \xdef\tf@fontloadorder{\TF@DEFAULTFONTLOADORDER} % NB, not \newcommand!
+ }{}
+ }{
+ \TF@PackageError{Suboption `#1' missing in package option\MessageBreak
+ `fontloadorder=\tf@fontloadorder'.\MessageBreak
+ Setting `fontloadorder=\TF@DEFAULT'}{}
+ \xdef\tf@fontloadorder{\TF@DEFAULTFONTLOADORDER} % NB, not \newcommand!
+ }
+}
+\forcsvlist{\tf@fontloadordercomplete}{rm,sf,tt,math,symbols,textfigures}
+
+% check for typos, weird entries in the font order list
+\renewcommand*\do[1]{ % see etoolbox package docs
+ \ifthenelse{\NOT\equal{#1}{textfigures}
+ \AND\NOT\equal{#1}{symbols}
+ \AND\NOT\equal{#1}{math}
+ \AND\NOT\equal{#1}{rm}
+ \AND\NOT\equal{#1}{sf}
+ \AND\NOT\equal{#1}{tt}}{
+ \TF@PackageError{Unexpected suboption `#1' in package option\MessageBreak
+ `fontloadorder=\tf@fontloadorder'.\MessageBreak
+ Setting `fontloadorder=\TF@DEFAULT'}{}
+ }{}
+}
+\expandafter\tf@doColonSeparatedList\expandafter{\tf@fontloadorder}
+
+% Package options validation -- cmap
+% -- cmap accepts a faux option which, after validation, we can now remove
+\tf@replacesuboption{noresetfonts}{}{\tf@cmap}
+
+% Load and process auxiliary file
+% ===============================
+
+% Ensure our auxiliary parameters have not been pre-defined...
+\tf@undefinecommands{
+ \tf@aux@fontencoding,
+ \tf@aux@inputencoding,
+ \tf@aux@textcomp,
+ \tf@aux@cmap,
+ \tf@aux@rmfontname,
+ \tf@aux@sffontname,
+ \tf@aux@ttfontname,
+ \tf@aux@mathfontname,
+ \tf@aux@symbolsfontname,
+ \tf@aux@textfiguresfontname,
+ \tf@aux@sfscalefactor,
+ \tf@aux@ttscalefactor,
+ \tf@aux@mathscalefactor,
+ \tf@aux@textfiguresscalefactor,
+ \tf@aux@textfiguresspacing,
+}
+
+% ... read them from our aux file if defined there ...
+\InputIfFileExists{\TF@AUXFILENAME}
+ {\TF@PackageDebugInfo{Loading auxiliary file `\TF@AUXFILENAME'...}}
+ {\TF@PackageDebugInfo{Could not locate auxiliary file `\TF@AUXFILENAME'}}
+
+% ... or define them safely if they are not
+\providecommand*\tf@aux@fontencoding{}
+\providecommand*\tf@aux@inputencoding{}
+\providecommand*\tf@aux@textcomp{}
+\providecommand*\tf@aux@cmap{}
+
+\providecommand*\tf@aux@rmfontname{}
+\providecommand*\tf@aux@sffontname{}
+\providecommand*\tf@aux@ttfontname{}
+\providecommand*\tf@aux@mathfontname{}
+\providecommand*\tf@aux@symbolsfontname{}
+\providecommand*\tf@aux@textfiguresfontname{}
+
+\providecommand*\tf@aux@sfscalefactor{}
+\providecommand*\tf@aux@ttscalefactor{}
+\providecommand*\tf@aux@mathscalefactor{}
+\providecommand*\tf@aux@textfiguresscalefactor{}
+\providecommand*\tf@aux@textfiguresspacing{}
+
+%--- Begin rebuilding the aux file anew ---------------------------------------
+\tf@writeauxfile{\string\relax} % reset aux file contents
+\tf@writeauxfile{\string\ProvidesFile{\TF@AUXFILENAME}[<\TF@PACKAGENAME package auxiliary file>]}
+\tf@writeauxfile{\string\newcommand*\string\tf@aux@fontencoding{\tf@fontencoding}}
+\tf@writeauxfile{\string\newcommand*\string\tf@aux@inputencoding{\tf@inputencoding}}
+\tf@writeauxfile{\string\newcommand*\string\tf@aux@textcomp{\tf@textcomp}}
+\tf@writeauxfile{\string\newcommand*\string\tf@aux@cmap{\tf@cmap}}
+\tf@writeauxfile{\string\newcommand*\string\tf@aux@rmfontname{\tf@rmfontname}}
+\tf@writeauxfile{\string\newcommand*\string\tf@aux@sffontname{\tf@sffontname}}
+\tf@writeauxfile{\string\newcommand*\string\tf@aux@ttfontname{\tf@ttfontname}}
+\tf@writeauxfile{\string\newcommand*\string\tf@aux@mathfontname{\tf@mathfontname}}
+\tf@writeauxfile{\string\newcommand*\string\tf@aux@symbolsfontname{\tf@symbolsfontname}}
+\tf@writeauxfile{\string\newcommand*\string\tf@aux@textfiguresfontname{\tf@textfiguresfontname}}
+%------------------------------------------------------------------------------
+
+% Shared typeface loading commands
+% ================================
+\TF@PackageDebugInfo{Configuring shared typeface load commands...}
+
+% Some fonts may be called on by multiple typeface loading commands. In
+% these cases, common code is factored out to assist font load management
+% and to reduce code duplication.
+
+%------------------------------------------------------------------------------
+% NB, because they contain shared/refactored code, many (if not most) of
+% these commands ignore user-specified changes in fontloadorder.
+%------------------------------------------------------------------------------
+
+% Adobe Minion Pro -- shared code
+%--------------------------------
+\newcommand*\tf@mp@printname{Adobe Minion Pro}
+\tf@newbool{tf@mp@implicitmathnums}{true}
+
+% Minion Pro load helper command
+\newcommand*\tf@mp@processoptions[1]{
+ % #1 is either \tf@rmfontoptions or \tf@mathfontoptions
+ \tf@ifsuboption{smallfamily}{#1}
+ {\PassOptionsToPackage{smallfamily}{MinionPro}}{}
+ \tf@ifsuboption{medfamily}{#1}
+ {\PassOptionsToPackage{medfamily}{MinionPro}}{}
+ \tf@ifsuboption{fullfamily}{#1}
+ {\PassOptionsToPackage{fullfamily}{MinionPro}}{}
+ \tf@ifsuboption{noopticals}{#1}
+ {\PassOptionsToPackage{noopticals}{MinionPro}}{}
+ \tf@ifsuboption{opticals}{#1}
+ {\PassOptionsToPackage{opticals}{MinionPro}}{}
+ \tf@ifsuboption{slides}{#1}
+ {\PassOptionsToPackage{slides}{MinionPro}}{}
+ \tf@ifsuboption{normalsize}{#1}
+ {\PassOptionsToPackage{normalsize}{MinionPro}}{}
+ \tf@ifsuboption{nonormalsize}{#1}
+ {\PassOptionsToPackage{nonormalsize}{MinionPro}}{}
+
+ \ifthenelse{\equal{\tf@mathfont}{adobeminionpro}}{
+ \def\tf@@configurempoptions##1{
+ \tf@ifsuboption{##1}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{mathlf}{MinionPro}
+ \boolfalse{tf@mp@implicitmathnums}
+ }{}
+ }
+ \forcsvlist{\tf@@configurempoptions}
+ {lf,lsf,lining,liningstyle,liningstylefigures,mathlf}
+
+ \def\tf@@configurempoptions##1{
+ \tf@ifsuboption{##1}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{mathosf}{MinionPro}
+ \boolfalse{tf@mp@implicitmathnums}
+ }{}
+ }
+ \forcsvlist{\tf@@configurempoptions}
+ {osf,oldstyle,oldfigures,oldstylefigures,mathosf}
+ }{}
+ % unlike math where we allow many lf/osf aliases for configuring
+ % math figures, we only allow `mathlf' or `mathosf' in rm
+ % options to configure math figures
+ \ifthenelse{\equal{\tf@rmfont}{adobeminionpro}}{
+ \tf@ifsuboption{mathlf}{\tf@rmfontoptions}{
+ \PassOptionsToPackage{mathlf}{MinionPro}
+ \boolfalse{tf@mp@implicitmathnums}}{}
+ \tf@ifsuboption{mathosf}{\tf@rmfontoptions}{
+ \PassOptionsToPackage{mathosf}{MinionPro}
+ \boolfalse{tf@mp@implicitmathnums}}{}
+ }{}
+ \ifbool{tf@mp@implicitmathnums}{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@LF}}
+ {\PassOptionsToPackage{mathlf}{MinionPro}}
+ {\PassOptionsToPackage{mathosf}{MinionPro}}
+ }{}
+
+ \tf@ifsuboption{mathtabular}{#1}
+ {\PassOptionsToPackage{mathtabular}{MinionPro}}{}
+ \tf@ifsuboption{mnsy}{#1}
+ {\PassOptionsToPackage{mnsy}{MinionPro}}{}
+ \tf@ifsuboption{cmsy}{#1}
+ {\PassOptionsToPackage{cmsy}{MinionPro}}{}
+ \tf@ifsuboption{swash}{#1}
+ {\PassOptionsToPackage{swash}{MinionPro}}{}
+ \tf@ifsuboption{abx}{#1}
+ {\PassOptionsToPackage{abx}{MinionPro}}{}
+ \tf@ifsuboption{amsbb}{#1}
+ {\PassOptionsToPackage{amsbb}{MinionPro}}{}
+ \tf@ifsuboption{fourierbb}{#1}
+ {\PassOptionsToPackage{fourierbb}{MinionPro}}{}
+ \tf@ifsuboption{lucidabb}{#1}
+ {\PassOptionsToPackage{lucidabb}{MinionPro}}{}
+ \tf@ifsuboption{mixedgreek}{#1}
+ {\PassOptionsToPackage{mixedgreek}{MinionPro}}{}
+ \tf@ifsuboption{italicgreek}{#1}
+ {\PassOptionsToPackage{italicgreek}{MinionPro}}{}
+ \tf@ifsuboption{frenchmath}{#1}
+ {\PassOptionsToPackage{frenchmath}{MinionPro}}{}
+ \tf@ifsuboption{minionint}{#1}
+ {\PassOptionsToPackage{minionint}{MinionPro}}{}
+ \tf@ifsuboption{openg}{#1}
+ {\PassOptionsToPackage{openg}{MinionPro}}{}
+ \tf@ifsuboption{loosequotes}{#1}
+ {\PassOptionsToPackage{loosequotes}{MinionPro}}{}
+ \tf@ifsuboption{footnotefigures}{#1}
+ {\PassOptionsToPackage{footnotefigures}{MinionPro}}{}
+}
+
+\newcommand*\tf@loadadobeminionpro{
+ \providebool{tf@adobeminionproloaded}
+ \ifbool{tf@adobeminionproloaded}{\relax}{
+ \booltrue{tf@adobeminionproloaded}
+ \ifthenelse{\equal{\tf@rmfont}{adobeminionpro}}{
+ \tf@mp@processoptions{\tf@rmfontoptions}
+ \ifthenelse{\equal{\tf@mathfont}{adobeminionpro}
+ \OR\equal{\tf@mathfont}{\TF@DEFAULT}}{
+ \renewcommand*\tf@mathprintname{\tf@mp@printname}
+ }{
+ \PassOptionsToPackage{onlytext}{MinionPro}
+ }
+ \renewcommand*\tf@rmprintname{\tf@mp@printname}
+ }{}
+
+ \ifthenelse{\equal{\tf@mathfont}{adobeminionpro}}{
+ \tf@mp@processoptions{\tf@mathfontoptions}
+ \ifthenelse{\equal{\tf@rmfont}{adobeminionpro}
+ \OR\equal{\tf@rmfont}{\TF@DEFAULT}}{
+ \renewcommand*\tf@rmprintname{\tf@mp@printname}
+ }{
+ \PassOptionsToPackage{onlymath}{MinionPro}
+ }
+ \renewcommand*\tf@mathprintname{\tf@mp@printname}
+ \renewcommand*\tf@symbolsprintname{MnSymbol}
+ }{}
+
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@LF}}{
+ \PassOptionsToPackage{textlf}{MinionPro}
+ }{
+ \PassOptionsToPackage{textosf}{MinionPro}
+ \renewenvironment{liningnums}{%
+ \ifbool{tf@debug}{%
+ \color{\TF@DEBUG@COLOUR@LININGNUMS}%
+ }{}%
+ \booltrue{tf@liningnums}%
+ \figureversion{lining}% % Adobe Minion Pro specific command
+ }{%
+ \boolfalse{tf@liningnums}% these lines are unnecessary,
+ \figureversion{text}% % but let's be explicit anyway
+ }
+ }
+
+ \let\oldoldstylenums\oldstylenums % before MinionPro hijacks this
+ \tf@usefontpackage{MinionPro}
+ \ifthenelse{\NOT\equal{\tf@rmprintname}{\tf@mp@printname}}{
+ % restore the hijacking if rm font is neither adobeminionpro nor default
+ \let\oldstylenums\oldoldstylenums
+ }{}
+ % Sidestep a pesky message from fontaxes, a package loaded by MinionPro.
+ % This message is generated whenever fontaxes tries to manage fonts that
+ % don't provide all the features that it requires -- in general, almost
+ % any font. In these cases, fontaxes will complain (a lot) that "I don't
+ % know how to decode family `X' on input line...", where (in our case) X
+ % is either \rmdefault (resp. \sfdefault, \ttdefault) or \tf@substosffont,
+ % our text figures substitute font. Note that the name of the fontaxes
+ % warning command depends on whether fontaxes has been installed via
+ % MinionPro package installation (\fa@warn@undecodable) or via a more
+ % recent fontaxes package update (\fontaxes@warn@undecodable).
+ \@ifpackageloaded{fontaxes}{
+ \ifdef{\fa@warn@undecodable}{
+ \renewcommand*\fa@warn@undecodable[1]{}
+ \TF@PackageInfoNoLine{Silenced fontaxes command %
+ \string\fa@warn@undecodable}
+ }{}
+ \ifdef{\fontaxes@warn@undecodable}{
+ \renewcommand*\fontaxes@warn@undecodable[1]{}
+ \TF@PackageInfoNoLine{Silenced fontaxes command %
+ \string\fontaxes@warn@undecodable}
+ }{}
+ }{}
+ }
+}
+
+% Antykwa Torunska -- shared code
+%--------------------------------
+\newcommand*\tf@at@processoptions[1]{
+ % #1 is either \tf@rmfontoptions or \tf@mathfontoptions
+ \tf@ifsuboption{mathnoalias}{#1}{
+ \PassOptionsToPackage{mathnoalias}{anttor}}{}
+ \tf@ifsuboption{light}{#1}{
+ \PassOptionsToPackage{light}{anttor}
+ \booltrue{tf@at@light}}{}
+ \tf@ifsuboption{condensed}{#1}{
+ \PassOptionsToPackage{condensed}{anttor}
+ \booltrue{tf@at@condensed}}{}
+}
+
+\newcommand*\tf@loadantykwatorunska{
+ \providebool{tf@antykwatorunskaloaded}
+ \ifbool{tf@antykwatorunskaloaded}{\relax}{
+ \booltrue{tf@antykwatorunskaloaded}
+ \newcommand*\tf@at@printname{Antykwa Toru\'nska}
+ \tf@newbool{tf@at@light}{false}
+ \tf@newbool{tf@at@condensed}{false}
+
+ \ifthenelse{\equal{\tf@rmfont}{antykwatorunska}
+ \OR\equal{\tf@rmfont}{\TF@DEFAULT}}{
+ \tf@at@processoptions{\tf@rmfontoptions}
+ \renewcommand*\tf@rmprintname{\tf@at@printname}
+ \renewcommand\oldstylenums[1]{{\scshape ##1}}
+ \tf@SCencodedosf
+ }{}
+ \ifthenelse{\equal{\tf@mathfont}{antykwatorunska}
+ \OR\equal{\tf@mathfont}{\TF@DEFAULT}}{
+ \tf@at@processoptions{\tf@mathfontoptions}
+ \PassOptionsToPackage{math}{anttor}
+ \renewcommand*\tf@mathprintname{\tf@at@printname}
+ }{}
+
+ \tf@usefontpackage{anttor}
+
+ \newcommand*\tf@at@subprintname{}
+ \ifbool{tf@at@light}
+ {\edef\tf@at@subprintname{\tf@at@subprintname\space Light}}{}
+ \ifbool{tf@at@condensed}
+ {\edef\tf@at@subprintname{\tf@at@subprintname\space Condensed}}{}
+ \ifthenelse{\equal{\tf@rmprintname}{\tf@at@printname}}
+ {\xdef\tf@rmprintname{\tf@rmprintname\tf@at@subprintname}}{}
+ \ifthenelse{\equal{\tf@mathprintname}{\tf@at@printname}}
+ {\xdef\tf@mathprintname{\tf@mathprintname\tf@at@subprintname}}{}
+ }
+}
+
+% CM Bright -- shared code
+%-------------------------
+% CM Bright is a raster rather than an outline (scalable) font unless the
+% hfbright remappings of cmbright have been installed at the user's site.
+\newcommand*\tf@loadcmbright{
+ % Load math/rm/sf/tt CM Bright as applicable, additionally loading
+ % rm/sf/tt (but not math) if any of these happen to be default
+ \providebool{tf@cmbrightloaded}
+ \ifbool{tf@cmbrightloaded}{\relax}{
+ \booltrue{tf@cmbrightloaded}
+ \ifthenelse{\equal{\tf@mathfont}{cmbright}}{
+ \tf@ifsuboption{slantedGreek}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{slantedGreek}{cmbright}}{}
+ \tf@ifsuboption{standard-baselineskips}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{standard-baselineskips}{cmbright}}{}
+ \tf@usefontpackage{cmbright}
+ \tf@mathfont@cmbright % housekeeping, e.g., sets math print name
+ }{}
+ \ifthenelse{\equal{\tf@rmfont}{cmbright}\OR\equal{\tf@rmfont}{\TF@DEFAULT}}{
+ \renewcommand*\rmdefault{cmbr}
+ \tf@TSencodedosf
+ \tf@rmfont@cmbright % housekeeping, e.g., sets rm print name
+ }{}
+ \ifthenelse{\equal{\tf@sffont}{cmbright}\OR\equal{\tf@sffont}{\TF@DEFAULT}}{
+ \renewcommand*\sfdefault{cmbr}
+ \tf@sffont@cmbright % housekeeping, e.g., sets sf print name
+ }{}
+ \ifthenelse{\equal{\tf@ttfont}{cmbright}\OR\equal{\tf@ttfont}{\TF@DEFAULT}}{
+ \renewcommand*\ttdefault{cmtl}
+ \tf@ttfont@cmbright % housekeeping, e.g., sets tt print name
+ }{}
+ }
+}
+
+% Concrete -- shared code
+%------------------------
+% Math - Concrete. NB, concrete math is a bitmap font. Likewise
+% concrete roman with OT1 fontencoding; T1 fontencoding loads
+% cm-super outline fonts instead.
+\newcommand*\tf@loadconcrete{
+ % Load math/rm concrete as applicable, additionally loading
+ % rm if user option typeface (rm) is set to \TF@DEFAULT
+ \providebool{tf@concreteloaded}
+ \ifbool{tf@concreteloaded}{\relax}{
+ \booltrue{tf@concreteloaded}
+ \ifthenelse{\equal{\tf@mathfont}{concrete}}{
+ \tf@ifsuboption{exscale}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{exscale}{concmath}}{}
+ \tf@ifsuboption{amsfonts}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{amsfonts}{concmath}}{}
+ \tf@ifsuboption{amssymb}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{amssymb}{concmath}}{}
+ % The documentation discusses `sansbold' option; the style file only
+ % accepts `boldsans'. Might as well make things easy for end users.
+ \tf@ifsuboption{sansbold}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{boldsans}{concmath}}{}
+ \tf@ifsuboption{boldsans}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{boldsans}{concmath}}{}
+ \tf@usefontpackage{concmath} % preferable to ccfonts
+ \tf@mathfont@concrete % housekeeping, e.g., sets math print name
+ }{}
+ \ifthenelse{\equal{\tf@rmfont}{concrete}\OR\equal{\tf@rmfont}{\TF@DEFAULT}}{
+ \renewcommand*\rmdefault{ccr}
+ \tf@TSencodedosf
+ \tf@rmfont@concrete % housekeeping, e.g., sets rm print name
+ }{}
+ }
+}
+
+% Kepler Project fonts -- shared code
+%------------------------------------
+\newcommand*\tf@loadkpfonts{
+ \providebool{tf@kpfontsloaded}
+ \ifbool{tf@kpfontsloaded}{\relax}{
+ \booltrue{tf@kpfontsloaded}
+ \edef\tf@@lfn{jkp} % lining figures fontname: jkp[l,x][k][f]
+
+ \tf@newbool{tf@@kprm}{false}
+ \tf@newbool{tf@@kpmath}{false}
+ \ifthenelse{\equal{\tf@rmfont}{kpfonts}}{\booltrue{tf@@kprm}}{}
+ \ifthenelse{\equal{\tf@mathfont}{kpfonts}}{\booltrue{tf@@kpmath}}{}
+ \ifthenelse{\boolean{tf@@kprm}\AND\equal{\tf@mathfont}{\TF@DEFAULT}}
+ {\booltrue{tf@@kpmath}}{}
+ \ifthenelse{\boolean{tf@@kpmath}\AND\equal{\tf@rmfont}{\TF@DEFAULT}}
+ {\booltrue{tf@@kprm}}{}
+
+ \ifthenelse{\boolean{tf@@kprm}}
+ {\renewcommand*\tf@rmprintname{KP Fonts}}{}
+ \ifthenelse{\boolean{tf@@kpmath}}
+ {\renewcommand*\tf@mathprintname{KP Fonts}}{}
+
+ \ifthenelse{\boolean{tf@@kprm}\AND\NOT\boolean{tf@@kpmath}}
+ {\PassOptionsToPackage{nomath}{kpfonts}}{}
+ \ifthenelse{\boolean{tf@@kpmath}\AND\NOT\boolean{tf@@kprm}}
+ {\PassOptionsToPackage{notext}{kpfonts}}{}
+
+ \ifbool{tf@@kprm}{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}}{
+ \PassOptionsToPackage{oldstylenums}{kpfonts}
+ \ifthenelse{\equal{\tf@mathfont}{\TF@DEFAULT}}{
+ \PassOptionsToPackage{oldstylenumsmath}{kpfonts}
+ }{}
+ }{}
+ \tf@ifsuboption{oldstyle}{\tf@rmfontoptions}{
+ \PassOptionsToPackage{oldstyle}{kpfonts}
+ }{
+ \tf@ifsuboption{veryoldstyle}{\tf@rmfontoptions}{
+ \PassOptionsToPackage{veryoldstyle}{kpfonts}
+ }{}
+ }
+ % NB, rmx trumps light in the kpfonts package. Also note
+ % that rmx might not be available under all installs.
+ \tf@ifsuboption{rmx}{\tf@rmfontoptions}{
+ \PassOptionsToPackage{rmx}{kpfonts}
+ \edef\tf@@lfn{\tf@@lfn x}
+ }{}
+ \tf@ifsuboption{light}{\tf@rmfontoptions}{
+ \PassOptionsToPackage{lighttext}{kpfonts}
+ \edef\tf@@lfn{\tf@@lfn l}
+ \xdef\tf@rmprintname{\tf@rmprintname\ Light}
+ }{
+ \ifthenelse{\equal{\tf@rmfont}{\TF@DEFAULT}}{
+ \tf@ifsuboption{light}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{lighttext}{kpfonts}
+ \edef\tf@@lfn{\tf@@lfn l}
+ \xdef\tf@rmprintname{\tf@rmprintname\ Light}
+ }{}
+ }{}
+ }
+ \tf@ifsuboption{largesmallcaps}{\tf@rmfontoptions}{
+ \PassOptionsToPackage{largesmallcaps}{kpfonts}
+ \edef\tf@@lfn{\tf@@lfn k}
+ }{}
+ \tf@ifsuboption{nofligatures}{\tf@rmfontoptions}{
+ \PassOptionsToPackage{nofligatures}{kpfonts}
+ \edef\tf@@lfn{\tf@@lfn f}
+ }{}
+ \tf@ifsuboption{easyscsl}{\tf@rmfontoptions}{
+ \PassOptionsToPackage{easyscsl}{kpfonts}
+ }{}
+ }{}
+
+ \ifbool{tf@@kpmath}{
+ \tf@ifsuboption{light}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{lightmath}{kpfonts}
+ \xdef\tf@mathprintname{\tf@mathprintname\ Light}
+ }{
+ \ifthenelse{\equal{\tf@mathfont}{\TF@DEFAULT}}{
+ \tf@ifsuboption{light}{\tf@rmfontoptions}{
+ \PassOptionsToPackage{lightmath}{kpfonts}
+ \xdef\tf@mathprintname{\tf@mathprintname\ Light}
+ }{}
+ }{}
+ }
+ \def\tf@@configurekpoptions##1{
+ \tf@ifsuboption{##1}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{oldstylenumsmath}{kpfonts}
+ }{}
+ }
+ \forcsvlist{\tf@@configurekpoptions}
+ {osf,oldstyle,oldfigures,oldstylefigures,oldstylenums,oldstylenumsmath}
+ \@ifpackageloaded{amsmath}{
+ \PassOptionsToPackage{noamsmath}{kpfonts}}{}
+ \tf@ifsuboption{noamsmath}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{noamsmath}{kpfonts}}{}
+ \tf@ifsuboption{sfmath}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{sfmath}{kpfonts}}{}
+ \tf@ifsuboption{sfmathbb}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{sfmathbb}{kpfonts}}{}
+ \tf@ifsuboption{rmmathbb}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{rmmathbb}{kpfonts}}{}
+ \tf@ifsuboption{nomathscript}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{nomathscript}{kpfonts}}{}
+ \tf@ifsuboption{mathcalasscript}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{mathcalasscript}{kpfonts}}{}
+ \tf@ifsuboption{classicReIm}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{classicReIm}{kpfonts}}{}
+ \tf@ifsuboption{uprightRoman}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{uprightRoman}{kpfonts}}{}
+ \tf@ifsuboption{frenchstyle}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{frenchstyle}{kpfonts}}{}
+ \tf@ifsuboption{upright}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{upright}{kpfonts}}{}
+ \tf@ifsuboption{oldstylenumsmath}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{oldstylenumsmath}{kpfonts}}{}
+ \tf@ifsuboption{oldstylemath}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{oldstylemath}{kpfonts}}{}
+ \tf@ifsuboption{veryoldstylemath}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{veryoldstylemath}{kpfonts}}{}
+ \tf@ifsuboption{narrowiints}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{narrowiints}{kpfonts}}{}
+ \tf@ifsuboption{partialup}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{partialup}{kpfonts}}{}
+ \tf@ifsuboption{widermath}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{widermath}{kpfonts}}{}
+ \tf@ifsuboption{noDcommand}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{noDcommand}{kpfonts}}{}
+ \tf@ifsuboption{intlimits}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{intlimits}{kpfonts}}{}
+ \tf@ifsuboption{nointlimits}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{nointlimits}{kpfonts}}{}
+ \tf@ifsuboption{fullintlimits}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{fullintlimits}{kpfonts}}{}
+ \tf@ifsuboption{sumlimits}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{sumlimits}{kpfonts}}{}
+ \tf@ifsuboption{nosumlimits}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{nosumlimits}{kpfonts}}{}
+ \tf@ifsuboption{fullsumlimits}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{fullsumlimits}{kpfonts}}{}
+ \tf@ifsuboption{uprightgreeks}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{uprightgreeks}{kpfonts}}{}
+ \tf@ifsuboption{slantedGreeks}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{slantedGreeks}{kpfonts}}{}
+ }{}
+
+ \ifthenelse{\boolean{tf@@kprm}\AND\equal{\tf@sffont}{\TF@DEFAULT}}
+ {\renewcommand*\tf@sfprintname{KP Fonts}}
+ {\PassOptionsToPackage{nosf}{kpfonts}}
+
+ \ifthenelse{\boolean{tf@@kprm}\AND\equal{\tf@ttfont}{\TF@DEFAULT}}
+ {\renewcommand*\tf@ttprintname{KP Fonts}}
+ {\PassOptionsToPackage{nott}{kpfonts}}
+
+ \tf@usefontpackage[notextcomp]{kpfonts}
+ \tf@define@liningfigures{\tf@@lfn}
+ }
+}
+
+% Lucida Bright fonts -- shared code
+% (TODO: switch for lucimatx package if some kind soul could give me a copy) % <-- TODO
+%---------------------------------------------------------------------------
+\tf@newbool{tf@@lbrm}{false}
+\tf@newbool{tf@@lbmath}{false}
+\tf@newbool{tf@@lbseriftt}{false}
+
+\newcommand*\tf@@loadlucidabrtextwithoutmath{
+ % Note: no attempt is made to check for incompatible user options here
+ \renewcommand*\rmdefault{hlh}
+ \tf@ifsuboption{casual}{\tf@rmfontoptions}{\renewcommand*\rmdefault{hlcn}}{}
+ \tf@ifsuboption{fax}{\tf@rmfontoptions}{\renewcommand*\rmdefault{hlx}}{}
+ \tf@ifsuboption{seriftt}{\tf@rmfontoptions}{\booltrue{tf@@lbseriftt}}{}
+
+ \def\tf@@lbscale{lucidascale}
+ \tf@ifsuboption{nolucidascale}{\tf@rmfontoptions}
+ {\def\tf@@lbscale{nolucidascale}}{}
+ \tf@ifsuboption{lucidasmallscale}{\tf@rmfontoptions}
+ {\def\tf@@lbscale{lucidasmallscale}}{}
+
+ \ifthenelse{\equal{\tf@@lbscale}{nolucidascale}}{% strictly redundant
+ \def\DeclareLucidaFontShape##1##2##3##4##5##6{%
+ \DeclareFontShape{##1}{##2}{##3}{##4}{<->##5}{##6}%
+ }
+ }{}
+
+ \ifthenelse{\equal{\tf@@lbscale}{lucidascale}}{
+ \def\DeclareLucidaFontShape##1##2##3##4##5##6{%
+ \DeclareFontShape{##1}{##2}{##3}{##4}{%
+ <-5.5>s*[1.04]##5%
+ <5.5-6.5>s*[1.02]##5%
+ <6.5-7.5>s*[.99]##5%
+ <7.5-8.5>s*[.97]##5%
+ <8.5-9.5>s*[.96]##5%
+ <9.5-10.5>s*[.95]##5%
+ <10.5-11.5>s*[.94]##5%
+ <11.5-13>s*[.93]##5%
+ <13-15.5>s*[.92]##5%
+ <15.5-18.5>s*[.91]##5%
+ <18.5-22.5>s*[.9]##5%
+ <22.5->s*[.89]##5%
+ }{##6}%
+ }
+ }{}
+
+ \ifthenelse{\equal{\tf@@lbscale}{lucidasmallscale}}{
+ \def\DeclareLucidaFontShape##1##2##3##4##5##6{%
+ \DeclareFontShape{##1}{##2}{##3}{##4}{%
+ <-5.5>s*[.98]##5%
+ <5.5-6.5>s*[.96]##5%
+ <6.5-7.5>s*[.94]##5%
+ <7.5-8.5>s*[.92]##5%
+ <8.5-9.5>s*[.91]##5%
+ <9.5-10.5>s*[.9]##5%
+ <10.5-11.5>s*[.89]##5%
+ <11.5-13>s*[.88]##5%
+ <13-15.5>s*[.87]##5%
+ <15.5-18.5>s*[.86]##5%
+ <18.5-22.5>s*[.85]##5%
+ <22.5->s*[.84]##5%
+ }{##6}%
+ }
+ }{}
+
+ \normalfont
+ \tf@ifsuboption{calligraphic}{\tf@rmfontoptions}{
+ \DeclareFontShape\encodingdefault\rmdefault{m}{it}%
+ {<->ssub*hlce/m/it}{}
+ }{}
+
+ \tf@ifsuboption{handwriting}{\tf@rmfontoptions}{
+ \DeclareFontShape\encodingdefault\rmdefault{m}{it}%
+ {<->ssub*hlcw/m/it}{}%
+ \DeclareFontShape\encodingdefault\rmdefault{b}{it}%
+ {<->ssub*hlcw/m/it}{}
+ }{}
+
+ \tf@ifsuboption{altbullet}{\tf@rmfontoptions}{
+ \DeclareTextCommand\textbullet\encodingdefault%
+ {\UseTextSymbol{OMS}\textbullet}
+ }{}
+}
+
+\newcommand*\tf@@loadlucidabrtextwithmath{
+ \@ifpackageloaded{\tf@@lbpkg}{\relax}{
+ % Process options. Note that we don't care whether the user requests these
+ % through rm or math suboptions -- it's all the same to us. E.g., the user
+ % can request mathitalic1 in rm suboptions. Equally, no attempt is made to
+ % check for incompatible user options, e.g., whether the user has
+ % simultaneously specified expert and noexpert. It's up to users to do the
+ % right thing (otherwise lucidabr.sty would already be coded against this
+ % sort of problem).
+ \def\tf@@lbprocessopt##1{
+ \tf@ifsuboption{##1}{\tf@rmfontoptions}{
+ \PassOptionsToPackage{##1}{\tf@@lbpkg}
+ }{
+ \tf@ifsuboption{##1}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{##1}{\tf@@lbpkg}
+ }{}
+ }
+ }
+ \ifthenelse{\boolean{tf@@lbrm}}{
+ \forcsvlist{\tf@@lbprocessopt}
+ {expert,noexpert,lucidascale,nolucidascale,lucidasmallscale,%
+ mathitalic1,mathitalic2,mathitalic3,slantedgreek,%
+ uprightgreek,vargreek,% these might, or might not, cause trouble
+ noamssymbols,OT1,T1,LY1,seriftt,%
+ fax,casual,calligraphic,handwriting,altbullet,%
+ errorshow,warningshow,nofontinfo}
+ }{
+ \forcsvlist{\tf@@lbprocessopt}
+ {expert,noexpert,nolucidascale,lucidascale,lucidasmallscale,%
+ mathitalic1,mathitalic2,mathitalic3,slantedgreek,%
+ uprightgreek,vargreek,% these might, or might not, cause trouble
+ noamssymbols,OT1,T1,LY1,errorshow,warningshow,nofontinfo}
+ }
+
+ \tf@ifsuboption{seriftt}{\tf@rmfontoptions}{\booltrue{tf@@lbseriftt}}{}
+ \tf@ifsuboption{seriftt}{\tf@mathfontoptions}{\booltrue{tf@@lbseriftt}}{}
+
+ % Allow preloading amsmath (new -- not one of lucida's native package
+ % options). For examples, see lucida-amsmath.pdf in lucidabr package.
+ \tf@ifsuboption{amsmath}{\tf@mathfontoptions}
+ {\tf@usefontpackage{amsmath}}{}
+
+ \tf@usefontpackage{\tf@@lbpkg}
+ }
+}
+
+\newcommand*\tf@loadlucidabr{
+ \ifthenelse{\equal{\tf@rmfont}{lucidabright}}{\booltrue{tf@@lbrm}}{}
+ \ifthenelse{\equal{\tf@mathfont}{lucidabright}}{\booltrue{tf@@lbmath}}{}
+ \ifthenelse{\boolean{tf@@lbrm}\AND\equal{\tf@mathfont}{\TF@DEFAULT}}
+ {\booltrue{tf@@lbmath}}{}
+ \ifthenelse{\boolean{tf@@lbmath}\AND\equal{\tf@rmfont}{\TF@DEFAULT}}
+ {\booltrue{tf@@lbrm}}{}
+
+ \ifbool{tf@@lbrm}{\renewcommand*\tf@rmprintname{Lucida Bright}}{}
+ \ifbool{tf@@lbmath}{\renewcommand*\tf@mathprintname{Lucida Bright}}{}
+
+ \ifbool{tf@@lbmath}{
+ \ifbool{tf@@lbrm}
+ {\def\tf@@lbpkg{lucidabr}}
+ {\def\tf@@lbpkg{lucbmath}}
+ \tf@@loadlucidabrtextwithmath
+ }{
+ \tf@@loadlucidabrtextwithoutmath
+ }
+
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@lucidabright}{}
+ \ifthenelse{\equal{\tf@ttfont}{\TF@DEFAULT}}{\tf@ttfont@lucidabright}{}
+
+ \ifbool{tf@@lbrm}{\tf@TSencodedosf}{}
+}
+
+% Mathpazo (aka palatino with pazo math fonts) -- shared code
+%------------------------------------------------------------
+\newcommand*\tf@loadmathpazo{
+ \providebool{tf@mathpazoloaded}
+ \ifbool{tf@mathpazoloaded}{\relax}{
+ \booltrue{tf@mathpazoloaded}
+
+ % ward off possible clash of glyphs
+ \tf@undefinecommands{\mathdollar}
+
+ \tf@ifsuboption{slantedGreek}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{slantedGreek}{mathpazo}}{}
+ \tf@ifsuboption{noBBpl}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{noBBpl}{mathpazo}}{}
+ \let\oldoldstylenums\oldstylenums % before mathpazo hijacks this
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@LF}}{
+ \tf@usefontpackage[sc]{mathpazo}
+ }{
+ \tf@usefontpackage[sc,osf]{mathpazo}
+ \tf@define@liningfigures{pplx}
+ }
+ \ifthenelse{\NOT\equal{\tf@rmfont}{palatino}
+ \AND\NOT\equal{\tf@rmfont}{\TF@DEFAULT}}{
+ \let\oldstylenums\oldoldstylenums
+ }{}
+ \tf@ifsuboption{osf}{\tf@mathfontoptions}{
+ % Experimental mathpazo old style figures. Covers
+ % normal and italic but not bold or bold italic.
+ % Probably best to avoid.
+ \DeclareSymbolFont{operators} {OT1}{pplj}{m}{n}
+ \SetSymbolFont{operators}{bold} {OT1}{pplj}{b}{n}
+ \DeclareMathAlphabet{\mathit} {OT1}{pplj}{m}{it}
+ \SetMathAlphabet{\mathit}{bold} {OT1}{pplj}{b}{it}
+ }{}
+ }
+}
+
+% TX Fonts (including New TX) -- shared code
+%-------------------------------------------
+\newcommand*\tf@loadtxfonts{
+ % Precondition: at least one of \tf@mathfont and \tf@rmfont equals `txfonts'
+ \providebool{tf@txfontsloaded}
+ \ifbool{tf@txfontsloaded}{\relax}{
+ \booltrue{tf@txfontsloaded}
+
+ % determine whether we should load (standard) tx or new tx fonts
+ \tf@newbool{newtxmath}{false}
+ \tf@newbool{newtxtext}{false}
+ \ifthenelse{\equal{\tf@mathfont}{txfonts}}{
+ \tf@ifsuboption{new}{\tf@mathfontoptions}{\booltrue{newtxmath}}{}
+ }{
+ \ifthenelse{\equal{\tf@mathfont}{\TF@DEFAULT}}{
+ \tf@ifsuboption{new}{\tf@rmfontoptions}{\booltrue{newtxmath}}{}
+ }{}
+ }
+ \ifthenelse{\equal{\tf@rmfont}{txfonts}}{
+ \tf@ifsuboption{new}{\tf@rmfontoptions}{\booltrue{newtxtext}}{}
+ }{
+ \ifthenelse{\equal{\tf@rmfont}{\TF@DEFAULT}}{
+ \tf@ifsuboption{new}{\tf@mathfontoptions}{\booltrue{newtxtext}}{}
+ }{}
+ }
+
+ \ifthenelse{\equal{\tf@mathfont}{txfonts}\OR\equal{\tf@mathfont}{\TF@DEFAULT}}{
+ \ifbool{newtxmath}{
+ \def\tf@@configuretxoptions##1{
+ \tf@ifsuboption{##1}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{##1}{newtxmath}
+ }{}
+ }
+ \forcsvlist{\tf@@configuretxoptions}{varg,libertine,cmintegrals,%
+ uprightGreek,cmbraces,varbb,nosymbolsc,amssymbols,noamssymbols}
+ \tf@usefontpackage{newtxmath}
+ }{
+ \tf@usefontpackage{txfonts}
+ }
+ \tf@ifsuboption{ptmxitalics}{\tf@mathfontoptions}{
+ % Use ptmx font's quite differently kerned italic/slant math letters.
+ % See van Bevern's discussion at:
+ % http://rvb.mytanet.de/times-with-normal-mathcal-and-summation-sign.shtml
+ \DeclareSymbolFont{letters}{OML}{ztmcm}{m}{it}
+ }{}
+ }{}
+
+ \ifthenelse{\equal{\tf@rmfont}{txfonts}\OR\equal{\tf@rmfont}{\TF@DEFAULT}}{
+ \ifbool{newtxtext}{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}}{
+ \tf@usefontpackage[osf]{newtxtext}
+ \tf@define@liningfigures{ntxr}
+ }{\tf@usefontpackage{newtxtext}}
+ }{
+ \renewcommand*\rmdefault{txr}
+ \tf@TSencodedosf
+ }
+ }{}
+
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@txfonts}{}
+ \ifthenelse{\equal{\tf@ttfont}{\TF@DEFAULT}}{\tf@ttfont@txfonts}{}
+ }{}
+}
+
+% Text figures typeface -- unlike other typeface families, text
+% figures configuration is not sensitive to font load ordering
+% =============================================================
+\TF@PackageDebugInfo{Configuring text figures load commands...}
+
+% Configure textfigures method and associated values
+%---------------------------------------------------
+% `\tf@osf@method' resolves to one of the following values:
+% TF@OSF@LF: normal typesetting, \textstylenums command and textnums
+% environment => lining figures
+% TF@OSF@JF: normal typesetting, \textstylenums and textnums => old style
+% figures sourced from `j' family
+% TF@OSF@XF: normal typesetting => lining figures
+% \textstylenums and textnums => old style figures sourced from
+% substitute font (\tf@textfiguresfont contains the name of the
+% substitute font)
+% TF@OSF@TS: normal typesetting => lining figures
+% \textstylenums and textnums => old style figures sourced from
+% TS1 font mappings
+% TF@OSF@SC: normal typesetting => lining figures
+% \textstylenums and textnums => old style figures sourced from
+% SmallCap family
+% TF@OSF@NF: use native font -- do nothing
+
+\newcommand*\tf@osf@method{TF@OSF@NF}
+
+% Default -- no-op
+\newtypeface{\TF@DEFAULT}{\TF@DEFAULTPRINTNAME}{textfigures}{
+ \renewcommand*\tf@osf@method{\TF@OSF@NF}
+}
+
+% Lining style text figures
+\newtypeface[lf,lsf,lining,liningstyle,liningstylefigures,false]
+ {liningfigures}
+ {Lining Style Figures}
+ {textfigures}{
+ \renewcommand*\tf@osf@method{\TF@OSF@LF}
+}
+
+% Old style text figures
+\newtypeface[osf,oldstyle,oldfigures,oldstylefigures,true]
+ {textfigures}
+ {Old Style Figures}
+ {textfigures}{
+ \renewcommand*\tf@osf@method{\TF@OSF@JF} % \tf@osf@method is often set to
+ % \TF@OSF@TS or \TF@OSF@SC later on
+}
+
+% Substitute OSF font name (literal) used in text figures font declarations
+\newcommand*\tf@substosffont{tf@substosffont}
+
+% \newtypeface textfigures preamble (see examples, below)
+\newcommand*\tf@initialisetextfiguresfont[1]{
+ % #1 is the substitute osf font encoding to use (T1 in all likelihood)
+ \renewcommand*\tf@osf@method{\TF@OSF@XF}
+ \newcommand*\tf@substosffontencoding{#1}
+ \let\oldencodingdefault\encodingdefault
+ \usepackage[\tf@substosffontencoding]{fontenc}
+ \let\encodingdefault\oldencodingdefault
+ \newcommand*\tf@s{}
+ \scaletypeface{textfigures}{\edef\tf@s{[\tf@textfiguresscalefactor]}}
+ \DeclareFontFamily{\tf@substosffontencoding}{\tf@substosffont}{}
+ % Redefine \DeclareSizeFunction (restored in \newtypeface, defined
+ % above). And, no, we can't apply `s*' in \tf@s in this case.
+ \let\oldDeclareSizeFunction\DeclareSizeFunction
+ \DeclareSizeFunction{}{\empty@sfcnt\@font@info}
+}
+
+% Substitute OSF \DeclareFontShape helper
+\newcommand*\tf@DeclareOsfFontShape[3]{
+ \DeclareFontShape{\tf@substosffontencoding}{\tf@substosffont}
+ {#1}{#2}{ <-> \tf@s #3}{}
+}
+
+% Adobe Minion Pro text figures
+\newtypeface{adobeminionpro}{Adobe Minion Pro}{textfigures}{
+ \tf@initialisetextfiguresfont{T1}
+
+ % proportional vs tabular OSF (don't do tabular -- it would be bad!)
+ \edef\tf@@mpsuffix{osf-\tf@substosffontencoding}
+ \tf@ifsuboption{tabular}{\tf@textfiguresfontoptions}{
+ \edef\tf@@mpsuffix{tosf-\tf@substosffontencoding}
+ }{
+ \tf@ifsuboption{tab}{\tf@textfiguresfontoptions}{
+ \edef\tf@@mpsuffix{tosf-\tf@substosffontencoding}
+ }{}
+ }
+ \tf@DeclareOsfFontShape{m} {n} {MinionPro-Regular-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{m} {it}{MinionPro-It-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{m} {sl}{MinionPro-It-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{m} {sc}{MinionPro-Regular-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{mb}{n} {MinionPro-Medium-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{mb}{it}{MinionPro-MediumI-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{mb}{sl}{MinionPro-MediumIt-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{b} {n} {MinionPro-Bold-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{b} {it}{MinionPro-BoldIt-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{b} {sl}{MinionPro-BoldIt-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{bx}{n} {MinionPro-Bold-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{bx}{it}{MinionPro-BoldIt-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{bx}{sl}{MinionPro-BoldIt-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{sb}{n} {MinionPro-Semibold-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{sb}{it}{MinionPro-SemiboldIt-\tf@@mpsuffix}
+ \tf@DeclareOsfFontShape{sb}{sl}{MinionPro-SemiboldIt-\tf@@mpsuffix}
+}
+
+% Day Roman text figures -- here for completeness only
+\newtypeface[dayrom]{dayroman}{Day Roman}{textfigures}{
+ \tf@initialisetextfiguresfont{T1}
+ \tf@DeclareOsfFontShape{m}{n}{dayromr8t}
+}
+
+% KP Fonts text figures
+\newtypeface[kp,kepler]{kpfonts}{KP Fonts}{textfigures}{ % TODO: condensed
+ \tf@initialisetextfiguresfont{T1}
+ \tf@ifsuboption{light}{\tf@textfiguresfontoptions}{
+ \tf@DeclareOsfFontShape{m} {n} {jkplosnmn8t}
+ \tf@DeclareOsfFontShape{m} {it} {jkplosnmit8t}
+ \tf@DeclareOsfFontShape{m} {sl} {jkplosnmsl8t}
+ \tf@DeclareOsfFontShape{m} {sc} {jkplosnmsc8t}
+ \tf@DeclareOsfFontShape{m} {scsl} {jkplosnmscsl8t}
+ \tf@DeclareOsfFontShape{b} {n} {jkplosnbn8t}
+ \tf@DeclareOsfFontShape{b} {it} {jkplosnbit8t}
+ \tf@DeclareOsfFontShape{b} {sl} {jkplosnbsl8t}
+ \tf@DeclareOsfFontShape{b} {sc} {jkplosnbsc8t}
+ \tf@DeclareOsfFontShape{b} {scsl} {jkplosnbscsl8t}
+ \tf@DeclareOsfFontShape{bx}{n} {jkplosnbxn8t}
+ \tf@DeclareOsfFontShape{bx}{it} {jkplosnbxit8t}
+ \tf@DeclareOsfFontShape{bx}{sl} {jkplosnbxsl8t}
+ \tf@DeclareOsfFontShape{bx}{sc} {jkplosnbxsc8t}
+ \tf@DeclareOsfFontShape{bx}{scsl} {jkplosnbxscsl8t}
+ }{
+ \tf@DeclareOsfFontShape{m} {n} {jkposnmn8t}
+ \tf@DeclareOsfFontShape{m} {it} {jkposnmit8t}
+ \tf@DeclareOsfFontShape{m} {sl} {jkposnmsl8t}
+ \tf@DeclareOsfFontShape{m} {sc} {jkposnmsc8t}
+ \tf@DeclareOsfFontShape{m} {scsl} {jkposnmscsl8t}
+ \tf@DeclareOsfFontShape{b} {n} {jkposnbn8t}
+ \tf@DeclareOsfFontShape{b} {it} {jkposnbit8t}
+ \tf@DeclareOsfFontShape{b} {sl} {jkposnbsl8t}
+ \tf@DeclareOsfFontShape{b} {sc} {jkposnbsc8t}
+ \tf@DeclareOsfFontShape{b} {scsl} {jkposnbscsl8t}
+ \tf@DeclareOsfFontShape{bx}{n} {jkposnbxn8t}
+ \tf@DeclareOsfFontShape{bx}{it} {jkposnbxit8t}
+ \tf@DeclareOsfFontShape{bx}{sl} {jkposnbxsl8t}
+ \tf@DeclareOsfFontShape{bx}{sc} {jkposnbxsc8t}
+ \tf@DeclareOsfFontShape{bx}{scsl} {jkposnbxscsl8t}
+ \tf@DeclareOsfFontShape{l} {n} {jkplosnmn8t}
+ \tf@DeclareOsfFontShape{l} {it} {jkplosnmit8t}
+ \tf@DeclareOsfFontShape{l} {sl} {jkplosnmsl8t}
+ \tf@DeclareOsfFontShape{l} {sc} {jkplosnmsc8t}
+ \tf@DeclareOsfFontShape{l} {scsl} {jkplosnmscsl8t}
+ \tf@DeclareOsfFontShape{sb}{n} {jkplosnbn8t}
+ \tf@DeclareOsfFontShape{sb}{it} {jkplosnbit8t}
+ \tf@DeclareOsfFontShape{sb}{sl} {jkplosnbsl8t}
+ \tf@DeclareOsfFontShape{sb}{sc} {jkplosnbsc8t}
+ \tf@DeclareOsfFontShape{sb}{scsl} {jkplosnbscsl8t}
+ \tf@DeclareOsfFontShape{sbx}{n} {jkplosnbxn8t}
+ \tf@DeclareOsfFontShape{sbx}{it} {jkplosnbxit8t}
+ \tf@DeclareOsfFontShape{sbx}{sl} {jkplosnbxsl8t}
+ \tf@DeclareOsfFontShape{sbx}{sc} {jkplosnbxsc8t}
+ \tf@DeclareOsfFontShape{sbx}{scsl}{jkplosnbxscsl8t}
+ }
+}
+
+% Latin Modern text figures
+\newtypeface[lm,lmodern]{latinmodern}{Latin Modern}{textfigures}{
+ % This is a bit dodgy since we're referring to TS1 tables regardless of
+ % our font encoding. Nevertheless, for numerals (and only numerals)
+ % substitution it should work out well enough.
+ \tf@initialisetextfiguresfont{T1}
+ \DeclareFontShape{\tf@substosffontencoding}{\tf@substosffont}{m}{n}{
+ <-5.5> \tf@s ts1-lmr5 <5.5-6.5> \tf@s ts1-lmr6
+ <6.5-7.5> \tf@s ts1-lmr7 <7.5-8.5> \tf@s ts1-lmr8
+ <8.5-9.5> \tf@s ts1-lmr9 <9.5-11> \tf@s ts1-lmr10
+ <11-15> \tf@s ts1-lmr12 <15-> \tf@s ts1-lmr17 }{}
+ \DeclareFontShape{\tf@substosffontencoding}{\tf@substosffont}{m}{it}{
+ <-7.5> \tf@s ts1-lmri7 <7.5-8.5> \tf@s ts1-lmri8
+ <8.5-9.5> \tf@s ts1-lmri9 <9.5-11> \tf@s ts1-lmri10
+ <11-> \tf@s ts1-lmri12 }{}
+ \DeclareFontShape{\tf@substosffontencoding}{\tf@substosffont}{m}{sl}{
+ <-8.5> \tf@s ts1-lmro8 <8.5-9.5> \tf@s ts1-lmro9
+ <9.5-11> \tf@s ts1-lmro10 <11-15> \tf@s ts1-lmro12
+ <15-> \tf@s ts1-lmro17 }{}
+ \tf@DeclareOsfFontShape{m}{sc} {ts1-lmcsc10}
+ \tf@DeclareOsfFontShape{m}{ui} {ts1-lmu10}
+ \tf@DeclareOsfFontShape{m}{scsl}{ts1-lmcsco10}
+ \tf@DeclareOsfFontShape{b}{n} {ts1-lmb10}
+ \tf@DeclareOsfFontShape{b}{it} {ts1-lmbo10}
+ \tf@DeclareOsfFontShape{b}{sl} {ts1-lmbo10}
+ \DeclareFontShape{\tf@substosffontencoding}{\tf@substosffont}{bx}{n}{
+ <-5.5> \tf@s ts1-lmbx5 <5.5-6.5> \tf@s ts1-lmbx6
+ <6.5-7.5> \tf@s ts1-lmbx7 <7.5-8.5> \tf@s ts1-lmbx8
+ <8.5-9.5> \tf@s ts1-lmbx9 <9.5-11> \tf@s ts1-lmbx10
+ <11-> \tf@s ts1-lmbx12}{}
+ \tf@DeclareOsfFontShape{bx}{it} {ts1-lmbxi10}
+ \tf@DeclareOsfFontShape{bx}{sl} {ts1-lmbxo10}
+}
+
+% Libertine text figures -- NB, see comments with libertine (legacy) rm
+\newtypeface{libertine}{Libertine}{textfigures}{
+ \tf@initialisetextfiguresfont{T1}
+ %---------------------------------------------------------------------
+ % NOTE! read the comments next to libertine in the Roman fonts section
+ %---------------------------------------------------------------------
+ % ***proportional*** (not tabular) old style figures
+ \tf@DeclareOsfFontShape{m}{ic} {fxlric-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{m}{it} {fxlri-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{m}{n} {fxlr-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{m}{sc} {fxlrc-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{m}{sl} {fxlro-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{b}{ic} {fxlbic-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{b}{it} {fxlbi-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{b}{n} {fxlz-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{b}{sc} {fxlbc-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{b}{sl} {fxlbo-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{bx}{ic} {fxlbic-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{bx}{it} {fxlbi-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{bx}{n} {fxlz-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{bx}{sc} {fxlbc-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{bx}{sl} {fxlbo-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{d}{it} {fxldro-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{d}{n} {fxldr-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{d}{sc} {fxldrc-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{d}{sl} {fxldro-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{z}{ic} {fxlzic-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{z}{it} {fxlzi-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{z}{n} {fxlz-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{z}{sc} {fxlzc-\tf@substosffontencoding os}
+ \tf@DeclareOsfFontShape{z}{sl} {fxlzo-\tf@substosffontencoding os}
+}
+
+% Lucida Bright text figures
+\newtypeface[lucidabr,lucida]{lucidabright}{Lucida Bright}{textfigures}{
+ \tf@initialisetextfiguresfont{T1}
+ \tf@DeclareOsfFontShape{m}{n} {hlhr8c}
+ \tf@DeclareOsfFontShape{m}{it} {hlhri8c}
+ \tf@DeclareOsfFontShape{m}{sl} {hlhro8c}
+ \tf@DeclareOsfFontShape{m}{sc} {hlhr8c}
+ \tf@DeclareOsfFontShape{b}{n} {hlhb8c}
+ \tf@DeclareOsfFontShape{b}{it} {hlhbi8c}
+ \tf@DeclareOsfFontShape{b}{sl} {hlhbi8c}
+ \tf@DeclareOsfFontShape{b}{sc} {hlhb8c}
+ \tf@DeclareOsfFontShape{bx}{n} {hlhb8c}
+ \tf@DeclareOsfFontShape{bx}{it} {hlhbi8c}
+ \tf@DeclareOsfFontShape{bx}{sl} {hlhbi8c}
+ \tf@DeclareOsfFontShape{bx}{sc} {hlhb8c}
+}
+
+% Palatino text figures
+\newtypeface{palatino}{Palatino}{textfigures}{
+ \tf@initialisetextfiguresfont{T1}
+ \tf@DeclareOsfFontShape{m} {it} {pplri9d}
+ \tf@DeclareOsfFontShape{m} {n} {pplr9d}
+ \tf@DeclareOsfFontShape{m} {sc} {pplrc9d}
+ \tf@DeclareOsfFontShape{m} {sl} {pplri9d}
+ \tf@DeclareOsfFontShape{b} {it} {pplbi9d}
+ \tf@DeclareOsfFontShape{b} {n} {pplb9d}
+ \tf@DeclareOsfFontShape{b} {sl} {pplbi9d}
+ \tf@DeclareOsfFontShape{bx}{it} {pplbi9d}
+ \tf@DeclareOsfFontShape{bx}{n} {pplb9d}
+ \tf@DeclareOsfFontShape{bx}{sl} {pplbi9d}
+}
+
+% Times Roman text figures (txfonts)
+\newtypeface{times}{Times Roman}{textfigures}{
+ \tf@initialisetextfiguresfont{T1}
+ \tf@DeclareOsfFontShape{m}{n} {tcxr}
+ \tf@DeclareOsfFontShape{m}{sc} {tcxr}
+ \tf@DeclareOsfFontShape{m}{sl} {tcxsl}
+ \tf@DeclareOsfFontShape{m}{it} {tcxi}
+ \tf@DeclareOsfFontShape{m}{ui} {tcxi}
+ \tf@DeclareOsfFontShape{b}{n} {tcxb}
+ \tf@DeclareOsfFontShape{b}{sc} {tcxb}
+ \tf@DeclareOsfFontShape{b}{sl} {tcxbsl}
+ \tf@DeclareOsfFontShape{b}{it} {tcxbi}
+ \tf@DeclareOsfFontShape{b}{ui} {tcxbi}
+ \tf@DeclareOsfFontShape{bx}{n} {tcxb}
+ \tf@DeclareOsfFontShape{bx}{sc} {tcxb}
+ \tf@DeclareOsfFontShape{bx}{sl} {tcxbsl}
+ \tf@DeclareOsfFontShape{bx}{it} {tcxbi}
+ \tf@DeclareOsfFontShape{bx}{ui} {tcxbi}
+}
+
+% Symbols typeface -- highly sensitive to font load ordering, particularly
+% to math -> symbols / symbols -> math font load order
+% =======================================================================
+\TF@PackageDebugInfo{Configuring symbols load commands...}
+
+% Default -- no-op
+\newtypeface{\TF@DEFAULT}{}{symbols}{
+ \ifthenelse{\equal{\tf@symbolsprintname}{undefined}}{
+ \renewcommand*\tf@symbolsprintname{\TF@DEFAULTPRINTNAME}
+ }{}
+}
+
+% AMS symbols
+\newtypeface[ams]{amssymb}{}{symbols}{
+ \ifthenelse{\equal{\tf@rmfont}{adobeminionpro}
+ \AND\equal{\tf@mathfont}{\TF@DEFAULT}}{
+ \TF@PackageWarningNoLine{%
+ Package option `symbolstypeface=\tf@symbolsfontname' conflicts
+ \MessageBreak with option combination:\MessageBreak
+ \space\space`typeface=\tf@rmfontname', and\MessageBreak
+ \space\space`mathtypeface=\tf@mathfontname'.\MessageBreak
+ Option `symbolstypeface=\tf@symbolsfontname' ignored}
+ \renewcommand*\tf@symbolsprintname{\TF@DEFAULTPRINTNAME}
+ }{
+ \ifthenelse{\equal{\tf@mathfont}{adobeminionpro}
+ \OR\equal{\tf@mathfont}{mathdesign}}{
+ \TF@PackageWarningNoLine{%
+ Package option `mathtypeface=\tf@mathfontname'\MessageBreak
+ conflicts with `symbolstypeface=\tf@symbolsfontname'.\MessageBreak
+ Option `symbolstypeface=\tf@symbolsfontname' ignored}
+ \renewcommand*\tf@symbolsprintname{\TF@DEFAULTPRINTNAME}
+ }{
+ \tf@usefontpackage{amssymb}
+ \renewcommand*\tf@symbolsprintname{AMS Symbols}
+ \tf@ifsuboption{nofixmath}{\tf@symbolsfontoptions}{
+ }{
+ \usepackage{fixmath} % Italic uppercase Greek. May be overridden by
+ % some maths packages later in the load stream
+ }
+ }
+ }
+}
+
+% FD Symbol
+\newtypeface[fd]{fdsymbol}{FD Symbol}{symbols}{
+ % bypass a few commonly troublesome namespace collisions
+ \tf@undefinecommands{\mid,\surd}
+
+ \newcommand*\tf@fdopt@normalweight{Book}
+ \newcommand*\tf@fdopt@boldweight{Medium}
+ \newcommand*\tf@fdopt@largedelims{false}
+
+ \tf@ifsuboption{normalweightRegular}{\tf@symbolsfontoptions}{
+ \renewcommand*\tf@fdopt@normalweight{Regular}
+ }{
+ \tf@ifsuboption{normalweightAuto}{\tf@symbolsfontoptions}{
+ \renewcommand*\tf@fdopt@normalweight{auto}
+ }{}
+ }
+
+ \tf@ifsuboption{boldweightMedium}{\tf@symbolsfontoptions}{
+ \renewcommand*\tf@fdopt@boldweight{Regular}
+ }{
+ \tf@ifsuboption{boldweightAuto}{\tf@symbolsfontoptions}{
+ \renewcommand*\tf@fdopt@boldweight{auto}
+ }{}
+ }
+
+ \tf@ifsuboption{largedelims}{\tf@symbolsfontoptions}{
+ \renewcommand*\tf@fdopt@largedelims{true}
+ }{}
+
+ % FD Symbol loads AMS Math. Preload amsmath here to ensure
+ % we can load it without package options clashes. This
+ % reverses the usual symbols/math loading order.
+ \ifthenelse{\equal{\tf@mathfont}{amsfonts}}{
+ \tf@mathfont@amsfonts
+ }{}
+
+ \tf@usefontpackage[normalweight=\tf@fdopt@normalweight,
+ boldweight=\tf@fdopt@boldweight,
+ scale=1,
+ largedelims=\tf@fdopt@largedelims]{fdsymbol}
+}
+
+% Mathabx. Standard mathabx (ported from mf) is a bitmap/raster font, and
+% therefore is not scalable out-of-the-box. Accordingly, you might see
+% several font size rescaling warnings. Additionally, mathabx does not
+% always play peacefully with other packages, potentially leading to
+% symbol already defined issues. Still, it offers a good number of math
+% symbols not easily found elsewhere.
+\newtypeface[abx]{mathabx}{Math abx}{symbols}{
+ \tf@usefontpackage{mathabx}
+}
+
+% Adobe Minion Pro compatible symbols
+\newtypeface[mn]{mnsymbol}{MnSymbol}{symbols}{
+ \tf@undefinecommands{\mathcal}
+
+ % MnSymbol loads AMS Math and textcomp. Preload amsmath here
+ % to ensure we load it without options clashes. This reverses the
+ % usual symbols/math loading order.
+ \ifthenelse{\equal{\tf@mathfont}{amsfonts}}{
+ \tf@mathfont@amsfonts
+ }{}
+ % We don't provide MnSymbol cmsy and abx package calligraphic font
+ % options here since they tend to be too fine grained, too unlikely
+ % to produce noticeable typographic differences and too problematic
+ % for ordinary users. Advanced users will almost certainly not want
+ % to select these options for those same reasons.
+ \tf@usefontpackage{MnSymbol}
+}
+
+% Adobe Myriad Pro compatible symbols
+\newtypeface[md]{mdsymbol}{MdSymbol}{symbols}{
+ \tf@ifsuboption{Regular}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{normalweight=Regular}{mdsymbol}}{}
+ \tf@ifsuboption{regular}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{normalweight=Regular}{mdsymbol}}{}
+ \tf@ifsuboption{Light}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{normalweight=Light}{mdsymbol}}{}
+ \tf@ifsuboption{light}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{normalweight=Light}{mdsymbol}}{}
+ \tf@ifsuboption{autolight}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{normalweight=autolight}{mdsymbol}}{}
+ \tf@ifsuboption{autoregular}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{normalweight=autoregular}{mdsymbol}}{}
+
+ \tf@ifsuboption{Semibold}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{boldweight=Semibold}{mdsymbol}}{}
+ \tf@ifsuboption{semibold}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{boldweight=Semibold}{mdsymbol}}{}
+ \tf@ifsuboption{Bold}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{boldweight=Bold}{mdsymbol}}{}
+ \tf@ifsuboption{bold}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{boldweight=Bold}{mdsymbol}}{}
+ \tf@ifsuboption{autosemibold}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{boldweight=autosemibold}{mdsymbol}}{}
+
+ \tf@ifsuboption{onlysansmath}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{onlysansmath=true}{mdsymbol}}{}
+ \tf@ifsuboption{retainmissing}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{retainmissing=true}{mdsymbol}}{}
+ \tf@ifsuboption{largedelims}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{largedelims=true}{mdsymbol}}{}
+
+ \tf@ifsuboption{scale}{\tf@symbolsfontoptions}
+ {\PassOptionsToPackage{scale=\tf@nextsuboption}{mdsymbol}}{}
+
+ % MdSymbol loads AMS Math. Preload amsmath here to ensure
+ % we can load it without package options clashes. This
+ % reverses the usual symbols/math loading order.
+ \ifthenelse{\equal{\tf@mathfont}{amsfonts}}{
+ \tf@mathfont@amsfonts
+ }{}
+
+ \tf@usefontpackage{mdsymbol}
+}
+
+% Math typeface -- highly sensitive to font load ordering, particularly
+% to math -> symbols / symbols -> math font load order
+% =====================================================================
+\TF@PackageDebugInfo{Configuring math load commands...}
+
+% Default -- no-op
+\newtypeface{\TF@DEFAULT}{}{math}{
+ \ifthenelse{\equal{\tf@mathprintname}{undefined}}{
+ \renewcommand*\tf@mathprintname{\TF@DEFAULTPRINTNAME}
+ }{}
+}
+
+% Math -- AMS Math
+\newtypeface[ams,amsmath]{amsfonts}{AMS Math}{math}{
+ \@ifpackageloaded{amsmath}{\relax}{
+ % avoid a bunch of possible symbols namespace collisions
+ \tf@undefinecommands{
+ \iint,\iiint,\dddot,\ddddot,
+ \overleftrightarrow,\underleftrightarrow,
+ \underrightarrow,\underleftarrow,
+ }
+ \tf@ifsuboption{tbtags}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{tbtags}{amsmath}}{}
+ \tf@ifsuboption{nosumlimits}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{nosumlimits}{amsmath}}{}
+ \tf@ifsuboption{intlimits}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{intlimits}{amsmath}}{}
+ \tf@ifsuboption{nonamelimits}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{nonamelimits}{amsmath}}{}
+ \tf@usefontpackage{amsmath}
+ }
+ \tf@ifsuboption{donotfixamsmathbugs}{\tf@mathfontoptions}
+ {}{\usepackage{mathtools}}
+}
+
+% Math -- Antykwa Torunska
+\newtypeface[anttor,torunska]{antykwatorunska}{}{math}{
+ \tf@loadantykwatorunska
+}
+
+% Math -- Arev Sans (Bitsream Vera Sans tuned for maths)
+\newtypeface[arev]{arevmath}{Arev Math}{math}{
+ \tf@ifsuboption{origletters}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{origletters}{arevmath}}{}
+ \tf@ifsuboption{vara}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{vara}{arevmath}}{}
+ \tf@ifsuboption{vari}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{vari}{arevmath}}{}
+ \tf@ifsuboption{varI}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{varI}{arevmath}}{}
+ \tf@ifsuboption{varf}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{varf}{arevmath}}{}
+ \tf@ifsuboption{oldf}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{oldf}{arevmath}}{}
+ \tf@ifsuboption{varl}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{varl}{arevmath}}{}
+ \tf@ifsuboption{varu}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{varu}{arevmath}}{}
+ \tf@ifsuboption{varv}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{varv}{arevmath}}{}
+ \tf@ifsuboption{varw}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{varw}{arevmath}}{}
+ \tf@ifsuboption{varGamma}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{varGamma}{arevmath}}{}
+ \tf@ifsuboption{varXi}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{varXi}{arevmath}}{}
+ \tf@ifsuboption{varPi}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{varPi}{arevmath}}{}
+ \tf@ifsuboption{varSigma}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{varSigma}{arevmath}}{}
+ \tf@ifsuboption{varPhi}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{varPhi}{arevmath}}{}
+ \tf@usefontpackage{arevmath}
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@arevsans}{}
+}
+
+% Math -- CM Bright
+\newtypeface{cmbright}{CM Bright}{math}{
+ \tf@loadcmbright
+}
+
+% Math -- Concrete
+\newtypeface{concrete}{Concrete Math}{math}{
+ \tf@loadconcrete
+}
+
+% Math -- Euler
+\newtypeface{euler}{Euler}{math}{
+ \tf@ifsuboption{small}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{small}{eulervm}}{}
+ \tf@ifsuboption{euler-digits}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{euler-digits}{eulervm}}{}
+ \tf@ifsuboption{euler-hat-accent}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{euler-hat-accent}{eulervm}}{}
+ \tf@ifsuboption{T1}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{T1}{eulervm}}{}
+ \tf@ifsuboption{OT1}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{OT1}{eulervm}}{}
+ \tf@ifsuboption{LY1}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{LY1}{eulervm}}{}
+ \tf@ifsuboption{icomma}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{icomma}{eulervm}}{}
+ \tf@usefontpackage{eulervm}
+}
+
+% Math -- European Modern
+%------------------------
+% To obtain: svn checkout files from:
+% `http://yytex.googlecode.com/svn/trunk/fonts/em'
+% From there, you're on your own! Hint: compile the .ins file.
+% FYI, European Modern is a CM clone/extension. Blurb from the readme.txt:
+% "The European Modern (EM) font set consists of 57 text fonts that are
+% vastly extended versions of Computer Modern (CM) text fonts. Each EM
+% text font contains 310 glyphs compared to the 128 in CM text fonts (of
+% which eleven are upright Greek letters). Each EM text font has over 90
+% accented characters, including the 58 `standard' ones found in most
+% fonts in Type 1 format."
+% For what it's worth, European Modern tt was used for typesetting keywords
+% in The Latex Companion 2nd ed. Look there for that.
+\newtypeface[em]{europeanmodern}{European Modern}{math}{
+ \tf@ifsuboption{T1}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{T1}{em}}{}
+ \tf@ifsuboption{LY1}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{LY1}{em}}{}
+ \tf@ifsuboption{LM1}{\tf@mathfontoptions}{
+ \PassOptionsToPackage{LM1}{em}}{}
+ \tf@usefontpackage{em}
+ \ifthenelse{\equal{\tf@rmfont}{\TF@DEFAULT}}{
+ \renewcommand*\rmdefault{cmr} % remapped by em.sty
+ \tf@rmfont@europeanmodern % housekeeping, e.g., sets rm print name
+ }{}
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{
+ \renewcommand*\sfdefault{cmss}% remapped by em.sty
+ \tf@sffont@europeanmodern % housekeeping, e.g., sets sf print name
+ }{}
+ \ifthenelse{\equal{\tf@ttfont}{\TF@DEFAULT}}{
+ \renewcommand*\ttdefault{cmtt}% remapped by em.sty
+ \tf@ttfont@europeanmodern % housekeeping, e.g., sets tt print name
+ }{}
+}
+
+% Math -- Fourier
+\newcommand*\tf@fouriermathfont{}
+\newtypeface{fourier}{Fourier}{math}{
+ % undefine a few problem symbols that might have
+ % sneaked in via a previously loaded symbols font
+ \tf@undefinecommands{\hslash,\complement,\hbar}
+
+ \def\tf@fouriermathfont{adobeutopia}
+ \ifthenelse{\equal{\tf@rmfont}{newcenturyschoolbook}}
+ {\def\tf@fouriermathfont{newcenturyschoolbook}}{}
+ \def\tf@@configurefourieroptions##1{
+ \tf@ifsuboption{##1}{\tf@mathfontoptions}
+ {\def\tf@fouriermathfont{newcenturyschoolbook}}{}
+ }
+ \forcsvlist{\tf@@configurefourieroptions}{nc,newcentury,newcenturyschoolbook}
+
+ \def\tf@@configurefourieroptions##1{
+ \tf@ifsuboption{##1}{\tf@mathfontoptions}
+ {\def\tf@fouriermathfont{adobeutopia}}{}% not redundant if \rmdefault==nc
+ }
+ \forcsvlist{\tf@@configurefourieroptions}{utopia,adobeutopia}
+
+ \def\tf@@configurefourieroptions##1{
+ \tf@ifsuboption{##1}{\tf@mathfontoptions}{
+ \ifthenelse{\equal{\tf@fouriermathfont}{adobeutopia}}{
+ % NB, user must ensure utopia expert fonts are properly installed.
+ % Otherwise LaTeX will compile but fail to construct the output file,
+ % e.g., complaining about missing `put..x.pfb' font file.
+ \PassOptionsToPackage{##1}{fourier}
+ }{
+ \TF@PackageWarningNoLine{%
+ Suboption `##1' in package option\MessageBreak
+ `mathtypeface=\tf@mathfontname'\MessageBreak
+ will be ignored while `newcenturyschoolbook'\MessageBreak
+ is in effect}
+ }
+ }{}
+ }
+ \forcsvlist{\tf@@configurefourieroptions}
+ {upright,widespace,expert,oldstyle,fulloldstyle}
+
+ \ifthenelse{\equal{\tf@fouriermathfont}{newcenturyschoolbook}}{
+ \tf@usefontpackage{fouriernc}
+ }{
+ \tf@usefontpackage{fourier} % loads [T1]{fontenc} and textcomp
+ \renewcommand*\rmdefault{fut\textfamilyextension}
+ \ifthenelse{\NOT\equal{\textfamilyextension}{s}}{
+ \tf@define@liningfigures{futs} % see comment about expert fonts, above
+ }{}
+ }
+}
+
+% Math -- GFS Artemisia
+\tf@newbool{tf@@gfsmatheuler}{false}
+\newtypeface[artemisia]{gfsartemisia}{GFS Artemisia}{math}{
+ % Unlike GFS Didot, GFS Artemisia does not set up math to any
+ % worthwhile extent. It's only included here for completeness's sake.
+ \ifthenelse{\equal{\tf@rmfont}{gfsartemisia}}{
+ \tf@ifsuboption{euler}{\tf@rmfontoptions}{\booltrue{tf@@gfsmatheuler}}{}
+ }{}
+ \tf@ifsuboption{euler}{\tf@mathfontoptions}{\booltrue{tf@@gfsmatheuler}}{}
+ \ifbool{tf@@gfsmatheuler}{
+ \tf@usefontpackage{gfsartemisia-euler}
+ \xdef\tf@rmprintname{\tf@mathprintname\ (Euler)}
+ }{
+ \tf@usefontpackage{gfsartemisia} % math symbols from txfonts
+ }
+ \ifthenelse{\equal{\tf@rmfont}{\TF@DEFAULT}}{\tf@rmfont@gfsartemisia}{}
+}
+
+% Math -- GFS Bodoni
+%............................................................................
+% NB, if you run into problems when using T1 font encoding, replace the line:
+% \DeclareFontFamily{T1}{bodoni} % <-- missing {}
+% with:
+% \DeclareFontFamily{T1}{bodoni}{} % <-- reinstated {}
+% in file t1bodoni.fd
+%............................................................................
+\newtypeface[bodoni]{gfsbodoni}{GFS Bodoni}{math}{
+ % Unlike GFS Didot, GFS Bodoni does not set up math to any
+ % worthwhile extent. It's only included here for completeness's sake.
+ \tf@usefontpackage{gfsbodoni}
+ \ifthenelse{\equal{\tf@rmfont}{\TF@DEFAULT}}{\tf@rmfont@gfsbodoni}{}
+}
+
+% Math -- GFS Didot
+\newtypeface[didot]{gfsdidot}{GFS Didot}{math}{
+ \tf@usefontpackage{gfsdidot}
+ \ifthenelse{\equal{\tf@rmfont}{\TF@DEFAULT}}{\tf@rmfont@gfsdidot}{}
+}
+
+% Math -- GFS Neohellenic
+\newtypeface[neohellenic]{gfsneohellenic}{GFS Neohellenic}{math}{
+ % Unlike GFS Didot, except for its oddly shaped digits, GFS
+ % Neohellenic does not set up math to any worthwhile extent. It's
+ % only included here for completeness's sake.
+ \tf@usefontpackage{gfsneohellenic}
+ \ifthenelse{\equal{\tf@rmfont}{\TF@DEFAULT}}{\tf@rmfont@gfsneohellenic}{}
+}
+
+% Math -- Iwona. NB, the Iwona package sets \rmdefault to Iwona. Specify
+% another font in your typeface option if this behaviour is not desired.
+\newtypeface{iwona}{Iwona}{math}{
+ \newcommand*\tf@iwopt@light{}
+ \newcommand*\tf@iwopt@condensed{}
+ \tf@ifsuboption{light}{\tf@mathfontoptions}{
+ \renewcommand*\tf@iwopt@light{light}
+ \xdef\tf@mathprintname{\tf@mathprintname\ Light}
+ }{}
+ \tf@ifsuboption{condensed}{\tf@mathfontoptions}{
+ \renewcommand*\tf@iwopt@condensed{condensed}
+ \xdef\tf@mathprintname{\tf@mathprintname\ Condensed}
+ }{}
+ \tf@usefontpackage[math,\tf@iwopt@light,\tf@iwopt@condensed]{iwona}
+}
+
+% Math -- Kerkis
+\newtypeface{kerkis}{Kerkis}{math}{
+ \tf@usefontpackage{kmath} % kmath on its own loads txfonts
+ \tf@usefontpackage{kerkis} % loads kerkis serif and sans, plus courier mono
+ \ifthenelse{\equal{\tf@rmfont}{\TF@DEFAULT}}{\tf@rmfont@kerkis}{}
+}
+
+% Math -- Kurier. NB, the Kurier package sets \rmdefault to Kurier. Specify
+% another font in your typeface option if this behaviour is not desired.
+\newtypeface{kurier}{Kurier}{math}{
+ \newcommand*\tf@kropt@light{}
+ \newcommand*\tf@kropt@condensed{}
+ \tf@ifsuboption{light}{\tf@mathfontoptions}{
+ \renewcommand*\tf@kropt@light{light}
+ \xdef\tf@mathprintname{\tf@mathprintname\ Light}
+ }{}
+ \tf@ifsuboption{condensed}{\tf@mathfontoptions}{
+ \renewcommand*\tf@kropt@condensed{condensed}
+ \xdef\tf@mathprintname{\tf@mathprintname\ Condensed}
+ }{}
+ \tf@usefontpackage[math,\tf@kropt@light,\tf@kropt@condensed]{kurier}
+}
+
+% Math -- Kp-Fonts
+\newtypeface[kp,kepler]{kpfonts}{}{math}{
+ \tf@loadkpfonts
+}
+
+% Math -- Latin Modern
+\newtypeface[lm,lmodern]{latinmodern}{Latin Modern}{math}{
+ \tf@usefontpackage{lmodern}
+}
+
+% Bigelow and Holmes Lucida Bright (purchase from CTAN)
+\newtypeface[lucidabr,lucida]{lucidabright}{Lucida Bright}{math}{
+ \tf@loadlucidabr
+}
+
+% Math -- LX Fonts. Extension of Computer Modern Sans Serif Quotation mainly
+% as a math enhancement for overhead slides, e.g., with beamer package.
+\newtypeface[lx]{lxfonts}{LX Fonts}{math}{
+ \tf@usefontpackage{lxfonts}
+ \ifthenelse{\equal{\tf@symbolsfont}{\TF@DEFAULT}}{ % LX Fonts overrides some
+ \renewcommand*\tf@symbolsprintname{LX Fonts} % but not all symbols
+ }{}
+ \renewcommand*\tf@sfprintname{\tf@rmprintname}
+ \renewcommand*\tf@ttprintname{\tf@rmprintname}% depends on font encoding T1/OT1
+}
+
+% Math Design
+\newcommand*\tf@mdrmfont{}
+\newtypeface{mathdesign}{Math Design}{math}{
+ \tf@ifsuboption{expert}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{expert}{mathdesign}}{}
+ \tf@ifsuboption{uppercase}{\tf@mathfontoptions}{
+ \ifthenelse{\equal{\tf@nextsuboption}{upright}}
+ {\PassOptionsToPackage{uppercase=upright}{mathdesign}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{italicized}}
+ {\PassOptionsToPackage{uppercase=italicized}{mathdesign}}{}
+ }{}
+ \tf@ifsuboption{greekuppercase}{\tf@mathfontoptions}{
+ \ifthenelse{\equal{\tf@nextsuboption}{upright}}
+ {\PassOptionsToPackage{greekuppercase=upright}{mathdesign}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{italicized}}
+ {\PassOptionsToPackage{greekuppercase=italicized}{mathdesign}}{}
+ }{}
+ \tf@ifsuboption{greeklowercase}{\tf@mathfontoptions}{
+ \ifthenelse{\equal{\tf@nextsuboption}{upright}}
+ {\PassOptionsToPackage{greeklowercase=upright}{mathdesign}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{italicized}}
+ {\PassOptionsToPackage{greeklowercase=italicized}{mathdesign}}{}
+ }{}
+
+ \def\tf@mdrmfont{charter}% default; available on all PSNFSS-compliant systems
+ \ifthenelse{\equal{\tf@rmfont}{urwgaramond}}{\def\tf@mdrmfont{garamond}}{}
+ \ifthenelse{\equal{\tf@rmfont}{adobeutopia}}{\def\tf@mdrmfont{utopia}}{}
+ \ifthenelse{\equal{\tf@rmfont}{bitstreamcharter}}{\def\tf@mdrmfont{charter}}{}
+ \tf@ifsuboption{urwgaramond}{\tf@mathfontoptions}{\def\tf@mdrmfont{garamond}}{}
+ \tf@ifsuboption{garamond}{\tf@mathfontoptions}{\def\tf@mdrmfont{garamond}}{}
+ \tf@ifsuboption{adobeutopia}{\tf@mathfontoptions}{\def\tf@mdrmfont{utopia}}{}
+ \tf@ifsuboption{utopia}{\tf@mathfontoptions}{\def\tf@mdrmfont{utopia}}{}
+ \tf@ifsuboption{bitstreamcharter}{\tf@mathfontoptions}{\def\tf@mdrmfont{charter}}{}
+ \tf@ifsuboption{charter}{\tf@mathfontoptions}{\def\tf@mdrmfont{charter}}{}
+
+ \let\oldscdefault\scdefault
+ \tf@usefontpackage[\tf@mdrmfont,sfscaled=false,ttscaled=false]{mathdesign}
+
+ % Of the three rm fonts accepted by mathdesign (charter, garamond and
+ % utopia), utopia alone provides old style figures, and this only through
+ % utopia's smallcaps collection (see below). However, mathdesign hijacks
+ % smallcaps for its own ends. Rather than 'unhijacking' smallcaps back
+ % from mathdesign, potentially upsetting anyone who relies on mathdesign's
+ % smallcaps behaviour, as a design decision, we turn textnums off instead.
+ %
+ % NOTE: mathdesign redefines \scdefault in order to provide faked smallcaps
+ % whenever expert is not in force. This creates problems should the
+ % user load a non-mathdesign rm font. In which case, we try to
+ % recover smallcaps as best we can, noting that users should access
+ % mathdesign (maths mode) smallcaps through its \fscshape command.
+ %
+ % Also please note: Native URW Garamond does not provide smallcaps.
+ \ifthenelse{
+ \(\equal{\tf@rmfont}{urwgaramond}\AND\equal{\tf@mdrmfont}{garamond}\)\OR
+ \(\equal{\tf@rmfont}{adobeutopia}\AND\equal{\tf@mdrmfont}{utopia}\)\OR
+ \(\equal{\tf@rmfont}{bitstreamcharter}\AND\equal{\tf@mdrmfont}{charter}\)}
+ {\TF@NativeOSFMathError}
+ {\let\scdefault\oldscdefault}
+}
+
+% Math -- Mathpazo (aka palatino with pazo math fonts)
+\newtypeface[pazo]{mathpazo}{Pazo}{math}{
+ \tf@loadmathpazo
+}
+
+% Math -- Math Time Pro 2
+% Michael Spivak's MathTime Pro2 fonts are essential should you plan on using
+% Times (or Gyre Termes) body text fonts. Do not for one instant dream of
+% using AMS fonts (although you may still need a symbols font, depending on
+% your work, for which amssymb or mnsymbol might do). A free (Lite) subset of
+% MathTime Pro2 can be downloaded from www.pctex.com (useful for those with
+% limited or occasional math requirements for their work). The cost for the
+% full set is not especially great compared to the benefits received.
+% Trust me.
+\newcommand\tf@premtpro{
+ % prevent the clash of glyphs (hmm, nice name for a band)
+ \tf@undefinecommands{
+ \barwedge,\centerdot,\circledS,\coloneq,\complement,
+ \dagger,\ddagger,\divideontimes,\dotplus,\doublebarwedge,
+ \hbar,\hslash,\mathparagraph,\mathsection,\mathsterling,
+ \ulcorner,\urcorner,\llcorner,\lrcorner,
+ \thickapprox,\thicksim,\veebar,
+ }
+}
+
+\newtypeface[mtpro]{mathtimepro}{MathTime 2 Professional}{math}{
+ \tf@ifsuboption{amssymbols}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{amssymbols}{mtpro2}}{}
+ \tf@ifsuboption{noamssymbols}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{noamssymbols}{mtpro2}}{}
+ \tf@ifsuboption{slantedGreek}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{slantedGreek}{mtpro2}}{}
+ \tf@ifsuboption{uprightGreek}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{uprightGreek}{mtpro2}}{}
+ \tf@ifsuboption{slantedoperators}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{slantedoperators}{mtpro2}}{}
+ \tf@ifsuboption{uprightoperators}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{uprightoperators}{mtpro2}}{}
+ % Option subscriptcorrection makes the underscore character '_' active
+ % which can break other packages. E.g., url typesets \url{a-b} as 'a-_b'.
+ \tf@ifsuboption{subscriptcorrection}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{subscriptcorrection}{mtpro2}}{}
+ \tf@ifsuboption{nosubscriptcorrection}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{nosubscriptcorrection}{mtpro2}}{}
+ \tf@ifsuboption{zswash}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{zswash}{mtpro2}}{}
+ \tf@ifsuboption{nozswash}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{nozswash}{mtpro2}}{}
+ \tf@ifsuboption{curlybraces}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{curlybraces}{mtpro2}}{}
+ \tf@ifsuboption{straightbraces}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{straightbraces}{mtpro2}}{}
+ \tf@ifsuboption{morphedbraces}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{morphedbraces}{mtpro2}}{}
+ \tf@ifsuboption{cmcal}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{cmcal}{mtpro2}}{}
+ \tf@ifsuboption{lucidacal}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{lucidacal}{mtpro2}}{}
+ \tf@ifsuboption{eucal}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{eucal}{mtpro2}}{}
+ \tf@ifsuboption{mtpluscal}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{mtpluscal}{mtpro2}}{}
+ \tf@ifsuboption{mtpcal}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{mtpcal}{mtpro2}}{}
+ \tf@ifsuboption{mtpccal}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{mtpccal}{mtpro2}}{}
+ \tf@ifsuboption{lucidascr}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{lucidascr}{mtpro2}}{}
+ \tf@ifsuboption{mtplusscr}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{mtplusscr}{mtpro2}}{}
+ \tf@ifsuboption{mtpscr}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{mtpscr}{mtpro2}}{}
+ \tf@ifsuboption{eufrak}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{eufrak}{mtpro2}}{}
+ \tf@ifsuboption{mtpfrak}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{mtpfrak}{mtpro2}}{}
+ \tf@ifsuboption{compatiblegreek}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{compatiblegreek}{mtpro2}}{}
+ \tf@ifsuboption{amsbb}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{amsbb}{mtpro2}}{}
+ \tf@ifsuboption{mtpbb}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{mtpbb}{mtpro2}}{}
+ \tf@ifsuboption{mtpbbd}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{mtpbbd}{mtpro2}}{}
+ \tf@ifsuboption{mtphrb}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{mtphrb}{mtpro2}}{}
+ \tf@ifsuboption{mtphrd}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{mtphrd}{mtpro2}}{}
+ \tf@ifsuboption{mtpbbi}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{mtpbbi}{mtpro2}}{}
+ \tf@ifsuboption{mtphbi}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{mtphbi}{mtpro2}}{}
+ \tf@ifsuboption{errorshow}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{errorshow}{mtpro2}}{}
+ \tf@ifsuboption{warningshow}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{warningshow}{mtpro2}}{}
+ \tf@ifsuboption{nofontinfo}{\tf@mathfontoptions}
+ {\PassOptionsToPackage{nofontinfo}{mtpro2}}{}
+ \tf@ifsuboption{lite}{\tf@mathfontoptions}{ % NB, 'lite', not 'light'
+ \tf@premtpro
+ \tf@usefontpackage[lite]{mtpro2}
+ \xdef\tf@rmprintname{\tf@mathprintname\ Lite}
+ }{
+ \tf@undefinecommands{\Bbbk} % prevent the clash of glyphs
+ \tf@premtpro
+ \tf@usefontpackage[complete]{mtpro2}
+ }
+}
+
+% Math -- Adobe Minion Pro
+\newtypeface{adobeminionpro}{Adobe Minion Pro}{math}{
+ \tf@loadadobeminionpro
+}
+
+% Math -- MathPTMX
+\newtypeface[ptmx]{mathptmx}{Math PTMX}{math}{
+ \tf@usefontpackage{mathptmx}
+ \ifthenelse{\equal{\tf@rmfont}{\TF@DEFAULT}}{
+ \tf@rmfont@times
+ }{}
+}
+
+% Math -- PXFonts
+\newtypeface[px]{pxfonts}{PX Fonts}{math}{
+ \tf@usefontpackage{pxfonts}
+}
+
+% Math -- TXFonts
+\newtypeface[tx]{txfonts}{TX Fonts}{math}{
+ \tf@loadtxfonts
+}
+
+% Roman family typeface -- somewhat sensitive to font load
+% ordering, particularly if loaded via font packages rather
+% than by directly setting \rmdefault
+% =========================================================
+\TF@PackageDebugInfo{Configuring rm load commands...}
+
+% Default -- no-op
+\newtypeface{\TF@DEFAULT}{}{rm}{
+ \ifthenelse{\equal{\tf@rmprintname}{undefined}}{
+ \renewcommand*\tf@rmprintname{\TF@DEFAULTPRINTNAME}
+ \TF@NativeOSFError
+ }{}
+}
+
+% ADF Baskervald
+\newtypeface[baskervald]{adfbaskervald}{ADF Baskervald}{rm}{
+ \tf@ifsuboption{lig}{\tf@rmfontoptions}
+ {\renewcommand*\rmdefault{ybvw}}
+ {\renewcommand*\rmdefault{ybv}}
+ \DeclareTextSymbol{\zeroslash}{TS1}{225}
+ \DeclareTextSymbolDefault{\zeroslash}{TS1}
+ \TF@NativeOSFError
+ \tf@pdfglyphcorrection{Baskervald}
+}
+
+% ADF Berenis -- sets font encoding to LY1 -- might have
+% consequences for sf/tt/math typeface choices
+\newtypeface[berenis]{adfberenis}{ADF Berenis}{rm}{
+ \tf@ifsuboption{tab}{\tf@rmfontoptions} % default is proportional figures
+ {\PassOptionsToPackage{tab}{berenis}}{} % otherwise, use tabular numbers
+ \tf@ifsuboption{lig}{\tf@rmfontoptions}
+ {\PassOptionsToPackage{lig}{berenis}}{} % oldstyle extra ligatures
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}}{
+ \PassOptionsToPackage{osf}{berenis}
+ \tf@ifsuboption{tab}{\tf@rmfontoptions}
+ {\tf@define@liningfigures{ybd}}
+ {\tf@define@liningfigures{ybd2}}
+ }{
+ \PassOptionsToPackage{lf}{berenis}
+ }
+ \tf@usefontpackage[lm]{berenis}
+ % ADF Berenis (without lm above) loads latin modern
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@latinmodern}{}
+ \ifthenelse{\equal{\tf@ttfont}{\TF@DEFAULT}}{\tf@ttfont@latinmodern}{}
+}
+
+% ADF Electrum
+\newtypeface[electrum]{adfelectrum}{ADF Electrum}{rm}{
+ \tf@ifsuboption{lig}{\tf@rmfontoptions}
+ {\PassOptionsToPackage{lig}{electrum}}{} % oldstyle extra ligatures
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}}{
+ \PassOptionsToPackage{osf}{electrum}
+ \tf@define@liningfigures{yes}
+ }{
+ \PassOptionsToPackage{lf}{electrum}
+ }
+ \tf@usefontpackage{electrum}
+}
+
+% ADF Romande
+\newtypeface[romande]{adfromande}{ADF Romande}{rm}{
+ \tf@ifsuboption{alt}{\tf@rmfontoptions}
+ {\PassOptionsToPackage{alt}{romande}}{}
+ \tf@usefontpackage{romande}
+ \TF@NativeOSFError % Romande's figures are a sort of hybrid LF/OSF
+}
+
+% ADF Venturis -- including ADF Venturis 2 and ADF Venturis Old
+\newtypeface[venturis]{adfventuris}{ADF Venturis}{rm}{
+ \tf@newbool{tf@rm@venturisii}{false}
+ \tf@newbool{tf@rm@venturisold}{false}
+
+ \tf@ifsuboption{2}{\tf@rmfontoptions}{\booltrue{tf@rm@venturisii}}{}
+ \tf@ifsuboption{old}{\tf@rmfontoptions}{\booltrue{tf@rm@venturisold}}{}
+
+ \ifthenelse{\boolean{tf@rm@venturisii}\AND\boolean{tf@rm@venturisold}}{
+ \TF@PackageError{Incompatible typeface suboptions:\MessageBreak
+ \space\space`typeface=\tf@rmfontname'\MessageBreak
+ Removed `old' suboption}{}
+ \renewcommand*\tf@rmfontname{\tf@rmfont:2}
+ \renewcommand*\tf@rmfontoptions{2}
+ \boolfalse{tf@rm@venturisold}
+ }{}
+ \ifthenelse{\boolean{tf@rm@venturisii}}{
+ \tf@usefontpackage{venturis2}
+ \renewcommand*\tf@rmprintname{ADF Venturis 2}
+ \TF@NativeOSFError
+ % ADF Venturis loads venturis sans
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@adfventuris}{}
+ }{
+ \ifthenelse{\boolean{tf@rm@venturisold}}{
+ \tf@usefontpackage{venturisold}
+ \renewcommand*\tf@rmprintname{ADF Venturis Old}
+ \TF@NativeOSFError
+ }{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}}{
+ \tf@usefontpackage[osf]{venturis}
+ \tf@define@liningfigures{yvt}
+ }{
+ \tf@usefontpackage[lf]{venturis}
+ }
+ % ADF Venturis loads venturis sans
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@adfventuris}{}
+ }
+ }
+}
+
+% Adobe Minion Pro
+\newtypeface[minionpro]{adobeminionpro}{Adobe Minion Pro}{rm}{
+ \tf@loadadobeminionpro
+}
+
+% Adobe Utopia
+\newtypeface[utopia]{adobeutopia}{Adobe Utopia}{rm}{
+ \ifthenelse{\equal{\tf@mathfont}{mathdesign}
+ \AND\equal{\tf@mdrmfont}{utopia}}{
+ % \rmdefault was configured in \tf@mathfont@mathdesign
+ \renewcommand*\tf@rmprintname{Math Design Utopia}
+ }{
+ \ifthenelse{\equal{\tf@mathfont}{fourier}
+ \AND\equal{\tf@fouriermathfont}{adobeutopia}}{
+ % \rmdefault was configured in \tf@mathfont@fourier
+ }{
+ \renewcommand*\rmdefault{put}
+ \tf@SCencodedosf
+ }
+ }
+}
+
+% AE -- "Almost European" Computer Modern
+\newtypeface{ae}{AE}{rm}{
+ \tf@ifsuboption{slides}{\tf@rmfontoptions}{
+ \renewcommand*\rmdefault{laess} % ``sans roman'' with slides
+ \renewcommand*\tf@rmprintname{AE Sans}
+ }{
+ \renewcommand*\rmdefault{aer}
+ }
+ \tf@TSencodedosf
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@ae}{}
+ \ifthenelse{\equal{\tf@ttfont}{\TF@DEFAULT}}{\tf@ttfont@ae}{}
+}
+
+% Antykwa Poltawskiego
+\newtypeface[antpol,poltawski]{antykwapoltawski}{Antykwa P\'o\l tawskiego}{rm}{
+ \tf@ifsuboption{light}{\tf@rmfontoptions}{
+ \renewcommand*\rmdefault{antpl}
+ \xdef\tf@rmprintname{\tf@rmprintname\ Light}
+ }{
+ \renewcommand*\rmdefault{antp}
+ }
+ \tf@SCencodedosf
+}
+
+% Antykwa Torunska
+\newtypeface[anttor,torunska]{antykwatorunska}{}{rm}{
+ \tf@loadantykwatorunska
+}
+
+% Augie
+\newtypeface{augie}{Augie}{rm}{
+ \renewcommand*\rmdefault{augie}
+ \TF@NativeOSFError
+}
+
+% Auriocus Kalligraphicus -- decorative script
+% Provides the fonts: Auriocus Kalligraphicus, Lukas Svatba (plus
+% Amici variant) and Jana Skrivana, accessed via the \Fontauri,
+% \Fontlukas, \Fontskrivan and \Fontamici commands
+\newtypeface[auriocus,kalligraphicus]{auriocuskalligraphicus}
+ {Auriocus Kalligraphicus}{rm}{
+ \tf@ifsuboption{backslant}{\tf@rmfontoptions}
+ {\tf@usefontpackage[backslant]{aurical}}
+ {\tf@usefontpackage{aurical}}
+ \TF@NativeLFError % rare!
+ \renewcommand*\rmdefault{AuriocusKalligraphicus}
+}
+
+% Bera Serif
+\newtypeface[bera]{beraserif}{Bera Serif}{rm}{
+ \tf@usefontpackage{beraserif}
+ \TF@NativeOSFError
+}
+
+% Bitstream Charter
+\newtypeface[charter]{bitstreamcharter}{Bitstream Charter}{rm}{
+ \ifthenelse{\equal{\tf@mathfont}{mathdesign}
+ \AND\equal{\tf@mdrmfont}{charter}}{
+ % \rmdefault was configured in \tf@mathfont@mathdesign
+ \renewcommand*\tf@rmprintname{Math Design Charter}
+ }{
+ \renewcommand*\rmdefault{bch}
+ }
+ \TF@NativeOSFError
+}
+
+% Computer Modern (the `fix-cm' proxies -- font encoding dependent)
+\newtypeface[cm,cmr]{computermodern}{Computer Modern}{rm}{
+ \@ifpackageloaded{fix-cm}{\relax}{
+ %-- NB, from `fixltx2e' documentation (which we ignore) -----------------
+ % The package should be loaded before \documentclass, using the command
+ % \RequirePackage{fix-cm}, rather than the normal \usepackage. Rationale:
+ % If the package is loaded in the preamble, a preceding package or even
+ % the code of the document class may have used any of the CM fonts
+ % already. However, the definitions of those fonts, that are already in
+ % use, cannot be changed any more.
+ %
+ % Rationale for our not observing this guideline: we don't have
+ % programmatic control over the user's code writing. The best we can
+ % do is load `fix-cm' here then issue some advice about the matter.
+ %------------------------------------------------------------------------
+ \usepackage{fix-cm}
+ \TF@PackageWarningNoLine{%
+ If you must set typeface to Computer Modern, please\MessageBreak
+ include \string\RequirePackage{fix-cm}\space before the\MessageBreak
+ \string\documentclass\space line in your code. See `fixltx2e'\MessageBreak
+ package documentation for an explanation. Doing so\MessageBreak
+ will make this warning go away. (Note that it is\MessageBreak
+ \string\RequirePackage{fix-cm}, not \string\usepackage{fix-cm}.)%
+ }
+ }
+ \renewcommand*\rmdefault{cmr}
+ \tf@TSencodedosf
+}
+
+% CM Bright (sans serif as a Roman font)
+\newtypeface{cmbright}{CM Bright}{rm}{
+ \tf@loadcmbright
+}
+
+% CM Dunhill
+\newtypeface{cmdunhill}{CM Dunhill}{rm}{
+ \renewcommand*\rmdefault{cmdh}
+ \tf@TSencodedosf
+}
+
+% CM Fibonacci
+\newtypeface{cmfibonacci}{CM Fibonacci}{rm}{
+ \renewcommand*\rmdefault{cmfib}
+ \tf@TSencodedosf
+}
+
+% Concrete
+\newtypeface{concrete}{Concrete}{rm}{
+ \tf@loadconcrete
+}
+
+% Day Roman
+\newtypeface[dayroman]{dayrom}{Day Roman}{rm}{
+ \tf@ifsuboption{s}{\tf@rmfontoptions}{
+ % with `long s' and additional c-t ligature
+ \renewcommand*\rmdefault{dayroms}
+ \xdef\tf@rmprintname{\tf@rmprintname\ S}
+ }{
+ \renewcommand*\rmdefault{dayrom}
+ }
+ \TF@NativeLFError % rare!
+}
+
+% DejaVu
+\newtypeface{dejavu}{DejaVu}{rm}{
+ % NB, scaling DejaVu does not affect baselineskip
+ \tf@newbool{tf@dejavu@scaled}{false}
+ \tf@ifsuboption{scaled}{\tf@rmfontoptions}
+ {\booltrue{tf@dejavu@scaled}}
+ {\tf@ifsuboption{scale}{\tf@rmfontoptions}{\booltrue{tf@dejavu@scaled}}{}}
+ \ifbool{tf@dejavu@scaled}{
+ \ifthenelse{\ispositiverealnumber{\tf@nextsuboption}}
+ {\xdef\tf@rmscale{\tf@nextsuboption}}
+ {\renewcommand*\tf@rmscale{0.95}} % DejaVu package default
+ }{}
+
+ \newcommand*\tf@dejavu@package{DejaVuSerif}
+ \tf@ifsuboption{condensed}{\tf@rmfontoptions}{
+ \renewcommand*\tf@dejavu@package{DejaVuSerifCondensed}
+ \xdef\tf@rmprintname{\tf@rmprintname\ Condensed}
+ }{}
+ \ifbool{tf@dejavu@scaled}
+ {\PassOptionsToPackage{scaled=\tf@rmscale}{\tf@dejavu@package}}{}
+ \tf@usefontpackage{\tf@dejavu@package}
+ \TF@NativeOSFError
+}
+
+% Droid
+\newtypeface{droid}{Droid}{rm}{
+ \renewcommand*\rmdefault{fdr}
+ \TF@NativeOSFError
+}
+
+% % Epigrafica -- not yet ready for prime time
+% \newtypeface{epigrafica}{Epigrafica}{rm}{
+% \tf@usefontpackage{epigrafica}
+% \tf@TSencodedosf
+% }
+
+% European Modern
+% European Modern presents a problem by encapsulating its font declarations
+% alongside math declarations within the style file rather than in separate
+% fd files. Given our default math -> rm -> sf -> tt font loading order, we'd
+% be in trouble if the user wanted, say, sf European Modern together with some
+% arbitrary non European Modern math. To sidestep this, we extract and
+% execute only the font declarations from the European Modern package.
+\newtypeface[em]{europeanmodern}{European Modern}{rm}{
+ % TODO: errmsg non-T1 encoding
+ \ifthenelse{\equal{\tf@mathfont}{europeanmodern}}{
+ % our europeanmodern math font handler has already done the required work
+ }{
+ \expandafter\let\csname T1/cmr/m/n/10\endcsname\@undefined
+ \global\defaulthyphenchar=127
+ \DeclareFontFamily{T1}{cmr}{}
+ \DeclareFontShape{T1}{cmr}{m}{n}{
+ <-6> emr5 <6-7> emr6 <7-8> emr7 <8-9> emr8
+ <9-10> emr9 <10-12> emr10 <12-17> emr12 <17-> emr17 }{}
+ \DeclareFontShape{T1}{cmr}{m}{sl}{
+ <-9> emsl8 <9-10> emsl9 <10-12> emsl10 <12-> emsl12 }{}
+ \DeclareFontShape{T1}{cmr}{m}{it}{
+ <-8> emti7 <8-9> emti8 <9-10> emti9 <10-12> emti10 <12-> emti12}{}
+ \DeclareFontShape{T1}{cmr}{m}{sc}{
+ <-9> emcsc8 <9-10> emcsc9 <10-> emcsc10}{}
+ \DeclareFontShape{T1}{cmr}{m}{ui}{<-> emu10}{}
+ \DeclareFontShape{T1}{cmr}{b}{n} {<-> emb10}{}
+ \DeclareFontShape{T1}{cmr}{bx}{n}{
+ <-6> embx5 <6-7> embx6 <7-8> embx7 <8-9> embx8
+ <9-10> embx9 <10-12> embx10 <12-> embx12}{}
+ \DeclareFontShape{T1}{cmr}{bx}{sl}{<-> embxsl10}{}
+ \DeclareFontShape{T1}{cmr}{bx}{it}{<-> embxti10}{}
+ \DeclareFontShape{T1}{cmr}{bx}{ui}{<-> emu10}{}
+ \renewcommand*\rmdefault{cmr}
+ }
+ \tf@TSencodedosf
+}
+
+
+% GFS Artemisia
+\newtypeface[artemisia]{gfsartemisia}{GFS Artemisia}{rm}{
+ \ifthenelse{\equal{\tf@mathfont}{\TF@DEFAULT}}{\tf@mathfont@gfsartemisia}{}
+ \ifthenelse{\equal{\tf@mathfont}{gfsartemisia}}{
+ \tf@ifsuboption{euler}{\tf@mathfontoptions}{\booltrue{tf@@gfsmatheuler}}{}
+ }{}
+ \tf@ifsuboption{euler}{\tf@rmfontoptions}{\booltrue{tf@@gfsmatheuler}}{}
+ \ifbool{tf@@gfsmatheuler}{
+ \renewcommand*\rmdefault{artemisiaeuler}
+ \xdef\tf@rmprintname{\tf@rmprintname\ (Euler)}
+ }{
+ \renewcommand*\rmdefault{artemisia}
+ }
+ \tf@SCencodedosf
+ % GFS Artemisia loads txfonts, which sets \sfdefault and \ttdefault
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@txfonts}{}
+ \ifthenelse{\equal{\tf@ttfont}{\TF@DEFAULT}}{\tf@ttfont@txfonts}{}
+}
+
+% GFS Bodoni
+% ----------------------------------------------------
+% See the comment with math gfsbodoni, if you run into
+% problems when using T1 font encoding
+% ----------------------------------------------------
+\newtypeface[bodoni]{gfsbodoni}{GFS Bodoni}{rm}{
+ \ifthenelse{\equal{\tf@mathfont}{\TF@DEFAULT}}{\tf@mathfont@gfsbodoni}{}
+ \renewcommand*\rmdefault{bodoni}
+ \tf@SCencodedosf
+}
+
+% GFS Didot
+\newtypeface[didot]{gfsdidot}{GFS Didot}{rm}{
+ \ifthenelse{\equal{\tf@mathfont}{\TF@DEFAULT}}{\tf@mathfont@gfsdidot}{}
+ \renewcommand*\rmdefault{udidot}
+ \tf@SCencodedosf
+ % GFS Didot loads pxfonts, which sets \sfdefault and \ttdefault
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@pxfonts}{}
+ \ifthenelse{\equal{\tf@ttfont}{\TF@DEFAULT}}{\tf@ttfont@pxfonts}{}
+}
+
+% GFS Neohellenic
+\newtypeface[neohellenic]{gfsneohellenic}{GFS Neohellenic}{rm}{
+ \renewcommand*\rmdefault{neohellenic}
+ \tf@ifsuboption{symbols}{\tf@rmfontoptions}{
+ \DeclareSymbolFont{letters}{OML}{neohellenic}{m}{it}
+ \ifthenelse{\equal{\tf@symbolsfont}{\TF@DEFAULT}}{
+ \renewcommand*\tf@symbolsprintname{GFS Neohellenic}
+ }{}
+ }{}
+ \ifthenelse{\equal{\tf@mathfont}{\TF@DEFAULT}}{\tf@mathfont@gfsneohellenic}{}
+ \tf@SCencodedosf
+ % GFS Neohellenic loads sets \sfdefault
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@gfsneohellenic}{}
+}
+
+% Gyre Bonum
+\newtypeface[bonum,tgbonum]{gyrebonum}{Gyre Bonum}{rm}{
+ \tf@usefontpackage{tgbonum}
+ \tf@TSencodedosf
+}
+
+% Gyre Pagella
+\newtypeface[pagella,tgpagella]{gyrepagella}{Gyre Pagella}{rm}{
+ \tf@usefontpackage{tgpagella}
+ \tf@TSencodedosf
+}
+
+% Gyre Schola
+\newtypeface[schola,tgschola]{gyreschola}{Gyre Schola}{rm}{
+ \tf@usefontpackage{tgschola}
+ \tf@TSencodedosf
+}
+
+% Gyre Termes
+\newtypeface[termes,tgtermes]{gyretermes}{Gyre Termes}{rm}{
+ \tf@usefontpackage{tgtermes}
+ \tf@TSencodedosf
+}
+
+% Iwona
+\newtypeface{iwona}{Iwona}{rm}{
+ \renewcommand*\rmdefault{iwona}
+ \tf@ifsuboption{light}{\tf@rmfontoptions}{
+ \xdef\rmdefault{\rmdefault l}
+ \xdef\tf@rmprintname{\tf@rmprintname\ Light}
+ }{}
+ \tf@ifsuboption{condensed}{\tf@rmfontoptions}{
+ \xdef\rmdefault{\rmdefault c}
+ \xdef\tf@rmprintname{\tf@rmprintname\ Condensed}
+ }{}
+ \tf@TSencodedosf
+}
+
+% Journal d'Analyse Mathematique expanded Times Roman font.
+% NB, while JAM Times generates a more spacious and consequently rather
+% attractive rendition of Times Roman, it cooperates poorly with (non-Belleek)
+% maths and symbols fonts, leading to many compile time warnings, especially
+% the innocuous but annoying 'LaTeX Font Warning: Font shape `xxx' will be
+% scaled' (even when compiling jamtimes' own mathsample.tex file).
+\newtypeface[jam]{jamtimes}{JAM Times}{rm}{
+ \tf@usefontpackage[scaled=1,sfscaled=1,amsfontsscaled=1]{jamtimes}
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@helvetica}{}
+ \ifthenelse{\equal{\tf@ttfont}{\TF@DEFAULT}}{\tf@ttfont@courier}{}
+ \TF@NativeOSFError
+}
+
+% Kurier
+\newtypeface{kurier}{Kurier}{rm}{
+ \renewcommand*\rmdefault{kurier}
+ \tf@ifsuboption{light}{\tf@rmfontoptions}{
+ \xdef\rmdefault{\rmdefault l}
+ \xdef\tf@rmprintname{\tf@rmprintname\ Light}
+ }{}
+ \tf@ifsuboption{condensed}{\tf@rmfontoptions}{
+ \xdef\rmdefault{\rmdefault c}
+ \xdef\tf@rmprintname{\tf@rmprintname\ Condensed}
+ }{}
+ \tf@TSencodedosf
+}
+
+% Kerkis (the latin parts are essentially URW Bookman,
+% of which, also consider Gyre Bonum)
+\newtypeface{kerkis}{Kerkis}{rm}{
+ \ifthenelse{\equal{\tf@mathfont}{\TF@DEFAULT}}{\tf@mathfont@kerkis}{}
+ \renewcommand*\rmdefault{mak}
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@kerkis}{}
+ \ifthenelse{\equal{\tf@ttfont}{\TF@DEFAULT}}{\tf@ttfont@courier}{}
+ \tf@TSencodedosf
+}
+
+% Kp-Fonts
+\newtypeface[kp,kepler]{kpfonts}{}{rm}{
+ \tf@loadkpfonts
+}
+
+% Latin Modern
+\newtypeface[lm,lmodern]{latinmodern}{Latin Modern}{rm}{
+ \renewcommand*\rmdefault{lmr}
+ % lm doesn't supply bold smallcaps, provide an
+ % option to source them from cm instead
+ \tf@ifsuboption{boldsc}{\tf@rmfontoptions}{
+ \normalfont
+ \DeclareFontShape{T1}{lmr}{bx}{sc} % NB, T1 only % TODO: other lm encodings
+ {<->ssub*cmr/bx/sc}{} % Note, no scaling (should be v. close)
+ }{}
+ \tf@TSencodedosf
+}
+
+% Libertine
+%------------------------------------------------------------------------------
+% NOTE! Around December 2011, the package author deprecated type1 libertine
+% fonts in favour of otf format. To use type1 libertine (this might be wrong
+% -- be sure to read the the latest libertine documentation if in any doubt):
+% i. if you also want to access libertine otf,
+% a. install the latest version of the libertine package,
+% b. rename (or delete) the new libertine.sty (dummy) file,
+% c. then re-texhash your system.
+% ii. uninstall the libertine package, install the libertine-legacy package
+% (containing the type1 font files as well as the version of the
+% libertine.sty file that we want to use).
+%------------------------------------------------------------------------------
+% NB, loads in biolinum (sf) font with matching OsF configuration. This will
+% only be noticeable if (a) the `sanstypeface' option is implicitly or
+% explicitly set to default, or (b), in the rare event of configuring option
+% `fontloadorder=...sf...rm...'
+% If case (a), you can override the matching OsF behaviour by explicitly
+% setting option `sanstypeface=biolinum' --> lining figures, or
+% setting option `sanstypeface=biolinum:osf' --> OsF. The joy.
+\newtypeface{libertine}{Libertine}{rm}{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}}{
+ \PassOptionsToPackage{osf}{libertine}
+ \tf@define@liningfigures{fxl}
+ }{}
+ \tf@usefontpackage{libertine}
+ \tf@pdfglyphcorrection{Libertine}
+ \renewcommand*\tf@sfprintname{Biolinum} % included in libertine package
+}
+
+% Bigelow and Holmes Lucida Bright (purchase from CTAN)
+\newtypeface[lucidabr,lucida]{lucidabright}{Lucida Bright}{rm}{
+ \tf@loadlucidabr
+}
+
+% New Century Schoolbook
+\newtypeface[nc,newcentury]{newcenturyschoolbook}{New Century Schoolbook}{rm}{
+ \ifthenelse{\equal{\tf@mathfont}{fourier}
+ \AND\equal{\tf@fouriermathfont}{newcenturyschoolbook}}{
+ % \rmdefault was configured in \tf@mathfont@fourier
+ }{
+ \tf@usefontpackage{newcent} % loads pnc, pag, pcr
+ }
+ \TF@NativeOSFError
+}
+
+% Palatino
+\newtypeface{palatino}{Palatino}{rm}{
+ \ifthenelse{\equal{\tf@mathfont}{\TF@DEFAULT}}{
+ \tf@loadmathpazo
+ }{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}}{
+ \renewcommand*\rmdefault{pplj}
+ \tf@define@liningfigures{pplx}
+ }{
+ \renewcommand*\rmdefault{pplx}
+ }
+ \tf@define@oldstylenums@cmd{pplj}
+ }
+}
+
+% Paratype PT Serif
+\newtypeface[pt,paratype]{ptserif}{PT Serif}{rm}{
+ \tf@usefontpackage{PTSerif}
+ \TF@NativeOSFError
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@ptsans}{}
+ % don't take this approach if tt is not specified since PTMono
+ % is unlikely to be installed. If it is and that's what's
+ % wanted for tt, then users can explicitly say so by including
+ % monotypeface=ptmono among their package options.
+}
+
+% PXFonts
+\newtypeface[px]{pxfonts}{PX Fonts}{rm}{
+ \ifthenelse{\equal{\tf@mathfont}{\TF@DEFAULT}}
+ {\tf@usefontpackage{pxfonts}}
+ {\renewcommand*\rmdefault{pxr}}
+ \tf@TSencodedosf
+ % PX Fonts sets \sfdefault and \ttdefault
+ \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{\tf@sffont@pxfonts}{}
+ \ifthenelse{\equal{\tf@ttfont}{\TF@DEFAULT}}{\tf@ttfont@pxfonts}{}
+}
+
+% Times Roman (faked smallcaps & oldstyle figures only if txfonts gets loaded)
+\newtypeface{times}{Times Roman}{rm}{
+ \ifthenelse{\equal{\tf@mathfont}{\TF@DEFAULT}
+ \OR\equal{\tf@mathfont}{amsfonts}}{
+ \tf@usefontpackage[varg]{txfonts}
+ \tf@TSencodedosf
+ }{
+ \renewcommand*\rmdefault{ptm}
+ \TF@NativeOSFMathError
+ }
+}
+
+% TXFonts
+\newtypeface[tx]{txfonts}{TX Fonts}{rm}{
+ \tf@loadtxfonts
+}
+
+% Uncial -- for 6th to the 10th century manuscripts
+% NB, requires B1 font encoding (i.e., you also need to have
+% installed: b1enc.def, b1cmr.fd, and maybe TeXB1.enc)
+\newtypeface{uncial}{Artificial Uncial}{rm}{
+ \tf@usefontpackage{allauncl}
+ \TF@NativeOSFError
+}
+
+% URW Antiqua
+\newtypeface[antiqua]{urwantiqua}{URW Antiqua}{rm}{
+ \renewcommand*\rmdefault{uaq}
+ \TF@NativeOSFError
+}
+
+% URW Bookman
+\newtypeface[bookman]{urwbookman}{URW Bookman}{rm}{
+ \tf@usefontpackage{bookman}
+ \TF@NativeOSFError
+}
+
+% URW Garamond -- NB, does not natively provide smallcaps
+\newtypeface[garamond]{urwgaramond}{URW Garamond}{rm}{
+ \ifthenelse{\equal{\tf@mathfont}{mathdesign}
+ \AND\equal{\tf@mdrmfont}{garamond}}{
+ % \rmdefault was configured in \tf@mathfont@mathdesign
+ \renewcommand*\tf@rmprintname{Math Design Garamond}
+ }{
+ \renewcommand*\rmdefault{ugm}
+ }
+ \TF@NativeOSFError
+}
+
+% URW Nimbus
+\newtypeface[nimbus]{urwnimbus}{URW Nimbus}{rm}{
+ \renewcommand*\rmdefault{unm}
+ \tf@TSencodedosf
+}
+
+% Zapf Chancery
+\newtypeface[chancery,zapf]{zapfchancery}{Zapf Chancery}{rm}{
+ \renewcommand*\rmdefault{pzc}
+ \TF@NativeOSFError
+}
+
+% Sans serif fonts -- somewhat sensitive to font load ordering,
+% particularly if loaded via a font package in the code below
+% =============================================================
+\TF@PackageDebugInfo{Configuring sf load commands...}
+
+% Default -- no-op
+\newtypeface{\TF@DEFAULT}{}{sf}{
+ \ifthenelse{\equal{\tf@sfprintname}{undefined}}{
+ \renewcommand*\tf@sfprintname{\TF@DEFAULTPRINTNAME}
+ }{}
+}
+
+\newtypeface[libris]{adflibris}{ADF Libris}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \RequirePackage{nfssext-cfr}% see libris doc for \swashstyle & \textswash
+ \renewcommand*\sfdefault{yly}
+ \renewcommand*\tf@sfprintname{ADF Libris}
+}
+
+\newtypeface[venturis]{adfventuris}{ADF Venturis Sans}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \tf@newbool{tf@@venturisii}{false}
+ \ifthenelse{\equal{\tf@rmfont}{adfventuris}}{
+ \tf@ifsuboption{2}{\tf@rmfontoptions}{\booltrue{tf@@venturisii}}{}
+ }{}
+ \tf@ifsuboption{2}{\tf@sffontoptions}{\booltrue{tf@@venturisii}}{}
+ \ifbool{tf@@venturisii}{
+ \renewcommand*\sfdefault{yv3}
+ \renewcommand*\tf@sfprintname{ADF Venturis 2 Sans}
+ }{
+ \renewcommand*\sfdefault{yv1}
+ }
+}
+
+\newtypeface{ae}{AE Sans}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \renewcommand*\sfdefault{aess}
+ \ifthenelse{\equal{\tf@rmfont}{ae}}{
+ \tf@ifsuboption{slides}{\tf@rmfontoptions}
+ {\renewcommand*\sfdefault{laess}}{}
+ }{}
+ \ifthenelse{\equal{\tf@ttfont}{ae}}{
+ \tf@ifsuboption{slides}{\tf@ttfontoptions}
+ {\renewcommand*\sfdefault{laess}}{}
+ }{}
+ \tf@ifsuboption{slides}{\tf@sffontoptions}
+ {\renewcommand*\sfdefault{laess}}{}
+}
+
+\newtypeface[arev]{arevsans}{Arev Sans}{sf}{
+ \ifthenelse{\equal{\tf@mathfont}{\TF@DEFAULT}}{\tf@mathfont@arevmath}{}
+ % requires reworked .fd file to accommodate load time scaling
+ \renewcommand*\sfdefault{fav}
+}
+
+\newtypeface{augie}{Augie}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \renewcommand*\sfdefault{augie}
+}
+
+\newtypeface{avantgarde}{Avant Garde}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \tf@usefontpackage{avant}
+}
+
+\newtypeface[bera]{berasans}{Bitstream Vera Sans}{sf}{
+ \scaletypeface{sf}{\PassOptionsToPackage{scaled=\tf@sfscalefactor}{berasans}}
+ \tf@usefontpackage{berasans}
+}
+
+\newtypeface{cantarell}{Cantarell}{sf}{
+ \scaletypeface{sf}{\PassOptionsToPackage{scale=\tf@sfscalefactor}{cantarell}}
+ \tf@usefontpackage[defaultsans]{cantarell}
+}
+
+% Biolinum aka Libertine sans
+%------------------------------------------------------------------------------
+% NOTE: read the comments with libertine in the roman fonts section
+%------------------------------------------------------------------------------
+% NB1, the biolinum ex font metrics in all tested versions of libertine (as of
+% writing, from v5.1.2 2011/06/06) is faulty. The bug report, again, as of
+% writing is still open (see http://sourceforge.net/tracker/?func=detail&
+% aid=3397220&group_id=89513&atid=590374). Consequently, ex based scaling
+% produces incorrect results. The easiest way out is to avoid setting typeface
+% option sanstypeface=ex. Try sanstypeface=xxx, where xxx is uppercase,
+% lowercase, figures or a floating point number instead. Alternatively, until
+% the bug is fixed, advanced users can hack their biolinum font description
+% (*fxb*.fd) files. Add this code:
+% \fontdimen5\font=\fontcharht\font`\x
+% to the last parameter in each \DeclareFontShape command in all *fxb*.fd
+% files. E.g.,
+% \DeclareFontShape{T1}{fxb}{m}{n}{ <-> \fxl@@scale fxbr-t1}
+% {\fontdimen5\font=\fontcharht\font`\x}
+%
+% NB2, biolinum and libertine SHARE the same loadtime scaling command (the
+% horror!). Consequently, there's a good risk that scaling one will
+% inadvertently scale the other, the risk depending on the order in which (i.e.,
+% when) LaTeX reads the respective rm/libertine and sf/biolinum .fd files.
+\newtypeface[libertine]{biolinum}{Biolinum}{sf}{
+ \tf@ifsuboption{osf}{\tf@sffontoptions}{
+ % Oddly enough for sans, biolinum has an OSF variant (and its quite nice!)
+ \renewcommand*\sfdefault{fxbj}
+ \xdef\tf@sfprintname{\tf@sfprintname\ OSF}
+ }{
+ \renewcommand*\sfdefault{fxb}
+ }
+ \scaletypeface{sf}{\xdef\fxl@scale{\tf@sfscalefactor}}
+ % TODO: pdfglyphcorrection is probably unnecessary here
+ \tf@pdfglyphcorrection{Biolinum}
+}
+
+\newtypeface{cmbright}{CM Bright Sans}{sf}{
+ \tf@loadcmbright
+}
+
+\newtypeface{comfortaa}{Comfortaa}{sf}{
+ \scaletypeface{sf}{\PassOptionsToPackage{scale=\tf@sfscalefactor}{comfortaa}}
+ \tf@usefontpackage{comfortaa}
+ \renewcommand*\sfdefault{fco}
+}
+
+\newtypeface[cm,cms]{computermodern}{Computer Modern Sans}{sf}{
+ % Warning: CM Sans Quotation is a rather dubious font. Bold, italic, slant
+ % fontsizes do not match normal fontsize. No smallcaps. Best avoid.
+ %
+ % requires reworked .fd file to accommodate load time scaling
+ \tf@ifsuboption{quotation}{\tf@sffontoptions}{
+ \renewcommand*\sfdefault{lcmss}
+ }{
+ \renewcommand*\sfdefault{cmss}
+ }
+}
+
+\newtypeface{cyklop}{Cyklop}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \renewcommand*\sfdefault{cyklop}
+}
+
+\newtypeface{dejavu}{DejaVu Sans}{sf}{
+ \tf@ifsuboption{condensed}{\tf@sffontoptions}{
+ \scaletypeface{sf}
+ {\PassOptionsToPackage{scaled=\tf@sfscalefactor}{DejaVuSansCondensed}}
+ \tf@usefontpackage{DejaVuSansCondensed}
+ \xdef\tf@sfprintname{\tf@sfprintname\ Condensed}
+ }{
+ \scaletypeface{sf}
+ {\PassOptionsToPackage{scaled=\tf@sfscalefactor}{DejaVuSans}}
+ \tf@usefontpackage{DejaVuSans}
+ }
+}
+
+\newtypeface{droid}{Droid Sans}{sf}{
+ \scaletypeface{sf}{\def\droid@fds@scale{s*[\tf@sfscalefactor]}}
+ \renewcommand*\sfdefault{fds}
+}
+
+\newtypeface[em]{europeanmodern}{European Modern Sans}{sf}{
+ % TODO: errmsg non-T1 encoding
+ % TODO: we can source sf osf from TS1
+ % See comments with rm \newtypeface declaration
+ \ifthenelse{\equal{\tf@mathfont}{europeanmodern}}{
+ % our europeanmodern math font handler has already done the needed work
+ }{
+ \DeclareFontFamily{T1}{emss}{}
+ \DeclareFontShape{T1}{emss}{m}{n} {
+ <-9> emss8 <9-10> emss9 <10-12> emss10 <12-17> emss12 <17-> emss17}{}
+ \DeclareFontShape{T1}{emss}{m}{sl} {
+ <-9> emssi8 <9-10> emssi9 <10-12> emssi10 <12-17> emssi12 <17-> emssi17}{}
+ \DeclareFontShape{T1}{emss}{sbc}{n}{<-> emssdc10}{}
+ \DeclareFontShape{T1}{emss}{bx}{n} {<-> emssbx10}{}
+ \DeclareFontShape{T1}{emss}{m}{it} {
+ <-9> emssi8 <9-10> emssi9 <10-12> emssi10 <12-17> emssi12 <17-> emssi17}{}
+ \DeclareFontShape{T1}{emss}{m}{sc} {
+ <-9> emcsc8 <9-10> emcsc9 <10-> emcsc10}{}
+ \DeclareFontShape{T1}{emss}{m}{ui} {<-> emu10}{}
+ \DeclareFontShape{T1}{emss}{bx}{ui}{<-> emu10}{}
+ \renewcommand*\sfdefault{emss}
+ }
+}
+
+\newtypeface[neohellenic]{gfsneohellenic}{GFS Neohellenic}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ % NB, .fd file contains scaling paraphernalia, however fixes scale to 1.225!
+ \renewcommand*\sfdefault{neohellenic}
+ \tf@ifsuboption{symbols}{\tf@sffontoptions}{
+ \DeclareSymbolFont{letters}{OML}{neohellenic}{m}{it}
+ \ifthenelse{\equal{\tf@symbolsfont}{\TF@DEFAULT}}{
+ \renewcommand*\tf@symbolsprintname{GFS Neohellenic}
+ }{}
+ }{}
+}
+
+\newtypeface[adventor,tgadventor]{gyreadventor}{Gyre Adventor}{sf}{
+ \scaletypeface{sf}{\PassOptionsToPackage{scale=\tf@sfscalefactor}{tgadventor}}
+ \tf@usefontpackage{tgadventor}
+}
+
+\newtypeface[heros,tgheros]{gyreheros}{Gyre Heros}{sf}{
+ \scaletypeface{sf}{\PassOptionsToPackage{scale=\tf@sfscalefactor}{tgheros}}
+ \tf@usefontpackage{tgheros}
+}
+
+\newtypeface[helv,helvet]{helvetica}{Helvetica}{sf}{
+ \scaletypeface{sf}{\PassOptionsToPackage{scaled=\tf@sfscalefactor}{helvet}}
+ \tf@usefontpackage{helvet}
+}
+
+\newtypeface{iwona}{Iwona}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \renewcommand*\sfdefault{iwona}
+
+ \tf@ifsuboption{light}{\tf@sffontoptions}{
+ \xdef\sfdefault{\sfdefault l}
+ \xdef\tf@sfprintname{\tf@sfprintname\ Light}
+ }{}
+ \tf@ifsuboption{condensed}{\tf@sffontoptions}{
+ \xdef\sfdefault{\sfdefault c}
+ \xdef\tf@sfprintname{\tf@sfprintname\ Condensed}
+ }{}
+}
+
+\newtypeface[kp,kepler]{kpfonts}{KP Fonts Sans}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \tf@ifsuboption{osf}{\tf@sffontoptions}{
+ % Oddly enough for a sans font, KP has an OSF variant
+ \renewcommand*\sfdefault{jkpssosn}
+ \xdef\tf@sfprintname{\tf@sfprintname\ OSF}
+ }{
+ \renewcommand*\sfdefault{jkpss}
+ }
+}
+
+\newtypeface{kerkis}{Kerkis Sans}{sf}{
+ \renewcommand*\sfdefault{maksf}
+ % <enc>maksf.fd hard codes its scale factor. This code rolls that back.
+ \providecommand*\tf@kerkismagicnumber{0.90} % change if <enc>maksf.fd changes
+ \g@addto@macro\tf@empty@sfcnt@hook{%
+ % Rewind 0.90 fixed scale factor in .fd file
+ \ifthenelse{\boolean{tf@@sffamily}
+ \AND\NOT\equal{\tf@sfscalemethod}{\TF@NO@SCALE}}{%
+ \@tempdima=\tf@sfscalefactor\p@%
+ \@tempdima=\tf@kerkismagicnumber\@tempdima%
+ \edef\optional@arg{\strip@pt\@tempdima}%
+ \global\booltrue{tf@sfscaledatloadtime}%
+ }{}%
+ }
+}
+
+\newtypeface{kurier}{Kurier Sans}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \renewcommand*\sfdefault{kurier}
+ \tf@ifsuboption{light}{\tf@sffontoptions}{
+ \xdef\sfdefault{\sfdefault l}
+ \xdef\tf@sfprintname{\tf@sfprintname\ Light}
+ }{}
+ \tf@ifsuboption{condensed}{\tf@sffontoptions}{
+ \xdef\sfdefault{\sfdefault c}
+ \xdef\tf@sfprintname{\tf@sfprintname\ Condensed}
+ }{}
+}
+
+\newtypeface[lm,lmodern]{latinmodern}{Latin Modern Sans}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \tf@ifsuboption{extended}{\tf@sffontoptions}{
+ \renewcommand*\sfdefault{lmssq}
+ \xdef\tf@sfprintname{\tf@sfprintname\ Extended}
+ }{
+ \renewcommand*\sfdefault{lmss}
+ }
+}
+
+\newtypeface{lato}{Lato}{sf}{
+ \scaletypeface{sf}{\PassOptionsToPackage{scale=\tf@sfscalefactor}{lato}}
+ \tf@usefontpackage[defaultsans]{lato}
+}
+
+\newtypeface[lucidabr,lucida]{lucidabright}{Lucida Bright Sans}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ % (unfortunately, redefining \DeclareLucidaFontShape won't work
+ % effortlessly since it is shared between rm, sf and tt fonts)
+ \renewcommand*\sfdefault{hls}
+}
+
+\newtypeface{opensans}{Open Sans}{sf}{
+ \scaletypeface{sf}{\PassOptionsToPackage{scale=\tf@sfscalefactor}{opensans}}
+ \tf@ifsuboption{osf}{\tf@sffontoptions}{
+ \PassOptionsToPackage{osfigures}{opensans}
+ }{}
+ \tf@usefontpackage[defaultsans]{opensans}[2011/11/11]
+}
+
+\newtypeface[pt,paratype]{ptsans}{PT Sans}{sf}{
+ \scaletypeface{sf}{\PassOptionsToPackage{scaled=\tf@sfscalefactor}{PTSans}}
+ \tf@usefontpackage{PTSans}
+}
+
+\newtypeface[px]{pxfonts}{PX Fonts Sans}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \renewcommand*\sfdefault{pxss}
+}
+
+\newtypeface[tx]{txfonts}{TX Fonts Sans}{sf}{
+%% NOTE: for users that want to use newtx's sf fonts definitions,
+%% copy this macro to typeface.cfg, uncommenting the commented text
+%% below. However, please check that it functions as intended before
+%% relying it in earnest. Particularly check italic and bold shape
+%% scaling to roman-relative size (sf scale options ex, uppercase,
+%% lowercase, figures and implicit/default).
+%
+% \tf@newbool{newtx}{false}
+% \ifthenelse{\equal{\tf@sffont}{\TF@DEFAULT}}{
+% \ifthenelse{\equal{\tf@rmfont}{txfonts}}{
+% \tf@ifsuboption{new}{\tf@rmfontoptions}{\booltrue{newtx}}{}
+% }{}
+% \ifthenelse{\equal{\tf@mathfont}{txfonts}}{
+% \tf@ifsuboption{new}{\tf@mathfontoptions}{\booltrue{newtx}}{}
+% }{}
+% }{
+% \tf@ifsuboption{new}{\tf@sffontoptions}{\booltrue{newtx}}{}
+% }
+%
+% \ifbool{newtx}{
+% % Michael Sharpe's newtx
+% \scaletypeface{sf}{\xdef\ntx@helvscaled{s*[\tf@sfscalefactor]}}
+% \renewcommand*\sfdefault{ntxss}
+% }{
+ \renewcommand*\sfdefault{txss}
+ % <enc>txss.fd hard codes its scale factor. This code rolls that back.
+ \providecommand*\tf@txfontsmagicnumber{0.95}% change if <enc>txss.fd changes
+ \g@addto@macro\tf@empty@sfcnt@hook{%
+ % Rewind 0.95 fixed scale factor in .fd file
+ \ifthenelse{\boolean{tf@@sffamily}
+ \AND\NOT\equal{\tf@sfscalemethod}{\TF@NO@SCALE}}{%
+ \@tempdima=\tf@sfscalefactor\p@%
+ \@tempdima=\tf@txfontsmagicnumber\@tempdima%
+ \edef\optional@arg{\strip@pt\@tempdima}%
+ \global\booltrue{tf@sfscaledatloadtime}%
+ }{}%
+ }
+% }
+}
+
+\newtypeface[arial]{urwarial}{URW Arial}{sf}{
+ \scaletypeface{sf}{\PassOptionsToPackage{scaled=\tf@sfscalefactor}{uarial}}
+ \tf@usefontpackage{uarial}
+}
+
+\newtypeface[classico,optima]{urwclassico}{URW Classico}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \renewcommand*\sfdefault{uop}
+}
+
+\newtypeface[grotesq]{urwgrotesq}{URW Grotesq}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \renewcommand*\sfdefault{ugq}
+}
+
+\newtypeface[nimbus]{urwnimbus}{URW Nimbus Sans}{sf}{
+ % requires reworked .fd file to accommodate load time scaling
+ \renewcommand*\sfdefault{unms}
+}
+
+% Typewriter fonts -- somewhat sensitive to font load ordering,
+% particularly if loaded via a font package in the code below
+% ============================================================
+\TF@PackageDebugInfo{Configuring tt load commands...}
+
+% Default -- no-op
+\newtypeface{\TF@DEFAULT}{}{tt}{
+ \ifthenelse{\equal{\tf@ttprintname}{undefined}}{
+ \renewcommand*\tf@ttprintname{\TF@DEFAULTPRINTNAME}
+ }{}
+}
+
+\newtypeface{ae}{AE Mono}{tt}{
+ % requires reworked .fd file to accommodate load time scaling
+ \renewcommand*\ttdefault{aett}
+ \ifthenelse{\equal{\tf@rmfont}{ae}}{
+ \tf@ifsuboption{slides}{\tf@rmfontoptions}
+ {\renewcommand*\ttdefault{laett}}{}
+ }{}
+ \ifthenelse{\equal{\tf@sffont}{ae}}{
+ \tf@ifsuboption{slides}{\tf@sffontoptions}
+ {\renewcommand*\ttdefault{laett}}{}
+ }{}
+ \tf@ifsuboption{slides}{\tf@ttfontoptions}
+ {\renewcommand*\ttdefault{laett}}{}
+}
+
+\newtypeface[bera]{beramono}{Bitstream Vera Mono}{tt}{
+ \scaletypeface{tt}{\PassOptionsToPackage{scaled=\tf@ttscalefactor}{beramono}}
+ \tf@usefontpackage{beramono} % contains no font load order side effects
+}
+
+\newtypeface{cmbright}{Computer Modern Mono Light}{tt}{
+ \tf@loadcmbright % contains math/symbols font load order side effects
+}
+
+\newtypeface[cm,cmt]{computermodern}{}{tt}{
+ % requires reworked .fd files to accommodate load time scaling
+ \tf@ifsuboption{light}{\tf@ttfontoptions}{
+ \renewcommand*\ttdefault{cmtl}
+ \renewcommand*\tf@ttprintname{Computer Modern Mono Light}
+ }{
+ \tf@ifsuboption{proportional}{\tf@ttfontoptions}{
+ \renewcommand*\ttdefault{cmvtt}
+ \renewcommand*\tf@ttprintname{Computer Modern Mono Proportional}
+ }{
+ \tf@ifsuboption{L}{\tf@ttfontoptions}{
+ \ifthenelse{\equal{\tf@fontencoding}{T1}}{
+ \DeclareFontFamily{T1}{lcmtt}{\hyphenchar\font\m@ne}
+ \DeclareFontShape{T1}{lcmtt}{m}{n}{<->ecltt8}{}
+ \DeclareFontShape{T1}{lcmtt}{m}{In}{<->iecltt8}{}
+ \DeclareFontShape{T1}{lcmtt}{m}{it}{<->ecit1000}{}
+ }{
+ \ifthenelse{\equal{\tf@fontencoding}{OT1}}{
+ \DeclareFontFamily{OT1}{lcmtt}{\hyphenchar\font\m@ne}
+ \DeclareFontShape{OT1}{lcmtt}{m}{n}{<-> cmtt8}{}
+ \DeclareFontShape{OT1}{lcmtt}{m}{In}{<->icmtt8}{}
+ \DeclareFontShape{OT1}{lcmtt}{m}{it}{<->cmitt10}{}
+ }
+ }{
+ %\TF@PackageWarningNoLine{...}
+ }
+ \renewcommand*\ttdefault{lcmtt}
+ \renewcommand*\tf@ttprintname{Computer Modern Mono L}
+ }{
+ \renewcommand*\ttdefault{cmtt}
+ \renewcommand*\tf@ttprintname{Computer Modern Mono}
+ }
+ }
+ }
+}
+
+\newtypeface{courier}{Courier}{tt}{
+ \scaletypeface{tt}{\PassOptionsToPackage{scaled=\tf@ttscalefactor}{couriers}}
+ \tf@usefontpackage{couriers}
+}
+
+\newtypeface{dejavu}{DejaVu Mono}{tt}{
+ \scaletypeface{tt}
+ {\PassOptionsToPackage{scaled=\tf@ttscalefactor}{DejaVuSansMono}}
+ \tf@usefontpackage{DejaVuSansMono}
+}
+
+\newtypeface{droid}{Droid Mono}{tt}{
+ \scaletypeface{tt}{\def\droid@fdm@scale{s*[\tf@ttscalefactor]}}
+ \renewcommand*\ttdefault{fdm}
+}
+
+\newtypeface[cursor,tgcursor]{gyrecursor}{Gyre Cursor}{tt}{
+ \scaletypeface{tt}{\PassOptionsToPackage{scale=\tf@ttscalefactor}{tgcursor}}
+ \tf@usefontpackage{tgcursor}
+}
+
+\newtypeface[em]{europeanmodern}{European Modern Mono}{tt}{
+ % TODO: errmsg non-T1 encoding
+ % TODO: we can source tt osf from TS1
+ % See comments with rm \newtypeface declaration
+ \ifthenelse{\equal{\tf@mathfont}{europeanmodern}}{
+ % our europeanmodern math font handler has already done the required work
+ }{
+ \DeclareFontFamily{T1}{cmtt}{\hyphenchar \font\m@ne}
+ \DeclareFontShape{T1}{cmtt}{m}{n}{
+ <-9> emtt8 <9-10> emtt9 <10-12> emtt10 <12-> emtt12}{}
+ \DeclareFontShape{T1}{cmtt}{m}{it} {<-> emitt10}{}
+ \DeclareFontShape{T1}{cmtt}{m}{sl} {<-> emsltt10}{}
+ \DeclareFontShape{T1}{cmtt}{m}{ui} {<-> emitt10}{}
+ \DeclareFontShape{T1}{cmtt}{bx}{n} {
+ <-9> emtt8 <9-10> emtt9 <10-12> emtt10 <12-> emtt12}{}
+ \DeclareFontShape{T1}{cmtt}{bx}{it}{<-> emitt10}{}
+ \DeclareFontShape{T1}{cmtt}{bx}{ui}{<-> emitt10}{}
+ \renewcommand*\ttdefault{cmtt}
+ }
+}
+
+\newtypeface{inconsolata}{Inconsolata}{tt}{
+ \scaletypeface{tt}{\def\fifour@scaled{s*[\tf@ttscalefactor]}}
+ \renewcommand*\ttdefault{fi4}
+}
+
+\newtypeface[kp,kepler]{kpfonts}{KP Fonts Mono}{tt}{
+ % requires reworked .fd file to accommodate load time scaling
+ \tf@ifsuboption{osf}{\tf@ttfontoptions}
+ {\renewcommand*\ttdefault{jkpttosn}} % KP mono has an OSF variant
+ {\renewcommand*\ttdefault{jkptt}}
+}
+
+\newtypeface[lm,lmodern]{latinmodern}{Latin Modern Mono}{tt}{
+ % requires reworked .fd file to accommodate load time scaling
+ \tf@ifsuboption{proportional}{\tf@ttfontoptions}{
+ \renewcommand*\ttdefault{lmvtt}
+ \xdef\tf@ttprintname{\tf@ttprintname\ Proportional}
+ \renewcommand*\tf@ttprintname{Latin Modern Mono Proportional}
+ }{
+ \renewcommand*\ttdefault{lmtt}
+ }
+}
+
+\newtypeface[lucidabr,lucida]{lucidabright}{Lucida Bright Mono}{tt}{
+ % We follow lucidabr (see \tf@loadlucidabr, above) by defaulting
+ % to sans tt unless serif tt is specified. This breaks with the
+ % sans vs serif tt pattern established with other tt fonts throughout
+ % this package (which default to serif tt unless `sans' option is provided).
+ % Note also that we require reworked .fd file to accommodate load time
+ % scaling (unfortunately, redefining \DeclareLucidaFontShape won't work
+ % without knottiness since it is common to rm, sf and tt fonts).
+ \tf@ifsuboption{serif}{\tf@ttfontoptions}{\booltrue{tf@@lbseriftt}}{}
+ \tf@ifsuboption{seriftt}{\tf@ttfontoptions}{\booltrue{tf@@lbseriftt}}{}
+ \tf@ifsuboption{sans}{\tf@ttfontoptions}{
+ \ifbool{tf@@lbseriftt}{
+ \TF@PackageWarningNoLine{%
+ Incompatible suboptions `sans' and `seriftt' (or\MessageBreak
+ `serif'). Check for conflicts in your `typeface',\MessageBreak
+ `mathtypeface' and `monotypeface' package options}
+ }{}
+ }{}
+ \ifbool{tf@@lbseriftt}{
+ \renewcommand*\ttdefault{hlct}
+ }{
+ \renewcommand*\ttdefault{hlst}
+ \renewcommand*\tf@ttprintname{Lucida Bright Sans Mono}
+ }
+}
+
+\newtypeface[luxi]{luximono}{Luxi Mono}{tt}{
+ \scaletypeface{tt}{\PassOptionsToPackage{scaled=\tf@ttscalefactor}{luximono}}
+ % While the luximono package is available via MiKTeX package manager, it is
+ % not through TeXLive package manager where instead you'll need to download
+ % and install by hand
+ \tf@usefontpackage{luximono}
+}
+
+\newtypeface[pt,paratype]{ptmono}{PT Mono}{tt}{
+ % PT Mono is not installed with the paratype package and must
+ % consequently be manually installed using the truetype variant
+ % (instructions in paratype's docs)
+ \scaletypeface{tt}{\PassOptionsToPackage{scaled=\tf@ttscalefactor}{PTSans}}
+ \tf@usefontpackage{PTMono}
+}
+
+\newtypeface[px]{pxfonts}{PX Fonts Mono}{tt}{
+ % requires reworked .fd file to accommodate load time scaling
+ \renewcommand*\ttdefault{pxtt}
+}
+
+\newtypeface[tx]{txfonts}{TX Fonts Mono}{tt}{
+ % requires reworked .fd file to accommodate load time scaling
+ \renewcommand*\ttdefault{txtt}
+}
+
+%== End \newtypeface font definitions =========================================
+
+% Unpack and validate typeface font options
+%------------------------------------------
+% Typeface name options (typeface/rm, sanstypeface/sf, monotypeface/tt,
+% mathtypeface/math, symbolstypeface/sym and textfigures) can include
+% colon-separated lists of suboptions, e.g.,
+% typeface=iwona:light,
+% sanstypeface=kepler:light:osf,
+% monotypeface=latinmodern:proportional
+% textfigures=kepler:light:scale:ex:spacing:-20:lkern:-20:rkern:-10
+% At this stage, each user supplied <fontname[:option]*> string has already
+% been set up in \tf@XXfontname, where XX is rm, sf, tt, math, symbols or
+% textfigures. We store the <fontname> part in \tf@XXfont and the <[:option]*>
+% part in \tf@XXfontoptions (discarding the first colon), then validate
+% that \tf@XXfont is a legitimate font name, complaining otherwise.
+%......................................................................
+\tf@newbool{tf@valid@fontname}{false}
+
+\newcommand*\tf@unpackfontname[2]{%
+ % split & save the string in #1 into \tf@#2font and \tf@#2fontoptions, where
+ % #1 is the <fontname(:option)*> user-supplied option string, and
+ % #2 is one of textfigures, symbols, math, rm, sf, or tt
+ \expandafter\tf@@unpackfontname\expandafter{#1}{#2}%
+}
+
+\newcommand*\tf@@unpackfontname[2]{%
+ \tf@split@fontname #2:#1\@empty:\@empty\relax%
+}
+
+\def\tf@split@fontname#1:#2:#3\@empty#4\relax{% % split and save to:
+ \expandafter\def\csname tf@#1font\endcsname{#2}% % eg, \tf@rmfont
+ \expandafter\def\csname tf@#1fontoptions\endcsname{#3}% eg, \tf@rmfontoptions
+}
+
+\newcommand*\tf@parsefontname[1]{
+ % #1 is one of textfigures, symbols, math, rm, sf, or tt
+ \edef\tf@@fontname{\csname tf@#1fontname\endcsname}
+ \tf@unpackfontname{\tf@@fontname}{#1}
+
+ % check that the fontname part we saved in \tf@#1font matches one
+ % of the entries in the \tf@#1typefacechoices comma separated list
+ \boolfalse{tf@valid@fontname}
+ \edef\tf@@font{\csname tf@#1font\endcsname}
+ \renewcommand*\do[1]{ % refer etoolbox package
+ \ifthenelse{\equal{\tf@@font}{##1}}
+ {\booltrue{tf@valid@fontname}\listbreak}
+ {}
+ }
+ \edef\tf@@typefacechoices{\csname tf@#1typefacechoices\endcsname}
+ \expandafter\docsvlist\expandafter{\tf@@typefacechoices}
+
+ \ifthenelse{\NOT\boolean{tf@valid@fontname}}{
+ \ifthenelse{\equal{rm}{#1}}{
+ \edef\tf@@XXtypeface{typeface}
+ \edef\tf@@XXdefaultfont{\TF@DEFAULTRMFONT}}{}
+ \ifthenelse{\equal{sf}{#1}}{
+ \edef\tf@@XXtypeface{sanstypeface}
+ \edef\tf@@XXdefaultfont{\TF@DEFAULTSFFONT}}{}
+ \ifthenelse{\equal{tt}{#1}}{
+ \edef\tf@@XXtypeface{monotypeface}
+ \edef\tf@@XXdefaultfont{\TF@DEFAULTTTFONT}}{}
+ \ifthenelse{\equal{math}{#1}}{
+ \edef\tf@@XXtypeface{mathtypeface}
+ \edef\tf@@XXdefaultfont{\TF@DEFAULTMATHFONT}}{}
+ \ifthenelse{\equal{symbols}{#1}}{
+ \edef\tf@@XXtypeface{symbolstypeface}
+ \edef\tf@@XXdefaultfont{\TF@DEFAULTSYMBOLSFONT}}{}
+ \ifthenelse{\equal{textfigures}{#1}}{
+ \edef\tf@@XXtypeface{textfigures}
+ \edef\tf@@XXdefaultfont{\TF@DEFAULTTEXTFIGURESFONT}}{}
+ % NB, no allowance is made in the following error message that the user
+ % might have used one of the options aliases, e.g., instead of
+ % typeface=..., s/he wrote rm=... Hopefully if the user is smart enough
+ % to use options aliases, s/he's smart enough to interpret the error.
+ \TF@PackageError{%
+ Package option `\tf@@XXtypeface=\tf@@fontname' is\MessageBreak
+ invalid. Setting `\tf@@XXtypeface=\tf@@XXdefaultfont'}{}
+ \expandafter\xdef\csname tf@#1fontname\endcsname{\tf@@XXdefaultfont}
+ \expandafter\xdef\csname tf@#1font\endcsname{\tf@@XXdefaultfont}
+ \expandafter\xdef\csname tf@rmfontdefaultstatus\endcsname{\TF@IMPLICITDEFAULT}
+ }{}
+}
+\forcsvlist{\tf@parsefontname}{rm,sf,tt,math,symbols,textfigures}
+
+% Configure sf, tt, math and textfigures font scaling
+% ===================================================
+% Options include: ex, lowercase, uppercase, figures, true (synonym for ex),
+% false, or a literal constant (e.g., 0.82), allowing authors to match the
+% ex-height, the baseline ascender height of lowercase letters, the ascender
+% height of uppercase letters, or the ascender height of figures for the
+% target fonts with respect to the \rmdefault (reference) font size. Special
+% values 0, false, 1, 1.0, etc. all produce unity, that is, no scaling.
+%---------------------------------------------------------------------------
+
+% Typeface family scale command names, e.g., ex, 0.98, false, uppercase,...
+\newcommand*\tf@rmscale{\TF@UNSCALED}
+\newcommand*\tf@sfscale{\TF@UNSCALED}
+\newcommand*\tf@ttscale{\TF@UNSCALED}
+\newcommand*\tf@mathscale{\TF@UNSCALED}
+\newcommand*\tf@textfiguresscale{\TF@UNSCALED}
+
+% Typeface family scale factors (+ve real numbers only)
+\newcommand*\tf@sfscalefactor{\TF@UNSCALED}
+\newcommand*\tf@ttscalefactor{\TF@UNSCALED}
+\newcommand*\tf@mathscalefactor{\TF@UNSCALED}
+\newcommand*\tf@textfiguresscalefactor{\TF@UNSCALED}
+
+% Track whether user explicitly defines scale or whether we implicitly set it
+\tf@newbool{tf@sfscaleimplicit}{true}
+\tf@newbool{tf@ttscaleimplicit}{true}
+\tf@newbool{tf@mathscaleimplicit}{true}
+\tf@newbool{tf@textfiguresscaleimplicit}{true}
+
+% Determine target font scaling methods
+%--------------------------------------
+\newcommand*\tf@sfscalemethod{\TF@ER@SCALE}
+\newcommand*\tf@ttscalemethod{\TF@ER@SCALE}
+\newcommand*\tf@mathscalemethod{\TF@ER@SCALE}
+\newcommand*\tf@textfiguresscalemethod{\TF@ER@SCALE}
+
+\tf@newbool{tf@sfscaledatloadtime}{false}
+\tf@newbool{tf@ttscaledatloadtime}{false}
+\tf@newbool{tf@mathscaledatloadtime}{false}
+\tf@newbool{tf@textfiguresscaledatloadtime}{false}
+
+% Validate and set the math font family (0..15) for use with rm-relative
+% font scaling (used in \tf@initialise@fontscaling and in printinfo)
+\newcommand*\tf@mathfontfamily{0} % default
+
+\tf@ifsuboption{fam}{\tf@mathfontoptions}{
+ \xdef\tf@mathfontfamily{\tf@nextsuboption}
+ \def\tf@@temp{fam}
+}{}
+
+\tf@ifsuboption{family}{\tf@mathfontoptions}{
+ \xdef\tf@mathfontfamily{\tf@nextsuboption}
+ \def\tf@@temp{family}
+}{}
+
+\ifthenelse{\NOT\ispositiveinteger{\tf@mathfontfamily}
+ \OR\(\tf@mathfontfamily > 15\)}{
+ \ifthenelse{\equal{\tf@mathfontfamily}{}}{\def\tf@mathfontfamily{<nil>}}{}
+ \TF@PackageError{%
+ Invalid `\tf@@temp:nn' suboption argument in package\MessageBreak
+ option `mathtypeface=\tf@mathfontname'.\MessageBreak
+ Integer `nn' must be between 0 and 15\MessageBreak
+ (not `\tf@mathfontfamily'). Setting math font family = 0%
+ }{}
+ \renewcommand*\tf@mathfontfamily{0}
+}{}
+
+% Determine sf, tt, math and textfigures font scaling methods
+\newcommand*\tf@configure@fontscalingmethod[1]{
+ \ifthenelse{\NOT\equal{#1}{sf}
+ \AND\NOT\equal{#1}{tt}
+ \AND\NOT\equal{#1}{math}
+ \AND\NOT\equal{#1}{textfigures}}{
+ \TF@PackageError{Internal error in \TF@PACKAGENAME.sty\MessageBreak
+ Illegal parameter [#1]\MessageBreak
+ in \string\tf@configure@fontscalingmethod}{}
+ }{
+ \begingroup
+ \edef\tf@@scalemethod{\TF@ER@SCALE}
+ \edef\tf@@scalefactor{\TF@UNSCALED}
+ \edef\tf@@fontoptions{\csname tf@#1fontoptions\endcsname}
+
+ \tf@ifsuboption{scale}{\tf@@fontoptions}{
+ \ifthenelse{\equal{\tf@nextsuboption}{false}}
+ {\edef\tf@@scalemethod{\TF@NO@SCALE}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{true}}
+ {\edef\tf@@scalemethod{\TF@EX@SCALE}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{ex}}
+ {\edef\tf@@scalemethod{\TF@EX@SCALE}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{lowercase}}
+ {\edef\tf@@scalemethod{\TF@LC@SCALE}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{lc}}
+ {\edef\tf@@scalemethod{\TF@LC@SCALE}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{uppercase}}
+ {\edef\tf@@scalemethod{\TF@UC@SCALE}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{uc}}
+ {\edef\tf@@scalemethod{\TF@UC@SCALE}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{figures}}
+ {\edef\tf@@scalemethod{\TF@FG@SCALE}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{fig}}
+ {\edef\tf@@scalemethod{\TF@FG@SCALE}}{}
+ \ifthenelse{\ispositiverealnumber{\tf@nextsuboption}}{
+ % Test "normalised" numbers, i.e., test 0 instead of 0.00,
+ % 1 instead of 001, ...
+ \edef\tf@@scalefactor{\strip@pt\dimexpr\tf@nextsuboption pt\relax}
+ \ifthenelse{\equal{\tf@@scalefactor}{0}
+ \OR\equal{\tf@@scalefactor}{1}}{
+ \edef\tf@@scalemethod{\TF@NO@SCALE}
+ }{
+ \edef\tf@@scalemethod{\TF@FX@SCALE}
+ \expandafter\xdef\csname tf@#1scalefactor\endcsname{\tf@@scalefactor}
+ }
+ }{}
+ }{
+ \edef\tf@@scalemethod{\TF@EX@SCALE} % default: scale to rm ex height
+ }
+
+ % Error handling
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@ER@SCALE}}{
+ \TF@PackageError{%
+ Invalid `scale:nnn' suboption argument in\MessageBreak
+ #1 parameters `\csname tf@#1fontname\endcsname'}{}
+ }{
+ \ifthenelse{\equal{#1}{textfigures}}{
+ \ifthenelse{\equal{\tf@nextsuboption}{lowercase}}
+ {\edef\tf@@scalemethod{\TF@ER@SCALE}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{lc}}
+ {\edef\tf@@scalemethod{\TF@ER@SCALE}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{uppercase}}
+ {\edef\tf@@scalemethod{\TF@ER@SCALE}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{uc}}
+ {\edef\tf@@scalemethod{\TF@ER@SCALE}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{figures}}
+ {\edef\tf@@scalemethod{\TF@ER@SCALE}}{}
+ \ifthenelse{\equal{\tf@nextsuboption}{fig}}
+ {\edef\tf@@scalemethod{\TF@ER@SCALE}}{}
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@ER@SCALE}}{
+ \TF@PackageError{%
+ Invalid `scale:\tf@nextsuboption' suboption argument in\MessageBreak
+ option `textfigures=\tf@textfiguresfontname'}{}
+ }{}
+ }{}
+ }
+
+ % Initialise \tf@#1scalefactor if we can at this stage (generally not yet
+ % possible if \tf@@scalemethod == \TF@EX@SCALE, \TF@LC@SCALE, etc.)
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@NO@SCALE}}{
+ \expandafter\xdef\csname tf@#1scalefactor\endcsname{\TF@UNSCALED}
+ }{
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@FX@SCALE}}{
+ \expandafter\xdef\csname tf@#1scalefactor\endcsname
+ {\strip@pt\dimexpr\tf@nextsuboption pt\relax}
+ }{}
+ }
+
+ % We can apply fixed (constant literal) value scaling with rm-relative
+ % scaling if we managed to save the computed scale factor in the aux file
+ % during the previous run and user options haven't changed significantly
+ % since then.
+ \ifthenelse{\equal{\tf@fontencoding}{\tf@aux@fontencoding}
+ \AND\equal{\tf@rmfontname}{\tf@aux@rmfontname}
+ \AND\equal{\csname tf@#1fontname\endcsname}
+ {\csname tf@aux@#1fontname\endcsname}
+ \AND\NOT\equal{\csname tf@aux@#1scalefactor\endcsname}{}}{
+ \expandafter\xdef\csname tf@#1scalefactor\endcsname
+ {\csname tf@aux@#1scalefactor\endcsname}
+ \edef\tf@@scalefactor{\csname tf@#1scalefactor\endcsname}
+ \edef\tf@@scalefactor{\strip@pt\dimexpr\tf@@scalefactor pt\relax}
+ \ifthenelse{\equal{\tf@@scalefactor}{1}}
+ {\edef\tf@@scalemethod{\TF@NO@SCALE}}
+ {\edef\tf@@scalemethod{\TF@FX@SCALE}}
+ }{}
+ \expandafter\xdef\csname tf@#1scalemethod\endcsname{\tf@@scalemethod}
+ \TF@PackageInfo{#1 scale method = \csname tf@#1scalemethod\endcsname}
+ \endgroup
+ }
+}
+\forcsvlist{\tf@configure@fontscalingmethod}{sf,tt,math,textfigures}
+
+% Initialise sf, tt, math and textfigures font scale factors
+%-----------------------------------------------------------
+\newcommand*\tf@initialise@fontscaling[1]{
+ % This macro assumes that \tf@configure@fontscalingmethod{#1} has already
+ % been executed, i.e., that \tf@#1scalemethod is properly configured
+ \ifthenelse{\NOT\equal{#1}{sf}
+ \AND\NOT\equal{#1}{tt}
+ \AND\NOT\equal{#1}{math}
+ \AND\NOT\equal{#1}{textfigures}}{
+ \TF@PackageError{Internal error in \TF@PACKAGENAME.sty\MessageBreak
+ Illegal parameter [#1]\MessageBreak
+ in \string\tf@initialise@fontscaling}{}
+ }{
+ \edef\tf@@scalemethod{\csname tf@#1scalemethod\endcsname}
+
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@ER@SCALE}}{
+ % User error. Error message was raised when detected. Do nothing here.
+ }{
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@NO@SCALE}}{
+ % By this stage, \tf@#1scalefactor has already been set to \TF@UNSCALED
+ %--- Aux file -----------------------------------------------------------
+ \tf@writeauxfile{\string\newcommand*%
+ \string\tf@aux@#1scalefactor{\TF@UNSCALED}}
+ %------------------------------------------------------------------------
+ }{
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@FX@SCALE}}{
+ % By this stage, \tf@#1scalefactor has already been set to
+ % the correct fixed value
+ %--- Aux file -----------------------------------------------------------
+ \tf@writeauxfile{\string\newcommand*\string\tf@aux@#1scalefactor{%
+ \csname tf@#1scalefactor\endcsname}}
+ %------------------------------------------------------------------------
+ }{
+ \begingroup
+ \expandafter\xdef\csname tf@#1scalefactor\endcsname{\TF@UNSCALED}
+
+ \edef\tf@@lc{bdfhklt}
+ \edef\tf@@uc{WXY}
+ \edef\tf@@fig{08}
+
+ % For reference font (rm) relative scaling purposes, select (and
+ % therefore load) an exceedingly unlikely user fontsize close to
+ % \normalsize font size
+ \normalsize
+ \edef\tf@@temp{\strip@pt\dimexpr\f@size pt + 0.027182pt\relax}%
+ \fontsize{\tf@@temp}{\f@baselineskip}
+
+ \usefont{\encodingdefault}{\rmdefault}{m}{n}
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@EX@SCALE}}
+ {\@tempdima=\fontdimen5\font}{}
+ % note that with many fonts, lc, uc & fig scaling methods
+ % are not particularly reliable
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@LC@SCALE}}
+ {\setbox0=\hbox{\tf@@lc}\@tempdima=\ht0}{}
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@UC@SCALE}}
+ {\setbox0=\hbox{\tf@@uc}\@tempdima=\ht0}{}
+ % note that we scale to rm font figures size, even if a
+ % substitute osf is in force
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@FG@SCALE}}
+ {\setbox0=\hbox{\tf@@fig}\@tempdima=\ht0}{}
+
+ \ifthenelse{\equal{#1}{textfigures}}{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@XF}}
+ {\usefont{\tf@substosffontencoding}{\tf@substosffont}{m}{n}}
+ {\usefont{\encodingdefault}{\rmdefault}{m}{n}} % redundant
+ }{
+ \ifthenelse{\equal{#1}{math}}{
+ % handled below
+ }{
+ % sf and tt
+ \usefont{\encodingdefault}{\csname #1default\endcsname}{m}{n}
+ }
+ }
+
+ \ifthenelse{\equal{#1}{math}}{
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@EX@SCALE}}{
+ \setbox0=\hbox{$x$} % to ensure font is selected
+ \@tempdimb=\fontdimen5\textfont\tf@mathfontfamily
+ \tf@ifsuboption{ex}{\tf@mathfontoptions}{
+ \ifthenelse{\equal{\tf@nextsuboption}{alt}}{
+ \@tempdimb=\ht0
+ }{}
+ }{}
+ }{}
+ % lc, uc and fig math scaling are ridiculously unreliable
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@LC@SCALE}}
+ {\setbox0=\hbox{$\tf@@lc$}\@tempdimb=\ht0}{}
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@UC@SCALE}}
+ {\setbox0=\hbox{$\tf@@uc$}\@tempdimb=\ht0}{}
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@FG@SCALE}}
+ {\setbox0=\hbox{$\tf@@fig$}\@tempdimb=\ht0}{}
+ }{
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@EX@SCALE}}
+ {\@tempdimb=\fontdimen5\font}{}
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@LC@SCALE}}
+ {\setbox0=\hbox{\tf@@lc}\@tempdimb=\ht0}{}
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@UC@SCALE}}
+ {\setbox0=\hbox{\tf@@uc}\@tempdimb=\ht0}{}
+ \ifthenelse{\equal{\tf@@scalemethod}{\TF@FG@SCALE}}
+ {\setbox0=\hbox{\tf@@fig}\@tempdimb=\ht0}{}
+ }
+
+ \edef\tf@@scalefactor
+ {\strip@pt\dimexpr \p@ * \@tempdima / \@tempdimb\relax}
+
+ \ifbool{tf@#1scaledatloadtime}{
+ \TF@PackageError{%
+ INTERNAL PACKAGE ERROR: flag `tf@#1scaledatloadtime'\MessageBreak
+ tested true in command `\tf@initialise@fontscaling',\MessageBreak
+ Please report this error to the package maintainer}{}
+ }{
+ % Font wasn't scaled at load time, most likely because we haven't
+ % configured the font for load time scaling and/or we haven't
+ % saved the scale factor and reloaded it from the aux file yet.
+ \expandafter\xdef\csname tf@#1scalefactor\endcsname{\tf@@scalefactor}
+ %--- Aux file ---------------------------------------------------------
+ \tf@writeauxfile{\string\newcommand*\string\tf@aux@#1scalefactor{%
+ \csname tf@#1scalefactor\endcsname}}
+ %----------------------------------------------------------------------
+ \ifthenelse{\NOT\equal{\csname tf@#1scalemethod\endcsname}{\TF@FX@SCALE}}{
+ \ifthenelse{\equal{#1}{sf}\OR\equal{#1}{tt}}{
+ % math and (generally) text figures do not require
+ % two pass font scaling
+ \tf@notifyauxfiledirty{#1}
+ }{}
+ }{}
+ }
+ \endgroup
+ }}}
+ }
+ \TF@PackageInfo{#1 scale factor = \csname tf@#1scalefactor\endcsname}
+}
+
+% Initialise math size declarations
+%----------------------------------
+\newcommand*\tf@initialise@mathsizes{
+ \newcommand*\tf@@scalemathfont[1]{
+ \begingroup
+ \csname ##1\endcsname
+ \let\oldf@size\f@size
+ \dimen@\f@size\p@
+ \@tempdima\tf@mathscalefactor\dimen@
+ \edef\f@size{\strip@pt\@tempdima}
+ \calculate@math@sizes
+ \csname S@\f@size\endcsname
+ \let\f@size\oldf@size
+
+ \expandafter\xdef\csname S@@tf\f@size\endcsname{\tf@size}
+ \expandafter\xdef\csname S@@sf\f@size\endcsname{\sf@size}
+ \expandafter\xdef\csname S@@ssf\f@size\endcsname{\ssf@size}
+
+ \expandafter\gdef\csname S@\f@size\endcsname{%
+ \xdef\tf@size{\csname S@@tf\f@size\endcsname}%
+ \xdef\sf@size{\csname S@@sf\f@size\endcsname}%
+ \xdef\ssf@size{\csname S@@ssf\f@size\endcsname}%
+ \TF@PackageDebugInfoNoLine{Math size \string\S@\f@size: %
+ [\f@size][\tf@size][\sf@size][\ssf@size]}%
+ }
+ \endgroup
+ }
+ \forcsvlist{\tf@@scalemathfont}
+ {tiny,scriptsize,footnotesize,small,normalsize,large,Large,LARGE,huge,Huge}
+ \ifthenelse{\classloaded{memoir}}{
+ \forcsvlist{\tf@@scalemathfont}{miniscule,HUGE}
+ }{}
+ \booltrue{tf@mathscaledatloadtime}
+}
+
+% Text figures spacing (tracking). User configurable by setting `spacing:nnn'
+% suboption in `textfigures' package option. E.g.,
+% textfigures=kpfonts:light:spacing:-20
+% nnn may be any integer from -1000 to 1000. Given value n, the substitute
+% text figures font will be kerned nnn/1000em. Requires the microtype package
+% -- complains if not already loaded.
+%----------------------------------------------------------------------------
+\newcommand*\tf@textfiguresspacing{0}
+\tf@newbool{tf@textfiguresspacingimplicit}{true}
+
+\newcommand*\tf@initialise@textfiguresfontspacing{
+ \tf@ifsuboption{spacing}{\tf@textfiguresfontoptions}{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@XF}}{
+ \ifthenelse{\isinteger{\tf@nextsuboption}
+ \AND\(\tf@nextsuboption > -1001\)
+ \AND\(\tf@nextsuboption < 1001\)}{
+ \xdef\tf@textfiguresspacing{\tf@nextsuboption}
+ \boolfalse{tf@textfiguresspacingimplicit}
+ }{
+ \TF@PackageError{%
+ Invalid `spacing:nnn' suboption argument in your\MessageBreak
+ package option `textfigures=\tf@textfiguresfontname'.\MessageBreak
+ Integer `nnn' must be between -1000 and 1000}{}
+ }
+ }{
+ \TF@PackageError{%
+ Ignoring package suboption `spacing:nnn' in\MessageBreak
+ `textfigures=\tf@textfiguresfontname'}{}
+ }
+ }{}
+
+ % set textfigures=...:spacing:1... suboption to take the <true> branch
+ % (microtype won't apply outer kerning if spacing == 0, we just follow
+ % along with that)
+ \ifthenelse{\NOT\equal{\tf@textfiguresspacing}{0}}{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@XF}}{
+ \@ifpackageloaded{microtype}{
+ \tf@ifsuboption{lkern}{\tf@textfiguresfontoptions}{
+ \ifthenelse{\isinteger{\tf@nextsuboption}}{
+ \edef\tf@MTtrackingL{\tf@nextsuboption}
+ }{
+ \TF@PackageError{%
+ Invalid `lkern:\tf@nextsuboption' suboption value\MessageBreak
+ (`\tf@nextsuboption' should be an integer)}{}
+ }
+ }{
+ \numdef\tf@MTtrackingL{\tf@textfiguresspacing}
+ }
+ \tf@ifsuboption{rkern}{\tf@textfiguresfontoptions}{
+ \ifthenelse{\isinteger{\tf@nextsuboption}}{
+ \edef\tf@MTtrackingR{\tf@nextsuboption}
+ }{
+ \TF@PackageError{%
+ Invalid `rkern:\tf@nextsuboption' suboption value\MessageBreak
+ (`\tf@nextsuboption' should be an integer)}{}
+ }
+ }{
+ \numdef\tf@MTtrackingR{\tf@textfiguresspacing}
+ }
+ \SetTracking[outer kerning={\tf@MTtrackingL,\tf@MTtrackingR}]
+ {encoding=*, family=\tf@substosffont}
+ {\tf@textfiguresspacing}
+ }{
+ \TF@PackageError{%
+ The microtype package must be loaded before\MessageBreak
+ loading the typeface package if suboption\MessageBreak
+ `spacing:nnn' in `textfigures=\tf@textfiguresfontname'\MessageBreak
+ is to have any effect. Ignoring suboption `spacing'}{}
+ \renewcommand*\tf@textfiguresspacing{0}
+ }
+ }{}
+ }{}
+ %--- Aux file ---------------------------------------------------------------
+ \tf@writeauxfile{\string\newcommand*\string\tf@aux@textfiguresspacing{%
+ \tf@textfiguresspacing}}
+ %----------------------------------------------------------------------------
+}
+
+% Load remaining Required Packages
+% ================================
+\TF@PackageDebugInfo{Loading remaining required packages...}
+
+\RequirePackage{scalefnt}
+\usepackage{anyfontsize}
+
+\ifbool{tf@debug}{
+ \@ifpackageloaded{xcolor}{\relax} % colour font substitutions when debugging
+ {\RequirePackage[dvipsnames,svgnames,x11names]{xcolor}}
+}
+
+% More housekeeping: additional configuration if debugging
+%---------------------------------------------------------
+\ifbool{tf@debug}{
+ \TF@PackageDebugInfo{Configuring extra debug routines...}
+ \listfiles % list the names of files read during this job run
+}{}
+
+% Encodings management
+%---------------------
+\TF@PackageDebugInfo{Configuring encodings...}
+
+\newcommand*\tf@@loadencpackage[2]{
+ % #1 package name (e.g., inputenc)
+ % #2 typeface option name (e.g., \tf@inputencoding)
+ \edef\tf@@packagename{#1}
+ \edef\tf@@optionname{\csname tf@#2\endcsname}
+ \edef\tf@@optionstring{\csname tf@#2string\endcsname}
+ \ifthenelse{\equal{\tf@@optionname}{\TF@DONTLOAD}
+ \OR\equal{\tf@@optionname}{\TF@IGNORE}}{
+ \relax
+ }{
+ \ifthenelse{\NOT\packageloaded{\tf@@packagename}}{
+ \TF@PackageDebugInfo{Loading `#1' with parameters [\tf@@optionname]}
+ \usepackage[\tf@@optionname]{\tf@@packagename}
+ }{
+ \TF@PackageWarningNoLine{%
+ The `#1' package is already loaded. Please\MessageBreak
+ check that its load-time options correspond with\MessageBreak
+ your needs. Package option `#2=\tf@@optionstring'\MessageBreak
+ ignored. (Set `#2=\TF@DONTLOAD' to make\MessageBreak
+ this warning go away)}
+ }
+ }
+}
+\tf@@loadencpackage{inputenc}{inputencoding}
+\tf@@loadencpackage{textcomp}{textcomp}
+\ifbool{pdf}{
+ \tf@@loadencpackage{cmap}{cmap}
+}{}
+
+% Even with cmap loaded, some pdf readers (notably including Adobe Acrobat)
+% are unable to search for or copy ligatures and oldstyle nums from
+% certain fonts. This macro provides a fix that often works. It depends
+% on the availability of `glyphtounicode.tex' in your TEXMF tree.
+% It is not guaranteed to work always since other factors might intervene,
+% e.g., an odd fontencoding (try T1 instead), the actual pdf reader being
+% used to view the document, which way the wind is blowing, etc.
+\newcommand*\tf@pdfglyphcorrection[1]{
+ \ifbool{pdf}{
+ \IfFileExists{glyphtounicode}{
+ \TF@PackageInfoNoLine{%
+ Correction applied to fix #1 font\MessageBreak
+ ligatures and old style figures search\MessageBreak
+ and copy problems. It might or might\MessageBreak
+ not work, depending on your pdf reader}
+ \input{glyphtounicode}
+ \pdfglyphtounicode{f_f}{FB00}
+ \pdfglyphtounicode{f_i}{FB01}
+ \pdfglyphtounicode{f_l}{FB02}
+ \pdfglyphtounicode{f_f_i}{FB03}
+ \pdfglyphtounicode{f_f_l}{FB04}
+ \pdfgentounicode=1
+ }{
+ \TF@PackageInfoNoLine{%
+ `glyphtounicode.tex' not found. Correction to\MessageBreak
+ #1 font ligatures and old style figures search\MessageBreak
+ and copy problem has not been applied}
+ }
+ }{}
+}
+
+\ifthenelse{\equal{\tf@fontencoding}{\TF@DONTLOAD}
+ \OR\equal{\tf@fontencoding}{\TF@IGNORE}}{
+ % Sneaky fontenc disappears itself from LaTeX's loaded packages
+ % record. Check for the existence of \@ifl@ter@@ rather than trying
+ % \@ifpackageloaded{fontenc}
+ \ifthenelse{\isundefined{\@ifl@ter@@}}{
+ \TF@PackageInfoNoLine{%
+ The `fontenc' package does not appear to be loaded,\MessageBreak
+ yet you have elected not to load it at this time.\MessageBreak
+ Are you certain that this is a good idea?}
+ }{}
+}{
+ \TF@PackageDebugInfo{Loading `fontenc' with parameters [\tf@fontencoding]}
+ \usepackage[\tf@fontencoding]{fontenc}
+ \TF@PackageDebugInfo{\string\encodingdefault=\encodingdefault}
+}
+
+% Namespace initialisation
+% ========================
+\TF@PackageDebugInfo{Initialising namespaces...}
+
+% Rationalise typeface options namespace (typeface aliases)
+\tf@rationalisefontnames % constructed by \newtypeface commands
+
+% Zero out the font name strings
+\newcommand*\tf@rmprintname{undefined}
+\newcommand*\tf@sfprintname{undefined}
+\newcommand*\tf@ttprintname{undefined}
+\newcommand*\tf@mathprintname{undefined}
+\newcommand*\tf@symbolsprintname{undefined}
+\newcommand*\tf@textfiguresprintname{undefined}
+
+% Zero out the self-registered macro names saved whenever a font is loaded
+% (see the \newtypeface command, above, to see how these are constructed)
+\newcommand*\tf@rmfontloadcommand{undefined}
+\newcommand*\tf@sffontloadcommand{undefined}
+\newcommand*\tf@ttfontloadcommand{undefined}
+\newcommand*\tf@mathfontloadcommand{undefined}
+\newcommand*\tf@symbolsfontloadcommand{undefined}
+\newcommand*\tf@textfiguresfontloadcommand{undefined}
+
+% Discard any previously defined math symbols fonts, more or less
+\let\glb@currsize\relax
+
+% Text figures management
+% =======================
+% Lowercase (text) numerals -- you almost certainly won't use these unless
+% your font natively provides old style figures. If it does, then all you need
+% do is to include `textfigures' in your package options. If your selected
+% font includes old style figures, to turn them on throughout your document
+% (except if set in the `liningnums' environment). If your font does not
+% natively provide old style figures, specifying `textfigures=xxx' (where xxx
+% is `palatino`, `adobeminionpro' or any other font configured for this) will
+% attempt to use the old style figures from the xxx font instead. The catch is
+% that to use the (non-native) substitute text figures font, you have to place
+% your numbers in a `textstylenums` environment, e.g.,
+% \begin{textstylenums}1234\end{textstylenums}
+% or pass them to the `\textstylenums' command. Unlike LaTeX's standard
+% `\oldstylenums' command, you can include some punctuation characters
+% alongside figures, e.g., you can include `$', hyphen, en dash, em dash,
+% full stop, comma, etc., depending on the font. However, since the success of
+% this is font-dependant, you probably should avoid this writing style.
+%
+% WARNING: DO NOT ATTEMPT TO USE \begin{textstylenums}....\end{textstylenums}
+% OR \textstylenums IN MATHS ENVIRONMENTS! IT WILL END IN TEARS!
+%
+% Note that if a substitute font is specified, `textnums' substitutes one font
+% family for another, whereas `oldstylenums' does not (it uses the old style
+% figures from the currently selected font if they are available, or typesets
+% little black rectangles otherwise). Converting your document to use the
+% `textnums' environment or `\textstylenums' command needn't require much
+% effort if you write a wildcard based search and replace routine in your
+% document editor to automate this for you (making sure to avoid numbers in
+% TeX command parameters, etc).
+%------------------------------------------------------------------------------
+\TF@PackageDebugInfo{Initialising textfigures commands...}
+
+% Useful author-level boolean expressions that can be used in
+% \ifthenelse tests. E.g., \ifthenelse{\NOT\isliningnums}{...}{...}
+\def\isliningnums{\equal{\tf@osf@method}{\TF@OSF@LF}}
+
+% Provide the default (stub) version of liningnums environment that (when
+% fleshed out on a per font basis in the font commands below) switches to
+% lining (uppercase) figures whenever the environment is in effect.
+\tf@newbool{tf@liningnums}{false} % TODO: should we make this nestable?
+\newenvironment{liningnums}
+ {\booltrue{tf@liningnums}}
+ {\boolfalse{tf@liningnums}}
+\newcommand*\tf@resetliningnumsenvironment{
+ \renewenvironment{liningnums}
+ {\booltrue{tf@liningnums}}
+ {\boolfalse{tf@liningnums}}
+}
+
+% Helper routine to redefine liningnums environment when using native osf
+\newcommand*\tf@define@liningfigures[1]{
+ % #1 is the font family name for lining figures, e.g., pplx (vs pplj)
+ \renewenvironment{liningnums}{%
+ \notbool{tf@suppressfiguressubstitution}{%
+ \ifbool{tf@debug}{\color{\TF@DEBUG@COLOUR@LININGNUMS}}{}%
+ \fontfamily{#1}\selectfont%
+ }{}%
+ }{%
+ \boolfalse{tf@liningnums}%
+ }
+}
+
+% Helper routine to define the \oldstylenums command for selected font families
+\newcommand*\tf@define@oldstylenums@cmd[1]{
+ % #1 is the font family name for old style figures, e.g., pplj (vs pplx)
+ \renewcommand\oldstylenums[1]{{\fontfamily{#1}\selectfont ##1}}
+}
+
+% Access old style figures via TS1 font encoding
+\newcommand*\tf@TSencodedosf{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}
+ \OR\equal{\tf@osf@method}{\TF@OSF@SC}}{
+ \renewcommand*\tf@osf@method{\TF@OSF@TS}
+ \tf@resetliningnumsenvironment
+ }{}
+}
+
+% Access old style figures by switching to small caps
+\newcommand*\tf@SCencodedosf{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}
+ \OR\equal{\tf@osf@method}{\TF@OSF@TS}}{
+ \renewcommand*\tf@osf@method{\TF@OSF@SC}
+ \tf@resetliningnumsenvironment
+ }{}
+}
+
+% Advise users that their selected font does not support old style figures
+\newcommand\TF@NativeOSFError{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}}{
+ \TF@PackageError{Option `typeface=\tf@rmfontname' does not\MessageBreak
+ support `textfigures=\tf@textfiguresfontname'.\MessageBreak
+ Setting `textfigures=false'}{}
+ \renewcommand*\tf@osf@method{\TF@OSF@LF}
+ \tf@resetliningnumsenvironment
+ \renewcommand*\tf@textfiguresfontname{false}
+ }{}
+}
+
+% Advise users that the selected font ONLY supports old style figures (rare!)
+\newcommand\TF@NativeLFError{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@LF}}{
+ \TF@PackageError{Option `typeface=\tf@rmfont' does not\MessageBreak
+ support `textfigures=\tf@textfiguresfontname' (default).\MessageBreak
+ Setting `textfigures=oldstylefigures'}{}
+ \renewcommand*\tf@osf@method{\TF@OSF@JF}
+ \tf@resetliningnumsenvironment
+ \renewcommand*\tf@textfiguresfontname{oldstylefigures}
+ }{}
+}
+
+% Advise users that their selected math font kills support for old style figures
+\newcommand\TF@NativeOSFMathError{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@JF}}{
+ \TF@PackageError{Option `typeface=\tf@rmfontname' does not\MessageBreak
+ support combining `mathtypeface=\tf@mathfontname'\MessageBreak
+ and `textfigures=\tf@textfiguresfontname'.\MessageBreak
+ Setting `textfigures=false'}{}
+ \renewcommand*\tf@osf@method{\TF@OSF@LF}
+ \tf@resetliningnumsenvironment
+ \renewcommand*\tf@textfiguresfontname{false}
+ }{}
+}
+
+% Set up our INTERNAL \tf@textstylenums declaration and the
+% AUTHOR textnums environment and \textstylenums command
+%----------------------------------------------------------
+\newcommand*\tf@initialise@textfiguresfontcommands{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@TS}}{
+ % Access old style figures via TS1 font encoding
+ \newcommand*\tf@textstylenums{%
+ \ifthenelse{\NOT\boolean{tf@liningnums}
+ \AND\NOT\boolean{tf@suppressfiguressubstitution}}{%
+ \ifbool{tf@debug}{\color{\TF@DEBUG@COLOUR@TS}}{}%
+ \fontencoding{TS1}\selectfont%
+ }{}%
+ }
+ }{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@SC}}{
+ % Access old style figures via small caps
+ \newcommand*\tf@textstylenums{%
+ \ifthenelse{\NOT\boolean{tf@liningnums}
+ \AND\NOT\boolean{tf@suppressfiguressubstitution}}{%
+ \ifbool{tf@debug}{\color{\TF@DEBUG@COLOUR@SC}}{}%
+ \scshape%
+ }{}%
+ }
+ }{
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@XF}}{
+ % Access old style figures via substitute font
+ \providecommand*\lsstyle{} % create no-op if microtype isn't loaded
+ \newcommand*\tf@textstylenums{%
+ \ifthenelse{\NOT\boolean{tf@liningnums}
+ \AND\NOT\boolean{tf@suppressfiguressubstitution}}{%
+ \ifthenelse{\NOT\equal{\tf@textfiguresspacing}{0}
+ \AND\value{tf@enable@textnumspacing} = 0}%
+ {\lsstyle}{}% % microtype-based text figures spacing
+ \ifbool{tf@debug}{\color{\TF@DEBUG@COLOUR@XF}}{}%
+ \notbool{tf@textfiguresscaledatloadtime}
+ {\scalefont{\tf@textfiguresscalefactor}}{}%
+ \fontencoding{\tf@substosffontencoding}%
+ \fontfamily{\tf@substosffont}%
+ \selectfont%
+ }{}%
+ }
+ }{
+ % Otherwise, access old style figures natively (i.e., deliver
+ % whatever the loaded font provides, which is either text
+ % figures or not)
+ \newcommand*\tf@textstylenums{%
+ \ifthenelse{\NOT\boolean{tf@liningnums}
+ \AND\NOT\boolean{tf@suppressfiguressubstitution}}{%
+ \ifbool{tf@debug}{\color{\TF@DEBUG@COLOUR@JF}}{}%
+ }{}%
+ }
+ }}}
+ \robustify{\tf@textstylenums}
+
+ % Define AUTHOR-LEVEL textnums environment
+ %-----------------------------------------
+ \newenvironment{textnums}{%
+ \tf@textstylenums%
+ }{}
+
+ % ... and AUTHOR-LEVEL \textstylenums (syn: \tsf) command
+ %--------------------------------------------------------
+ \newcommand\textstylenums[1]{%
+ \begingroup%
+ \begin{textnums}##1\end{textnums}%
+ \endgroup%
+ }
+
+ \newcommand\tsf[1]{%
+ \begingroup%
+ \begin{textnums}##1\end{textnums}%
+ \endgroup%
+ }
+
+ % ... and AUTHOR-LEVEL \liningstylenums (syn: \lsf) command
+ %----------------------------------------------------------
+ \newcommand\liningstylenums[1]{%
+ \begingroup%
+ \begin{liningnums}##1\end{liningnums}%
+ \endgroup%
+ }
+
+ \newcommand\lsf[1]{%
+ \begingroup%
+ \begin{liningnums}##1\end{liningnums}%
+ \endgroup%
+ }
+
+ % AUTHOR-LEVEL commands to enable/disable textnums letterspacing
+ % (uses a counter for reentrancy)
+ \newcounter{tf@enable@textnumspacing}
+ \newcommand*\enabletextnumspacing{\addtocounter{tf@enable@textnumspacing}{1}}
+ \newcommand*\disabletextnumspacing{\addtocounter{tf@enable@textnumspacing}{-1}}
+ \newcommand*\reenabletextnumspacing{\setcounter{tf@enable@textnumspacing}{0}}
+ \reenabletextnumspacing
+}
+
+% Typeface selection
+% ==================
+\TF@PackageDebugInfo{Loading typefaces in load order [\tf@fontloadorder] ...}
+
+% Font loading commands are (generally) processed in this order:
+% textfigures, symbols, math, roman, sans serif, teletype
+%
+% Where possible, fonts are loaded using std packages (\tf@usefontpackage{...}),
+% otherwise they are loaded via direct commands (\renewcommand\rmdefault{...}).
+% Many packages load "matching" fonts, e.g., one might load courier tt
+% alongside the rm font that it specifies. The typeface package attempts to
+% reverse this when it can in order to ensure that when users specify
+% particular fonts, that is in fact what they get, rather than, for example,
+% getting the "matching" font decided by a font package author some long time ago.
+%
+% Note that when loading multiple font packages one after the other, glyph
+% definitions can potentially collide. When this happens, later loaded
+% glyphs can (often silently) override earlier definitions or in other case
+% simply trigger errors. You should (must) always thoroughly check your output
+% pdf document to ensure that the body text, math, symbols and (potential) text
+% figures substitution fonts work together to produce desired results. Not all
+% combinations will produce satisfactory output.
+%
+% The "textfigures, symbols, math, roman, sans serif, teletype" font
+% load order should not be wholly relied upon. To obviate the "clash of
+% glyphs" problem as best we can, this package will, for example, load the
+% roman font family before loading math where a particular math package
+% requires the standard load ordering to change. We might even, in extreme
+% cases, load the roman font, then math, then to counteract a certain side
+% effect, reload roman to re-establish its original configuration. Specific
+% behavioural rules for individual situations are set out in the code above.
+% Bottom line, however: we try to achieve the combination of typefaces as the
+% end-user most likely intended.
+%------------------------------------------------------------------------------
+% Construct and execute font load commands macro in specified font load order
+\newcommand*\tf@loadfonts{}
+\renewcommand*\do[1]{
+ \ifcsdef{beforeloading#1}
+ {\g@addto@macro{\tf@loadfonts}{\csname beforeloading#1\endcsname}}{}
+ \g@addto@macro{\tf@loadfonts}{\csname tf@load#1typeface\endcsname}
+ \ifcsdef{afterloading#1}
+ {\g@addto@macro{\tf@loadfonts}{\csname afterloading#1\endcsname}}{}
+}
+\expandafter\tf@doColonSeparatedList\expandafter{\tf@fontloadorder}
+\tf@loadfonts
+
+% After loading fonts, set up font scaling ...
+\forcsvlist{\tf@initialise@fontscaling}{sf,tt,math,textfigures}
+
+% ... and math size declarations ...
+\tf@initialise@mathsizes
+
+% ... and textfigures font spacing ...
+\tf@initialise@textfiguresfontspacing
+
+% ... and text figures author-level commands
+\tf@initialise@textfiguresfontcommands
+
+% Finally, hook our work into LaTeX's font selection machinery
+% ============================================================
+
+\TF@PackageDebugInfo{Hooking font scaling into LaTeX commands ...}
+
+% Guard against the (presumably exceedingly unlikely) event where sf and
+% tt are 1) the same font, yet 2) are being scaled by different amounts
+\tf@newbool{tf@@sfttscaleconflict}{false}
+\ifthenelse{\equal{\tf@sfdefault}{\tf@ttdefault}}{
+ \@tempdima=\tf@sfscalefactor\p@
+ \@tempdimb=\tf@ttscalefactor\p@
+ \ifthenelse{\NOT\lengthtest{\@tempdima = \@tempdimb}}{
+ \booltrue{tf@@sfttscaleconflict}
+ \TF@PackageError{%
+ Requested sans serif and teletypewriter fonts are\MessageBreak
+ identical except for differing scale factors\MessageBreak
+ [sf=\tf@sfscalefactor, tt=\tf@ttscalefactor].\MessageBreak
+ **** This isn't going to work. Please help\MessageBreak
+ **** me out. I don't know what to do}{}
+ \global\boolfalse{tf@sfscaledatloadtime}
+ \global\boolfalse{tf@ttscaledatloadtime}
+ }{}
+}{}
+
+\def\empty@sfcnt#1{%
+ % Subclass LaTeX's default font size function, inserting sf/tt % TODO: confirm this works with lua, xetex
+ % scale factors into \optional@arg if it is empty at the time
+ \def\tf@@sizeinfofunction{#1}%
+ \tf@newbool{tf@@sffamily}{false}%
+ \tf@newbool{tf@@ttfamily}{false}%
+ \ifdefstrequal{\tf@sfdefault}{\f@family}{\booltrue{tf@@sffamily}}{}%
+ \ifdefstrequal{\tf@ttdefault}{\f@family}{\booltrue{tf@@ttfamily}}{}%
+ %
+ % Last chance for font load functions to affect load-time scaling
+ \tf@empty@sfcnt@hook%
+ %
+ % So long as it's empty, set \optional@arg to appropriate scale factor
+ \ifthenelse{\equal{\optional@arg}{}\AND\NOT\boolean{tf@@sfttscaleconflict}}{%
+ \ifthenelse{\boolean{tf@@sffamily}
+ \AND\NOT\equal{\tf@sfscalemethod}{\TF@NO@SCALE}}{%
+ \edef\optional@arg{\tf@sfscalefactor}%
+ \def\tf@@sizeinfofunction{\@font@info}%
+ \xdef\tf@sfscalemethod{\TF@FX@SCALE}%
+ \global\booltrue{tf@sfscaledatloadtime}%
+ \TF@PackageInfo{%
+ Scaling sf font `\curr@fontshape' (\tf@sfscalefactor*\f@size pt)}%
+ }{}%
+ \ifthenelse{\boolean{tf@@ttfamily}
+ \AND\NOT\equal{\tf@ttscalemethod}{\TF@NO@SCALE}}{%
+ \edef\optional@arg{\tf@ttscalefactor}%
+ \def\tf@@sizeinfofunction{\@font@info}%
+ \xdef\tf@ttscalemethod{\TF@FX@SCALE}%
+ \global\booltrue{tf@ttscaledatloadtime}%
+ \TF@PackageInfo{%
+ Scaling tt font `\curr@fontshape' (\tf@ttscalefactor*\f@size pt)}%
+ }{}%
+ }{}%
+ %
+ \@tempdimb \f@size\p@%
+ \ifx\optional@arg\@empty%
+ \else%
+ \@tempdimb \optional@arg\@tempdimb%
+ \tf@@sizeinfofunction{Font\space shape\space `\curr@fontshape'\space
+ will\space be\MessageBreak
+ scaled\space to\space size\space \the\@tempdimb}%
+ \fi%
+ \edef\external@font{\mandatory@arg\space at\the\@tempdimb}%
+}
+
+\tf@newbool{tf@suppressfiguressubstitution}{false}
+\newcommand*\enablefiguressubstitution{%
+ \boolfalse{tf@suppressfiguressubstitution}%
+}
+\newcommand*\disablefiguressubstitution{%
+ \booltrue{tf@suppressfiguressubstitution}%
+}
+
+\let\tf@oldrmfamily\rmfamily
+\renewrobustcmd\rmfamily{%
+ \enablefiguressubstitution% % we enable text figures substitution
+ \tf@oldrmfamily% % even if user has changed \rmdefault
+ \ifbool{tf@debug}{\color{\TF@DEBUG@COLOUR@RM}}{}%
+}
+
+\let\tf@oldsffamily\sffamily
+\renewrobustcmd\sffamily{%
+ \disablefiguressubstitution%
+ \tf@oldsffamily%
+ \ifbool{tf@debug}{\color{\TF@DEBUG@COLOUR@SF}}{}%
+}
+
+\let\tf@oldttfamily\ttfamily
+\renewrobustcmd\ttfamily{%
+ \disablefiguressubstitution%
+ \tf@oldttfamily%
+ \ifbool{tf@debug}{\color{\TF@DEBUG@COLOUR@TT}}{}%
+}
+
+% Provide AUTHOR level read-only access to several internal values
+%-----------------------------------------------------------------
+\xdef\rmprintname{\tf@rmprintname}
+\xdef\sfprintname{\tf@sfprintname}
+\xdef\ttprintname{\tf@ttprintname}
+\xdef\mathprintname{\tf@mathprintname}
+\xdef\symbolsprintname{\tf@symbolsprintname}
+\xdef\textfiguresprintname{\tf@textfiguresprintname}
+
+% Package info and typeface testing commands
+% ==========================================
+
+\ifbool{tf@printinfo}{
+ \TF@PackageDebugInfo{Configuring print info commands...}
+
+ \@ifpackageloaded{array}{\relax}{\usepackage{array}}
+ \everymath=\expandafter{%
+ \the\everymath%
+ \ifbool{tf@debug}{\color{\TF@DEBUG@COLOUR@MATH}}{}%
+ }
+
+ \providecommand*\tfabc{abcdefghijklmnopqrstuvwxyz}
+ \providecommand*\tfABC{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
+ \providecommand*\tfdigits{0123456789}
+ \providecommand*\tftext{abcdefghijklmnopqrstuvwxyz %
+ ct st th ff fi fj fl ffi ffl ft ij \ae\ \oe\ \"o\ \~e\ wavaw %
+ {\large large} {\footnotesize footnotesize}}
+ \providecommand*\tfTEXT{ABCDEFGHIJKLMNOPQRSTUVWXYZ %
+ Ct St Th Ff Fi Fj Fl Ffi Ffl IJ \AE\ \OE\ \"O\ \~E\ WAVAW}
+ \providecommand*\tfpunctuation{\$ \% . , : ; ? \& ! \# = ( \_ ) + - -- ---}
+
+ \newcommand\tfprintinfopage{%
+ \pagestyle{empty}%
+ \raggedbottom%
+ \tfprintpackageoptions%
+ \tfprintinfo%
+ \tfprinttext{rm}%
+ \tfprinttext{sf}%
+ \tfprinttext{tt}%
+ \tfprintfigures{rm}%
+ \tfprinttextalphabets%
+ }
+
+ \newcommand*\tf@@printfontname[1]{% % helper command
+ \ifthenelse{
+ \equal{\csname tf@#1fontdefaultstatus\endcsname}{\TF@IMPLICITDEFAULT}}{%
+ <\TF@DEFAULT> \tf@@printfontname@@helper{#1}%
+ }{%
+ \ifthenelse{
+ \equal{\csname tf@#1fontdefaultstatus\endcsname}{\TF@EXPLICITDEFAULT}}{%
+ \TF@DEFAULT\space\tf@@printfontname@@helper{#1}%
+ }{%
+ \ifthenelse{
+ \equal{\csname tf@#1fontdefaultstatus\endcsname}{\TF@EXPLICITOTHER}}{%
+ \csname tf@#1fontname\endcsname%
+ }{}}}
+ }
+
+ \newcommand*\tf@@printfontname@@helper[1]{% % helper of helper command
+ \ifthenelse{\NOT\equal{\csname tf@#1fontname\endcsname}{\TF@DEFAULT}}
+ {(\csname tf@#1fontname\endcsname\space-- see `\TF@CONFIGFILE')}
+ {}%
+ }
+
+ \newcommand\tfprintpackageoptions{{%
+ \rmfamily\selectfont\noindent%
+ \texttt{typeface}\ package options:\par\noindent%
+ \begin{tabular}{@{}
+ >{\ttfamily}l
+ >{\ttfamily}l@{\hspace{2.5em}}
+ >{\ttfamily}l
+ >{\ttfamily}l@{}}
+%------------------------------------------------------------------------------
+ typeface & \tf@@printfontname{rm} &
+ fontencoding &
+ \ifthenelse{\equal{\tf@fontencodingdefaultstatus}{\TF@IMPLICITDEFAULT}}{%
+ <\TF@DEFAULT> (\TF@DEFAULTFONTENCODING)%
+ }{%
+ \tf@fontencodingstring\space%
+ \ifthenelse{\equal{\tf@fontencodingdefaultstatus}{\TF@EXPLICITDEFAULT}
+ \OR\value{tf@fontencodingsuboptionscount} > 1}{%
+ (\tf@fontencodingprimary)%
+ }{}%
+ } \\
+%------------------------------------------------------------------------------
+ textfigures & \tf@@printfontname{textfigures}%
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@TS}}
+ {(TS1)}
+ {\ifthenelse{\equal{\tf@osf@method}{\TF@OSF@SC}}
+ {(smallcaps)}
+ {}%
+ } &
+ inputencoding &
+ \ifthenelse{\equal{\tf@inputencodingdefaultstatus}{\TF@IMPLICITDEFAULT}}{%
+ <\TF@DEFAULT> (\TF@DEFAULTINPUTENCODING)%
+ }{%
+ \tf@inputencodingstring\space%
+ \ifthenelse{\equal{\tf@inputencodingdefaultstatus}{\TF@EXPLICITDEFAULT}}{%
+ (\tf@inputencoding)%
+ }{}%
+ } \\
+%------------------------------------------------------------------------------
+ sanstypeface & \tf@@printfontname{sf} &
+ textcomp &
+ \ifthenelse{\equal{\tf@textcompdefaultstatus}{\TF@IMPLICITDEFAULT}}{%
+ <\TF@DEFAULT> (\TF@DEFAULTTEXTCOMP)%
+ }{%
+ \tf@textcompstring\space%
+ \ifthenelse{\equal{\tf@textcompdefaultstatus}{\TF@EXPLICITDEFAULT}}{%
+ (\tf@textcomp)%
+ }{}%
+ } \\
+%------------------------------------------------------------------------------
+ monotypeface & \tf@@printfontname{tt} &
+ fontloadorder & \ifbool{tf@fontloadorderimplicit}{<}{}%
+ \ifthenelse{\equal{\tf@fontloadorder}{\TF@DEFAULTFONTLOADORDER}}
+ {\TF@DEFAULT}
+ {\tf@fontloadorder}%
+ \ifbool{tf@fontloadorderimplicit}{>}{} \\
+%------------------------------------------------------------------------------
+ mathtypeface & \tf@@printfontname{math} &
+ printinfo & \ifbool{tf@printinfoimplicit}{<}{}%
+ \ifbool{tf@printinfo}{true}{false}%
+ \ifbool{tf@printinfoimplicit}{>}{} \\
+%------------------------------------------------------------------------------
+ symbolstypeface & \tf@@printfontname{symbols} &
+ debug & \ifbool{tf@debugimplicit}{<}{}%
+ \ifbool{tf@debug}{true}{false}%
+ \ifbool{tf@debugimplicit}{>}{} \\
+%------------------------------------------------------------------------------
+ \end{tabular}%
+ \par\medskip%
+ }}
+
+ \newcommand\tfprintinfo{{%
+ \noindent%
+ \begin{tabular}{@{}lllrrrl@{}}
+ \ttfamily Family & \ttfamily Typeface & \ttfamily \TeX\ Name &
+ \ttfamily em size & \ttfamily ex size &
+ \ttfamily scale & \ttfamily scale time \\
+ \rmfamily Roman &
+ \rmfamily \tf@rmprintname &
+ \rmfamily \fontname\the\font &
+ \rmfamily \tf@roundvi@pt{\the\fontdimen6\font} &
+ \rmfamily \tf@roundvi@pt{\the\fontdimen5\font} &
+ \rmfamily \tf@roundvi{1}%
+ \ifthenelse{\NOT\equal{\tf@rmscale}{\TF@UNSCALED}}
+ { [$\times$\tf@roundvi{\tf@rmscale}]}{} &
+ \rmfamily not scaled
+ \\
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@XF}}{%
+ \rmfamily Text figures &
+ \rmfamily \tf@textfiguresprintname &
+ % NB, the following group will print gobbledegook if the
+ % \tf@substosffont typeface doesn't properly map non-numeral chars to
+ % standard print glyphs (e.g., see using textfigures=latinmodern)
+ \begingroup%
+ \ifbool{tf@debug}{\color{\TF@DEBUG@COLOUR@XFNAME}}{}%
+ \notbool{tf@textfiguresscaledatloadtime}{%
+ \scalefont{\tf@textfiguresscalefactor}%
+ }{}%
+ \fontencoding{\tf@substosffontencoding}%
+ \fontfamily{\tf@substosffont}\selectfont\fontname\the\font%
+ \endgroup &
+ \rmfamily \begin{textnums}\tf@roundvi{\strip@pt\fontdimen6\font}\end{textnums}pt &
+ \rmfamily \begin{textnums}\tf@roundvi{\strip@pt\fontdimen5\font}\end{textnums}pt &
+ \rmfamily \begin{textnums}\tf@roundvi{\tf@textfiguresscalefactor}\end{textnums}&
+ \rmfamily \ifthenelse{\equal{\tf@textfiguresscalemethod}{\TF@NO@SCALE}
+ \OR\equal{\tf@textfiguresscalefactor}{\TF@UNSCALED}}
+ {not scaled}
+ {\ifbool{tf@textfiguresscaledatloadtime}{load time}{run time}}
+ \\
+ }{}%
+ \sffamily Sans Serif &
+ \sffamily \tf@sfprintname &
+ \sffamily \fontname\the\font &
+ \sffamily \tf@roundvi@pt{\the\fontdimen6\font} &
+ \sffamily \tf@roundvi@pt{\the\fontdimen5\font} &
+ \sffamily \tf@roundvi{\tf@sfscalefactor} &
+ \sffamily \ifthenelse{\equal{\tf@sfscalemethod}{\TF@NO@SCALE}
+ \OR\equal{\tf@sfscalefactor}{\TF@UNSCALED}}
+ {not scaled}
+ {\ifbool{tf@sffontdirty}{run time}{load time}}
+ \\
+ \ttfamily Typewriter &
+ \ttfamily \tf@ttprintname &
+ \ttfamily \fontname\the\font &
+ \ttfamily \tf@roundvi@pt{\the\fontdimen6\font} &
+ \ttfamily \tf@roundvi@pt{\the\fontdimen5\font} &
+ \ttfamily \tf@roundvi{\tf@ttscalefactor} &
+ \ttfamily \ifthenelse{\equal{\tf@ttscalemethod}{\TF@NO@SCALE}
+ \OR\equal{\tf@ttscalefactor}{\TF@UNSCALED}}
+ {not scaled}
+ {\ifbool{tf@ttfontdirty}{run time}{load time}}
+ \\
+ \rmfamily Math &
+ \rmfamily $\tf@mathprintname$ &
+ \rmfamily $\fontname\textfont\tf@mathfontfamily$ &
+ \rmfamily $\tf@roundvi@pt{\the\fontdimen6\textfont\tf@mathfontfamily}$ &
+ \rmfamily $\tf@roundvi@pt{\the\fontdimen5\textfont\tf@mathfontfamily}$ &
+ \rmfamily $\tf@roundvi{\tf@mathscalefactor}$ &
+ \rmfamily \ifthenelse{\equal{\tf@mathscalemethod}{\TF@NO@SCALE}
+ \OR\equal{\tf@mathscalefactor}{\TF@UNSCALED}}
+ {not scaled}
+ {\ifbool{tf@mathscaledatloadtime}{load time}{run time}}
+ \\
+ \rmfamily Symbols &
+ \multicolumn{4}{l}{\rmfamily $\tf@symbolsprintname$} & &
+ \rmfamily \ifthenelse{\equal{\tf@mathscalemethod}{\TF@NO@SCALE}
+ \OR\equal{\tf@mathscalefactor}{\TF@UNSCALED}}
+ {not scaled}
+ {\ifbool{tf@mathscaledatloadtime}{load time}{run time}}
+ \\
+ \end{tabular}%
+ \par\medskip%
+ }}
+
+ \newcommand\tfprinttext[1]{{%
+ \ifthenelse{\equal{#1}{rm}}{
+ \newcommand\tf@nums{\begin{textnums}0123456789\end{textnums}}
+ \newcommand\tf@NUMS{\begin{liningnums}0123456789\end{liningnums}}
+ }{
+ \newcommand\tf@nums{0123456789}
+ \newcommand\tf@NUMS{}
+ }%
+ \csname #1family\endcsname\selectfont\noindent%
+ \begin{tabular}{@{}>{\csname #1family\endcsname\selectfont}l
+ >{\csname #1family\endcsname\selectfont}l@{}}%
+ `#1' family: & \ifthenelse{\equal{#1}{rm}}{\tf@rmprintname}{}%
+ \ifthenelse{\equal{#1}{sf}}{\tf@sfprintname}{}%
+ \ifthenelse{\equal{#1}{tt}}{\tf@ttprintname}{}\\
+ Normal: & \tftext\ \tf@nums \\
+ & \tfTEXT\ \tf@NUMS \\
+ \textbf{Bold:} & \textbf{\tftext\ \tf@nums}\\
+ & \textbf{\tfTEXT\ \tf@NUMS}\\
+ \textit{Italic:} & \textit{\tftext\ \tf@nums}\\
+ & \textit{\tfTEXT\ \tf@NUMS}\\
+ \textsl{Slant:} & \textsl{\tftext\ \tf@nums}\\
+ & \textsl{\tfTEXT\ \tf@NUMS}\\
+ \textsc{Smallcaps:} & \textsc{\tftext\ \tf@nums}\\
+ & \textsc{\tfTEXT\ \tf@NUMS}\\
+ Variants: & {\fontseries{l}\selectfont Light}
+ {\fontseries{c}\selectfont Condensed}
+ {\fontseries{m}\selectfont Medium}
+ {\fontseries{sb}\selectfont Semi-bold}
+ {\fontseries{b}\selectfont Bold}
+ {\fontseries{bx}\selectfont Bold-extended}
+ {\scshape\bfseries Bold-Smallcaps}
+ {\fontseries{eb}\selectfont Extra-bold}\\
+ \end{tabular}%
+ \par\medskip%
+ }}
+
+ \newcommand\tfprintfigures[1]{{%
+ \csname #1family\endcsname\selectfont\noindent%
+ \begin{tabular}{@{}>{\rmfamily}l>{\rmfamily}l>{\rmfamily}l
+ >{\rmfamily}l>{\rmfamily}l>{\rmfamily}l
+ >{\rmfamily}l>{\rmfamily}l@{}}
+ & Normal & Italics & Bold & Bold Italics & Punctuation \\
+ Plain numerals: &
+ 0123456789 &
+ \textit{0123456789} &
+ \textbf{0123456789} &
+ \textbf{\textit{0123456789}} &
+ \tfpunctuation \\
+ $Math$: &
+ $0123456789$ &
+ $\mathit{0123456789}$ &
+ $\mathbf{0123456789}$ &
+ $\mathbf{\mathit{0123456789}}$ &
+ $\tfpunctuation$ \\
+ \texttt{\textbraceleft liningnums\textbraceright}: &
+ \begin{liningnums}0123456789\end{liningnums} &
+ \textit{\begin{liningnums}0123456789\end{liningnums}} &
+ \textbf{\begin{liningnums}0123456789\end{liningnums}} &
+ \textbf{\textit{\begin{liningnums}0123456789\end{liningnums}}} &
+ \begin{liningnums}\tfpunctuation\end{liningnums} \\
+ \texttt{\textbraceleft textnums\textbraceright}%
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@TS}\AND\equal{#1}{rm}}
+ { (TS1)}
+ {\ifthenelse{\equal{\tf@osf@method}{\TF@OSF@SC}\AND\equal{#1}{rm}}
+ { (smallcaps)}{}}: &
+ \begin{textnums}0123456789\end{textnums} &
+ \textit{\begin{textnums}0123456789\end{textnums}} &
+ \textbf{\begin{textnums}0123456789\end{textnums}} &
+ \textbf{\textit{\begin{textnums}0123456789\end{textnums}}} &
+ \begin{textnums}\tfpunctuation\end{textnums} \\
+ \texttt{\textbackslash textstylenums}%
+ \ifthenelse{\equal{\tf@osf@method}{\TF@OSF@TS}\AND\equal{#1}{rm}}
+ { (TS1)}
+ {\ifthenelse{\equal{\tf@osf@method}{\TF@OSF@SC}\AND\equal{#1}{rm}}
+ { (smallcaps)}{}}: &
+ \textstylenums{0123456789} &
+ \textit{\textstylenums{0123456789}} &
+ \textbf{\textstylenums{0123456789}} &
+ \textbf{\textit{\textstylenums{0123456789}}} &
+ \textstylenums{\tfpunctuation} \\
+ \texttt{\textbackslash oldstylenums}: &
+ \oldstylenums{0123456789} &
+ \textit{\oldstylenums{0123456789}} &
+ \textbf{\oldstylenums{0123456789}} &
+ \textbf{\textit{\oldstylenums{0123456789}}} &
+ \oldstylenums{\tfpunctuation} \\
+ \texttt{\textbackslash oldstylenums} (TS1): &
+ {\fontencoding{TS1}\selectfont0123456789} &
+ {\fontencoding{TS1}\selectfont\textit{0123456789}} &
+ {\fontencoding{TS1}\selectfont\textbf{0123456789}} &
+ {\fontencoding{TS1}\selectfont\textbf{\textit{0123456789}}} &
+ {\fontencoding{TS1}\selectfont\tfpunctuation} \\
+ \end{tabular}%
+ \par\medskip%
+ }}
+
+ \newcommand\tfprinttextalphabets{{%
+ \setlength{\parindent}{0pt}
+ $acegmnopqrsuvwxyz$%
+ \textrm{acegmnopqrsuvwxyz}%
+ \textsf{acegmnopqrsuvwxyz}%
+ \texttt{acegmnopqrsuvwxyz}\ %
+ $bdfhijklt$%
+ \textrm{bdfhijklt}%
+ \textsf{bdfhijklt}%
+ \texttt{bdfhijklt}\\%
+ $\tfABC$\textrm{\tfABC}\textsf{\tfABC}\texttt{\tfABC}\\%
+ $\tfdigits$\textrm{\tfdigits}\textsf{\tfdigits}\texttt{\tfdigits}%
+ }\par\medskip%
+ }
+
+ \newcommand\tfprinttextsample[1]{{%
+ \csname #1family\endcsname\selectfont\noindent%
+ Rank-dependent utility theories, introduced for objective probabilities
+ by Quiggin (\begin{textnums}1981\end{textnums};
+ \begin{textnums}1982\end{textnums}) and for subjective distributions by
+ Schmeidler (\begin{textnums}1989\end{textnums}), reconfigure $p$ to
+ accommodate findings that actual choice behaviours often differ
+ systematically from that predicted by classical expected utility
+ theories (for example, see Allais, \begin{textnums}1953\end{textnums};
+ Ellsberg, \begin{textnums}1961\end{textnums}; Lichtenstein \& Slovic,
+ \begin{textnums}1971\end{textnums}; H\"{u}fflefjord,
+ \begin{textnums}2004\end{textnums}). These theories accomplish their
+ task in two interrelated ways:\ first by discarding the ``linearity of
+ the probabilities'' restriction imposed by the standard rationality
+ assumptions, second by employing more of the information available to
+ individuals at decision-making time.\par\medskip%
+ }}
+
+ \newcommand\tfprintmathalphabets[1]{{%
+ \csname #1family\endcsname\selectfont\noindent%
+ \edef\longestword{calligraphic:\ \ }%
+ \ifundef{\mathbb}{}
+ {\rlap{blackboard:}\phantom{\longestword}$\mathbb\tfABC$\\}%
+ \ifundef{\mathcal}{}
+ {\rlap{calligraphic:}\phantom{\longestword}$\mathcal\tfABC$\\}%
+ \ifundef{\mathfrak}{}
+ {\rlap{fraktur:}\phantom{\longestword}$\mathfrak\tfABC%
+ \quad\mathfrak\tfabc$\\}%
+ \rlap{greek:}\phantom{\longestword}$%
+ \Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega%
+ \quad%
+ \alpha\beta\gamma%
+ \ifundef{\digamma}{.}{\digamma}%
+ \delta\epsilon%
+ \ifundef{\varepsilon}{.}{\varepsilon}%
+ \zeta\eta\theta%
+ \ifundef{\vartheta}{.}{\vartheta}%
+ \iota\kappa%
+ \ifundef{\varkappa}{.}{\varkappa}%
+ \lambda\mu\nu\xi\pi%
+ \ifundef{\varpi}{.}{\varpi}%
+ \rho%
+ \ifundef{\varrho}{.}{\varrho}%
+ \sigma%
+ \ifundef{\varsigma}{.}{\varsigma}%
+ \tau%
+ \ifundef{\varphi}{.}{\varphi}%
+ \upsilon\phi\chi\psi\omega%
+ $\\%
+ \ifthenelse{\NOT\isundefined{\alphaup}}{%
+ \phantom{\longestword$%
+ \Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega%
+ \quad$}$%
+ \ifundef{\alphaup}{.}{\alphaup}%
+ \ifundef{\betaup}{.}{\betaup}%
+ \ifundef{\gammaup}{.}{\gammaup}%
+ \ifundef{\digammaup}{.}{\digammaup}%
+ \ifundef{\deltaup}{.}{\deltaup}%
+ \ifundef{\epsilonup}{.}{\epsilonup}%
+ \ifundef{\varepsilonup}{.}{\varepsilonup}%
+ \ifundef{\zetaup}{.}{\zetaup}%
+ \ifundef{\etaup}{.}{\etaup}%
+ \ifundef{\thetaup}{.}{\thetaup}%
+ \ifundef{\varthetaup}{.}{\varthetaup}%
+ \ifundef{\iotaup}{.}{\iotaup}%
+ \ifundef{\kappaup}{.}{\kappaup}%
+ \ifundef{\varkappaup}{.}{\varkappaup}%
+ \ifundef{\lambdaup}{.}{\lambdaup}%
+ \ifundef{\muup}{.}{\muup}%
+ \ifundef{\nuup}{.}{\nuup}%
+ \ifundef{\xiup}{.}{\xiup}%
+ \ifundef{\piup}{.}{\piup}%
+ \ifundef{\varpiup}{.}{\varpiup}%
+ \ifundef{\rhoup}{.}{\rhoup}%
+ \ifundef{\varrhoup}{.}{\varrhoup}%
+ \ifundef{\sigmaup}{.}{\sigmaup}%
+ \ifundef{\varsigmaup}{.}{\varsigmaup}%
+ \ifundef{\tauup}{.}{\tauup}%
+ \ifundef{\varphiup}{.}{\varphiup}%
+ \ifundef{\upsilonup}{.}{\upsilonup}%
+ \ifundef{\phiup}{.}{\phiup}%
+ \ifundef{\chiup}{.}{\chiup}%
+ \ifundef{\psiup}{.}{\psiup}%
+ \ifundef{\omegaup}{.}{\omegaup}%
+ $\\%
+ }{}%
+ \par\vspace{-0.5\baselineskip}%
+ }}
+
+ \newcommand\tfprintmathfonts{{%
+ \noindent%
+ \parbox{\linewidth}{\ttfamily\selectfont%
+ \count255=0
+ \textbf{Math fonts:}
+ \loop\ifnum\count255<15
+ \the\count255.~\fontname\textfont\count255;
+ \advance\count255 by 1
+ \repeat
+ \the\count255.~\fontname\textfont\count255.
+ }\par%
+ }}
+
+ \newcommand\tfprintmathsample[1]{{%
+ \ifundef{\Res}{%
+ \edef\Res{\mathop{\operator@font Res}\nolimits}%
+ }{}%
+ \csname #1family\endcsname\selectfont\noindent%
+ \textbf{Theorem 1 (Residue Theorem)} % Credit: Hartke
+ Let $f$ be analytic in the region $G$ except for the isolated
+ singularities $a_1,a_2,\ldots,a_m$. If $\gamma$ is a closed rectifiable
+ curve in $G$ which does not pass through any of the points $a_k$ and if
+ $\gamma\approx 0$ in $G$ then
+ \begin{equation}\ifbool{tf@debug}{\color{\TF@DEBUG@COLOUR@MATH}}{}%
+ \frac{1}{2\pi i}\int_\gamma f = \sum_{k=1}^m n(\gamma;a_k)
+ \Res(f;a_k)\qquad\pi=3.1415926\dots
+ \end{equation}%
+ }}
+}{
+ % Stub print info definitions for whenever package option printinfo=false
+ %------------------------------------------------------------------------
+ \newcommand\tfprintinfopage{}
+ \newcommand\tfprintpackageoptions{}
+ \newcommand\tfprintinfo{}
+ \newcommand\tfprinttext[1]{}
+ \newcommand\tfprintfigures[1]{}
+ \newcommand\tfprinttextalphabets{}
+ \newcommand\tfprinttextsample[1]{}
+ \newcommand\tfprintmathalphabets[1]{}
+ \newcommand\tfprintmathsample[1]{}
+}
+
+\renewcommand*\familydefault{\rmdefault} % override any package-induced change
+\rmfamily
+
+\TF@PackageDebugInfo{... package loaded}
+%
+%============================== end typeface.sty ==============================
diff --git a/macros/latex/contrib/typeface/typeface.tex b/macros/latex/contrib/typeface/typeface.tex
new file mode 100644
index 0000000000..c12f11d284
--- /dev/null
+++ b/macros/latex/contrib/typeface/typeface.tex
@@ -0,0 +1,1067 @@
+% $Id: typeface.tex 907 2012-06-18 04:42:32Z Geoffrey $
+%
+% typeface.tex Copyright (C) 2012 Geoffrey Jones
+
+\documentclass[oneside,a4paper]{ltxdockit}[2010/09/26]
+
+\RequirePackage[typeface=adobeminionpro,
+ sanstypeface=adobemyriadpro,
+ monotypeface=latinmodern,
+ textfigures=oldstylefigures,
+ inputencoding=dontload, % already loaded by ltxdockit
+ textcomp=dontload, % ditto
+ ]{typeface}
+
+\usepackage[
+% showframe,
+]{geometry}
+
+\geometry{
+ bindingoffset = 3em,
+ marginparsep = 0.5em,
+ vmarginratio = 9:10,
+ headheight = 5ex,
+ headsep = 2ex,
+ footskip = 6ex,
+ hcentering,
+}
+
+\usepackage{calc}
+\geometry{width = 154mm,
+ height = 154mm * \real{1.61803}} % golden ratio
+\setlength{\parindent}{0pt}
+% \flushbottom
+
+\usepackage{ragged2e}
+\usepackage{xspace}
+\usepackage{fancyhdr}
+\fancypagestyle{plain}{%
+ \fancyhf{}
+ \fancyfoot[C]{\liningstylenums{\thepage}}
+ \renewcommand{\headrulewidth}{0pt}
+ \renewcommand{\footrulewidth}{0pt}
+}
+\pagestyle{plain}
+
+\usepackage[babel]{microtype}
+\usepackage[american]{babel}
+\usepackage[strict]{csquotes}
+\MakeAutoQuote{«}{»}
+\MakeAutoQuote*{<}{>}
+
+\usepackage{shortvrb}
+\MakeShortVerb{\|}
+
+\newrobustcmd*\keyword[1]{\mbox{\verbatimfont#1}}
+\newrobustcmd*\typei{\keyword{Type1}\xspace}
+
+\usepackage[dvipsnames,svgnames,x11names]{xcolor}
+\definecolor{spot}{named}{MidnightBlue}
+\definecolor{optspot}{named}{MidnightBlue}
+\definecolor{option}{named}{black}
+\definecolor{suboption}{named}{black}
+
+\renewrobustcmd*{\opt}[1]{\mbox{\color{option}\verbatimfont#1}}
+\newrobustcmd*{\subopt}[1]{\mbox{\color{suboption}\verbatimfont#1}}
+\newrobustcmd*{\optlabel}[1]{\mbox{\color{optspot}\verbatimfont#1}}
+
+\usepackage{caption}
+\usepackage{booktabs}
+\usepackage{needspace}
+\usepackage{enumitem}
+\usepackage{placeins}
+
+\usepackage{tabularx}
+\newcolumntype{H}{>{\sffamily\bfseries\spotcolor}l}
+\newcolumntype{P}{>{\raggedright}l}
+\newcommand*\colA[1]{\textrm{#1}}
+
+\lstset{xleftmargin=1em,aboveskip=\medskipamount,belowskip=\medskipamount}
+
+\newcommand*\OR{\thinspace\textbar\thinspace}
+\newcommand*\np{\vspace{0.3\baselineskip}\\\noindent} % don't ask
+\newcommand*\example[1]{\bigskip\emph{Example #1.}\smallskip}
+\makeatletter
+\newcommand*\tfrmfont{\tf@rmfont}
+\renewcommand*\@makefntext[1]{%
+ \hskip-1.2em%
+ \leftskip=1.2em%
+ \makebox[1.2em][l]{\@thefnmark}#1%
+}
+\setlength{\@fptop}{0pt}
+\makeatother
+
+\usepackage{dtklogos}
+\newcommand*\LaTeXiie{%
+ \LaTeX{}\kern.0em\liningstylenums{2}$_{\textstyle\varepsilon}$}
+\newcommand*\LaTeXiii{%
+ \LaTeX{}\kern.0em\liningstylenums{3}}
+
+\titlepage{%
+ title={The \sty{typeface} Package},
+ subtitle={A package for simplifying \LaTeX\space \typei font setup},
+ url={http://www.ctan.org/tex-archive/macros/latex/contrib/typeface/},
+ author={Geoffrey Jones},
+ email={geoffrey.jones@uqconnect.edu.au},
+ revision={\liningstylenums{0.1} (preliminary release)},
+ date={\liningstylenums{18 June 2012}}
+}
+
+\hypersetup{%
+ pdftitle={The typeface Package},
+ pdfsubject={A package for simplifying LaTeX Type1 font setup},
+ pdfauthor={Geoffrey Jones},
+ pdfkeywords={typeface, font, fonts, type1, pdf}
+}
+
+\begin{document}
+
+\printtitlepage
+\tableofcontents
+
+\section{Introduction}
+\label{sec:intro}
+
+\subsection[About typeface]{About \sty{typeface}}
+
+The \sty{typeface} package provides a relatively simple facility for setting up default roman, sans serif, teletype, math, symbols and lining/text figures \typei fonts in \LaTeX\space documents. Its purpose is to make it as easy as possible to mix, match, scale, test and use whatever combinations you might like from the main \typei font sets available at \acr{CTAN}\fnurl{http://www.ctan.org/tex-archive/fonts}. Other \typei fonts can be readily integrated into \sty{typeface} package management by modifying the provided configuration file.
+\np%
+As a document font manager, \sty{typeface} bears certain similarities to Will Robertson's and Khaled Hosny's more extensive \href{http://ctan.org/tex-archive/macros/latex/contrib/fontspec}{fontspec} package. While the role of \sty{typeface} is to simplify configuring and loading document default \typei fonts, \sty{fontspec}'s purpose is to simplify most things connected with using \keyword{OpenType} and, to some extent, \keyword{TrueType} fonts. However, unlike \sty{fontspec} which cannot be used under \LaTeX, with a few restrictions, \sty{typeface} performs as advertised under \LuaTeX\space and \XeTeX. That said, each package has its natural role and home environment---\sty{typeface} for simplifying setting up default \typei fonts in \LaTeX\space documents, and \sty{fontspec} for managing \keyword{OpenType} fonts in \LuaTeX\space and \XeTeX\space documents.
+
+\subsubsection{Motivation}
+
+This work is grounded in the observation that, despite the tremendous strides that have been made by more modern \TeX\space engines and compilation formats, \LaTeX\footnote{By which I mean \LaTeXiie, including reasonably strict supersets such as \LaTeXiii.} remains a document production mainstay for many individuals, institutions and publication houses. Given this and its relative stability, things will most likely remain this way for some time to come. However, the task of setting up fonts in \LaTeX\space documents all too frequently takes more effort than it reasonably should. The approaches for loading fonts typically depend more on the programming styles of font package authors than on actual necessity---given, that is, that relevant font loading packages even exist. The Berry names\fnurl{http://www.tug.org/fontname/fontname.pdf} for individual typefaces can prove frustrating to recall when using fonts that have not been thus supplied. The methods for scaling fonts can often prove exasperating to remember and apply. Worse, font scaling is often not included as a load-time option in font loading packages or font descriptor (\file{.fd}) files. For such a routine task, scaling one font to match another is seldom, if ever, automated. Notwithstanding the \ae sthetic appropriateness of the task, freely mixing and matching combinations of text and math typefaces can prove technically difficult to get right. Switching between text figures (\begin{textnums}12345\end{textnums}) and lining figures (\begin{liningnums}12345\end{liningnums}) is often so burdensome that \LaTeX\space users all too often give up, preferring to render body text, titles and adornments like page numbers equally, either in all lining figures or in all text figures.%
+\footnote{\LaTeX's native \cmd{oldstylenums} command provides some support for this. Unfortunately, it is surrounded by several noteworthy limitations, including patchy coverage across the breadth of \typei fonts and missing reciprocal function (\cmd{liningstylenums}?).}
+Nevertheless, the beauty of a finished \LaTeX\space document typeset with well-configured fonts can make memories of the frustrations that went into creating it quickly recede. The \sty{fontspec} package overcomes many of these difficulties in the \LuaTeX\space and \XeTeX\space worlds. This work sets out to reduce the effort of default \typei font setup in the \LaTeX\space world.
+
+\subsection{License}
+
+Copyright \textcopyright\ 2011--2012 Geoffrey Jones. Permission is granted to copy, distribute and\slash or modify this software under the terms of the \lppl, version 1.3 or later.\fnurl{http://www.ctan.org/tex-archive/macros/latex/base/lppl.txt} This package is author"=maintained.
+
+\subsection{About this Manual}
+
+This manual was compiled using Philipp Lehman's \sty{ltxdockit} document class. Document fonts were specified with the following command:
+
+\begin{ltxcode}
+\RequirePackage[typeface=<<adobeminionpro>>,
+ sanstypeface=<<adobemyriadpro>>,
+ monotypeface=<<latinmodern>>,
+ textfigures=<<oldstylefigures>>
+ ]{typeface}
+\end{ltxcode}
+
+As Adobe Myriad Pro, at least, is not a readily available Postscript \typei font, you might need to make substitutions before regenerating this document.
+\np%
+As an early aside, note as you read this manual that the \sty{typeface} package was not instructed about font scaling. Rather, during loading, the \sty{typeface} package automatically scaled the \textsf{sans serif} and \texttt{teletype} font ex-heights to match the roman font ex-height size.
+
+\subsection{Package Contents}
+\label{sec:pkgcontents}
+
+The \sty{typeface} package contains the following files:
+ \begin{itemize}[noitemsep]
+ \item \file{README}---the package README file
+ \item \file{typeface.pdf}---the package manual (this document)
+ \item \file{typeface.tex}---the package manual source
+ \item \file{typeface.sty}---the \sty{typeface} package
+ \item \file{typeface.cfg}---installation customisation and reconfiguration file
+ \item \file{typeface-test.tex}---\sty{typeface} package test harness
+ \item \file{typeface-all-rm.pdf}---a \emph{very} large typeface exhibits file (\begin{liningnums}16\end{liningnums}MB or thereabouts)
+ \item \file{typeface-all-rm.bat}---the \acr{ms-dos} script used to produce the file above
+ \end{itemize}
+
+\subsection{Installation}
+
+Installation involves placing \file{typeface.sty} somewhere in your \file{texmf} tree then rehashing \TeX's name database using \keyword{texhash} or whatever. These actions are performed automatically if you install this package using \MiKTeX's or \TeXLive's system package managers.
+\np%
+Likewise, configuration file \file{typeface.cfg} should be placed in a suitable location in your system or local \file{texmf} trees, re-\keyword{texhash}-ing when you are done. Alternatively, you could save a customised version of \file{typeface.cfg} in your document directory should your document have highly particular \sty{typeface} configuration needs.
+
+\begin{enumerate}[leftmargin=0em,itemindent=0em,labelsep=0.5em]
+ \item[\emph{Caveat}:] Please take extra precautions to ensure any site-local versions of \file{typeface.cfg} are not overwritten if using \MiKTeX's or \TeXLive's system package managers. As usual, versioning or otherwise backing up your configuration files might prove a useful idea.
+\end{enumerate}
+
+Finally, note that \sty{typeface} cannot access \LaTeX\space\typei fonts unless they are properly installed. Please ensure that this is done before attempting to access them through this package. \MiKTeX's and \TeXLive's system package managers make this chore a breeze.
+
+\subsection{Typeface Exhibits File}
+
+The \sty{typeface} package includes a large typeface exhibits file presenting all the roman fonts and many of the other font sets that it manages. This file, \file{typeface-all-rm.pdf}, was produced by compiling \file{typeface-test.tex} with parameters set out in \file{typeface-all-rm.bat}\footnote{It should be relatively trivial to convert this script to Unix-compatible form.}. The first few pages in \file{typeface-all-rm.pdf} contain the output produced using \keyword{default} options, \kvopt{debug}{true}, \kvopt{fontencoding}{OT1}, typeface options set to (typographically hideous) example non-\opt{default} values, and suboption \opt{scale} set to \opt{1}, a value that switches off font scaling. The remaining pages contain exhibits of \acr{CTAN}-available roman fonts accompanied by randomly selected sans serif, teletype, math and substitute text figures companion typefaces automatically scaled to match the roman font size. Exhibits of some widely available commercial fonts are included at the end of the file.
+
+\subsection{Prerequisite Conditions}
+
+This package requires \sty{e-TeX}.
+\np%
+This package requires \sty{microtype} if (and only if) text figures substitute font letter spacing is desired (advanced usage; see section \ref{sec:textfigures}, below). Note that \sty{microtype} generally does not partner well with bitmap fonts, especially if any scaling is involved. Should you select bitmap fonts (\keyword{concrete}, \keyword{cmbright}, etc.), \sty{microtype} will probably raise ``auto expansion is only possible with scalable fonts'' errors during document compilation. Bottom line: either avoid bitmap fonts (for example, install the \keyword{hfbright} package to use a \typei variant of \keyword{cmbright}), or avoid \sty{microtype}.
+
+\subsection{Auxiliary File}
+
+The \sty{typeface} package produces auxiliary file \prm{jobname}\file{.tf} during the course of each run. The package will issue a warning whenever changes made to the auxiliary file necessitate a recompile.
+
+\section{Package Options}
+\label{sec:opt}
+
+This package performs most of its work at package load time. Except for a small number of commands for typesetting text and lining figures and a few others for printing font information, \sty{typeface} exposes very little functionality to users after it has been loaded. Thus, users should ordinarily focus on understanding the package's main options before turning to use its few available commands.
+
+\subsection{Options Syntax}
+
+All package options are given in \kvopt{\prm{key}}{\prm{option}\prm{suboptions}} syntax, where \prm{suboptions} is constructed by appending zero or more :\prm{suboption} terms to \kvopt{\prm{key}}{\prm{option}} productions.
+\np%
+Spaces are ignored within these constructs, so may be freely included wherever you like, presumably for better aiding readability.
+
+\subsection{Default Options}
+
+Default behaviour occurs whenever a particular \keyval option is not explicitly supplied or, given the keyword \opt{default} has not been modified, package option \kvopt{\prm{key}}{default} is explicitly specified.
+\np%
+Please note that this package can be extensively reconfigured in order to meet the requirements of the different locales, institutions or installations where it might be used. Both the keyword \opt{default} and the default behaviour of package keys can be modified. Thus, you should check the contents of \file{typeface.cfg} if you feel concerned that the package's default behaviour has been overridden in some way. See section \ref{sec:config}, below, for further details.
+
+\subsection{Typeface Selection}
+
+\begin{optionlist}
+
+\optitem[default]{typeface}{\prm{roman font}\prm{suboptions}}\vspace{-\baselineskip}
+\optitem{rm}{\prm{roman font}\prm{suboptions}}
+
+The \opt{typeface} (syn: \opt{rm}) option can be used to set up \cmd{rmdefault}, that is, the document's default roman font. The value \prm{roman font} may be one of the font names or shorthand terms (aliases) set out in table \ref{tab:rmopt}. This list can be extended by modifying the package configuration file \file{typeface.cfg} (see section \ref{sec:config}).
+
+A number of roman typefaces can take suboptions. These are set out in table \ref{tab:rmsubopt}. Users should refer to the relevant font documentation or simply try them out to determine what they do.
+
+Note that \cmd{encodingdefault}, the font encoding in place at font load time, can influence the typeface that is used. Font encodings are discussed in section \ref{sec:enc}, below.
+
+Unless reconfigured in the configuration file \file{typeface.cfg}, package option
+
+\begin{ltxcode}
+typeface=<<default>>
+\end{ltxcode}\vspace{-\medskipamount}
+
+is essentially a \keyword{no-op}. In other words, \sty{typeface} will not alter whatever value \cmd{rmdefault} might expand to at \sty{typeface} package load time.
+
+\begin{table}[!ht]
+\tablesetup
+\texttt{%
+\begin{tabularx}{\columnwidth}{@{}PPX@{}}
+ \toprule
+ \multicolumn{1}{@{}H}{Typeface Name} &
+ \multicolumn{1}{H}{Option} &
+ \multicolumn{1}{H}{Aliases} \\
+ \midrule
+ \colA{ADF Baskervald} & adfbaskervald & baskervald \\
+ \colA{ADF Berenis} & adfberenis & berenis \\
+ \colA{ADF Electrum} & adfelectrum & electrum \\
+ \colA{ADF Romande} & adfromande & romande \\
+ \colA{ADF Venturis} & adfventuris & venturis \\
+ \colA{Adobe Minion Pro} & adobeminionpro & minionpro \\
+ \colA{Adobe Utopia} & adobeutopia & utopia \\
+ \colA{AE} & ae & \\
+ \colA{Antykwa P\'o\l tawskiego} & antykwapoltawski & antpol, poltawski \\
+ \colA{Antykwa Toru\'nska} & antykwatorunska & anttor, torunska \\
+ \colA{Artificial Uncial} & uncial & \\
+ \colA{Augie} & augie & \\
+ \colA{Auriocus Kalligraphicus} & auriocuskalligraphicus & auriocus, kalligraphicus \\
+ \colA{Bera Serif} & beraserif & bera \\
+ \colA{Bitstream Charter} & bitstreamcharter & charter \\
+ \colA{CM Bright} & cmbright & \\
+ \colA{CM Dunhill} & cmdunhill & \\
+ \colA{CM Fibonacci} & cmfibonacci & \\
+ \colA{Computer Modern} & computermodern & cm, cmr \\
+ \colA{Concrete} & concrete & \\
+ \colA{Day Roman} & dayroman & dayrom \\
+ \colA{DejaVu} & dejavu & \\
+ \colA{Droid} & droid & \\
+ \colA{European Modern} & europeanmodern & em \\
+ \colA{GFS Artemisia} & gfsartemisia & artemisia \\
+ \colA{GFS Bodoni} & gfsbodoni & bodoni \\
+ \colA{GFS Didot} & gfsdidot & didot \\
+ \colA{GFS Neohellenic} & gfsneohellenic & neohellenic \\
+ \colA{Gyre Bonum} & gyrebonum & bonum, tgbonum \\
+ \colA{Gyre Pagella} & gyrepagella & pagella, tgpagella \\
+ \colA{Gyre Schola} & gyreschola & schola, tgschola \\
+ \colA{Gyre Termes} & gyretermes & termes, tgtermes \\
+ \colA{Iwona} & iwona & \\
+ \colA{JAM Times} & jamtimes & jam \\
+ \colA{KP Fonts} & kpfonts & kp, kepler \\
+ \colA{Kerkis} & kerkis & \\
+ \colA{Kurier} & kurier & \\
+ \colA{Latin Modern} & latinmodern & lm, lmodern \\
+ \colA{Libertine} & libertine & \\
+ \colA{Lucida Bright} & lucidabright & lucidabr, lucida \\
+ \colA{New Century Schoolbook} & newcenturyschoolbook & nc, newcentury \\
+ \colA{PT Serif} & ptserif & pt, paratype \\
+ \colA{PX Fonts} & pxfonts & px \\
+ \colA{Palatino} & palatino & \\
+ \colA{TX Fonts} & txfonts & tx \\
+ \colA{Times Roman} & times & \\
+ \colA{URW Antiqua} & urwantiqua & antiqua \\
+ \colA{URW Bookman} & urwbookman & bookman \\
+ \colA{URW Garamond} & urwgaramond & garamond \\
+ \colA{URW Nimbus} & urwnimbus & nimbus \\
+ \colA{Zapf Chancery} & zapfchancery & chancery, zapf \\
+ \bottomrule
+\end{tabularx}%
+}
+\caption[Typeface Options]{\raggedright{Roman typeface options.
+ Usage: \kvopt{typeface}{\prm{option}\prm{suboptions}}, where \prm{option} is an item from the \textsf{\spotcolor{Option}} or \textsf{\spotcolor{Aliases}} columns, and \prm{suboptions} is formed by concatenating zero or more :\prm{suboption} terms, for which, see table \ref{tab:rmsubopt}.}}
+\label{tab:rmopt}
+\end{table}
+
+\begin{table}[!ht]
+\tablesetup
+\texttt{%
+\begin{tabularx}{\columnwidth}{@{}PX>{\hsize=.01\hsize}X@{}}
+ \toprule
+ \multicolumn{1}{@{}H}{Typeface Name} &
+ \multicolumn{1}{H}{Suboptions} &
+ \multicolumn{1}{H@{}}{Reference Packages} \\
+ \midrule
+ \colA{ADF Baskervald} & lig & baskervald \\
+ \colA{ADF Berenis} & tab, lig & berenis \\
+ \colA{ADF Electrum} & lig & electrum \\
+ \colA{ADF Romande} & alt & romande \\
+ \colA{ADF Venturis} & 2, old & venturis, venturis2, venturisold \\
+ \colA{AE} & slides & ae \\
+ \colA{Adobe Minion Pro} & smallfamily, medfamily, fullfamily, noopticals, opticals, slides, normalsize, nonormalsize & MinionPro \\
+ \colA{Antykwa P\'o\l tawskiego} & light & \\
+ \colA{Antykwa Toru\'nska} & mathnoalias, light, condensed & anttor \\
+ \colA{Auriocus Kalligraphicus} & backslant & aurical \\
+ \colA{CM Bright} & slantedGreek, standard-baselineskips & cmbright \\
+ \colA{Concrete} & exscale, amsfonts, amssymb, sansbold, boldsans & concmath \\
+ \colA{Day Roman} & s & dayrom \\
+ \colA{DejaVu} & condensed & DejaVuSerif, DejaVuSerifCondensed \\
+ \colA{GFS Artemisia} & euler & gfsartemisia \\
+ \colA{GFS Neohellenic} & symbols & gfsneohellenic \\
+ \colA{Iwona} & light, condensed & iwona \\
+ \colA{KP Fonts} & oldstyle, veryoldstyle, rmx, light, largesmallcaps, nofligatures, easyscsl, oldstylenumsmath (\textrm{syn:}\hspace{0.4em}osf, oldstylenums), noamsmath, sfmath, sfmathbb, rmmathbb, nomathscript, mathcalasscript, classicReIm, uprightRoman, frenchstyle, upright, oldstylenumsmath, oldstylemath, veryoldstylemath, narrowiints, partialup, widermath, noDcommand, intlimits, nointlimits, fullintlimits, sumlimits, nosumlimits, fullsumlimits, uprightgreeks, slantedGreeks & kpfonts \\
+ \colA{Kurier} & light, condensed & kurier \\
+ \colA{Latin Modern} & boldsc\textsuperscript{\textit{a}} & \\
+ \colA{Lucida Bright} & seriftt, expert, noexpert, lucidascale, nolucidascale, lucidasmallscale, mathitalic1, mathitalic2, mathitalic3, slantedgreek, uprightgreek, vargreek, noamssymbols, amsmath, OT1, T1, LY1, seriftt, fax, casual, calligraphic, handwriting, altbullet, errorshow, warningshow, nofontinfo & lucidabr, lucbmath\\
+ \colA{TX Fonts} & new\textsuperscript{\textit{b}} & txfonts, newtxtext \\
+ \bottomrule
+\end{tabularx}%
+}
+\caption[Typeface Suboptions]{\raggedright{Roman typeface suboptions. See reference packages for the meaning of these terms.\par\footnotesize{\textsuperscript{\textit{a}}Draws bold smallcaps from Computer Modern. Font encoding \keyword{T1} only.}\par\footnotesize{\textsuperscript{\textit{b}}Loads TX Fonts from the \keyword{newtx} package.}\par}}
+\label{tab:rmsubopt}
+\end{table}
+
+\optitem[default]{sanstypeface}{\prm{sans serif font}\prm{suboptions}}\vspace{-\baselineskip}
+\optitem{sf}{\prm{sans serif font}\prm{suboptions}}
+
+\optitem[default]{monotypeface}{\prm{teletype font}\prm{suboptions}}\vspace{-\baselineskip}
+\optitem{tt}{\prm{teletype font}\prm{suboptions}}
+
+The \opt{sanstypeface} (syn: \opt{sf}) and \opt{monotypeface} (syn: \opt{tt}) options can be used to set up \cmd{sfdefault} and \cmd{ttdefault}, that is, the document's default sans serif and teletypewriter fonts. As with setting \kvopt{typeface}{default}, setting \kvopt{sanstypeface}{default} and/or \kvopt{monotypeface}{default} does very little at all---\cmd{sfdefault} and \cmd{ttdefault} are not altered in these cases.
+
+Key values \prm{sans serif font} and \prm{teletype font} can be selected from the font names or shorthand terms (aliases) set out in tables \ref{tab:sfopt} and \ref{tab:ttopt}. These lists can be expanded by modifying package configuration file \file{typeface.cfg}.
+
+In addition to fine-tuning font selections by applying the \prm{suboptions} listed in tables \ref{tab:sfsubopt} and \ref{tab:ttsubopt}, sans serif and teletype fonts can be scaled using the \subopt{scale} suboption. This suboption is discussed in section \ref{sec:scaling}, below.
+
+\begin{table}[!ht]
+\tablesetup
+\texttt{%
+\begin{tabularx}{\columnwidth}{@{}PPX@{}}
+ \toprule
+ \multicolumn{1}{@{}H}{Typeface Name} &
+ \multicolumn{1}{H}{Option} &
+ \multicolumn{1}{H}{Aliases} \\
+ \midrule
+ \colA{ADF Libris} & adflibris & libris \\
+ \colA{ADF Venturis Sans} & adfventuris & venturis \\
+ \colA{AE Sans} & ae & \\
+ \colA{Arev Sans} & arevsans & arev \\
+ \colA{Augie} & augie & \\
+ \colA{Avant Garde} & avantgarde & \\
+ \colA{Biolinum} & biolinum & libertine \\
+ \colA{Bitstream Vera Sans} & berasans & bera \\
+ \colA{CM Bright Sans} & cmbright & \\
+ \colA{Cantarell} & cantarell & \\
+ \colA{Comfortaa} & comfortaa & \\
+ \colA{Computer Modern Sans} & computermodern & cm, cms \\
+ \colA{Cyklop} & cyklop & \\
+ \colA{DejaVu Sans} & dejavu & \\
+ \colA{Droid Sans} & droid & \\
+ \colA{European Modern Sans} & europeanmodern & em \\
+ \colA{GFS Neohellenic} & gfsneohellenic & neohellenic \\
+ \colA{Gyre Adventor} & gyreadventor & adventor, tgadventor \\
+ \colA{Gyre Heros} & gyreheros & heros, tgheros \\
+ \colA{Helvetica} & helvetica & helv \\
+ \colA{Iwona} & iwona & \\
+ \colA{KP Fonts Sans} & kpfonts & kp, kepler \\
+ \colA{Kerkis Sans} & kerkis & \\
+ \colA{Kurier Sans} & kurier & \\
+ \colA{Latin Modern Sans} & latinmodern & lm, lmodern \\
+ \colA{Lato} & lato & \\
+ \colA{Lucida Bright Sans} & lucidabright & lucidabr, lucida \\
+ \colA{Open Sans} & opensans & \\
+ \colA{PT Sans} & ptsans & pt, paratype \\
+ \colA{PX Fonts Sans} & px fonts & px \\
+ \colA{TX Fonts Sans} & tx fonts & tx \\
+ \colA{URW Arial} & urwarial & arial \\
+ \colA{URW Classico} & urwclassico & classico, optima \\
+ \colA{URW Grotesq} & urwgrotesq & grotesq \\
+ \colA{URW Nimbus Sans} & urwnimbus & nimbus \\
+ \bottomrule
+\end{tabularx}%
+}
+\caption[Sans Serif Options]{\raggedright{Sans serif typeface options. See table \ref{tab:sfsubopt} for associated suboptions.}}
+\label{tab:sfopt}
+\end{table}
+
+\begin{table}[!ht]
+\tablesetup
+\texttt{%
+\begin{tabularx}{\columnwidth}{@{}PPX@{}}
+ \toprule
+ \multicolumn{1}{@{}H}{Typeface Name} &
+ \multicolumn{1}{H}{Suboptions} &
+ \multicolumn{1}{H@{}}{Reference Packages} \\
+ \midrule
+ \colA{ADF Venturis Sans} & 2 & venturis \\
+ \colA{AE Sans} & slides & ae \\
+ \colA{Biolinum} & osf & libertine \\
+ \colA{Computer Modern Sans} & quotation & \\
+ \colA{DejaVu Sans} & condensed & dejavu \\
+ \colA{GFS Neohellenic} & symbols & gfsneohellenic \\
+ \colA{Iwona} & light, condensed & iwona \\
+ \colA{KP Fonts Sans} & osf & kpfonts\\
+ \colA{Kurier Sans} & light, condensed & kurier \\
+ \colA{Latin Modern Sans} & extended & \\
+ \colA{Open Sans} & osf & opensans \\
+ \bottomrule
+\end{tabularx}%
+}
+\caption[Sans Serif Suboptions]{\raggedright{Sans serif typeface suboptions. See reference packages for the meaning of each term.}}
+\label{tab:sfsubopt}
+\end{table}
+
+\begin{table}[!ht]
+\tablesetup
+\texttt{%
+\begin{tabularx}{\columnwidth}{@{}PPX@{}}
+ \toprule
+ \multicolumn{1}{@{}H}{Typeface Name} &
+ \multicolumn{1}{H}{Option} &
+ \multicolumn{1}{H}{Aliases} \\
+ \midrule
+ \colA{AE Mono} & ae & \\
+ \colA{Bitstream Vera Mono} & beramono & bera \\
+ \colA{Computer Modern Mono Light} & cmbright & \\
+ \colA{Courier} & courier & \\
+ \colA{DejaVu Mono} & dejavu & \\
+ \colA{Droid Mono} & droid & \\
+ \colA{European Modern Mono} & europeanmodern & em \\
+ \colA{Gyre Cursor} & gyrecursor & cursor, tgcursor \\
+ \colA{Inconsolata} & inconsolata & \\
+ \colA{KP Fonts Mono} & kpfonts & kp, kepler \\
+ \colA{Latin Modern Mono} & latinmodern & lm, lmodern \\
+ \colA{Lucida Bright Mono} & lucidabright & lucidabr, lucida \\
+ \colA{Luxi Mono} & luximono & luxi \\
+ \colA{PT Mono} & ptmono & pt, paratype \\
+ \colA{PX Fonts Mono} & pxfonts & px \\
+ \colA{TX Fonts Mono} & txfonts & tx \\
+ \colA{} & computermodern & cm, cmt \\
+ \bottomrule
+\end{tabularx}%
+}
+\caption[Teletype Options]{\raggedright{Teletype typeface options. See table \ref{tab:ttsubopt} for associated suboptions.}}
+\label{tab:ttopt}
+\end{table}
+
+\begin{table}[!ht]
+\tablesetup
+\texttt{%
+\begin{tabularx}{\columnwidth}{@{}PX>{\hsize=.01\hsize}X@{}}
+ \toprule
+ \multicolumn{1}{@{}H}{Typeface Name} &
+ \multicolumn{1}{H}{Suboptions} &
+ \multicolumn{1}{H@{}}{Reference Packages} \\
+ \midrule
+ \colA{AE Mono} & slides & ae\\
+ \colA{Computer Modern Mono Light} & light, proportional, L & \\
+ \colA{KP Fonts Mono} & osf & kpfonts \\
+ \colA{Latin Modern Mono} & proportional & lmodern \\
+ \colA{Lucida Bright Mono} & serif, seriftt, sans & lucidabr \\
+ \bottomrule
+\end{tabularx}%
+}
+\caption[Teletype Suboptions]{\raggedright{Teletype typeface suboptions. See reference packages for their meaning.}}
+\label{tab:ttsubopt}
+\end{table}
+
+\begin{table}[!ht]
+\tablesetup
+\texttt{%
+\begin{tabularx}{\columnwidth}{@{}PPX@{}}
+ \toprule
+ \multicolumn{1}{@{}H}{Typeface Name} &
+ \multicolumn{1}{H}{Option} &
+ \multicolumn{1}{H}{Aliases} \\
+ \midrule
+ \colA{Adobe Minion Pro} & adobeminionpro & \\
+ \colA{AMS Math} & amsmath & ams \\
+ \colA{Antykwa Toru\'nska} & antykwatorunska & anttor, torunska \\
+ \colA{Arev Math} & arevmath & arev \\
+ \colA{CM Bright} & cmbright & \\
+ \colA{Concrete Math} & concrete & \\
+ \colA{Euler} & euler & \\
+ \colA{European Modern} & europeanmodern & em \\
+ \colA{Fourier} & fourier & \\
+ \colA{GFS Artemisia} & gfsartemisia & artemisia \\
+ \colA{GFS Bodoni} & gfsbodoni & bodoni \\
+ \colA{GFS Didot} & gfsdidot & didot \\
+ \colA{GFS Neohellenic} & gfsneohellenic & neohellenic \\
+ \colA{Iwona} & iwona & \\
+ \colA{KP Fonts} & kpfonts & kp, kepler \\
+ \colA{Kerkis} & kerkis & \\
+ \colA{Kurier} & kurier & \\
+ \colA{LX Fonts} & lxfonts & lx \\
+ \colA{Latin Modern} & latinmodern & lm, lmodern \\
+ \colA{Lucida Bright} & lucidabright & lucidabr, lucida \\
+ \colA{Math Design} & mathdesign & \\
+ \colA{MathTime 2} & mathtimepro & mtpro \\
+ \colA{Math PTMX} & mathptmx & ptmx \\
+ \colA{PX Fonts} & pxfonts & px \\
+ \colA{Pazo} & mathpazo & pazo \\
+ \colA{TX Fonts} & txfonts & tx \\
+ \bottomrule
+\end{tabularx}%
+}
+\caption[Math Typeface Options]{\raggedright{Math typeface options. See table \ref{tab:mathsubopt} for associated suboptions.}}
+\label{tab:mathopt}
+\end{table}
+
+\begin{table}[!ht]
+\tablesetup
+\texttt{%
+\hspace{-.05\columnwidth}\begin{tabularx}{1.05\columnwidth}{@{}PX>{\hsize=.01\hsize}X@{}}
+ \toprule
+ \multicolumn{1}{@{}H}{Typeface Name} &
+ \multicolumn{1}{H}{Suboptions} &
+ \multicolumn{1}{H@{}}{Reference Packages} \\
+ \midrule
+ \colA{Adobe Minion Pro} & smallfamily, medfamily, fullfamily, noopticals, opticals, slides, normalsize, nonormalsize, liningstylefigures (syn: lf, lsf, lining, liningstyle, mathlf), oldstylefigures (syn: osf, oldstyle, oldfigures, mathosf), mathtabular, mnsy, cmsy, swash, abx, amsbb, fourierbb, lucidabb, mixedgreek, italicgreek, frenchmath, minionint, openg, loosequotes, footnotefigures & MinionPro \\
+ \colA{AMS Math} & tbtags, nosumlimits, intlimits, nonamelimits, donotfixamsmathbugs & amsmath \\
+ \colA{Antykwa Toru\'nska} & light, condensed & anttor \\
+ \colA{Arev Math} & origletters, vara, vari, varI, varf, oldf, varl, varu, varv, varw, varGamma, varXi, varPi, varSigma, varPhi & arevmath \\
+ \colA{CM Bright} & slantedGreek, standard-baselineskips & cmbright\\
+ \colA{Concrete Math} & exscale, amsfonts, amssymb, sansbold, boldsans & concrete\\
+ \colA{Euler} & small, euler-digits, euler-hat-accent, T1, OT1, LY1, icomma & eulervm \\
+ \colA{European Modern} & T1, LY1, LM1 & em \\
+ \colA{Fourier} & nc, newcentury, newcenturyschoolbook, utopia, adobeutopia, upright, widespace, expert, oldstyle, fulloldstyle & fourier \\
+ \colA{GFS Artemisia} & euler & gfsartemisia \\
+ \colA{Iwona} & light, condensed & iwona\\
+ \colA{KP Fonts} & light, noamsmath, sfmath, sfmathbb, rmmathbb, nomathscript, mathcalasscript, classicReIm, uprightRoman, frenchstyle, upright, oldstylefigures (syn: osf, oldstyle, oldfigures, oldstylenums, oldstylenumsmath), oldstylemath, veryoldstylemath, narrowiints, partialup, widermath, noDcommand, intlimits, nointlimits, fullintlimits, sumlimits, nosumlimits, fullsumlimits, uprightgreeks, slantedGreeks & kpfonts \\
+ \colA{Kerkis} & light, condensed & kerkis\\
+ \colA{Lucida Bright} & expert, noexpert, lucidascale, nolucidascale, lucidasmallscale, mathitalic1, mathitalic2, mathitalic3, slantedgreek, uprightgreek, vargreek, amsmath, noamssymbols, OT1, T1, LY1, seriftt, fax, casual, calligraphic, handwriting, altbullet,errorshow, warningshow, nofontinfo & lucidabr, lucbmath \\
+ \colA{Math Design} & expert, uppercase:upright,uppercase:italicized, greekuppercase:upright,greekuppercase:italicized, greeklowercase:upright,greeklowercase:italicized, greekuppercase, greeklowercase, urwgaramond, garamond, adobeutopia, utopia, bitstreamcharter, charter & mathdesign \\
+ \colA{MathTime 2} & amssymbols, noamssymbols, slantedGreek, uprightGreek, slantedoperators, uprightoperators, subscriptcorrection, nosubscriptcorrection, zswash, nozswash, curlybraces, straightbraces, morphedbraces, cmcal, lucidacal, eucal, mtpluscal, mtpcal, mtpccal, lucidascr, mtplusscr, mtpscr, eufrak, mtpfrak, compatiblegreek, amsbb, mtpbb, mtpbbd, mtphrb, mtphrd, mtpbbi, mtphbi, errorshow, warningshow, nofontinfo, lite & mtpro2 \\
+ \colA{Pazo} & slantedGreek, noBBpl & mathpazo\\
+ \colA{TX Fonts} & new\textsuperscript{\textit{a}}, varg, libertine, cmintegrals, uprightGreek, cmbraces, varbb, nosymbolsc, amssymbols, noamssymbols, ptmxitalics & txfonts, newtxmath \\
+ \bottomrule
+\end{tabularx}%
+}
+\caption[Math Typeface Suboptions]{\raggedright{Math typeface suboptions. See reference packages for their meaning.\par\footnotesize{\textsuperscript{\textit{a}}Loads TX Fonts from the \keyword{newtx} package.}}}
+\label{tab:mathsubopt}
+\end{table}
+
+\FloatBarrier
+
+\begin{table}[!ht]
+\tablesetup
+\texttt{%
+\begin{tabularx}{\columnwidth}{@{}PPX@{}}
+ \toprule
+ \multicolumn{1}{@{}H}{Typeface Name} &
+ \multicolumn{1}{H}{Option} &
+ \multicolumn{1}{H}{Aliases} \\
+ \midrule
+ \colA{AMS Symbols} & amssymb & ams \\
+ \colA{FD Symbol} & fdsymbol & fd \\
+ \colA{Math abx} & mathabx & abx \\
+ \colA{MdSymbol} & mdsymbol & md \\
+ \colA{MnSymbol} & mnsymbol & mn \\
+ \bottomrule
+\end{tabularx}%
+}
+\caption[Symbols Options]{\raggedright{Symbols typeface options. See table \ref{tab:symsubopt} for associated suboptions.}}
+\label{tab:symopt}
+\end{table}
+
+\begin{table}[!ht]
+\tablesetup
+\texttt{%
+\begin{tabularx}{\columnwidth}{@{}PX>{\hsize=.01\hsize}X@{}}
+ \toprule
+ \multicolumn{1}{@{}H}{Typeface Name} &
+ \multicolumn{1}{H}{Suboptions} &
+ \multicolumn{1}{H@{}}{Reference Packages} \\
+ \midrule
+ \colA{FD Symbol} & normalweightRegular, normalweightAuto, boldweightMedium, boldweightAuto, largedelims & fdsymbol \\
+ \colA{MdSymbol} & autolight, autoregular, autosemibold, Bold, bold, largedelims, Light, light, onlysansmath, regular, Regular, retainmissing, semibold, Semibold & mdsymbol \\
+ \bottomrule
+\end{tabularx}%
+}
+\caption[Symbols Suboptions]{\raggedright{Symbols typeface suboptions. See reference packages for their meaning.}}
+\label{tab:symsubopt}
+\end{table}
+
+\optitem[default]{mathtypeface}{\prm{math font}\prm{suboptions}}\vspace{-\baselineskip}
+\optitem{math}{\prm{math font}\prm{suboptions}}
+
+\optitem[default]{symbolstypeface}{\prm{symbols font}\prm{suboptions}}\vspace{-\baselineskip}
+\optitem{sym}{\prm{symbols font}\prm{suboptions}}
+
+The \opt{mathtypeface} (syn: \opt{math}) and \opt{symbolstypeface} (syn: \opt{sym}) options can be used to set up math and symbols fonts. See tables \ref{tab:mathopt} and \ref{tab:symopt} for values of \prm{math font} and \prm{symbols font}, respectively. Like other \prm{typeface} options, these lists can be extended by modifying package configuration file \file{typeface.cfg}.
+
+Apart from registering math and symbols typeface print names, \kvopt{mathtypeface}{default} and \kvopt{symbolstypeface}{default} do nothing noticeable at all.
+
+Math and symbols \prm{suboptions} are listed in tables \ref{tab:mathsubopt} and \ref{tab:symsubopt}.
+
+In addition to the functions invoked by these suboptions, math and symbols typefaces can be scaled using the \subopt{scale} suboption with the \opt{mathtypeface} key. As math and symbols fonts are scaled in unison, the \subopt{scale} suboption is ignored, and therefore should not be used, with the \opt{symbolstypeface} key. The \subopt{scale} suboption only applies to \opt{mathtypeface} options. See section \ref{sec:scaling}, below.
+
+\end{optionlist}
+
+\subsection{Text Figures}
+\label{sec:textfigures}
+
+\begin{optionlist}
+
+\optitem[default]{textfigures}{\prm{option}\prm{suboptions}}
+
+This option is used to specify the text figures font configuration. Text figures may be sourced from the typeface established using the \kvopt{typeface}{\prm{roman font}} package option, they may be sourced from a substitute text figures font, or they may be switched off entirely.
+
+Once configured, the text figures font is selected using the \cmd{textstylenums} command or \env{textnums} environment. The \cmd{liningstylenums} command or \env{liningnums} environment selects the lining style figures font. See section \ref{sec:textnums} for usage.
+
+Text figures \prm{option}s include:
+\begin{enumerate}[leftmargin=0em,itemindent=0em,labelsep=0.5em,format=\optlabel]
+ \item[default] This option does nothing at all.
+ \item[false] (syn: \opt{lf}, \opt{lsf}, \opt{lining}, \opt{liningstyle}, \opt{liningfigures}, \opt{liningstylefigures})
+
+ This option sets \cmd{rmdefault} to the lining figures variant of the font requested using the \kvopt{typeface}{\prm{roman font}} package option. Thus, given \kvopt{typeface}{\tfrmfont} and \kvopt{textfigures}{false}, the three lines of code:
+ {\lstset{xleftmargin=-2em}\begin{ltxcode}
+ 12345
+ <<\textstylenums>>{12345}
+ <<\begin{textnums}>>12345<<\end{textnums}>>
+ \end{ltxcode}}\vspace{-\medskipamount}
+ each produce \liningstylenums{12345}, that is, \keyword{12345} rendered in \rmprintname's lining style (uppercase) figures typeface variant.
+
+ Note again: the \cmd{textstylenums} command and the \env{textnums} environment generate \emph{lining style figures} if \kvopt{textfigures}{false}.
+
+ On the other hand, no matter what the value of the \opt{textfigures} option, the \LaTeX\space command:
+ {\lstset{xleftmargin=-2em}\begin{ltxcode}
+ <<\oldstylenums>>{12345}
+ \end{ltxcode}}\vspace{-\medskipamount}
+ will use the font's text figures (lowercase) variant, if it exists, to produce \oldstylenums{12345}.
+
+ Note that in a few rare cases, the selected roman font cannot render true lining figures. Examples include Day Roman and Auriocus Kalligraphicus typefaces. An error will be issued if \kvopt{textfigures}{false} is specified under these circumstances.
+
+ \item[true] (syn: \opt{osf}, \opt{oldstyle}, \opt{oldfigures}, \opt{oldstylefigures}, \opt{textfigures})\\
+ This option sets \cmd{rmdefault} to the text figures variant of the \kvopt{typeface}{\prm{roman font}} font. Given \kvopt{textfigures}{true}, arbitrary \kvopt{typeface}{\prm{roman font}}, and input string:
+ {\lstset{xleftmargin=-2em}\begin{ltxcode}
+ 12345
+ \end{ltxcode}}\vspace{-\medskipamount}
+ the output will be typeset using the text style figures font variant (\textstylenums{12345}) if and only if \prm{roman font} is natively capable of supplying these glyphs. Fortunately, several roman fonts are capable of this. Unfortunately, many more are not.
+
+ The following lines of code:
+ {\lstset{xleftmargin=-2em}\begin{ltxcode}
+ <<\textstylenums>>{12345}
+ <<\begin{textnums}>>12345<<\end{textnums}>>
+ \end{ltxcode}}\vspace{-\medskipamount}
+ are semantically identical. If \prm{roman font} is natively capable of rendering text style figures, output is the same as that immediately above (\textstylenums{12345}). If not, that is, if input \texttt{12345} produces \liningstylenums{12345}, then \texttt{\string\textstylenums\{12345\}} and \texttt{\string\begin\{textnums\}12345\string\end\{textnums\}} will attempt to generate text style figures by sourcing glyphs from the font's \keyword{TS1}-encoded or \keyword{smallcaps} character sets. Around one half of the roman fonts managed by \sty{typeface} succeed with this approach, leaving around a final one third unable to produce text figures from their own font sets in any shape or form. An error will be issued if the \kvopt{textfigures}{true} option is specified in these instances.
+
+ No matter what these outcomes, the command:
+ {\lstset{xleftmargin=-2em}\begin{ltxcode}
+ <<\liningstylenums>>{12345}
+ \end{ltxcode}}\vspace{-\medskipamount}
+ will, as described above, attempt to typeset its argument using the font's lining figures variant.
+
+ \item[\prm{substitute font}] This option provides a last ditch technique for typesetting text figures in cases when the \kvopt{typeface}{\prm{roman font}} document font provides no other means for doing so. Substitute text figures should be used carefully, that is, with keen attention for blending in with the established \cmd{rmdefault} font. Perfect seamlessness may be difficult to achieve. In any event, the mere attempt will certainly provoke derision by typographical purists. Life can be hard.
+
+ \prm{substitute font} may be one of the following:
+ \begin{itemize}[leftmargin=4em,noitemsep,format=\optlabel]
+ \item[adobeminionpro] also accepting suboption \subopt{tabular} (syn: \subopt{tab}) for tabular, that is, monospaced figures
+ \item[dayroman] (syn: \opt{dayrom})
+ \item[kpfonts] (syn: \opt{kp}, \opt{kepler}), also accepting suboption \subopt{light} for a lighter weight font
+ \item[latinmodern] (syn: \opt{lm}, \opt{lmodern})
+ \item[libertine]
+ \item[lucidabright] (syn: \opt{lucidabr}, \opt{lucida})
+ \item[palatino]
+ \item[times]
+ \end{itemize}
+ In these cases, arguments of the \cmd{textstylenums} command or \env{textnums} environment:
+ {\lstset{xleftmargin=0em}\begin{ltxcode}
+ <<\textstylenums>>{12345}
+ <<\begin{textnums}>>12345<<\end{textnums}>>
+ \end{ltxcode}}\vspace{-\medskipamount}
+ will be typeset in the nominated substitute font. All other text will be rendered in the non-substitute typeface. This includes figures passed to the \cmd{liningstylenums} command or the \env{liningnums} environment, and all output generated while \cmd{sffamily} or \cmd{ttfamily} selections are in force.
+
+ \begin{enumerate}[leftmargin=0em,itemindent=0em,labelsep=0.5em]
+ \item[\emph{Caveat}:] Advanced usage. The inter-character spacing, inter-unit kerning and the overall scaling of substitute text figures will generally require fine-tuning to promote seamless integration with the surrounding roman text. The following suboptions provide the means for making some very fine-grained adjustments:
+ \begin{itemize}[leftmargin=4em,noitemsep,format=\optlabel,midpenalty=10000]
+ \item[scale:\prm{scale factor}] adjust the size of the substitute text figures font
+ \item[spacing:\prm{adjustment}] adjust the substitute text figures font inter-character spacing
+ \item[lkern:\prm{adjustment}] kern the space preceding the substitute text figures block
+ \item[rkern:\prm{adjustment}] kern the space after the substitute text figures block
+ \end{itemize}
+ Substitute text figures font scaling is described in section \ref{sec:scaling}, below.
+
+ The \subopt{spacing}, \subopt{lkern} and \subopt{rkern} suboptions rely on the \sty{microtype} package for the fine-grained adjustments they provide. Consequently, they cannot be applied unless \sty{microtype} is loaded before loading \sty{typeface}. The \prm{adjustment} parameter of these suboptions accepts integers between $-1000$ and $1000$, inclusive.
+ \end{enumerate}
+\end{enumerate}
+
+\end{optionlist}
+
+\subsection{Font Scaling}
+\label{sec:scaling}
+
+\begin{optionlist}
+
+\varitem[ex]{typeface}{\prm{typeface name}\prm{suboptions}[\opt{:scale}\prm{scale factor}]\prm{suboptions}}
+
+\begin{enumerate}[labelsep=0.5em,noitemsep,format=\optlabel,midpenalty=10000]
+ \item[\prm{typeface}] Package option \opt{sanstypeface}, \opt{monotypeface}, \opt{mathtypeface}, \opt{textfigures} or any of their synonyms.
+ \item[\prm{typeface name}] Any typeface name accepted by \prm{typeface}.
+ \item[\prm{suboptions}] Zero or more \subopt{:\prm{suboption}} terms accepted by the \kvopt{\prm{typeface}}{\prm{typeface name}} tuple.
+ \item[\prm{scale factor}] Optional: preceded by a colon separator, \subopt{ex}, \subopt{uppercase}, \subopt{lowercase}, \subopt{figures} or any positive real number.
+\end{enumerate}
+
+Scaling defaults to \opt{ex} if the \opt{scale}\prm{scale factor} suboption is not included among \prm{typeface} suboptions or if \prm{scale factor} is empty.
+
+The \subopt{scale} suboption scales \prm{typeface name} by an absolute or reference font relative amount. In all cases, the reference font is the font loaded by the \kvopt{typeface}{\prm{roman font}} package option.
+
+Reference font relative scaling parameters include:
+
+\begin{enumerate}[labelsep=0.5em,noitemsep,format=\optlabel,midpenalty=10000]
+ \item[ex] the ex-height of \prm{typeface name} is auto-scaled to the ex-height of the reference font
+ \item[uppercase] (syn: \subopt{uc}) the height of full-ascender uppercase characters in \prm{typeface name} is auto-scaled to the height of full-ascender uppercase characters in the reference font
+ \item[lowercase] (syn: \subopt{lc}) the height of full-ascender lowercase characters in \prm{typeface name} is auto-scaled to the height of full-ascender lowercase characters in the reference font
+ \item[figures] (syn: \subopt{fig}) the height of numerals in \prm{typeface name} is auto-scaled to the height of numerals in the reference font
+\end{enumerate}
+
+Scaling parameters \subopt{uppercase}, \subopt{lowercase}, \subopt{figures} and synonyms do not apply, and will be rejected, whenever \prm{typeface} is \opt{textfigures}.
+
+Font scaling, whether by absolute or reference font relative amounts, is not guaranteed. Much depends on the quality of the internal font metrics in the installed \typei fonts\footnote{Extant varieties of \sty{biolinum sans} \typei provide particularly egregious examples of poor internal font metrics. Unless recently fixed, users should stick to scaling \sty{biolinum sans} by absolute and not reference font relative amounts.}, or on the load time information in their font descriptor \file{.fd} files. The supplied test harness and font exhibits file might prove useful for determining individual font scaling capabilities (see section \ref{sec:pkgcontents}, above).
+
+\end{optionlist}
+
+\subsection{Font Load Order}
+\label{sec:loadorder}
+
+\begin{optionlist}
+
+\optitem[default]{fontloadorder}{\prm{load order list}}
+
+\begin{enumerate}[leftmargin=0em,itemindent=0em,labelsep=0.5em]
+ \item[\emph{Caveat}:] Advanced usage. You probably do not want to use this option in any serious way. It can cause no end of trouble.
+\end{enumerate}
+
+\sty{Typeface}'s default font load order is \opt{textfigures:symbols:math:rm:sf:tt}. That is, the substitute text figure font, if specified, is loaded, then the symbols, math, roman, sans serif, and teletype fonts in succession.
+
+Internally, much of \sty{typeface}'s work involves orchestrating font package loading to achieve the user's intended results. In addition to the primary fonts they load, many font packages also load a range of complementary fonts, ostensibly to provide greater value for their users. This situation introduces considerable potential for downstream font loading conflicts when, rather than wanting to use the package's complementary typeface choices, one would prefer to match other typefaces with the package's primary font instead. Font package loading nonorthogonalities can be particularly troublesome between symbols and math or between math and roman choices. The \sty{typeface} package does its best to insulate users from these problems. On extremely rare occasions, however, better results might be obtained by adjusting \sty{typeface}'s inbuilt font load order rule to suit.
+
+All six terms must be included in the colon-separated \prm{load order list}. However, be mindful that \opt{fontloadorder} is ``more what you'd call `guidelines' than actual rules''---the font load order cannot always be rearranged, no matter what your instruction.
+
+Example: symbols will \emph{probably} be loaded after math fonts rather than before them by specifying \kvopt{fontloadorder}{textfigures:math:symbols:rm:sf:tt}.
+
+Take this option with a grain of salt---it is there should you need it. However, you should best avoid it if you can.
+
+\end{optionlist}
+
+\subsection{Ancillary Packages}
+
+\begin{optionlist}
+
+\makeatletter
+\label{sec:enc}
+\optitem[\TF@DEFAULTFONTENCODING]{fontencoding}{\subopt{default}\OR\subopt{dontload}\OR\subopt{ignore}\OR\prm{fontencodings list}}\vspace{-\baselineskip}
+\optitem[\TF@DEFAULTINPUTENCODING]{inputencoding}{\subopt{default}\OR\subopt{dontload}\OR\subopt{ignore}\OR\prm{inputencoding}}\vspace{-\baselineskip}
+\optitem[\TF@DEFAULTTEXTCOMP]{textcomp}{\subopt{default}\OR\subopt{dontload}\OR\subopt{ignore}\OR\prm{textcomp}}\vspace{-\baselineskip}
+\optitem[\TF@DEFAULTCMAP]{cmap}{\subopt{default}\OR\subopt{dontload}\OR\subopt{ignore}\OR\subopt{resetfonts}\OR\subopt{noresetfonts}}
+\makeatother
+
+The \sty{typeface} package loads the \sty{fontenc}, \sty{inputenc}, \sty{textcomp} and \sty{cmap}\footnote{The \sty{cmap} option might be withdrawn in an upcoming ``release'' version. Alternatively, it might be replaced by an option for loading \file{glyphtounicode.tex}. Bearing in mind that \sty{typeface's} principal constituency is novice \LaTeX\space users, ideas about the best way to proceed would be warmly welcomed by the author.} packages by default. Descriptions of these can be found in many places, for example, in the UK \TeX\space FAQ.\fnurl{http://www.tex.ac.uk/faq} \sty{Typeface} will not load these packages if \opt{dontload} or \opt{ignore} are supplied. Default values and the sets of valid parameters can be reconfigured by modifying \file{typeface.cfg} as described in section \ref{sec:config}, below.
+
+The \opt{fontencoding} option accepts a colon-separated list of font encodings. In processing these, the \sty{fontenc} package records the last item in the list in \cmd{encodingdefault}.
+
+\end{optionlist}
+
+\subsection{Package Testing}
+
+\begin{optionlist}
+
+\optitem[false]{debug}{\subopt{true}\OR\subopt{false}}
+
+If \kvopt{debug}{true}, the \sty{typeface} package writes extra load-time and run-time processing information in the job log file. It also colour-codes output text according to selected font family. The short form \opt{debug} is equivalent to \kvopt{debug}{true}. Debug colours can be reconfigured by modifying \file{typeface.cfg}.
+
+\optitem[false]{printinfo}{\subopt{true}\OR\subopt{false}}
+
+Package test harness \file{typeface-test.tex} provides a useful testbed for exploring and testing various font scenarios. The \sty{typeface} package exposes several commands for supporting this if \kvopt{printinfo}{true}. The short form \opt{printinfo} is equivalent to \kvopt{printinfo}{true}.
+
+The following commands become available when \kvopt{printinfo}{true}:
+
+\begin{enumerate}[leftmargin=5em,labelsep=0.5em,noitemsep,format=\optlabel,beginpenalty=5000,midpenalty=10000]
+ \item[\cmd{tfprintpackageoptions}] Prints current package option values.
+ \item[\cmd{tfprintinfo}] Prints roman, substitute text figures (if specified), sans serif, teletype, math and symbols typeface information, including \TeX\space font name, em size, ex height, and scale factor metrics.
+ \item[\cmd{tfprinttext\{\#1\}}] Prints a small exhibit of alphanumeric text in different shapes and weights. Text is drawn from \opt{\#1} family where \opt{\#1} may be \opt{rm}, \opt{sf} or \opt{tt}.
+ \item[\cmd{tfprintfigures\{\#1\}}] Prints a small exhibit of numeric text in different shapes and weights, including output from \env{math}, \env{liningnums} and \env{textnums} environments and from \cmd{textstylenums} and \cmd{oldstylenums} commands. Figures are drawn from \opt{\#1} family, given \opt{\#1} contains \opt{rm}, \opt{sf} or \opt{tt}.
+ \item[\cmd{tfprintmathsample\{\#1\}}] Prints a small block of math-oriented prose, including calligraphic, blackboard and greek fonts where defined. Text is drawn from \opt{\#1} family, with \opt{\#1} being \opt{rm}, \opt{sf} or \opt{tt}.
+ \item[\cmd{tfprintmathfonts}] Prints a 16 element vector of math family \TeX font names.
+ \item[\cmd{tfprinttextsample\{\#1\}}] Prints a small block of prose. Text is drawn from \opt{\#1} family where \opt{\#1} is \opt{rm}, \opt{sf} or \opt{tt}.
+ \item[\cmd{tfprinttextalphabets}] Prints \opt{math}, \opt{rm}, \opt{sf} and \opt{tt} intermixed lines of lowercase, uppercase and numeric text. Useful for comparing relative print sizes across different font families.
+ \item[\cmd{tfprintinfopage}] Executes several of the commands described above.
+\end{enumerate}
+
+See \file{typeface-all-rm.pdf}, the font exhibits file included with this package for example usage of these commands.
+
+\end{optionlist}
+
+\section{Author Commands}
+
+
+\subsection{Text and Lining Figures}
+\label{sec:textnums}
+
+The \sty{typeface} package provides very few author-level commands. Those that it provides include commands and environments for switching between text and lining figures:
+
+\begin{enumerate}[leftmargin=4em,labelsep=0.5em,noitemsep,format=\optlabel,beginpenalty=5000,midpenalty=10000]
+ \item[\cmd{textstylenums}] This command is a homologue of \LaTeX's native \cmd{oldstylenums}. Unlike \cmd{oldstylenums}, \cmd{textstylenums} renders text style figures if:
+ \begin{enumerate}[noitemsep]
+ \item package option \kvopt{textfigures}{true} (or a synonym for such) and the roman font established by setting \kvopt{typeface}{\prm{roman font}} provides text figures natively, via \keyword{TS1}-encoding or through smallcaps selection; \emph{or}
+ \item package option \kvopt{textfigures}{\prm{substitute font}}.
+ \end{enumerate}
+
+ However, \cmd{textstylenums} generates \emph{lining style figures} if \kvopt{textfigures}{false} (or a synonym for such). The result is indeterminate if \kvopt{textfigures}{default}.
+
+ \item[\env{textnums}] The \env{textnums} environment is semantically equivalent to the \cmd{textstylenums} command.
+ \item[\cmd{liningstylenums}] This command provides a reciprocal of sorts to \cmd{textstylenums}. In all but a few exceptional cases, its argument will be rendered in lining style figures font.
+ \item[\env{liningnums}] The \env{liningnums} environment is semantically equivalent to the \cmd{liningstylenums} command.
+\end{enumerate}
+
+While their use is not particularly recommended, the commands \cmd{tsn} and \cmd{lsn} can be used in place of \cmd{textstylenums} and \cmd{liningstylenums}.
+\np%
+See section \ref{sec:textfigures} for information about configuring text figure fonts.
+
+\subsection{Typeface Print Names}
+\label{sec:printname}
+
+Typeface print names can be accessed with the following commands:
+
+\begin{ltxcode}
+<<\rmprintname>>
+<<\sfprintname>>
+<<\ttprintname>>
+<<\mathprintname>>
+<<\symbolsprintname>>
+<<\textfiguresprintname>>
+\end{ltxcode}
+
+For example, using \cmd{rmprintname} in this manual produces \keyword{\rmprintname}. All bets are off if the user or some package modified \cmd{rmdefault}, \cmd{sfdefault}, etcetera after \sty{typeface} was loaded.
+
+\section{Package Configuration}
+\label{sec:config}
+
+The \sty{typeface} package was developed with locale and institution specific customisations in mind. Customisation is carried out by modifying the \file{typeface.cfg} file. A sample \file{typeface.cfg} file is bundled with this package.
+\np%
+Note: \file{typeface.cfg} is loaded early during \sty{typeface} package processing. At that time, it has complete freedom to access or introduce new \sty{typeface} package commands. Due care should be applied. Many of \sty{typeface}'s internal commands contain the \keyword{@} character in their names. There is no need to, and therefore you should not, wrap \keyword{@}-containing identifiers between \cmd{makeatletter} and \cmd{makeatother} parse-time modifiers.
+
+\subsection{Typeface Options}
+
+Each of the six \opt{typeface} option defaults can be redefined. Here are some (typographically dubious) examples:
+
+\begin{ltxcode}
+\renewcommand*<<\TF@DEFAULTRMFONT>>{kpfonts:veryoldstyle:largesmallcaps}
+\renewcommand*<<\TF@DEFAULTSFFONT>>{helv:scale:0.75}
+\renewcommand*<<\TF@DEFAULTTTFONT>>{luxi:scale:lowercase}
+\renewcommand*<<\TF@DEFAULTMATHFONT>>{iwona:light:condensed}
+\renewcommand*<<\TF@DEFAULTSYMBOLSFONT>>{ams}
+\renewcommand*<<\TF@DEFAULTTEXTFIGURESFONT>>{palatino:spacing:20:lkern:-20}
+\end{ltxcode}
+
+Observe that these definitions literally substitute for default user package options. Accordingly, note that list separators are colons and not commas.
+\np%
+Extra code can be executed immediately before and/or after each typeface family is loaded. To do so, define
+\cmd{beforeloading}\prm{fam} and/or \cmd{afterloading}\prm{fam} in \file{typeface.cfg}. Here, \prm{fam} is any of \opt{textfigures}, \opt{symbols}, \opt{math}, \opt{rm}, \opt{sf} or \opt{tt}.
+\np%
+For example:
+\begin{ltxcode}
+\newcommand*<<\beforeloadingmath>>{
+ \ifthenelse{\equal{\tf@mathfont}{amsfonts}}{
+ % undefine the following to prevent amsfonts namespace clashes
+ \tf@undefinecommands{\underrightarrow,\underleftarrow}
+ \TF@PackageDebugInfoNoLine[\TF@CONFIGFILE]{%
+ Blew away \string\underrightarrow\space and
+ \string\underleftarrow\MessageBreak
+ symbols before loading amsfonts package}
+ }{}
+}
+\end{ltxcode}
+
+
+\subsection{Ancillary Package Options}
+
+Ancillary package option defaults can be configured in \file{typeface.cfg}. For example:
+
+\begin{ltxcode}
+\renewcommand*<<\TF@DEFAULTFONTENCODING>>{EU1:T1}
+\renewcommand*<<\TF@DEFAULTINPUTENCODING>>{dontload}
+\renewcommand*<<\TF@DEFAULTTEXTCOMP>>{safe}
+\renewcommand*<<\TF@DEFAULTCMAP>>{ignore}
+\end{ltxcode}
+
+Extra choices can be added to \sty{typeface}'s \opt{fontencoding} and \opt{inputencoding} package options lists. For example, suppose you wanted to make (fictitious) \opt{K9} and \opt{K10} font encodings available to \sty{typeface} package users. Then, after ensuring \file{k9enc.def} and \file{k10enc.def} encoding files are installed, simply include:
+
+\begin{ltxcode}
+\renewcommand*<<\tf@fontencodingchoices>>{K9,K10}
+\end{ltxcode}
+
+in \file{typeface.cfg}. Similarly, use \cmd{tf@inputencodingchoices} to add more options to \sty{typeface}'s inbuilt \opt{inputencoding} choice list.
+
+
+\subsection{\cmd{newtypeface} Command}
+\label{sec:newtypeface}
+
+The \cmd{newtypeface} command can be used to place additional \typei fonts under \sty{typeface} package access management. This command takes one optional and four mandatory arguments:
+
+\begin{enumerate}[labelsep=0.5em,noitemsep,format=\small\texttt,beginpenalty=5000,midpenalty=10000]
+\item[\#1] optional comma-separated list of typeface name aliases (enclose in square brackets)
+\item[\#2] primary typeface name
+\item[\#3] human-readable print name, accessible through commands outlined in section \ref{sec:printname}
+\item[\#4] typeface family: \opt{rm}, \opt{sf}, \opt{tt}, \opt{math}, \opt{symbols} or \opt{textfigures}
+\item[\#5] typeface initialisation code
+\end{enumerate}
+
+\example{1}
+
+\begin{ltxcode}
+% Adobe Bembo
+<<\newtypeface>>[bembo]{adobebembo}{Adobe Bembo}{rm}{
+ \renewcommand*\rmdefault{pbb}
+ <<\tf@SCencodedosf>>
+}
+\end{ltxcode}
+
+Assuming Adobe Bembo is installed on the system and accessible by its \keyword{pbb} Berry font name, \sty{typeface} users can now set their document's default roman font to Adobe Bembo using options \kvopt{typeface}{adobebembo} or \kvopt{typeface}{bembo}. Text figures will be selected from Adobe Bembo's smallcaps font.
+\np%
+Text figures declarations like \cmd{tf@SCencodedosf} apply only to \cmd{newtypeface} \opt{rm} definitions. Four commands are available for text figures configuration:
+
+\begin{enumerate}[labelsep=0.5em,noitemsep,format=\optlabel,beginpenalty=5000,midpenalty=10000]
+ \item[\cmd{tf@TSencodedosf}] Source text figures via \keyword{TS1} font encoding
+ \item[\cmd{tf@SCencodedosf}] Source text figures by switching to smallcaps
+ \item[\cmd{TF@NativeOSFError}] Advise user that the selected font does not accept package option \kvopt{textfigures}{true}
+ \item[\cmd{TF@NativeLFError}] Advise user that the selected font \emph{requires} package option \kvopt{textfigures}{true} (in practice, this is very rare)
+\end{enumerate}
+
+Absent these declarations, text figures are assumed to be natively available in the requested roman font. Nevertheless, without further configuration, the \cmd{textstylenums} and \cmd{liningstylenums} commands (resp: the \env{textnums} and \env{liningnums} environments) do very little at all. Therefore, at a minimum, you should specify the font's text figures and lining figures configuration. One way of doing this is shown below:
+
+\clearpage% manual adjustment - remove if things change
+
+\example{2}
+
+\begin{ltxcode}
+% Adobe Sabon
+<<\newtypeface>>[sabon]{adobesabon}{Adobe Sabon}{rm}{
+ \ifthenelse{\equal{<<\tf@osf@method>>}{<<\TF@OSF@JF>>}}{
+ \renewcommand*\rmdefault{psbj} % Native old style figures
+ <<\tf@define@liningfigures>>{psb}
+ }{
+ \renewcommand*\rmdefault{psb} % Native lining figures
+ }
+}
+\end{ltxcode}
+
+By the time \cmd{newtypeface} \keyword{rm} initialisation code is reached, internal macro \cmd{tf@osf@method} will have been initialised with one of the following four values\footnote{\cmd{tf@osf@method} initialisation occurs during \opt{textfigures} option processing. This processing will not have taken place before \cmd{newtypeface} \keyword{rm} initialisation code is executed if \subopt{rm} precedes \subopt{textfigures} in package option \opt{fontloadorder} (another reason to use this option with great care---see section \ref{sec:loadorder}). In that event, \cmd{tf@osf@method} will expand to \cmd{TF@OSF@NF}.}:
+
+\begin{enumerate}[labelsep=0.5em,noitemsep,format=\optlabel,beginpenalty=5000,midpenalty=10000]
+ \item[\cmd{TF@OSF@LF}] the user set package option \kvopt{textfigures}{false} (or synonym)
+ \item[\cmd{TF@OSF@JF}] the user set package option \kvopt{textfigures}{true} (or synonym)
+ \item[\cmd{TF@OSF@XF}] the user set package option \kvopt{textfigures}{\prm{substitute font}}
+ \item[\cmd{TF@OSF@NF}] the user has implicitly or explicitly set package option \kvopt{textfigures}{default}
+\end{enumerate}
+
+Thus, in this example, we set the document's default roman font to \keyword{psbj} (Adobe Sabon with old style figures) and the lining figures font to \keyword{psb} (Adobe Sabon with lining style figures) whenever the user sets \kvopt{textfigures}{true}, and to \keyword{psb} otherwise.
+
+\example{3}
+
+\begin{ltxcode}
+% Adobe Myriad Pro
+<<\newtypeface>>{adobemyriadpro}{Adobe Myriad Pro}{sf}{
+ <<\tf@ifsuboption>>{<<osf>>}{<<\tf@sffontoptions>>}{
+ % Myriad Pro has an OSF variant (depending on your installation)
+ \renewcommand*\sfdefault{Myriad-OsF}
+ \xdef\tf@sfprintname{\tf@sfprintname\ OSF}
+ }{
+ \renewcommand*\sfdefault{Myriad-LF}
+ }
+}
+\end{ltxcode}
+
+We set up sans serif font Adobe Myriad Pro in this example. This \keyword{sf} font is quite unusual in possessing lining and old style figures variants. We allow users their choice with this by testing for \opt{sanstypeface} suboption \subopt{osf} in the \cmd{newtypeface} code, initialising the font and its print name appropriately.
+\np%
+Note that we did nothing special to enable \keyword{rm} font relative scaling in this case. The \sty{typeface} package automatically handles this in (most) cases where the corresponding \keyword{sf} or \keyword{tt} font descriptor \file{.fd} file \emph{does not} contain scaling instructions.\footnote{Compare PXFonts Sans \file{t1pxss.fd} which does not contain scaling instructions and Helvetica \file{t1phv.fd} which contains scaling machinery. The \cmd{newtypeface} command automatically accommodates typeface scaling in the former case without special intervention. However, we must provide the \cmd{newtypeface} command explicit instruction about how to initialise scaling in the latter case. This is explored in examples 4 and 5.}
+
+% \clearpage% manual adjustment - remove if things change
+
+\example{4}
+
+\begin{ltxcode}
+% Helvetica
+<<\newtypeface>>[helv]{helvetica}{Helvetica}{sf}{
+ <<\scaletypeface>>{sf}
+ {\PassOptionsToPackage{scaled=<<\tf@sfscalefactor>>}{helvet}}
+ <<\tf@usefontpackage>>{helvet}
+}
+\end{ltxcode}
+
+In this example, using \sty{typeface}'s \cmd{scaletypeface} command, we simply pass the font family appropriate scale factor, \cmd{tf@sfscalefactor}, to the \opt{scaled} option in the \sty{helvet} package.
+\np%
+Note that \sty{typeface} command \cmd{tf@usefontpackage} is an instrumented version of \cmd{usepackage}. It should be used whenever loading font packages (and only then) since it facilitates debug information logging whenever package option \kvopt{debug}{true}.
+
+\example{5}
+
+\begin{ltxcode}
+% Helvetica
+<<\newtypeface>>[helv]{helvetica}{Helvetica}{sf}{
+ <<\scaletypeface>>{sf}{\newcommand*\Hv@scale{<<\tf@sfscalefactor>>}}
+ \renewcommand*\sfdefault{phv}
+}
+\end{ltxcode}
+
+We take an alternative approach to sans serif font scaling configuration in this example. As outlined in example 4, internal \sty{typeface} command \cmd{scaletypeface} accepts any scaling code eventually recognised by the target font definition (\file{.fd}) file. Here, we initialise \cmd{Hv@scale} to \sty{typeface}'s pre-computed sans serif font scale factor and specify the font we want in \cmd{sfdefault}. Again, there is no more to do in order to set up reference font (\keyword{rm}) relative scaling for \keyword{sans serif} and \keyword{teletype} fonts.
+
+\example{6}
+
+\begin{ltxcode}
+% Adobe Sabon text figures
+<<\newtypeface>>[sabon]{adobesabon}{Adobe Sabon}{textfigures}{
+ <<\tf@initialisetextfiguresfont>>{T1}
+ <<\tf@DeclareOsfFontShape>>{m}{n} {psbr9d}
+ <<\tf@DeclareOsfFontShape>>{m}{sc} {psbrc9d}
+ <<\tf@DeclareOsfFontShape>>{m}{it} {psbri9d}
+ <<\tf@DeclareOsfFontShape>>{m}{sl} {psbri9d}
+ <<\tf@DeclareOsfFontShape>>{b}{n} {psbb9d}
+ <<\tf@DeclareOsfFontShape>>{b}{it} {psbbi9d}
+ <<\tf@DeclareOsfFontShape>>{b}{sl} {psbbi9d}
+ <<\tf@DeclareOsfFontShape>>{bx}{n} {psbb9d}
+ <<\tf@DeclareOsfFontShape>>{bx}{it}{psbbi9d}
+ <<\tf@DeclareOsfFontShape>>{bx}{sl}{psbbi9d}
+}
+\end{ltxcode}
+
+This example demonstrates how to set up a new text figures typeface. This task requires just two commands. First, we declare the text figures font encoding using \cmd{tf@initialisetextfiguresfont}. That done, we transliterate the information from the appropriate font descriptor (\file{.fd}) file\footnote{In our case, turning to file \file{t1psbj.fd} for the required values.} into a series of \cmd{tf@DeclareOsfFontShape} commands.
+\np%
+Further examples of \cmd{newtypeface} usage can be found in the bundled configuration file and, of course, in package file \file{typeface.sty} itself.
+
+\subsection{Redefining Predefined Typefaces}
+
+\sty{Typeface} package typeface definitions might not always be what you want them to be. In such cases, you can override \sty{typeface}'s inbuilt \cmd{newtypeface} declarations by defining and saving new versions in \file{typeface.cfg}. Simply use the \cmd{newtypeface} command as before, the only requirement being that, to override an internal \cmd{newtypeface} definition, you must use the same key identifier {\small{\keyword{\#2}}} (the primary typeface name) and {\small{\keyword{\#4}}} (the typeface family) in your new typeface declaration.
+
+\clearpage% manual adjustment - remove if things change
+
+\section{Revision History}
+
+\begin{changelog}
+
+\begin{release}{0.1}{2012-06-18}
+
+\item Initial release for comments (pre-release).
+
+\end{release}
+
+\end{changelog}
+
+\end{document}