diff options
author | Karl Berry <karl@freefriends.org> | 2007-12-10 18:21:56 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-12-10 18:21:56 +0000 |
commit | c1967007b6e58b2a7492744b5330ae4a684c7240 (patch) | |
tree | e45d1d2a1ca7c4ee90e16e6d6a6a761528a490cb /Master | |
parent | 97509dfa0b075dfdc328c84a27668fb11e9303d1 (diff) |
new scripts for hyphenation exceptions
git-svn-id: svn://tug.org/texlive/trunk@5748 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-doc/source/generic/hyphenex/README | 2 | ||||
-rw-r--r-- | Master/texmf-doc/source/generic/hyphenex/hyphenex.pl | 81 | ||||
-rw-r--r-- | Master/texmf-doc/source/generic/hyphenex/hyphenex.sh | 92 | ||||
-rwxr-xr-x | Master/tlpkg/bin/ctan2tds | 5 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/collection-binextra.tlpsrc | 7 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/hyphenex.tlpsrc | 2 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/jsclasses.tlpsrc | 2 |
7 files changed, 187 insertions, 4 deletions
diff --git a/Master/texmf-doc/source/generic/hyphenex/README b/Master/texmf-doc/source/generic/hyphenex/README new file mode 100644 index 00000000000..015cdd20203 --- /dev/null +++ b/Master/texmf-doc/source/generic/hyphenex/README @@ -0,0 +1,2 @@ +Scripts to generate hyphenation exceptions from tub, written +by Werner Lemberg. This material is public domain.
\ No newline at end of file diff --git a/Master/texmf-doc/source/generic/hyphenex/hyphenex.pl b/Master/texmf-doc/source/generic/hyphenex/hyphenex.pl new file mode 100644 index 00000000000..7cc546634f7 --- /dev/null +++ b/Master/texmf-doc/source/generic/hyphenex/hyphenex.pl @@ -0,0 +1,81 @@ +#! /usr/bin/env perl +# +# +# hyphenex.pl +# +# 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.2 (2007/11/16) +# +# Public domain. +# +# +# Usage: +# +# [perl] hyphenex.pl < tugboat-article > hyphenation-exceptions + +# print header +print "% Hyphenation exceptions for US English,\n"; +print "% based on hyphenation exception log articles in TUGboat.\n"; +print "%\n"; +print "% Copyright 2007 TeX Users Group.\n"; +print "% You may freely use, modify and/or distribute this file.\n"; +print "%\n"; +print "% This is an automatically generated file. Do not edit!\n"; +print "%\n"; +print "% Please contact the TUGboat editorial staff <tugboat\@tug.org>\n"; +print "% for corrections and omissions.\n"; +print "\n"; +print "\\hyphenation{\n"; + +while (<>) { + # retain only lines starting with \1 ... \6 or \tabalign + next if not (m/^\\[123456]/ || m/^\\tabalign/); + # remove final newline + chop; + # remove all TeX commands except \1 ... \6 + s/\\[^123456\s{]+//g; + # remove all paired { ... } + 1 while s/{(.*?)}/\1/g; + # skip lines which now have only whitespace before `&' + next if m/^\s*&/; + # remove comments + s/%.*//; + # remove trailing whitespace + s/\s*$//; + # remove trailing `*' (used as a marker in the document) + s/\*$//; + # split at whitespace + @field = split(' '); + if ($field[0] eq "\\1" || $field[0] eq "\\4") { + print " $field[2]\n"; + } + elsif ($field[0] eq "\\2" || $field[0] eq "\\5") { + print " $field[2]\n"; + # handle multiple suffixes separated by commata + @suffix_list = split(/,/, "$field[3]"); + foreach $suffix (@suffix_list) { + print " $field[2]$suffix\n"; + } + } + elsif ($field[0] eq "\\3" || $field[0] eq "\\6") { + # handle multiple suffixes separated by commata + @suffix_list = split(/,/, "$field[3],$field[4]"); + foreach $suffix (@suffix_list) { + print " $field[2]$suffix\n"; + } + } + else { + # for `&', split at `&' with trailing whitespace + @field = split(/&\s*/); + print " $field[1]\n"; + } +} + +# print trailer +print "}\n"; +print "\n"; +print "% EOF\n"; diff --git a/Master/texmf-doc/source/generic/hyphenex/hyphenex.sh b/Master/texmf-doc/source/generic/hyphenex/hyphenex.sh new file mode 100644 index 00000000000..14bd729b985 --- /dev/null +++ b/Master/texmf-doc/source/generic/hyphenex/hyphenex.sh @@ -0,0 +1,92 @@ +#! /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.4 (2007/11/16) +# +# 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 2007 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\\n \\1\\3/ +s/\\\\2 [^ ][^ ]* {\\(.*\\) \\(.*\\)}\$/\\1\\n \\1\\2/ +s/\\\\3 [^ ][^ ]* {\\(.*\\) \\(.*\\) \\(.*\\)}\$/\\1\\2\\n \\1\\3/ +s/\\\\1 [^ ][^ ]* {\\(.*\\)} .*\$/\\1/ +s/\\\\2 [^ ][^ ]* {\\(.*\\) \\(.*\\),\\(.*\\),\\(.*\\)} .*\$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]*\\)\$/\\1\\n \\1\\2\\n \\1\\3/ +s/\\\\2 [^ ][^ ]* \\([^ ][^ ]*\\) \\([^ ][^ ]*\\)\$/\\1\\n \\1\\2/ +s/\\\\3 [^ ][^ ]* \\([^ ][^ ]*\\) \\([^ ][^ ]*\\) \\([^ ][^ ]*\\)\$/\\1\\2\\n \\1\\3/ +s/\\\\1 [^ ][^ ]* \\([^ ][^ ]*\\) .*\$/\\1/ +s/\\\\2 [^ ][^ ]* \\([^ ][^ ]*\\) \\([^ ][^ ]*\\),\\([^ ][^ ]*\\),\\([^ ][^ ]*\\) .*\$/\\1\\n \\1\\2\\n \\1\\3\\n \\1\\4/ +s/\\\\2 [^ ][^ ]* \\([^ ][^ ]*\\) \\([^ ][^ ]*\\),\\([^ ][^ ]*\\) .*\$/\\1\\n \\1\\2\\n \\1\\3/ +s/\\\\2 [^ ][^ ]* \\([^ ][^ ]*\\) \\([^ ][^ ]*\\) .*\$/\\1\\n \\1\\2/ +s/\\\\3 [^ ][^ ]* \\([^ ][^ ]*\\) \\([^ ][^ ]*\\) \\([^ ][^ ]*\\) .*\$/\\1\\2\\n \\1\\3/ +s/\\*// +s/\\\\llap *{\\(.*\\)}/\\1/ +s/\\\\[^ ]* // +s/\\\\[^ ][^ ]*\$// +s/{.*}// +p +SED_EOF + +sed -n -f /tmp/sed.$$ +rm /tmp/sed.$$ + +# EOF diff --git a/Master/tlpkg/bin/ctan2tds b/Master/tlpkg/bin/ctan2tds index f4802952f96..6f030c7ff77 100755 --- a/Master/tlpkg/bin/ctan2tds +++ b/Master/tlpkg/bin/ctan2tds @@ -173,6 +173,7 @@ chdir $startdir || die "chdir($startdir) failed: $!"; # back to raw 'japanese', "die 'skipping, requires ptex'", 'jasthesis', "die 'skipping, license is unknown'", 'jj_game', "die 'skipping, requires acrotex'", + 'jsclasses', "die 'skipping, invalid characters processing dtx'", 'kerkis', "&MAKEflatten", 'koma-script', "&MAKEkoma", 'kpfonts', "&MAKEflatten", @@ -398,6 +399,7 @@ chdir $startdir || die "chdir($startdir) failed: $!"; # back to raw $standardsource='\.fdd|\.dtx|\.ins|\.c$|Makefile|\.drv'; %specialsource= ( + 'ae', "$standardsource|\.mtx|\.etx|\.tex|clean|go|install|makepl", 'amsldoc-vn', 'NULL', 'apl', ".*", # just get everything, seems simplest 'arabxetex', 'NULL', # keep dtx with others, why not @@ -409,8 +411,8 @@ $standardsource='\.fdd|\.dtx|\.ins|\.c$|Makefile|\.drv'; 'eskdx', 'NULL', # do not move makefiles 'mff', '\.mfj|\.bat|\.diz', 'fpl', "$standardsource|Add|\.sfd|\.pe|\.ps", + 'hyphenex', ".*", 'rcs', "$standardsource|rcs.el|src", - 'ae', "$standardsource|\.mtx|\.etx|\.tex|clean|go|install|makepl", ); %specialfoundry = ( @@ -494,6 +496,7 @@ $standarddest = "texmf-dist"; 'gost', 'bibtex', 'greenpoint', 'fonts', 'hfoldsty', 'fonts', + 'hyphenex', 'generic', 'kixfont', 'fonts', 'latexmp', 'metapost', 'leawood', 'fonts', diff --git a/Master/tlpkg/tlpsrc/collection-binextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-binextra.tlpsrc index aa444ece3e0..5da9794012a 100644 --- a/Master/tlpkg/tlpsrc/collection-binextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-binextra.tlpsrc @@ -4,8 +4,7 @@ shortdesc TeX auxiliary programs longdesc Various useful, but non-essential, support programs. Includes longdesc programs and macros for DVI file manipulation, literate longdesc programming, PerlTeX, patgen, etc. -depend cweb -depend mkind-english +depend collection-basic depend bin-bibtex8 depend bin-ctie depend bin-cweb @@ -26,4 +25,6 @@ depend bin-tie depend bin-tpic2pdftex depend bin-vpe depend bin-web -depend collection-basic +depend cweb +depend hyphenex +depend mkind-english diff --git a/Master/tlpkg/tlpsrc/hyphenex.tlpsrc b/Master/tlpkg/tlpsrc/hyphenex.tlpsrc new file mode 100644 index 00000000000..f4f80543e24 --- /dev/null +++ b/Master/tlpkg/tlpsrc/hyphenex.tlpsrc @@ -0,0 +1,2 @@ +name hyphenex +category Documentation diff --git a/Master/tlpkg/tlpsrc/jsclasses.tlpsrc b/Master/tlpkg/tlpsrc/jsclasses.tlpsrc new file mode 100644 index 00000000000..db8bcdf4244 --- /dev/null +++ b/Master/tlpkg/tlpsrc/jsclasses.tlpsrc @@ -0,0 +1,2 @@ +name jsclasses +category Package |