diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2011-10-14 04:55:05 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2011-10-14 04:55:05 +0200 |
commit | 6aa0e0017d7d0cddc006da885946934b06949a91 (patch) | |
tree | 66b688ec32e2f91266db760b1762f2a50cc52036 /libslang/doc/tm/fixtex.sl | |
parent | a966db5b71328f6adf9dd767e64b322a3bd7ed9c (diff) | |
download | erlang-slang-fork-6aa0e0017d7d0cddc006da885946934b06949a91.tar.gz |
include libslang-1.4.9 and automatically build it and link erlang-slang against it
few (erlang) people will still have libslang-1.4.9 installed or spend time
to get it to link against the driver
Diffstat (limited to 'libslang/doc/tm/fixtex.sl')
-rw-r--r-- | libslang/doc/tm/fixtex.sl | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/libslang/doc/tm/fixtex.sl b/libslang/doc/tm/fixtex.sl new file mode 100644 index 0000000..787eb91 --- /dev/null +++ b/libslang/doc/tm/fixtex.sl @@ -0,0 +1,56 @@ +!if (is_defined ("__argv")) +{ + message ("You need a newer version of jed to run this script"); + quit_jed (); +} + +if (__argc != 4) +{ + message ("Usage: jed -script fixtex.sl <filename>"); + quit_jed (); +} + +variable file = __argv[3]; +() = read_file (file); + +% Patch up the >,< signs +bob (); +replace ("$<$", "<"); +replace ("$>$", ">"); + +% It appears that sgml2tex screws up _for in section titles, producing \_{for}. +replace ("ion\\_{", "ion{\\_"); + +% Make the first chapter a preface +bob (); +if (bol_fsearch ("\\chapter{Preface}")) +{ + push_spot (); + push_mark (); + go_right (8); insert ("*"); % \chapter{ --> \chapter*{ + () = bol_fsearch ("\\chapter{"); + push_spot (); + + insert("\\tableofcontents\n"); + eol (); + insert ("\n\\pagenumbering{arabic}"); + + pop_spot (); + narrow (); + bob (); + replace ("\\section{", "\\section*{"); + widen (); + + if (bol_bsearch ("\\tableofcontents")) + delete_line (); + + pop_spot (); + if (bol_bsearch ("\\maketitle")) + insert ("\\pagenumbering{roman}\n"); + +} + +save_buffer (); +quit_jed (); + + |