summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-toascii.html
blob: 76d49847ef29e1c572506b46947095b5f5045920 (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
<head>
<title>UK TeX FAQ -- question label toascii</title>
</head><body>
<h3>Conversion from (La)TeX to plain text</h3>
<p/>The aim here is to emulate the Unix <i>nroff</i>, which formats
text as best it can for the screen, from the same
input as the Unix typesetting program <i>troff</i>.
<p/>Converting DVI to plain text is the basis of many of these
techniques; sometimes the simple conversion provides a good enough
response.  Options are:
<ul>
<li> <i>dvi2tty</i> (one of the earliest),
<li> <i>crudetype</i> and
<li> <i>catdvi</i>, which is capable of generating Latin-1
  (ISO 8859-1) or UTF-8 encoded output.  <i>Catdvi</i> was
  conceived as a replacement for <i>dvi2tty</i>, but can&#8217;t (quite)
  be recommended as a complete replacement yet.
</ul>
A common problem is the hyphenation that TeX inserts when
typesetting something: since the output is inevitably viewed using
fonts that don&#8217;t match the original, the hyphenation usually looks
silly.
<p/>Ralph Droms provides a <i>txt</i> bundle of things in support of
ASCII generation,
but it doesn&#8217;t do a good job with tables and mathematics.  An
alternative is the <i>screen</i> package.
<p/>Another possibility is to
use the LaTeX-to-ASCII conversion program, <i>l2a</i>,
although this is really more of a de-TeXing program.
<p/>The canonical de-TeXing program is <i>detex</i>, which removes
all comments and control sequences 
from its input before writing it to its output.  Its original purpose
was to prepare input for a dumb spelling checker, and it&#8217;s only usable
for preparing useful ASCII versions of a document in highly
restricted circumstances.
<p/><i>Tex2mail</i> is slightly more than a de-TeXer &#8212; it&#8217;s a
<i>Perl</i> script that converts TeX files into
plain text files, expanding various mathematical symbols
(sums, products, integrals, sub/superscripts, fractions, square
roots, &#8230;) into &#8220;ASCII art&#8221; that spreads over
multiple lines if necessary. The result is more readable to human
beings than the flat-style TeX code.
<p/>Another significant possibility is to use one of the
<a href="FAQ-LaTeX2HTML.html">HTML-generation solutions</a>,
and then to use a browser such as <i>lynx</i> to dump the resulting
HTML as plain text.
<dl>
<dt><tt><i>catdvi</i></tt><dd><a href="http://mirror.ctan.org/dviware/catdvi.zip">dviware/catdvi</a> (or <a href="http://mirror.ctan.org/dviware/catdvi/">browse the directory</a>)
<dt><tt><i>crudetype</i></tt><dd><a href="http://mirror.ctan.org/dviware/crudetype.zip">dviware/crudetype</a> (or <a href="http://mirror.ctan.org/dviware/crudetype/">browse the directory</a>); <a href="http://mirror.ctan.org/help/Catalogue/entries/crudetype.html">catalogue entry</a>
<dt><tt><i>detex</i></tt><dd><a href="http://mirror.ctan.org/support/detex.zip">support/detex</a> (or <a href="http://mirror.ctan.org/support/detex/">browse the directory</a>); <a href="http://mirror.ctan.org/help/Catalogue/entries/detex.html">catalogue entry</a>
<dt><tt><i>dvi2tty</i></tt><dd><a href="http://mirror.ctan.org/dviware/dvi2tty.zip">dviware/dvi2tty</a> (or <a href="http://mirror.ctan.org/dviware/dvi2tty/">browse the directory</a>); <a href="http://mirror.ctan.org/help/Catalogue/entries/dvi2tty.html">catalogue entry</a>
<dt><tt><i>l2a</i></tt><dd><a href="http://mirror.ctan.org/support/l2a.zip">support/l2a</a> (or <a href="http://mirror.ctan.org/support/l2a/">browse the directory</a>); <a href="http://mirror.ctan.org/help/Catalogue/entries/l2a.html">catalogue entry</a>
<dt><tt><i>screen.sty</i></tt><dd><a href="http://mirror.ctan.org/macros/latex209/contrib/misc/screen.sty">macros/latex209/contrib/misc/screen.sty</a>; <a href="http://mirror.ctan.org//help/Catalogue/entries/screen.html">catalogue entry</a>
<dt><tt><i>tex2mail</i></tt><dd><a href="http://mirror.ctan.org/support/tex2mail.zip">support/tex2mail</a> (or <a href="http://mirror.ctan.org/support/tex2mail/">browse the directory</a>); <a href="http://mirror.ctan.org/help/Catalogue/entries/tex2mail.html">catalogue entry</a>
<dt><tt><i>txt</i></tt><dd><a href="http://mirror.ctan.org/support/txt.zip">support/txt</a> (or <a href="http://mirror.ctan.org/support/txt/">browse the directory</a>); <a href="http://mirror.ctan.org/help/Catalogue/entries/txt.html">catalogue entry</a>
</dl>
<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=toascii">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=toascii</a>
</body>