diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /info/beginlatex/html/chapter10.html |
Initial commit
Diffstat (limited to 'info/beginlatex/html/chapter10.html')
-rw-r--r-- | info/beginlatex/html/chapter10.html | 863 |
1 files changed, 863 insertions, 0 deletions
diff --git a/info/beginlatex/html/chapter10.html b/info/beginlatex/html/chapter10.html new file mode 100644 index 0000000000..b1ffa32efe --- /dev/null +++ b/info/beginlatex/html/chapter10.html @@ -0,0 +1,863 @@ +<!DOCTYPE html + PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "/dtds/html4t.dtd"> + +<!--Generated from beginlatex.XML.xml with typebook-html.xslt on 2005-04-04T01:02:52--><html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + + <title>Formatting information: Chapter 10 — Compatibility with other systems</title> + <link rel="stylesheet" href="typebook.css" type="text/css"> + <meta http-equiv="Content-Style-Type" content="text/css"> + </head> + <body> + <table width="100%"> + <tr> + <th class="title" width="66%"> + <h1><a name="doctitle">Formatting information</a></h1> + <h2>A beginner's introduction to typesetting with + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></h2> + <h3>Chapter 10 — Compatibility with other systems</h3> + <h3>Peter Flynn</h3> + <h4>Silmaril Consultants<br>Textual Therapy Division + </h4><br>v. 3.6 (March 2005) + </th> + <td class="toc" width="33%"> + <h4><a name="doctoc">Contents</a></h4> + <dl> + <dd class=""><a href="intro.html#intro">Introduction</a></dd> + <dd class=""><a href="foreword.html#foreword">Foreword</a></dd> + <dd class=""><a href="preface.html#preface">Preface</a></dd> + </dl> + <ol> + <li class=""><a href="chapter1.html#get">Installing <span class="TEX">T<span class="E">E</span>X</span> and <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></li> + <li class=""><a href="chapter2.html#plaintext">Using your editor to create documents</a></li> + <li class=""><a href="chapter3.html#basic">Basic document structures</a></li> + <li class=""><a href="chapter4.html#process">Typesetting, viewing and printing</a></li> + <li class=""><a href="chapter5.html#ctan">CTAN, packages, and online help</a></li> + <li class=""><a href="chapter6.html#otherdoc">Other document structures</a></li> + <li class=""><a href="chapter7.html#texttools">Textual tools</a></li> + <li class=""><a href="chapter8.html#typo">Fonts and layouts</a></li> + <li class=""><a href="chapter9.html#macros">Programmability (macros)</a></li> + <li class="current"><a href="chapter10.html#compat">Compatibility with other systems</a></li> + </ol> + <ol type="A"> + <li class=""><a href="appendixA.html#cnf">Configuring <span class="TEX">T<span class="E">E</span>X</span> search paths</a></li> + <li class=""><a href="appendixB.html#tugform"><span class="TEX">T<span class="E">E</span>X</span> Users Group membership</a></li> + <li class=""><a href="appendixC.html#asciicharset">The ASCII character set</a></li> + <li class=""><a href="appendixD.html#gfdl">GNU Free Documentation License</a></li> + </ol> + <dl> + <dd class=""><a href="bibliography.html#biblio">References</a></dd> + <dd class=""><a href="index.html#index">Index</a></dd> + </dl> + </td> + </tr> + <tr> + <td class="credits"> + <p>This edition of <cite>Formatting + Information</cite> was prompted by the generous help I + have received from <span class="TEX">T<span class="E">E</span>X</span> users too numerous to mention + individually. Shortly after TUGboat published the November + 2003 edition, I was reminded by a spate of email of the + fragility of documentation for a system like <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> which is + constantly under development. There have been revisions to + packages; issues of new distributions, new tools, and new + interfaces; new books and other new documents; corrections to + my own errors; suggestions for rewording; and in one or two + cases mild abuse for having omitted package X which the author + felt to be indispensable to users. ¶ I am grateful as always to the people who sent me + corrections and suggestions for improvement. Please keep them + coming: only this way can this book reflect what people + want to learn. The same limitation still applies, however: no + mathematics, as there are already a dozen or more excellent + books on the market — as well as other online + documents — dealing with mathematical typesetting in + <span class="TEX">T<span class="E">E</span>X</span> and <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> in finer and better detail than I am + capable of. ¶ The structure remains the same, but I have revised and + rephrased a lot of material, especially in the earlier + chapters where a new user cannot be expected yet to have + acquired any depth of knowledge. Many of the screenshots have + been updated, and most of the examples and code fragments have + been retested. ¶ As I was finishing this edition, I was asked to review + an article for <cite><a href="http://www.tug.org/pracjourn/" name="C3">The Prac<span class="TEX">T<span class="E">E</span>X</span> Journal</a></cite>, which + grew out of the Practical <span class="TEX">T<span class="E">E</span>X</span> Conference in 2004. The + author specifically took the writers of documentation to task + for failing to explain things more clearly, and as I read + more, I found myself agreeing, and resolving to clear up some + specific problems areas as far as possible. It is very + difficult for people who write technical documentation to + remember how they struggled to learn what has now become a + familiar system. So much of what we do is second nature, and a + lot of it actually has nothing to do with the software, but + more with the way in which we view and approach information, + and the general level of knowledge of computing. If I have + obscured something by making unreasonable assumptions about + <em>your</em> knowledge, please let me know so + that I can correct it. + <p>Peter Flynn is author of <cite><a href="bibliography.html#htmlbook" name="C4">The HTML Handbook</a></cite> and <cite><a href="bibliography.html#sgmltools" name="C5">Understanding SGML and XML Tools</a></cite>, and editor of <cite><a href="http://www.ucc.ie/xml/" name="C6">The XML FAQ</a></cite>. + </p> + </p> + </td> + <td class="legal"> + <p> + <p>This document is Copyright © 1999–2005 by + Silmaril Consultants under the terms of what is now the GNU + Free Documentation License (copyleft). + </p> + <p>Permission is granted to copy, distribute and/or modify + this document under the terms of the GNU Free Documentation + License, Version 1.2 or any later version published by the + Free Software Foundation; with no Invariant Sections, no + Front-Cover Texts, and no Back-Cover Texts. A copy of the + license is included in the section entitled <cite><a href="http://www.fsf.org/copyleft/fdl.html" name="C1">The GNU Free Documentation License</a></cite>. + </p> + <p>You are allowed to distribute, reproduce, and modify it + without fee or further requirement for consent subject to the + conditions in <a href="appendixD.html#gfdl-4">section D.5</a>. The author has + asserted his right to be identified as the author of this + document. If you make useful modifications you are asked to + inform the author so that the master copy can be updated. See + the full text of the License in <a href="appendixD.html#gfdl">Appendix D</a>. + + </p> + </p> + </td> + </tr> + </table> + <div class="chapter"> + <table width="100%"> + <tr> + <td align="center"><small><i class="chaphead"><b><a name="compat">CHAPTER</a></b></i></small><br><table border="1"> + <tr> + <td class="chapno">10</td> + </tr> + </table> + </td> + <td><pre class="spacing"></pre></td> + <td> + <p> </p> + <h1>Compatibility with other systems</h1> + </td> + <td class="toc"> + <p> </p> + <ol> + <li><a href="#tolatex">Converting into <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></li> + <li><a href="#latexto">Converting out of <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></li> + </ol> + </td> + <td align="right"><a href="#doctoc"><img src="top.png" title="Table of Contents" width="32" alt="ToC" align="right" border="0"></a></td> + </tr> + </table> + <p>As we saw in <a href="chapter2.html#plaintext">Chapter 2</a>, <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> uses + plain-text files, so they can be read and written by any + standard application that can open text files. This helps + preserve your information over time, as the plain-text format + cannot be obsoleted or hijacked by any manufacturer or sectoral + interest, and it will always be readable on any computer, from + your handheld (yes, <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> is available for some <small><a href="intro.html#PDA" class="acroref" name="A216" title="Personal Digital Assistant">PDA</a></small>s, see <a href="chapter10.html#zaurus">Figure 10.1</a>) to the + biggest supercomputer. + </p> + <div class="figure" align="center"> + <hr> + <caption><i>Figure 10.1</i>: <a name="zaurus"><span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> editing and processing on the Sharp Zaurus 5500 + PDA</a></caption> + <div align="center" style="margin:12px"><img src="zedit.png" width="30%"> <img src="zlatex.png" width="30%"> <img src="qpdf.png" width="30%"></div> + <hr> + </div> + <p>However, <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> is intended as the last stage of the + editorial process: formatting for print or display. If you have + a requirement to re-use the text in some other + environment — a database perhaps, or on the Web or a + <small>CD-ROM</small> or <small><a href=".html#DVD" class="acroref" name="A218" title="Digital Versatile Disk">DVD</a></small>, or in Braille or voice output — then + it should probably be edited, stored, and maintained in + something neutral like the <a name="XML" class="acroref" href="http://www.ucc.ie/xml/">Extensible Markup + Language</a> (<small>XML</small>), and only converted to <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> when a + typeset copy is needed. + </p> + <p>Although <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> has many structured-document features in + common with <small><a href="chapter10.html#SGML" class="acroref" name="A220" title="Standard Generalized Markup Language">SGML</a></small> and <small><a href="chapter10.html#XML" class="acroref" name="A221" title="Extensible Markup Language">XML</a></small>, it can still only be processed by the + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> and <i><a name="p227">pdf<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></i> programs. + Because its macro features make it almost infinitely + redefinable, processing it requires a program which can unravel + arbitrarily complex macros, and <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> and its siblings are + the only programs which can do that effectively. Like other + typesetters and formatters (Quark + <i><a name="p228">XPress</a></i>, + <i><a name="p229">PageMaker</a></i>, + <i><a name="p230">FrameMaker</a></i>, Microsoft + <i><a name="p231">Publisher</a></i>, <i><a name="p232">3B2</a></i> etc.), <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> is largely a + one-way street leading to typeset printing or display + formatting. + </p> + <p>Converting <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> to some other format therefore means you + will unavoidably lose some formatting, as <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> has features + that others systems simply don't possess, so they cannot be + translated — although there are several ways to minimise + this loss. Similarly, converting other formats into <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> + often means editing back the stuff the other formats omit + because they only store appearances, not structure. + </p> + <p>However, there are at least two excellent systems for + converting <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> directly to <a name="HTML" class="acroref">HyperText + Markup Language</a> (<small>HTML</small>) so you can publish it on the web, as + we shall see in <a href="chapter10.html#latexto">section 10.2</a>. + </p> + <div class="sect1"> + <h2><a href="#compat"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>10.1 <a name="tolatex">Converting into <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></h2> + <p>There are several systems which will save their text in + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> format. The best known is probably the <span class="LYX">L<span class="Y">Y</span>X</span> editor + (see <a href="chapter2.html#lyxwin">Figure 2.1</a>), which is a wordprocessor-like + interface to <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> for Windows and Unix. Both the + <i><a name="p233">AbiWord</a></i> and + <i><a name="p234">Kword</a></i> wordprocessors on Linux + systems have a very good <b>Save + As</b>...<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> output, so they can be used to + open Microsoft <i><a name="p235">Word</a></i> documents and + convert to + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>. Several maths packages like the + <i><a name="p236">EuroMath</a></i> editor, and the + <i><a name="p237">Mathematica</a></i> and + <i><a name="p238">Maple</a></i> analysis packages, can also + save material in <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> format. + </p> + <p>In general, most other wordprocessors and DTP systems + either don't have the level of internal markup + sophistication needed to create a <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> file, or they lack + a suitable filter to enable them to output what they do have. + Often they are incapable of outputting any kind of structured + document, because they only store what the text looks like, + not why it's there or what role it fulfills. There are + two ways out of this: + </p> + <ul> + <li> + <p>Use the <span class="guimenu">File</span>→<span class="guimenuitem">Save + As...</span> menu item to save the + wordprocessor file as <small><a href="chapter10.html#HTML" class="acroref" name="A223" title="HyperText Markup Language">HTML</a></small>, + rationalise the <small><a href="chapter10.html#HTML" class="acroref" name="A224" title="HyperText Markup Language">HTML</a></small> using + <a name="raggett">Dave Raggett</a>'s <a href="http://tidy.sourceforge.net/"><i><a name="p239">HTML + Tidy</a></i></a>, and convert the resulting + <a name="XHTML" class="acroref">Extensible HyperText Markup + Language</a> (<small>XHTML</small>) to <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> with any of the standard + <small><a href="chapter10.html#XML" class="acroref" name="A226" title="Extensible Markup Language">XML</a></small> tools (see below). + </p> + </li> + <li> + <p>Use a specialist conversion tool like EBT's + <i><a name="p240">DynaTag</a></i> (supposedly available + from Enigma, if you can persuade them they have a copy to + sell you; or you may still be able to get it from <a href="http://www.rbii.com/">Red Bridge + Interactive</a> in Providence, RI). It's + expensive and they don't advertise it, but for bulk + conversion of consistently-marked + <i><a name="p241">Word</a></i> files into XML it beats + everything else hands down. The + <i><a name="p242">Word</a></i> files + <em>must</em> be consistent, though, and must + use named styles from a stylesheet, otherwise no system on + earth is going to be able to guess what it means. + </p> + </li> + </ul> + <p>There is of course a third way, suitable for large volumes + only: send it off to the Pacific Rim to be retyped into XML or + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>. There are hundreds of companies from India to + Polynesia who do this at high speed and low cost with very + high accuracy. It sounds crazy when the document is already in + electronic form, but it's a good example of the problem + of low quality of wordprocessor markup that this solution + exists at all. + </p> + <p>You will have noticed that most of the solutions lead to + one place: <small><a href="chapter10.html#SGML" class="acroref" name="A227" title="Standard Generalized Markup Language">SGML</a></small><sup><a href="#F53">1</a></sup> or <small><a href="chapter10.html#XML" class="acroref" name="A231" title="Extensible Markup Language">XML</a></small>. As explained + above and elsewhere, these formats are the only ones devised + so far capable of storing sufficient information in + machine-processable, publicly-accessible form to enable your + document to be recreated in multiple output formats. Once + your document is in <small><a href="chapter10.html#XML" class="acroref" name="A232" title="Extensible Markup Language">XML</a></small>, there is a + large range of software available to turn it into other + formats, including <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>. Processors in any of the common + <small><a href="chapter10.html#SGML" class="acroref" name="A233" title="Standard Generalized Markup Language">SGML</a></small>/<small><a href="chapter10.html#XML" class="acroref" name="A234" title="Extensible Markup Language">XML</a></small> + processing languages like the <a name="DSSSL" class="acroref">Document + Style Semantics and Specification Language</a> (<small>DSSSL</small>), the + <a name="XSLT" class="acroref">Extensible Stylesheet Language + [Transformations]</a> (<small>XSLT</small>), + <i><a name="p243">Omnimark</a></i>, + <i><a name="p244">Metamorphosis</a></i>, + <i><a name="p245">Balise</a></i>, etc. can easily be written + to output <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>, and this approach is extremely + common. + </p> + <p>Much of this will be simplified when wordprocessors + support native, arbitrary <small><a href="chapter10.html#XML" class="acroref" name="A237" title="Extensible Markup Language">XML</a></small>/<small><a href="chapter10.html#XSLT" class="acroref" name="A238" title="Extensible Stylesheet Language [Transformations]">XSLT</a></small> as a + standard feature, because <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> output will become much + simpler to produce. + </p> + <ul> + <li> + <p>Sun's <i><a name="p246">Star Office</a></i> and + its Open Source sister, + <i><a name="p247">OpenOffice</a></i>, have used XML as + their native file format for several years, and there is a + project at the <a name="OASIS" class="acroref">Organisation for the + Advancement of Structured Information Systems</a> (<small>OASIS</small>) + for developing a common <small><a href="chapter10.html#XML" class="acroref" name="A240" title="Extensible Markup Language">XML</a></small> + office file format based on those used by these two + packages, which has been proposed to the <a name="ISO" class="acroref">International Organization for + Standardization</a> (<small>ISO</small>) in Geneva as a candidate for + an International Standard. + </p> + </li> + <li> + <p><i><a name="p248">WordPerfect</a></i> has also had a + native <small><a href="chapter10.html#SGML" class="acroref" name="A242" title="Standard Generalized Markup Language">SGML</a></small> (and now <small><a href="chapter10.html#XML" class="acroref" name="A243" title="Extensible Markup Language">XML</a></small>) editor for many years, which will + work with any <a name="DTD" class="acroref">Document Type + Definition</a> (<small>DTD</small>) (but not a Schema; and at the time + of writing (2005) it still used a proprietary stylesheet + format). + </p> + </li> + <li> + <p>Microsoft has had a half-hearted ‘Save + As...XML’ for a while, using an + internal and formerly largely undocumented Schema + (recently published at last). The + ‘Professional’ versions of + <i><a name="p249">Word</a></i> and + <i><a name="p250">Excel</a></i> in + <i><a name="p251">Office 11</a></i> (Office 2003 for + XP) now have full support for arbitrary Schemas and a real + <small><a href="chapter10.html#XML" class="acroref" name="A245" title="Extensible Markup Language">XML</a></small> editor, albeit with a rather + primitive interface, but there is no conversion to or from + <i><a name="p252">Word</a></i>'s + <code>.doc</code> format.<sup><a href="#F54">2</a></sup></p> + <p>However, help comes in the shape of <a name="rd">Ruggero Dambra</a>'s + <i><a name="p256">WordML2<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></i>, which is an + <small><a href="chapter10.html#XSLT" class="acroref" name="A250" title="Extensible Stylesheet Language [Transformations]">XSLT</a></small> stylesheet to transform an + <small><a href="chapter10.html#XML" class="acroref" name="A251" title="Extensible Markup Language">XML</a></small> document in this internal + Schema (WordML) into <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span>ε</span> format. + Download it from any <small><a href="chapter5.html#CTAN" class="acroref" name="A252" title="Comprehensive Archive Network">CTAN</a></small> server + in <code>/support/WordML2LaTeX</code>. + </p> + </li> + <li> + <p><a name="rtf2latex2e"></a>Among the conversion programs on <small><a href="chapter5.html#CTAN" class="acroref" name="A253" title="Comprehensive Archive Network">CTAN</a></small> is <a name="us">Ujwal Sath­yam</a>'s + <i><a name="p257">rtf2latex2e</a></i>, which converts + <a name="RTF" class="acroref">Rich Text Format</a> (<small>RTF</small>) files (output + by many wordprocessors) to <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span>ε</span>. The package + description says it has support + for figures and tables, equations are read as figures, and + it can the handle the latest <small><a href="chapter10.html#RTF" class="acroref" name="A255" title="Rich Text Format">RTF</a></small> + versions from Microsoft Word 97/98/2000, StarOffice, and + other wordprocessors. It runs on Macs, Linux, other Unix + systems, and Windows. + </p> + </li> + </ul> + <p>When these efforts coalesce into generalised support for + arbitrary <small><a href="chapter10.html#DTD" class="acroref" name="A256" title="Document Type Definition">DTD</a></small>s and Schemas, it will + mean a wider choice of editing interfaces, and when they + achieve the ability to run <small><a href="chapter10.html#XSLT" class="acroref" name="A257" title="Extensible Stylesheet Language [Transformations]">XSLT</a></small> + conversion into + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> from within these editors, such as is done at the + moment with <i><a name="p258">Emacs</a></i> or + <i><a name="p259">XML Spy</a></i>, we will have full + convertability. + </p> + <ol class="footnotes" start="1"> + <li><a name="F53">The <a name="SGML" class="acroref">Standard Generalized Markup + Language</a> (<small>SGML</small>) itself is little used now for new + projects, as the software support for its daughter + <small><a href="chapter10.html#XML" class="acroref" name="A229" title="Extensible Markup Language">XML</a></small> is far greater, but there + are still hundreds of large document repositories in + <small><a href="chapter10.html#SGML" class="acroref" name="A230" title="Standard Generalized Markup Language">SGML</a></small> still growing their + collection by adding documents.</a></li> + </ol> + <ol class="footnotes" start="2"> + <li><a name="F54">Which is silly, given that Microsoft used to make + one of the best + <i><a name="p253">Word</a></i>-to-<small><a href="chapter10.html#SGML" class="acroref" name="A246" title="Standard Generalized Markup Language">SGML</a></small> converters ever, which was + bi-directional (yes, it could round-trip + <i><a name="p254">Word</a></i> to <small><a href="chapter10.html#SGML" class="acroref" name="A247" title="Standard Generalized Markup Language">SGML</a></small> and back to + <i><a name="p255">Word</a></i> and back into <small><a href="chapter10.html#SGML" class="acroref" name="A248" title="Standard Generalized Markup Language">SGML</a></small>). But they dropped it on the + floor when <small><a href="chapter10.html#XML" class="acroref" name="A249" title="Extensible Markup Language">XML</a></small> + arrived.</a></li> + </ol> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>10.1.1 Getting <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> out of XML + </h3> + <p>Assuming you can get your document out of its + wordprocessor format into <small><a href="chapter10.html#XML" class="acroref" name="A258" title="Extensible Markup Language">XML</a></small> by + some method, here is a very brief example of how to turn it + into <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>. + </p> + <p>You can of course buy and install a fully-fledged + commercial <small><a href="chapter10.html#XML" class="acroref" name="A259" title="Extensible Markup Language">XML</a></small> editor with + <small><a href="chapter10.html#XSLT" class="acroref" name="A260" title="Extensible Stylesheet Language [Transformations]">XSLT</a></small> support, and run this + application within it. However, this is beyond the reach of + many users, so to do this unaided you just need to install + three pieces of software: <a href="http://java.sun.com/j2se/1.4.2/download.html"><i><a name="p260">Java</a></i></a>, + <a href="http://saxon.sourceforge.net/"><i><a name="p261">Saxon</a></i></a> + and the <a href="http://www.docbook.org/xml/4.2/index.html">DocBook + 4.2 DTD</a> (<small><a href="chapter6.html#URI" class="acroref" name="A261" title="Uniform Resource Indicator">URI</a></small>s are + correct at the time of writing). None of these has a visual + interface: they are run from the command-line in the same + way as is possible with <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>. + </p> + <p>As an example, let's take the above paragraph, as + typed or imported into <i><a name="p262">AbiWord</a></i> + (see + <a href="chapter10.html#abidoc">Figure 10.1</a>). This is stored as a single + paragraph with highlighting on the product names (italics), + and the names are also links to their Internet sources, just + as they are in this document. This is a convenient way to + store two pieces of information in the same place. + </p> + <div class="figure" align="center"> + <hr> + <caption><i>Figure 10.1</i>: <a name="abidoc">Sample paragraph in + <i><a name="p263">AbiWord</a></i> converted to <small><a href="chapter10.html#XML" class="acroref" name="A262" title="Extensible Markup Language">XML</a></small></a></caption> + <div align="center" style="margin:12px"><img src="abiword.png" width="100%"></div> + <hr> + </div> + <p><i><a name="p264">AbiWord</a></i> can export in DocBook + format, which is an <small><a href="chapter10.html#XML" class="acroref" name="A263" title="Extensible Markup Language">XML</a></small> vocabulary + for describing technical (computer) + documents–it's what I use for this book. + <i><a name="p265">AbiWord</a></i> can also export <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>, + but we're going make our own + version, working from the <small><a href="chapter10.html#XML" class="acroref" name="A264" title="Extensible Markup Language">XML</a></small> + (Brownie points for the reader who can guess why I'm + not just accepting the <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> conversion output). + </p> + <p>Although <i><a name="p266">AbiWord</a></i>'s + default is to output an <small><a href="chapter10.html#XML" class="acroref" name="A265" title="Extensible Markup Language">XML</a></small> book document + type, we'll convert it to a <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> article document + class. Notice that <i><a name="p267">AbiWord</a></i> has + correctly output the expected section and title markup + empty, even though it's not used. Here's the + <small><a href="chapter10.html#XML" class="acroref" name="A266" title="Extensible Markup Language">XML</a></small> output (I've changed the + linebreaks to keep it within the bounds of this page + size): + </p> + <blockquote><pre class="tiny"> +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> +<book> +<!-- ===================================================================== --> +<!-- This DocBook file was created by AbiWord. --> +<!-- AbiWord is a free, Open Source word processor. --> +<!-- You may obtain more information about AbiWord at www.abisource.com --> +<!-- ===================================================================== --> + <chapter> + <title></title> + <section role="unnumbered"> + <title></title> + <para>You can of course buy and install a fully-fledged commercial XML +editor with XSLT support, and run this application within it. However, this +is beyond the reach of many users, so to do this unaided you just need to +install three pieces of software: <ulink +url="http://java.sun.com/j2se/1.4.2/download.html"><emphasis>Java</emphasis></ulink>, +<ulink +url="http://saxon.sourceforge.net"><emphasis>Saxon</emphasis></ulink>, and +the <ulink url="http://www.docbook.org/xml/4.2/index.html">DocBook 4.2 DTD</ulink> +(URIs are correct at the time of writing). None of these has a visual +interface: they are run from the command-line in the same way as is possible +with L<superscript>A</superscript>T<subscript>E</subscript>X.</para> + </section> + </chapter> +</book> + </pre></blockquote> + <p>The <small><a href="chapter10.html#XSLT" class="acroref" name="A267" title="Extensible Stylesheet Language [Transformations]">XSLT</a></small> language lets us + create templates for each type of element in an <small><a href="chapter10.html#XML" class="acroref" name="A268" title="Extensible Markup Language">XML</a></small> document. In our example, there are + only three which need handling, as we did not create chapter + or section titles (DocBook requires them to be present, but + they don't have to be used). + </p> + <ul> + <li> + <p>para, for the + paragraph[s]; + </p> + </li> + <li> + <p>ulink, for the URIs;</p> + </li> + <li> + <p>emphasis, for the + italicisation. + </p> + </li> + </ul> + <p>I'm going to cheat over the superscripting and + subscripting of the letters in the <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> logo, and use my + editor to replace the whole thing with the + <code class="command"><a name="c319">\LaTeX</a></code> command. In the other three cases, + we already know how <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> deals with these, so we can + write our templates (see <a href="chapter10.html#xslcode">Figure 10.2</a>). + </p> + <div class="figure" align="center"> + <hr> + <caption><i>Figure 10.2</i>: <a name="xslcode"><small><a href="chapter10.html#XSLT" class="acroref" name="A269" title="Extensible Stylesheet Language [Transformations]">XSLT</a></small> script to convert the + paragraph</a></caption> + <blockquote><pre class="footnotesize"> +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + <xsl:output method="text"/> + + <xsl:template match="/"> + <xsl:text>\documentclass{article} +\usepackage{url}</xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="book"> + <xsl:text>\begin{document}</xsl:text> + <xsl:apply-templates/> + <xsl:text>\end{document}</xsl:text> + </xsl:template> + + <xsl:template match="para"> + <xsl:apply-templates/> + <xsl:text>&#x000A;</xsl:text> + </xsl:template> + + <xsl:template match="ulink"> + <xsl:apply-templates/> + <xsl:text>\footnote{\url{</xsl:text> + <xsl:value-of select="@url"/> + <xsl:text>}}</xsl:text> + </xsl:template> + + <xsl:template match="emphasis"> + <xsl:text>\emph{</xsl:text> + <xsl:apply-templates/> + <xsl:text>}</xsl:text> + </xsl:template> + +</xsl:stylesheet> + </pre></blockquote> + <hr> + </div> + <p>If you run this through + <i><a name="p268">Saxon</a></i>, which is an <small><a href="chapter10.html#XSLT" class="acroref" name="A270" title="Extensible Stylesheet Language [Transformations]">XSLT</a></small> processor, you can output a <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> + file which you can process and view (see <a href="chapter10.html#paraview">Figure 10.3</a>). + </p> + <blockquote><pre class="scriptsize"> +$ java -jar /usr/local/saxonb8-0/saxon8.jar -o para.ltx \ +para.dbk para.xsl +$ latex para.ltx +This is TeX, Version 3.14159 (Web2C 7.3.7x) +(./para.ltx +LaTeX2e <2001/06/01> +Loading CZ hyphenation patterns: Pavel Sevecek, v3, 1995 +Loading SK hyphenation patterns: Jana Chlebikova, 1992 +Babel <v3.7h> and hyphenation patterns for english, +dumylang, nohyphenation, czech, slovak, german, ngerman, +danish, spanish, catalan, finnish, french, ukenglish, greek, +croatian, hungarian, italian, latin, mongolian, dutch, +norwegian, polish, portuguese, russian, ukrainian, +serbocroat, swedish, loaded. +(/usr/TeX/texmf/tex/latex/base/article.cls +Document Class: article 2001/04/21 v1.4e Standard LaTeX +document class (/usr/TeX/texmf/tex/latex/base/size10.clo)) +(/usr/TeX/texmf/tex/latex/ltxmisc/url.sty) (./para.aux) +[1] (./para.aux) ) +Output written on para.dvi (1 page, 1252 bytes). +Transcript written on para.log. +$ xdvi para & + </pre></blockquote> + <div class="figure" align="center"> + <hr> + <caption><i>Figure 10.3</i>: <a name="paraview">Displaying the typeset paragraph</a></caption> + <div align="center" style="margin:12px"><img src="para.png" width="60%"></div> + <blockquote><pre class="scriptsize"> +\documentclass{article}\usepackage{url}\begin{document} + + You can of course buy and install a fully-fledged commercial +XML editor with XSLT support, and run this application within it. +However, this is beyond the reach of many users, so to do this +unaided you just need to install three pieces of software: +\emph{Java}\footnote{\url{http://java.sun.com/j2se/1.4.2/download.html}}, +\emph{Saxon}\footnote{\url{http://saxon.sourceforge.net}}, and the +DocBook 4.2 DTD\footnote{\url{http://www.docbook.org/xml/4.2/index.html}} +(URIs are correct at the time of writing). None of these has a visual +interface: they are run from the command-line in the same way as is +possible with \LaTeX. + +\end{document} + </pre></blockquote> + <hr> + </div> + <p>Writing <small><a href="chapter10.html#XSLT" class="acroref" name="A271" title="Extensible Stylesheet Language [Transformations]">XSLT</a></small> is not hard, but + requires a little learning. The output method here is + <code class="literal">text</code>, which is <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>'s file + format (<small><a href="chapter10.html#XSLT" class="acroref" name="A272" title="Extensible Stylesheet Language [Transformations]">XSLT</a></small> can also output + <small><a href="chapter10.html#HTML" class="acroref" name="A273" title="HyperText Markup Language">HTML</a></small> and other formats of + XML). + </p> + <ol type="1"> + <li> + <p>The first template matches + ‘<code class="literal">/</code>’, which is + the document root (before the book + start-tag). At this stage we output the text + <code class="literal">\documentclass{article}</code> and + <code class="literal">\usepackage{url}</code>. The + ‘<code class="literal">apply-templates</code>’ + instructions tells the processor to carry on processing, + looking for more matches. <small><a href="chapter10.html#XML" class="acroref" name="A274" title="Extensible Markup Language">XML</a></small> + comments get ignored, and any elements which don't + match a template simply have their contents passed + through until the next match occurs. + </p> + </li> + <li> + <p>The book template outputs the + <code class="literal">\begin{document}</code> and the + <code class="literal">\end{document}</code> commands, and between + them to carry on processing. + </p> + </li> + <li> + <p>The para template just outputs + its content, but follows it with a linebreak (using the + hexadecimal character code <code class="literal">x000A</code> (see + the <small><a href="chapter2.html#ASCII" class="acroref" name="A275" title="American Standard Code for Information Interchange">ASCII</a></small> chart in <a href="appendixC.html#asciicodes">Table C.1</a>). + </p> + </li> + <li> + <p>The ulink template outputs its + content but follows it with a footnote using the + <code class="command"><a name="c320">\url</a></code> command to output the value of + the url attribute. + </p> + </li> + <li> + <p>The emphasis template surrounds + its content with <code class="literal">\emph{</code> and + <code class="literal">}</code>. + </p> + </li> + </ol> + <p>This is a relatively trivial example, but it serves to + show that it's not hard to output <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> from + <small><a href="chapter10.html#XML" class="acroref" name="A276" title="Extensible Markup Language">XML</a></small>. In fact there is a set of + templates already written to produce <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> from a DocBook + file at + <a href="http://www.dpawson.co.uk/docbook/tools.html#d4e2905"><tt>http://www.dpawson.co.uk/docbook/tools.html#d4e2905</tt></a></p> + </div> + </div> + <div class="sect1"> + <h2><a href="#compat"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>10.2 <a name="latexto">Converting out of <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></h2> + <p>This is much harder to do comprehensively. As noted + earlier, the <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> file format really requires the <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> + program itself in order to process all the packages and + macros, because there is no telling what complexities authors + have added themselves (what a lot of this book is + about!). + </p> + <p>Many authors and editors rely on custom-designed or + homebrew converters, often written in the standard shell + scripting languages (Unix shells, Perl, Python, Tcl, etc). + Although some of the packages presented here are also written + in the same languages, they have some advantages and + restrictions compared with private conversions: + </p> + <ul> + <li> + <p>Conversion done with the standard utilities (eg awk, + tr, sed, grep, detex, etc) can be faster for + <i>ad hoc</i> translations, but it + is easier to obtain consistency and a more sophisticated + final product using + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>2<small><a href="chapter10.html#HTML" class="acroref" name="A277" title="HyperText Markup Language">HTML</a></small> or + <span class="TEX">T<span class="E">E</span>X</span>4ht — or one of the other systems + available. + </p> + </li> + <li> + <p>Embedding additional non-standard control sequences in + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> source code may make it harder to edit and + maintain, and will definitely make it harder to port to + another system. + </p> + </li> + <li> + <p>Both the above methods (and others) provide a fast and + reasonable reliable way to get documents authored in + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> onto the Web in an acceptable — if not + optimal — format. + </p> + </li> + <li> + <p><span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>2<small><a href="chapter10.html#HTML" class="acroref" name="A278" title="HyperText Markup Language">HTML</a></small> was written to + solve the problem of getting <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>-with-mathematics + onto the Web, in the days before MathML and math-capable + browsers. + <span class="TEX">T<span class="E">E</span>X</span>4ht was written to turn <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> documents into Web + hypertext — mathematics or not. + </p> + </li> + </ul> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>10.2.1 Conversion to <i><a name="p269">Word</a></i></h3> + <p>There are several programs on <small><a href="chapter5.html#CTAN" class="acroref" name="A279" title="Comprehensive Archive Network">CTAN</a></small> to do + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>-to-<i><a name="p270">Word</a></i> and similar + conversions, but they do not all handles everything <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> + can throw at them, and some only handle a subset of the + built-in commands of default + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>. Two in particular, however, have a good + reputation, although I haven't used either of them (I + stay as far away from <i><a name="p271">Word</a></i> as + possible): + </p> + <ul> + <li> + <p><i><a name="p272">latex2rtf</a></i> by <a name="wh">Wilfried Hennings</a>, <a name="fd">Fernando Dorner</a>, and <a name="ag">Andreas Granzer</a> translates + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> into <small><a href="chapter10.html#RTF" class="acroref" name="A280" title="Rich Text Format">RTF</a></small> — the + opposite of the <i><a name="p273">rtf2latex2e</a></i> + mentioned in <a href="chapter10.html#rtf2latex2e">the 4th item</a>. <small><a href="chapter10.html#RTF" class="acroref" name="A281" title="Rich Text Format">RTF</a></small> can be read by most + wordprocessors, and this program preserves layout and + formatting for most <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> documents using standard + built-in commands. + </p> + </li> + <li> + <p><a name="kac">KirillA Chikrii</a>'s <i><a name="p274"><span class="TEX">T<span class="E">E</span>X</span>2Word</a></i> for + Microsoft Windows is a converter plug-in for + <i><a name="p275">Word</a></i> to let it open <span class="TEX">T<span class="E">E</span>X</span> + and <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> documents. The author's company claims + that ‘virtually any existing <span class="TEX">T<span class="E">E</span>X</span>/<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> + package can be supported by <i><a name="p276"><span class="TEX">T<span class="E">E</span>X</span>2Word</a></i>’ + because it is customisable. + </p> + </li> + </ul> + <p>One easy route into wordprocessing, however, is the + reverse of the procedures suggested in the preceding + section: convert <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> to <small><a href="chapter10.html#HTML" class="acroref" name="A282" title="HyperText Markup Language">HTML</a></small>, + which many wordprocessors read easily. The following + sections cover two packages for this. + </p> + </div> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>10.2.2 <i><a name="p277"><span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>2HTML</a></i></h3> + <p>As its name suggests, <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>2<small><a href="chapter10.html#HTML" class="acroref" name="A283" title="HyperText Markup Language">HTML</a></small> is a system to convert <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> + structured documents to <small><a href="chapter10.html#HTML" class="acroref" name="A284" title="HyperText Markup Language">HTML</a></small>. Its + main task is to reproduce the document structure as a set of + interconnected <small><a href="chapter10.html#HTML" class="acroref" name="A285" title="HyperText Markup Language">HTML</a></small> files. Despite + using Perl, + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>2<small><a href="chapter10.html#HTML" class="acroref" name="A286" title="HyperText Markup Language">HTML</a></small> relies very heavily + on standard Unix facilities like the + <i><a name="p278">NetPBM</a></i> graphics package and the + pipe syntax. Microsoft Windows is not well suited to this + kind of composite processing, although all the required + facilities are available for download in various forms and + should in theory allow the package to run — but reports + of problems are common. + </p> + <ul> + <li> + <p>The sectional structure is preserved, and + navigational links are generated for the standard Next, + Previous, and Up directions. + </p> + </li> + <li> + <p>Links are also used for the cross-references, + citations, footnotes, ToC, and lists of figures and + tables. + </p> + </li> + <li> + <p>Conversion is direct for common elements like lists, + quotes, paragraph-breaks, type-styles, etc, where there + is an obvious <small><a href="chapter10.html#HTML" class="acroref" name="A287" title="HyperText Markup Language">HTML</a></small> + equivalent. + </p> + </li> + <li> + <p>Heavily formatted objects such as math and diagrams + are converted to images. + </p> + </li> + <li> + <p>There is no support for homebrew macros.</p> + </li> + </ul> + <p>There is, however, support for arbitrary hypertext + links, symbolic cross-references between ‘evolving + remote documents’, conditional text, and the + inclusion of raw <small><a href="chapter10.html#HTML" class="acroref" name="A288" title="HyperText Markup Language">HTML</a></small>. These are + extensions to + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>, implemented as new commands and + environments. + </p> + <p><span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>2<small><a href="chapter10.html#HTML" class="acroref" name="A289" title="HyperText Markup Language">HTML</a></small> outputs a + directory named after the input filename, and all the output + files are put in that directory, so the output is + self-contained and can be uploaded to a server as it + stands. + </p> + </div> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>10.2.3 <i><a name="p279"><span class="TEX">T<span class="E">E</span>X</span>4ht</a></i></h3> + <p><span class="TEX">T<span class="E">E</span>X</span>4ht operates differently from + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>2<small><a href="chapter10.html#HTML" class="acroref" name="A290" title="HyperText Markup Language">HTML</a></small>: it uses the <span class="TEX">T<span class="E">E</span>X</span> + program to process the file, and handles conversion in a set + of postprocessors for the common <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> packages. It can + also output to <small><a href="chapter10.html#XML" class="acroref" name="A291" title="Extensible Markup Language">XML</a></small>, including + <a name="TEI" class="acroref">Text Encoding Initiative</a> (<small>TEI</small>) and + DocBook, and the OpenOffice and WordXML formats, and it can + create <span class="TEX">T<span class="E">E</span>X</span>info format + manuals. + </p> + <p>By default, documents retain the single-file structure + implied by the original, but there is again a set of + additional configuration directives to make use of the + features of hypertext and navigation, and to split files for + ease of use. + </p> + </div> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>10.2.4 Extraction from PS and PDF + </h3> + <p>If you have the full version of Adobe + <i><a name="p280">Acrobat</a></i>, you can open a <small><a href="chapter4.html#PDF" class="acroref" name="A293" title="Portable Document Format">PDF</a></small> file created by + <i><a name="p281">pdf<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></i>, select and copy all + the text, and paste it into <i><a name="p282">Word</a></i> + and some other wordprocessors, and retain some common + formatting of headings, paragraphs, and lists. Both + solutions still require the wordprocessor text to be edited + into shape, but they preserve enough of the formatting to + make it worthwhile for short documents. Otherwise, use the + <i><a name="p283">pdftotext</a></i> program to extract + everything from the <small><a href="chapter4.html#PDF" class="acroref" name="A294" title="Portable Document Format">PDF</a></small> file as + plain (paragraph-formatted) text. + </p> + </div> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>10.2.5 Last resort: strip the markup + </h3> + <p>At worst, the <i><a name="p284">detex</a></i> program + on <small><a href="chapter5.html#CTAN" class="acroref" name="A295" title="Comprehensive Archive Network">CTAN</a></small> will strip a <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> file + of all markup and leave just the raw unformatted text, which + can then be re-edited. There are also programs to extract + the raw text from <small><a href="chapter4.html#DVI" class="acroref" name="A296" title="device-independent">DVI</a></small> and <a name="PS" class="acroref">PostScript</a> (<small>PS</small>) files. + </p> + </div> + </div> + </div> + <hr> + <table width="100%"> + <tr> + <td align="left"><a href="chapter9.html"><img src="previous.png" alt="Previous" border="0"></a></td> + <td align="center"><a href="#doctoc"><img src="top.png" alt="Top" border="0"></a></td> + <td align="right"><a href="appendixA.html"><img src="next.png" alt="Next" border="0"></a></td> + </tr> + </table> + </body> +</html>
\ No newline at end of file |