1
2
3
4
5
6
7
8
9
10
11
12
13
14\registerctxluafile
{
lang
url
}{}
15
16\unprotect
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\newtoks
\everyhyphenatedurl
45
46\appendtoks
47 \resetfontfeature
48 \resetcharacterspacing
49
50 \let
\&
\letterampersand
51 \let
\#
\letterhash
52 \let
\~
\lettertilde
53 \let
\\
\letterbackslash
54 \let
\$
\letterdollar
55 \let
\^
\letterhat
56 \let
\_
\letterunderscore
57 \let
\{
\letterleftbrace
58 \let
\}
\letterrightbrace
59 \let
\|
\letterbar
60 \let
=
\lettertilde
61 \let
=
\letterbar
62 \let
\Ux\eUx
63\to
\everyhyphenatedurl
64
65\let
\hyphenatedurlseparator
\empty
66\let
\hyphenatedurldiscretionary
\empty
67
68\setnewconstant
\hyphenatedurllefthyphenmin
\plusthree
69\setnewconstant
\hyphenatedurlrighthyphenmin
\plusthree
70
71\def
\lang_url_more
{
\penalty
\plustenthousand
\hskip
\scratchskipone
\penalty
\plustenthousand
}
72\def
\lang_url_less
{
\penalty
\plustenthousand
\hskip
\scratchskiptwo
\penalty
\plustenthousand
}
73\def
\lang_url_trac
{
\penalty
\plustenthousand
\hsmash
{
\darkred
\vl
}
\penalty
\plustenthousand
}
74
75\def
\lang_url_a
#
1
{
\lang_url_more
\char
#
1
\lang_url_show
\discretionary
{}{
\hyphenatedurlseparator
}{}}
76\def
\lang_url_b
#
1
{
\lang_url_more
\discretionary
{
\hyphenatedurlseparator
}{}{}
\lang_url_show
\char
#
1
\relax
}
77\def
\lang_url_d
{
\lang_url_more
\discretionary
{
\lang_url_show
}{
\lang_url_show
}{
\lang_url_show
}}
78\def
\lang_url_l
#
1
{
\lang_url_less
\char
#
1
\relax
}
79\def
\lang_url_c
#
1
{
\lang_url_more
\char
#
1
\relax
}
80\def
\lang_url_L
#
1
{
\lang_url_less
\char
#
1
\relax
}
81\def
\lang_url_C
#
1
{
\lang_url_more
\char
#
1
\relax
}
82
83\unexpanded
\def
\showhyphenatedurlbreaks
84 {
\let
\lang_url_show
\lang_url_trac
}
85
86\installtextracker
87 {
languages
.
url
}
88 {
\let
\lang_url_show
\lang_url_trac
}
89 {
\let
\lang_url_show
\relax
}
90
91\let
\lang_url_show
\relax
92
93\unexpanded
\def
\sethyphenatedurlnormal
#
1
{
\clf_sethyphenatedurlcharacters
{
#
1
}{
\v!normal
}}
94\unexpanded
\def
\sethyphenatedurlbefore
#
1
{
\clf_sethyphenatedurlcharacters
{
#
1
}{
\v!before
}}
95\unexpanded
\def
\sethyphenatedurlafter
#
1
{
\clf_sethyphenatedurlcharacters
{
#
1
}{
\v!after
}}
96
97
98
99\unexpanded
\def
\hyphenatedurl
#
1
100 {
\dontleavehmode
101 \begingroup
102 \the
\everyhyphenatedurl
103 \normallanguage
\zerocount
104 \let
\a
\lang_url_a
105 \let
\b
\lang_url_b
106 \let
\d
\lang_url_d
107 \let
\l
\lang_url_l
108 \let
\c
\lang_url_c
109 \let
\L
\lang_url_L
110 \let
\C
\lang_url_C
111 \scratchskipone
\zeropoint
\s!plus
\dimexpr
\emwidth
1
2
\s!minus
\dimexpr
\emwidth
2
4
\relax
112 \scratchskiptwo
\zeropoint
\s!plus
\dimexpr
\emwidth
4
8
\s!minus
\dimexpr
\emwidth
9
6
\relax
113 \normalexpanded
{
\noexpand
\clf_hyphenatedurl
114 {
\noexpand\detokenize
{
#
1
}}
115 \hyphenatedurllefthyphenmin
116 \hyphenatedurlrighthyphenmin
117 {
\hyphenatedurldiscretionary
}
118 }
119 \endgroup
}
120
121
122
123
124
125
126
127
128
129
130\ifx
\hyphenatedfilename
\undefined
\let
\hyphenatedfilename\hyphenatedurl
\fi
131
132
133
134
135
136
137
138
139
140
141
142
143
144\protect
\endinput
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