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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
delim $$
l2x -- conversion from LaTeX to other formats
Version 1.4
Henning Schulzrinne
GMD Fokus
Berlin, Germany
hgs@fokus.gmd.de
1 Description
l2x
is a general-purpose LaTeX converter. It consists of a parser
written in C, which then calls Tcl functions for each LaTeX func-
tion. The Tcl functions return the translated value.
2 Installation
The newest version of this package is available by anon. ftp. It is
a gzip'ed tar file. You must have the Tcl libraries installed, for
example obtained by anonymous ftp. Edit the
Makefile
for the correct location of the Tcl library and include files and
type
make
3 Usage
To translate the LaTeX file
input.tex
using the translator
foo.tcl
:
l2x foo.tcl < paper.tex
The application
lf
is a filter that removes blank lines and, with the
-b
flag specified, initial blank space on lines. It is intended for
nroff conversion. The application
pgstrip
removes extra blank lines from the beginning of a page and is due
to Jon Postel. The script
fix.sh
processes an RFC or Internet Draft, including the necessary strip-
ping of backspaces and the conversion of FORMFEED to real formfeeds
(control-L).
Currently, the following example translators are provided:
l2html.tcl Convert input to a single HTML file.
ms.tcl Convert to nroff/troff -ms macros. Currently converts to a
format suitable for FAQs and READMEs (no page breaks or page
numbers), but that is readily changed.
4 Limitations
Currently, only a subset of LaTeX commands is supported. Many are
easy to add, but the following might require more work, albeit
mostly limited to writing new Tcl functions:
o For conversion to HTML, math mode is supported by calling
LaTeX and including the GIF image.
o The \newenvironment
command is not supported.
o Table of contents, etc. are not supported in nroff.
5 Examples
To convert nroff output to plain ASCII, without underscores, use
l2x ms.tcl < foo.tex | nroff -ms | ul -tdumb > foo.txt
6 Copyright
Copyright (c) 1994 Henning Schulzrinne
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistribution for direct commercial gain requires prior
permission.
2. Redistributions of source code must retain the above
copyright notice, this list of conditions and the follow-
ing disclaimer.
3. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the follow-
ing disclaimer in the documentation and/or other materi-
als provided with the distribution.
4. All advertising materials mentioning features or use of
this software must display the following acknowledgement:
This product includes software developed by Henning
Schulzrinne.
This software is provided by the author(s) "as is" and any express
or implied warranties, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose
are disclaimed. In no event shall the contributors be liable for
any direct, indirect, incidental, special, exemplary, or consequen-
tial damages (including, but not limited to, procurement of substi-
tute goods or services; loss of use, data, or profits; or business
interruption) however caused and on any theory of liability,
whether in contract, strict liability, or tort (including negli-
gence or otherwise) arising in any way out of the use of this
software, even if advised of the possibility of such damage.
|