summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/heuristica/heuristica.sty
blob: 71109219beed40d2602ecc2a7554d32d5b725c4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
%% heuristica.sty
%%
\NeedsTeXFormat{LaTeX2e}
\def\fileversion{1.08}
\def\filedate{2015/01/04}
\ProvidesPackage{heuristica}
    [\filedate\space v\fileversion]
    
\message{`heuristica' v\fileversion, \filedate\space  Style file (m_sharpe) for Heuristica (a_panov, m_sharpe), an extension of Utopia.}

\RequirePackage[T2A,T2B,T2C,LY1,T1]{fontenc}
\RequirePackage{textcomp}
\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
}{}
\providecommand*{\textfrac}[2]{%
    \textsu{#1}\kern.01em\textfractionsolidus\kern-.03em\textin{#2}}

\IfFileExists{xkeyval.sty}{
    \newcommand*{\Heuristica@scale}{1}
    \RequirePackage{xkeyval}
    \DeclareOptionX{scale}{\renewcommand*{\Heuristica@scale}{##1}}
    \DeclareOptionX{scaled}{\renewcommand*{\Heuristica@scale}{##1}}
    \DeclareOptionX{space}[1.2]{\DeclareRobustCommand{\zut@sf}{%
    \fontdimen2\font=##1\fontdimen2\font}}
}{
    \let\DeclareOptionX\DeclareOption
    \let\ExecuteOptionsX\ExecuteOptions
    \let\ProcessOptionsX\ProcessOptions
}
\let\orig@footnote=\thefootnote
\let\orig@makefnmark=\@makefnmark

\newif\if@Heuristica@sups

\DeclareOptionX{lining}{\edef\Heuristica@figurestyle{LF}}
\DeclareOptionX{lf}{\edef\Heuristica@figurestyle{LF}}
\DeclareOptionX{oldstyle}{\edef\Heuristica@figurestyle{OsF}}
\DeclareOptionX{osf}{\edef\Heuristica@figurestyle{OsF}}
\DeclareOptionX{tabular}{\edef\Heuristica@figurealign{T}}
\DeclareOptionX{bold}{\edef\bfseries@rm{b}}
\DeclareOptionX{regular}{\edef\mdseries@rm{m}}
\DeclareOptionX{sups}{\@Heuristica@supstrue}
\ExecuteOptionsX{lining,tabular,bold,regular}
\ProcessOptionsX\relax

\def\useosf{\edef\Heuristica@figurestyle{OsF}}
\@onlypreamble\useosf

\DeclareRobustCommand{\textlf}[1]{%
  {\fontfamily{Heuristica-TLF}\selectfont #1}%
}% to get lf
\DeclareRobustCommand{\texttlf}[1]{%
  {\fontfamily{Heuristica-TLF}\selectfont #1}%
}% to get tlf
\DeclareRobustCommand{\textosf}[1]{%
  {\fontfamily{Heuristica-TOsF}\selectfont #1}%
}% to get osf
\DeclareRobustCommand{\texttosf}[1]{%
  {\fontfamily{Heuristica-TOsF}\selectfont #1}%
}% to get tosf

\renewcommand*{\rmdefault}{Heuristica-TLF} % always TLF in math
\renewcommand*{\familydefault}{\rmdefault}

\if@Heuristica@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

\AtEndPreamble{%
\renewcommand*{\rmdefault}{Heuristica-T\Heuristica@figurestyle}
\normalfont}

\endinput