summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lambda/base/odev.sty
blob: 882870d2b9c4da88d676b3a945dd7c65a9390d3e (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
\def\externalfont{\fontfamily{\rmdefault}\selectfont}
     \ocp\HindiA=velthuis2unicode
     \ocp\HindiB=hindi-uni2cuni
     \ocp\HindiBS=sanskrit-uni2cuni
     \ocp\HindiC=hindi-uni2cuni2
     \ocp\HindiD=hindi-cuni2font
     \ocp\HindiDS=sanskrit-cuni2font
     \ocp\HindiE=hindi-cuni2font2
     \ocp\HindiF=hindi-cuni2font3

     \ocplist\HindiCTP=
     \addbeforeocplist 1 \HindiA
     \addbeforeocplist 2 \HindiB
     \addbeforeocplist 3 \HindiC
     \addbeforeocplist 4 \HindiD
     \addbeforeocplist 5 \HindiE
     \addbeforeocplist 6 \HindiF
     \nullocplist
     \ocplist\SanskritCTP=
     \addbeforeocplist 1 \HindiA
     \addbeforeocplist 2 \HindiBS
     \addbeforeocplist 3 \HindiC
     \addbeforeocplist 4 \HindiDS
     \addbeforeocplist 5 \HindiE
     \addbeforeocplist 6 \HindiF
     \nullocplist
\newcount\dev@chnum
%
\newcommand*\do@dev@catcodes{%
  \dev@chnum=0
  \loop\catcode\dev@chnum=11
    \ifnum\dev@chnum<12 \advance\dev@chnum by1
    \repeat
  \dev@chnum=14
  \loop\catcode\dev@chnum=11
    \ifnum\dev@chnum<31 \advance\dev@chnum by1
    \repeat
  \catcode127=11 }
%
% We execute the macro straight away, which means these catcodes are in
% force throughout the whole document, not just in the Devanagari part
% of the text.  This can sometimes cause spurious "Omega" characters if,
% in some special conditions, TeX reads a line feed outside the \dn environment,
% and so forth.
% The alternative, i.e., calling the catcodes locally within Devanagari text, leads
% to even worse "illegal character" problems with \chapter and \section headings, etc.
% This dilemma may be soluble in the longer run, but is not being addressed in
% the current release (1999).
%
%
% Here are the macros that set the particular characters in the font:
%
\newdimen\itdim
%
\DeclareRobustCommand*\subscr[1]{{\clearocplists\/\itdim=\lastkern
  \unkern\kern-\itdim \lower\dp0 \hbox to\itdim{#1\hfil}}}
%
\DeclareRobustCommand*\5{\llap{\char125}}
\DeclareRobustCommand*\qqq[1]{\setbox0=\hbox{#1}#1\subscr{\char126}}
\DeclareRobustCommand*\qqqa[1]{\setbox0=\hbox{#1}#1\subscr{\char0}}
\DeclareRobustCommand*\qqqb[1]{\setbox0=\hbox{#1}#1\subscr{\char1}}
\DeclareRobustCommand*\qqqc[1]{\setbox0=\hbox{#1}#1\subscr{\char2}}
\DeclareRobustCommand*\qa[2]{\setbox0=\hbox{#1}#1\subscr{\char253\kern1.5ex\lower1.25ex
  \hbox{\char#2}\kern-1.5ex}}
\DeclareRobustCommand*\qb[1]{\setbox0=\hbox{#1}#1\subscr{\char253}}
% New \qc ligature command introduced by devnag version 2:
\DeclareRobustCommand*\qc[2]{\setbox0=\hbox{#1}#1\subscr{\char126\kern1.5ex\lower1.25ex
  \hbox{\char#2}\kern-1.5ex}}
\DeclareRobustCommand*\qq[1]{\setbox0=\hbox{#1}#1\subscr{\char94}}
\DeclareRobustCommand*\qx[1]{\setbox0=\hbox{#1}#1\subscr{\char14}}
\DeclareRobustCommand*\qy[1]{\setbox0=\hbox{#1}#1\subscr{\char31}}
\DeclareRobustCommand*\qz[1]{\setbox0=\hbox{#1}#1\subscr{\char124}}
\DeclareRobustCommand*\qzz[1]{{\clearocplists#1A\llap{\char4}}}
\DeclareRobustCommand*\qva{\kern0.5ex\2\kern-0.5ex}
\DeclareRobustCommand*\qvb{\kern1ex\0\kern-1ex}
\DeclareRobustCommand*\qvc{\kern1ex\rdt\kern-1ex}
\DeclareRobustCommand*\rs{\rm\thinspace}
\let\re=\thinspace
\DeclareRobustCommand*\rdt{\llap{\char19}}
\DeclareRobustCommand*\dnnum{\let\nstyle=d}
\DeclareRobustCommand*\cmnum{\let\nstyle=r}
\cmnum
\DeclareRobustCommand*\rn[1]{\if\nstyle r{\rm #1}\else#1\fi}
\def\qqqx{\llap{{\clearocplists\char32}}}
\def\qqqy{\llap{{\clearocplists\char"5C}}}
\def\qqqz{\llap{{\clearocplists\char"7B}}}
\def\qqqs{\llap{{\clearocplists\char4}}}
\def\qqqr{\llap{{\clearocplists\char3}}}
%
%
%


%{\pushocplist\HindiCTP katarama k kt ktr ktrm ktrm}


\long\def\hindi{\do@dev@catcodes
\fontencoding{U}\fontfamily{dn}\selectfont\catcode`\~=11
\pushocplist\HindiCTP}
\long\def\sanskrit{\do@dev@catcodes
\fontencoding{U}\fontfamily{dn}\selectfont\catcode`\~=11
\pushocplist\SanskritCTP}