tbook

Name

tbook -- XML authoring system

Description

tbook is an XML file format. tbook files are text files that contain a document such as an article or a book. A minimal tbook document looks like this:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE book PUBLIC "-//Torsten Bronger//DTD tbook 1.3//EN" 
		      "http://tbookdtd.sourceforge.net/tbook13.dtd">
<book xml:lang="en-GB">
  <frontmatter>
    <title>A little book</title>
    <author>Bugs Bunny</author>
  </frontmatter>

  <mainmatter>
    <chapter>
      <heading>First Chapter</heading>

      <p>Small is beautiful.</p>
    </chapter>
  </mainmatter>
</book>

For a detailed description of the generic XML file format, see http://www.w3.org/XML/. For a detailed description of the tbook file syntax, see tbookman.pdf or visit the tbook homepage (see below).

General Concept

The tbook program is a set of conversion scripts that convert tbook XML files to other document formats. For doing so, it defines an own file format. Technically speaking, tbook is an XML application plus tools.

tbook offers a method to cross the distances between the LaTeX world, the world of wordprocessors such as Microsoft Word, and the HTML world. Normally it is almost impossible to convert from one of these formats to another.

With tbook you write your document in a well structured form, namely XML. Thus, tbook files are text files. There are some editors that may help you greatly with that, e.g. Emacs. tbook consists of tools that convert your document to HTML, XHTML, LaTeX and DocBook.

In contrast to direct conversions from e.g. LaTeX to HTML, the conversions here are guaranteed to work, and -- except for individual taste -- try hard to achieve nice results.

Textual elements such as bibliography, index, tables, graphics, and formulae are preserved during the the conversion processes.

Conversion Tools

tbtolatex

converts a given tbook file to LaTeX.

tbtohtml

converts a given tbook file to HTML.

tbtodocbk

converts a given tbook file to DocBook XML.

There is yet another program called tbprepare that makes the creation of a fresh document easier.

Please consult the respective man pages for further information about these programs.

Supporting Shell Scripts

There a several shell scripts that reside in the same directory as the document and that are constantly modified by the above conversion tools. If your document contains non-trivial material such as formulae or a bibliography, these shell scripts make coping with it a lot easier.

makeepss [image-name]

creates EPS versions of all bitmap graphics (JPEGs) used in the document. They are needed by dvips. If image-name is given, only the graphics with this filename (without extension) is converted.

makepdfs [image-name]

creates PDF versions of all vector graphics (EPSes) used in the document. They are needed by pdfLaTeX. If image-name is given, only the graphics with this filename (without extension) is converted.

makewebs [image-name]

creates web-ready bitmaps of all graphics used in the document. If image-name is given, only the graphics with this filename (without extension) is converted. If the document contains JPEGs, makeepss must be called first.

makebib

creates the bibliography. For which output format depends on the tbto?? transformer you've called last.

makeidx

creates the index. For which output format depends on the tbto?? transformer you've called last.

makeeqns [equation-number]

creates web-ready bitmaps of all equations used in the document. This command is only available if you've called tbtohtml with the -t option or if you explicitly enabled bitmap equations via an XSLT parameter. See tbtohtml(1) for further details.

If equation-number is given, only the equation with this number is processed.

In this context the XSLT parameter preview-latex may be interesting. See tbtolatex(1) for further details.

makepage

creates a subdirectory called public-document-name/ and copies all files that belong to the web representation of the document into this subdirectory. You can then easily upload it on the web server. If the directory already existed, it is overwritten.

makeclean

deletes most files generated by the other make files.

As already mentioned, these scripts are updated by the transformation processes, so that they are perfectly suited to your document. However, only tbtolatex updates all of them. tbtohtml just writes makeidx and makebib, and tbtodocbk solely updates makebib.

Call Dependencies

The dependencies of the make?? shell scripts and the tbto?? programs are somewhat subtle. In general, if you've changed your XML file significantly (e.g., you've added a new graphics), you have to call tbtolatex in any case, because only then all make files are up to date.

Then you should call makeepss, makepdfs, and makewebs with the name of the graphics as argument.

Then you can do the transformation to HTML or DocBook, or call latex or pdflatex.

If you want to update your index or bibliography, call the transformation to the desired format, call makeidx or makebib respectively, and then the transformation again.

You can't destroy anything: In the worst case one call is waste of time.

Availability

http://sourceforge.net/projects/tbookdtd

See Also

tbtolatex(1), tbtohtml(1), tbtodocbk(1), tbprepare(1), tbook homepage.

tbookman.pdf

emacs(1)

Author

Torsten Bronger