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
Living Linux

Managing Documents With SGMLtools

05/23/2000

With the SGMLtools package, you can write documents and generate output in many different kinds of formats -- including HTML, plain text, PDF, and PostScript -- all from the same plain text input file.

SGML ("Standard Generalized Markup Language") is not an actual format, but a specification for writing markup languages; the markup language "formats" themselves are called DTDs ("Document Type Definitions"). When you write a document in an SGML DTD, you write input as a plain text file with markup tags -- such as "<em>this<em>" for emphasized text..

The various SGML packages on Linux are currently in a state of transition; the original SGML-Tools package (now "SGMLtools v1") is considered obsolete and is no longer being developed; however, the newer SGMLtools v2 (aka "SGMLtools Next Generation" and "SGMLtools '98") is still alpha software, as is SGMLtools-lite, a new subset of SGMLtools.

In the meantime, if you want to dive in and get started making documents with the early SGMLtools and the linuxdoc DTD (the DTD long-used by the Linux Documentation Project), it's not hard to do. While the newer DocBook DTD has become very popular, it may be best suited for technical books and other very large projects. For smaller documents written by individual authors, such as a multi-part essay, FAQ, or white paper, the linuxdoc DTD still works fine.

And since the Linux HOWTOs are still written in linuxdoc, Debian has decided to maintain the SGMLtools 1.0 package independently; you can download both the Debian package and the original source code from http://www.debian.org/Packages/stable/text/sgml-tools.html.

Many of the same SGML tools are available for BSD and can be found in the "textproc" section of the ports or pkg-src collection. Both the linuxdoc and DocBook DTDs are available.

Elements of a document

A document written in an SGML DTD looks a lot like HTML -- which is no coincidence, since HTML is a subset of SGML. A very simple "Hello, world" in the linuxdoc DTD might look like this:

<!doctype linuxdoc system>
<article>
<title>An Example Document
<author>Ann Author
<date>4 May 2000
<abstract>
This is an example LinuxDoc document.
</abstract>

<sect>Introduction

<p>Hello, world.

</article>

The SGMLtools package comes with a simple example file, example.sgml.gz, which is installed in the /usr/doc/sgml-tools directory.

Pages: 1, 2

Next Pagearrow




Tagged Articles

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

Recommended for You

  1. Cover of Squid: The Definitive Guide
    Squid: The Definitive Guide
    Print: $44.95
    Ebook: $35.99
  2. Cover of Mac OS X Tiger for Unix Geeks
    Mac OS X Tiger for Unix Geeks
    Print: $34.95
    Ebook: $27.99
  3. Cover of Unix Power Tools
    Unix Power Tools
    Print: $74.99
    Ebook: $55.99
  4. Cover of The OpenBSD 4.0 Crash Course
    The OpenBSD 4.0 Crash Course
    Ebook: $9.99

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
makezine.com
craftzine.com
hackszine.com
perl.com
xml.com

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