diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /fonts/erewhon/tex/erewhon.sty |
Initial commit
Diffstat (limited to 'fonts/erewhon/tex/erewhon.sty')
-rw-r--r-- | fonts/erewhon/tex/erewhon.sty | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/fonts/erewhon/tex/erewhon.sty b/fonts/erewhon/tex/erewhon.sty new file mode 100644 index 0000000000..53182a6c24 --- /dev/null +++ b/fonts/erewhon/tex/erewhon.sty @@ -0,0 +1,163 @@ +%% erewhon.sty +%% +\NeedsTeXFormat{LaTeX2e} +\def\fileversion{1.08} +\def\filedate{2017/03/14} +\ProvidesPackage{erewhon} + [\filedate\space v\fileversion] + +\message{`erewhon' v\fileversion, \filedate\space Style file for Erewhon (m_sharpe), based on Heuristica (a_panov) and, ultimately, Utopia.} + +%\RequirePackage[T2A,T2B,T2C,LY1,T1]{fontenc} +\RequirePackage[LY1,T1]{fontenc} +\RequirePackage{textcomp} +\RequirePackage{ifthen} +\IfFileExists{mweights.sty}{\RequirePackage{mweights}}{} +\RequirePackage{etoolbox} +\IfFileExists{fontaxes.sty}{ + \RequirePackage{fontaxes} + \fa@naming@exception{figures}{{superior}{proportional}}{Sup} + \fa@naming@exception{figures}{{superior}{tabular}}{Sup} + \def\sufigures{\@nomath\sufigures% + \fontfigurestyle{superior}\selectfont} + \DeclareTextFontCommand{\textsu}{\sufigures} + \let\textsuperior\textsu + + \fa@naming@exception{figures}{{inferior}{proportional}}{Inf} + \fa@naming@exception{figures}{{inferior}{tabular}}{Inf} + \def\infigures{\@nomath\infigures% + \fontfigurestyle{inferior}\selectfont} + \DeclareTextFontCommand{\textin}{\infigures} + \let\textinferior\textin + \fa@naming@exception{figures}{{numerators}{proportional}}{Numr} + \fa@naming@exception{figures}{{numerators}{tabular}}{Numr} + \def\nufigures{\@nomath\nufigures% + \fontfigurestyle{numerators}\selectfont} + \DeclareTextFontCommand{\textnu}{\nufigures} + \let\textnumerator\textnu + + \fa@naming@exception{figures}{{denominators}{proportional}}{Dnom} + \fa@naming@exception{figures}{{denominators}{tabular}}{Dnom} + \def\defigures{\@nomath\defigures% + \fontfigurestyle{denominators}\selectfont} + \DeclareTextFontCommand{\textde}{\defigures} + \let\textdenominator\textde +}{} +\providecommand*{\textfrac}[2]{% + \textnu{#1}\kern0em\textfractionsolidus\kern0em\textde{#2}} + +\def\erewhon@spc{.211em} +\def\erewhon@stretch{.1055em} +\def\erewhon@shrink{.0703em} +\def\erewhon@spcf{} % a factor to multiply \fontdimen2 + +\newcommand*{\erewhon@scale}{1} +\RequirePackage{xkeyval} +\DeclareOptionX{scale}{\renewcommand*{\erewhon@scale}{#1}} +\DeclareOptionX{scaled}{\renewcommand*{\erewhon@scale}{#1}} +\DeclareOptionX{spacing}[.25em]{\gdef\erewhon@spc{#1}} +\DeclareOptionX{stretch}[.125em]{\gdef\erewhon@stretch{#1}} +\DeclareOptionX{shrink}[.1em]{\gdef\erewhon@shrink{#1}} +\DeclareOptionX{space}[1.23]{\gdef\erewhon@spcf{#1}} + +\let\orig@footnote=\thefootnote +\let\orig@makefnmark=\@makefnmark +\def\bfseries@rm{b} +\def\mdseries@rm{m} + +\newif\if@Erewhon@sups +\newif\if@Erewhon@scosf +\def\useosf{\edef\Erewhon@figurestyle{OsF}} +\@onlypreamble\useosf +\def\useproportional{\edef\Erewhon@figurealign{}} +\@onlypreamble\useproportional +%\newif\ifErewhon@babel +%\ifdefined\bbl@version \Erewhon@babeltrue\fi + +\DeclareOptionX{lining}{\edef\Erewhon@figurestyle{LF}} +\DeclareOptionX{lf}{\edef\Erewhon@figurestyle{LF}} +\DeclareOptionX{oldstyle}{\useosf} +\DeclareOptionX{osf}{\useosf} +\DeclareOptionX{tabular}{\edef\Erewhon@figurealign{T}} +\DeclareOptionX{p}{\useproportional} +\DeclareOptionX{proportional}{\useproportional} +\DeclareOptionX{sups}{\@Erewhon@supstrue} +\DeclareOptionX{scosf}{\@Erewhon@scosftrue} +\DeclareOptionX{looser}{% +\gdef\erewhon@spc{.25em}\gdef\erewhon@stretch{.125em}\erewhon@shrink{.1em}} +\DeclareOptionX{loosest}{% +\gdef\erewhon@spc{.28em}\gdef\erewhon@stretch{.125em}\gdef\erewhon@shrink{.13em}} +\ExecuteOptionsX{lining,tabular} +\ProcessOptionsX\relax + +\ifthenelse{\equal{\erewhon@spcf}{}}{% +\DeclareRobustCommand{\erewhon@sf}{% + \fontdimen2\font=\erewhon@spc + \fontdimen3\font=\erewhon@stretch + \fontdimen4\font=\erewhon@shrink}}{% +\DeclareRobustCommand{\erewhon@sf}{% + \fontdimen2\font=\erewhon@spcf\fontdimen2\font}} + +\DeclareRobustCommand{\lfstyle}{% + \not@math@alphabet\lfstyle\relax + \fontfamily{erewhon-LF}\selectfont % +}% to get lf +\DeclareRobustCommand{\tlfstyle}{% + \not@math@alphabet\tlfstyle\relax + \fontfamily{erewhon-TLF}\selectfont % +}% to get tlf +\DeclareRobustCommand{\osfstyle}{% + \not@math@alphabet\osfstyle\relax + \fontfamily{erewhon-OsF}\selectfont % +}% to get osf +\DeclareRobustCommand{\tosfstyle}{% + \not@math@alphabet\tosfstyle\relax + \fontfamily{erewhon-TOsF}\selectfont % +}% to get tosf +\DeclareRobustCommand{\textlf}[1]{% + {\lfstyle #1}% +}% to get lf +\DeclareRobustCommand{\texttlf}[1]{% + {\tlfstyle #1}% +}% to get tlf +\DeclareRobustCommand{\textosf}[1]{% + {\osfstyle #1}% +}% to get osf +\DeclareRobustCommand{\texttosf}[1]{% + {\tosfstyle #1}% +}% to get tosf +\if@Erewhon@scosf % +\DeclareRobustCommand{\textsc}[1]{% +{\fontfamily{erewhon-\Erewhon@figurealign% +OsF}\fontshape{sc}\selectfont #1}% +}\fi% use OsF in small caps +\renewcommand*{\rmdefault}{erewhon-TLF} % always TLF in math +\renewcommand*{\familydefault}{\rmdefault} + +\if@Erewhon@sups % + \ifdefined\sufigures + \def\f@@tn@te{footnote} + \def\@makefnmark{% + \ifx\@mpfn\f@@tn@te% + \ifx\thefootnote\orig@footnote% + \hbox{\sufigures\hspace*{.04em}\@thefnmark\hspace*{.04em}}% + \else% + \orig@makefnmark% + \fi + \else% + \orig@makefnmark% + \fi}% + \fi% +\fi + +%\ifErewhon@babel +% \renewcommand*{\rmdefault}{erewhon-\Erewhon@figurealign% +% \Erewhon@figurestyle} +% \normalfont +%\else + \AtEndPreamble{% + \renewcommand*{\rmdefault}{erewhon-\Erewhon@figurealign% + \Erewhon@figurestyle} + \normalfont} +%\fi +\endinput |