Changes

Jump to navigation Jump to search
m
Lots of minor typographical/spelling corrections.
software to produce high quality PDF documents--right now.
One and one half years ago I gave up using latex LaTeX to format my XML
documents. I had found--or so I thought--a much superior solution
in the Formatting Object language, or FO. FO would allow me to
create high quality PDF documents in XML and unicode instead of
the unfamiliar cumbersome and unfamilar syntx unfamiliar syntax of texTeX. It would
allowed me to convert from an XML tree to an XML tree, exactly
what an XML author wants. The FO language was established in the
the development of FOP. While I could produce basic documents, I
still couldn't perform other basic formatting needs, such as
controlling widow pagraphras paragraphs or centering a table. Since the
developers of FOP have made no changes to their software in all
this time, I came to the conclusion that I would be stuck with
documents.
Thus I turned back to texTeX, knowing I would face almost none of
these limitations. I could produce beautiful documents right now,
without having to wait for an open source FO converter that
actually implements implemented all the standards. ConTeXt seemed the mostadvanced form of texTeX, allowing me to format in the most direct
manner without having to rely on many different macros (or
outside libraries), so I choose it.
If you are an XML author who want wants to convert their your documents toPDF via XSLT , you will find this document useful. I try to first
describe how to do something in FO before explaining how I would
do it in ConTeXt, but even if you do not know any FO you should
==What You Should Know==
This document assumes that the user you already has have ConTeXt installedand knows know how to use it. If neither is true, take a little bit
of time and visit the ConTeXt website to get familiar with how to
run ConTeXt on your system. At the minimum, you should know the
commands to issue to conver convert the ConTeXt examles examples here to PDF. You
don't need to know more than that to get started, though of
course the more you learn, the clearer this document will be.
python utility that converts its own special form of XML into
ConTeXt. That means you can use XSLT to convert from one XML tree
to another and then let the python utlity to utility do the dirty work ofhandling white spacewhitespace.
TeXML uses a very simple XML language. Basically, it represents
<texcode>
 
\starttext
hello world
\stoptext
 
 
</texcode>
<texcode>
 
 
texexec [document_name]
 
</texcode>
to produce a formatted document. Along with many other documents,
this command prodices a document with the extension ".dvi"," whichI can view with the xdvi software . Follow the instructions to
produce other types of output.
<pre>
 
<?xml version="1.0"?>
<TeXML>
</env>
</TeXML>
 
</pre>
<pre>
 
 
texml -e utf8 -c [infile.xml] [outfile.tex]
 
</pre>
The "-e" option along with its argument of "utf8" tells TeXML to
produce a document that is encoded in utf8. The "-c" option tells
TeXML to produce ConTeXt output rather than latexLaTeX. Make sure you
include both options.
Although both the ConTeXt and XML document documents use differentstructurestructures, they do share the main text environment. Like allenvironments Like all environments in ConTeXt, this one starts
with a backslash followed by the word "start", and then followed
by the name of the environment wihout without a space. We end this
environment in the same way, replacing "start" with "stop."
In TeXML, we enclose environments with the <texcode>
<texcode>env</texcode>
element. The mandatory "name" attribute defines the environment's
<texcode>
 
\starttext
\framed[width=2cm,height=1cm]{that's it}
\stoptext
 
</texcode>
<pre>
 
<?xml version="1.0"?>
<TeXML>
</env>
</TeXML>
 
</pre>
<texcode>
 
\enableregime[utf]
 
</texcode>
Apparently, this allows ConTeXt to handle both utf8 and utf16.
In addtionaddition, we want to disable as many of ConTeXt's automatic
modes as possible, since we will generate things like titles and
sections our selfourselves. ConTeXt automatically places a number on each
page, and starts a new number with each part. To turn this
feature off, place this line somewhere at the top of your
<texcode>
 
 
\setuppagenumbering[state=stop, way=bytext]
 
</texcode>

Navigation menu