blob: ef26da1e8fa486d0e9c1163ca0c30e82b3e9fdbc (
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
%% Copyright 2010 Clea F. Rees
%
% 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 Current Maintainer of this work is Clea F. Rees.
%
% This work consists of all files listed in manifest.txt.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{berenis}[2010/08/26 v1.0 berenis]
\RequirePackage{xkeyval}
\RequirePackage[LY1]{fontenc}
\RequirePackage{nfssext-cfr}
%:boolkeys for ligature/swash encoding as default
\define@boolkey{berenis.sty}[berenis@]{lig}[true]{%
\ifberenis@lig
\def\berenis@lig{w}%
\else
\def\berenis@lig{}%
\fi}
%:boolkeys for roman osf/lf
\define@boolkey{berenis.sty}[berenis@]{osf}[true]{%
\ifberenis@osf
\def\berenis@lfosf{j}%
\else
\def\berenis@lfosf{}%
\fi}
\define@boolkey{berenis.sty}[berenis@]{lf}[true]{%
\ifberenis@lf
\def\berenis@lfosf{}%
\else
\def\berenis@lfosf{j}%
\fi}
%:boolkeys for roman prop/tab
\define@boolkey{berenis.sty}[berenis@]{prop}[true]{%
\ifberenis@prop
\def\berenis@tabprop{2}%
\else
\def\berenis@tabprop{}%
\fi}
\define@boolkey{berenis.sty}[berenis@]{tab}[true]{%
\ifberenis@tab
\def\berenis@tabprop{}%
\else
\def\berenis@tabprop{2}%
\fi}
\define@boolkey{berenis.sty}[berenis@]{lm}[true]{%
\ifberenis@lm
\relax
\else
\PackageWarning{berenis.sty}{%
Default sf and tt families will not\MessageBreak
be changed to Latin Modern.\MessageBreak
You should change the defaults\MessageBreak
yourself since Computer Modern\MessageBreak
does not support LY1.\MessageBreak}%
\fi}
%:defaults to ensure everything is defined to something
\ExecuteOptionsX{lig=false,osf=true,prop=true,lm=true}
%:options override defaults
\ProcessOptionsX
%:make BerenisADFPro default roman font, implementing options for ligature/swash encoding and lf/osf as applicable
\renewcommand{\rmdefault}{ybd\berenis@tabprop\berenis@lfosf\berenis@lig}
\ifberenis@lm
\renewcommand{\sfdefault}{lmss}
\renewcommand{\ttdefault}{lmtt}
\fi
\newcommand*{\berenis@rhybudd}[2]{\PackageWarning{berenis.sty}{#1 unavailable.\MessageBreak #2 used instead.\MessageBreak}}%
%:based on definition of \ss from afm2pl manual page
\def\zeroslash{%
\setbox0\hbox{\char184}%
\setbox1\hbox{\char24}%
\ifnum\wd0=\wd1 \char48\berenis@rhybudd{slashed zero}{zero}\else\ifnum\wd0=0 \char48\berenis@rhybudd{slashed zero}{zero}\else\char184\fi\fi}
%:experiment: even if this works, it is a horrible kludge
\gdef\berenis@ligswash{w}%
\def\berenis@Q{ Q}%
\def\berenis@get@vff#1#2#3#4\@nil{#1#2#3}%
\def\berenis@get@variants ybd#1\@nil{#1}%
\def\berenis@cyntaf@variant#1#2\@nil{#1}%
\def\berenis@ail@variant#1#2\@nil{#2}%
\newcommand*{\berenis@variants}[1]{%
\edef\tempz{#1}%
\def\tempe{}%
\ifx\tempz\tempe
\gdef\berenis@olaf{}%
\else
\edef\tempb{\expandafter\berenis@cyntaf@variant#1 Q\@nil}%
\edef\tempc{\expandafter\berenis@ail@variant#1 Q\@nil}%
\edef\tempd{\expandafter\berenis@ail@variant#1\@nil}%
\ifx\tempc\berenis@Q \gdef\berenis@olaf{\tempb}\else\berenis@variants{\tempd}\fi
\fi
}%
\newcommand*{\berenis@teulu}{%
\edef\tempf{\expandafter\berenis@get@vff\f@family\@nil}%
\def\tempybd{ybd}%
\ifx\tempf\tempybd
\edef\tempa{\expandafter\berenis@get@variants\f@family\@nil}%
\berenis@variants{\tempa}%
\else
\gdef\berenis@olaf{}%
\fi}%
\DeclareTextCompositeCommand{\^}{LY1}{W}{%
\berenis@teulu
\edef\tempx{\berenis@ligswash}%
\edef\tempy{\berenis@olaf}%
\ifx\tempx\tempy \char29 \else\accent94\char87\fi
}
\DeclareTextCompositeCommand{\^}{LY1}{w}{%
\berenis@teulu
\edef\tempx{\berenis@ligswash}%
\edef\tempy{\berenis@olaf}%
\ifx\tempx\tempy \char31 \else\accent94\char119\fi
}
\DeclareTextCompositeCommand{\^}{LY1}{Y}{%
\berenis@teulu
\edef\tempx{\berenis@ligswash}%
\edef\tempy{\berenis@olaf}%
\ifx\tempx\tempy \char223 \else\accent94\char89\fi
}
\DeclareTextCompositeCommand{\^}{LY1}{y}{%
\berenis@teulu
\edef\tempx{\berenis@ligswash}%
\edef\tempy{\berenis@olaf}%
\ifx\tempx\tempy \char26 \else\accent94\char121\fi
}
\endinput
%% end berenis.sty
|