summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mh/mhsetup.sty
blob: 5424b64c898cbc70a6007ebf0da25612702e365a (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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
%%
%% This is file `mhsetup.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mhsetup.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2002-2007,2010 by Morten Hoegholm <mh.ctan@gmail.com>
%% 
%% 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".
%% 
%% This Current Maintainer of this work is Morten Hoegholm.
%% 
%% This work consists of the main source file mhsetup.dtx
%% and the derived files
%%    mhsetup.sty, mhsetup.pdf, mhsetup.ins, mhsetup.drv.
%% 
\ProvidesPackage{mhsetup}%
  [2010/01/21 v1.2a programming setup (MH)]
\def\MHInternalSyntaxOn{
  \edef\MHInternalSyntaxOff{%
  \catcode`\noexpand\~=\the\catcode`\~\relax
  \catcode`\noexpand\ =\the\catcode`\ \relax
  \catcode`\noexpand\^^I=\the\catcode`\^^I\relax
  \catcode`\noexpand\@=\the\catcode`\@\relax
  \catcode`\noexpand\:=\the\catcode`\:\relax
  \catcode`\noexpand\_=\the\catcode`\_\relax
  \endlinechar=\the\endlinechar\relax
  }%
  \catcode`\~=10\relax
  \catcode`\ =9\relax
  \catcode`\^^I=9\relax
  \makeatletter
  \catcode`\_=11\relax
  \catcode`\:=11\relax
  \endlinechar=` %
  \relax
}
\MHInternalSyntaxOn
\AtEndOfPackage{\MHInternalSyntaxOff}
\let\MH_let:NwN \let
\def\MH_let:cN #1#2{
  \expandafter\MH_let:NwN \csname#1\endcsname#2}
\def\MH_let:cc #1#2{
  \expandafter\MH_let:NwN\csname#1\expandafter\endcsname
  \csname#2\endcsname}
\def\MH_new_boolean:n #1{
  \expandafter\@ifdefinable\csname if_boolean_#1:\endcsname{
    \@namedef{boolean_#1_true:}
      {\MH_let:cN{if_boolean_#1:}\iftrue}
    \@namedef{boolean_#1_false:}
      {\MH_let:cN{if_boolean_#1:}\iffalse}
    \@nameuse{boolean_#1_false:}%
  }
}
\def\MH_set_boolean_F:n #1{ \@nameuse{boolean_#1_false:} }
\def\MH_set_boolean_T:n #1{ \@nameuse{boolean_#1_true:} }
\def\MH_if_boolean:nTF #1{
  \@nameuse{if_boolean_#1:}
    \expandafter\@firstoftwo
  \else:
    \expandafter\@secondoftwo
  \fi:
}
\def\MH_if_boolean:nT #1{
  \@nameuse{if_boolean_#1:}
    \expandafter\@firstofone
  \else:
    \expandafter\@gobble
  \fi:
}
\def\MH_if_boolean:nF #1{
  \@nameuse{if_boolean_#1:}
    \expandafter\@gobble
  \else:
    \expandafter\@firstofone
  \fi:
}
\@ifundefined{if:w}{\MH_let:NwN \if:w =\if}{}
\@ifundefined{if_meaning:NN}{\MH_let:NwN \if_meaning:NN =\ifx}{}
\@ifundefined{else:}{\MH_let:NwN \else:=\else}{}
\@ifundefined{fi:}{\MH_let:NwN \fi:=\fi}{}
\AtBeginDocument{
  \@ifundefined{if_num:w}{\MH_let:NwN \if_num:w =\ifnum}{}
  \@ifundefined{if_dim:w}{\MH_let:NwN \if_dim:w =\ifdim}{}
  \@ifundefined{if_case:w}{\MH_let:NwN \if_case:w =\ifcase}{}
}
\@ifundefined{or:}{\MH_let:NwN \or:=\or}{}
\def\MH_cs_to_str:N {\expandafter\@gobble\string}
\@ifundefined{eTeXversion}
  {
    \MH_let:NwN \MH_protected:\relax
    \def\MH_setlength:dn{\setlength}
    \def\MH_addtolength:dn{\addtolength}
  }
  {
    \MH_let:NwN \MH_protected:\protected
    \def\MH_setlength:dn #1#2{#1=\dimexpr#2\relax\relax}
    \def\MH_addtolength:dn #1#2{\advance#1 \dimexpr#2\relax\relax}
  }

\def\MH_keyval_alias_with_addon:nnnn #1#2#3#4{
  \@namedef{KV@#1@#2}{\@nameuse{KV@#1@#3}#4}
  \@namedef{KV@#1@#2@default}{\@nameuse{KV@#1@#3@default}#4}}
\def\MH_keyval_alias:nnn #1#2#3{
  \MH_keyval_alias_with_addon:nnnn {#1}{#2}{#3}{}}
\def\MH_use_choice_i:nnnn #1#2#3#4{#1}
\def\MH_use_choice_ii:nnnn #1#2#3#4{#2}
\def\MH_use_choice_iii:nnnn #1#2#3#4{#3}
\def\MH_use_choice_iv:nnnn #1#2#3#4{#4}
\long\def\MH_nospace_ifnextchar:Nnn #1#2#3{
  \MH_let:NwN\reserved@d=~#1
  \def\reserved@a{#2}
  \def\reserved@b{#3}
  \futurelet\@let@token\MH_nospace_nextchar:
}
\def\MH_nospace_nextchar:{
  \if_meaning:NN \@let@token\reserved@d
    \MH_let:NwN \reserved@b\reserved@a
  \fi:
  \reserved@b
}
\long\def\MH_nospace_testopt:nn #1#2{
  \MH_nospace_ifnextchar:Nnn[
    {#1}
    {#1[{#2}]}
}
\def\MH_nospace_protected_testopt:n #1{
  \if_meaning:NN \protect\@typeset@protect
    \expandafter\MH_nospace_testopt:nn
  \else:
    \@x@protect#1
  \fi:
}
\@ifundefined{kernel@ifnextchar}
  {\MH_let:NwN \kernel@ifnextchar \@ifnextchar}
  {}
\MH_let:NwN \MH_kernel_xargdef:nwwn \@xargdef
\long\def\MH_nospace_xargdef:nwwn #1[#2][#3]#4{
  \@ifdefinable#1{
     \expandafter\def\expandafter#1\expandafter{
          \expandafter
          \MH_nospace_protected_testopt:n
          \expandafter
          #1
          \csname\string#1\endcsname
          {#3}}
       \expandafter\@yargdef
          \csname\string#1\endcsname
           \tw@
           {#2}
           {#4}}}
\providecommand*\MHPrecedingSpacesOff{
  \MH_let:NwN \@xargdef \MH_nospace_xargdef:nwwn
}
\providecommand*\MHPrecedingSpacesOn{
  \MH_let:NwN \@xargdef \MH_kernel_xargdef:nwwn
}
\def \MH_group_align_safe_begin: {\iffalse{\fi\ifnum0=`}\fi}
\def \MH_group_align_safe_end:   {\ifnum0=`{}\fi}
\endinput
%%
%% End of file `mhsetup.sty'.