summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/hyphenex/hyphenex.sh
blob: ec8e101976ca21bfdc36050c5229b847b345bde6 (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
#! /bin/sh
#
# hyphenex.sh
#
# This small filter converts a hyphenation exception log article for
# TUGBoat to a real \hyphenation block.
#
# Written by Werner Lemberg <wl@gnu.org>.
#
# Version 1.5 (2008/05/20)
#
# Public domain.
#
#
# Usage:
#   sh hyphenex.sh < tugboat-article > hyphenation-exceptions

cat >/tmp/sed.$$ <<SED_EOF
1 i\\
% Hyphenation exceptions for US English,\\
% based on hyphenation exception log articles in TUGboat.\\
%\\
% Copyright 2008 TeX Users Group.\\
% You may freely use, modify and/or distribute this file.\\
%\\
% This is an automatically generated file.  Do not edit!\\
%\\
% Please contact the TUGboat editorial staff <tugboat@tug.org>\\
% for corrections and omissions.\\
\\
\\\\hyphenation{
\$ i\\
}\\
\\
% EOF
/^\\\\tabalign/ {
  s/{}//g
  s/[ 	][ 	]*/ /g
  s/ *\\\\[^ ][^ ]*\$//
  s/\\\\tabalign *[^ ][^ ]*.*& *\\(.*\\)\$/  \\1/p
  b
}
/^\\\\[123456]/ !d
s/\\\\4/\\\\1/
s/\\\\5/\\\\2/
s/\\\\6/\\\\3/
s/[ 	][ 	]*/ /g
s/^/  /
s/\\\\1 [^ ][^ ]* {\\(.*\\)}\$/\\1/
s/\\\\2 [^ ][^ ]* {\\(.*\\) \\(.*\\),\\(.*\\),\\(.*\\)}\$/\\1\\n  \\1\\2\\n  \\1\\3\\n  \\1\\4/
s/\\\\2 [^ ][^ ]* {\\(.*\\) \\(.*\\),\\(.*\\)}\$/\\1\\n  \\1\\2\\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