LinuxDevCenter.com

oreilly.comSafari Books Online.Conferences.

We've expanded our Linux news coverage and improved our search! Search for all things Linux across O'Reilly!

Search
Search Tips

advertisement

Listen Print Subscribe to Linux Subscribe to Newsletters

Managing Documents With SGMLtools
Pages: 1, 2

Checking document syntax

Use sgmlcheck to make sure the syntax of your SGML document is correct -- it outputs any errors in the document you specify as an argument. For example, to check the sgml file myfile.sgml, you'd type:

$ sgmlcheck myfile.sgml RET

Generating output

Now for the fun part -- generating output from your .sgml input file.



The following table lists the available SGML converters and the kind of output they generate:

sgml2html

Generates HTML files

sgml2info

Generates a GNU info file

sgml2lyx

Generates a LyX input file

sgml2latex

Generates a LaTeX input file

sgml2rtf

Generates a file in Microsoft Rich Text Format

sgml2txt

Generates plain text format

Each of these tools takes the .sgml input file as an argument and writes the output to a file with the same base file name but with an extension that reflects its format.

For example, to make a plain text file from myfile.sgml, you'd type:

$ sgml2txt myfile.sgml RET

This command writes a plain text file called myfile.txt.

To make a PostScript or PDF file from an .sgml file, first generate a LaTeX input file, run it through LaTeX to make a DVI output file, and then process that to make the final output (processing LaTeX files was the subject of a previous column):

$ sgml2latex myfile.sgml RET
$ latex myfile.latex RET
$ dvips -t letter -o myfile.ps myfile.dvi RET

In this example, sgml2latex writes a LaTeX input file from the .sgml source, and then the latex tool processes the LaTeX file to make DVI output, which is processed with dvips to get the final output, a PostScript file called myfile.ps with a paper size of US letter.

To make a PDF file from the PostScript file, you need to do one more step, and use ps2pdf (part of the gs or Ghostscript package) to convert the PostScript to PDF:

$ ps2pdf myfile.ps myfile.pdf RET

Next week: LyX, a "document processor" application.

Michael Stutz was one of the first reporters to cover Linux and the free software movement in the mainstream press.


Read more Living Linux columns.




Tagged Articles

Be the first to post this article to del.icio.us

Sponsored Resources

  • Inside Lightroom
Advertisement

Sponsored by:

O'Reilly Media

©2009, O'Reilly Media, Inc.
(707) 827-7000 / (800) 998-9938
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
About O'Reilly
Academic Solutions
Authors
Contacts
Customer Service
Jobs
Newsletters
O'Reilly Labs
Press Room
Privacy Policy
RSS Feeds
Terms of Service
User Groups
Writing for O'Reilly
Content Archive
Business Technology
Computer Technology
Google
Microsoft
Mobile
Network
Operating System
Digital Photography
Programming
Software
Web
Web Design
More O'Reilly Sites
O'Reilly Radar
Ignite
Tools of Change for Publishing
Digital Media
Inside iPhone
O'Reilly FYI
makezine.com
craftzine.com
hackszine.com
perl.com
xml.com

Partner Sites
InsideRIA
java.net
O'Reilly Insights on Forbes.com