1
2
3
4
5
6
7
8
9
10
11
12
13
14\registerctxluafile{langurl}{}
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 \scratchskipone\zeropoint\s!plus\dimexpr\emwidth12\s!minus\dimexpr\emwidth24\relax
105 \scratchskiptwo\zeropoint\s!plus\dimexpr\emwidth48\s!minus\dimexpr\emwidth96\relax
106 \unprotect
107 \normalexpanded{\noexpand\clf_hyphenatedurl
108 {\noexpand\detokenize{#1}}
109 \hyphenatedurllefthyphenmin
110 \hyphenatedurlrighthyphenmin
111 {\hyphenatedurldiscretionary}
112 }
113 \protect
114 \endgroup}
115
116
117
118
119
120
121
122
123
124
125\ifx\hyphenatedfilename\undefined \let\hyphenatedfilename\hyphenatedurl \fi
126
127
128
129
130
131
132
133
134
135
136
137
138
139\protect \endinput
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 |