Document strategies for the Web


XML as central source repository

passivetex

TeX brings typography to XML

Running PassiveTeX and FOP, an example

We can run the above XML file with an XSL processor (such as xt or LotusXSL) to generate FOs, and then use FOP (see James Tauber's presentation) or PassiveTeX to generate PDF.

What is PassiveTeX?

PassiveTeX is available at http://users.ox.ac.uk/~rahtz/passivetex/.

PassiveTeX derives from and builds on:

The system components, which probably will be rewritten separately, are:

Advantages and disadvantages of PassiveTeX

Running PassiveTeX

A typical invocation would be on a Unix command line:

# make the special TeX format file (first time only)
pdftex -ini "&pdflatex" fotex.tex
# run an XSL processor
xt file.xml somestyle.xsl file.fo
# run pdfTeX on the result; twice, to make sure
# referencing and pagination is stable.
pdflatex "&fotex" file.fo
pdflatex "&fotex" file.fo
# look at the result
acroread file.pdf

Most modern TeX implementations contain pdfTeX.

PassiveTeX: how it handles maths

PassiveTeX supports MathML directly. An XSL style sheet can pass <math> and its children through unchanged, as follows:

<xsl:template match="math">
  <xsl:apply-templates mode="math"/>
</xsl:template>

<xsl:template mode="math"
  match="*|@*|comment()|processing-instruction()|text()">
  <xsl:copy>
    <xsl:apply-templates mode="math" 
      select="*|@*|processing-instruction()|text()"/>
  </xsl:copy>
</xsl:template>

A reasonable subset of presentation MathML is recognized, and produces good output. We show an example later.

LaTeX users, beware!

XSL, FO and TeX, cons and pros

PassiveTeX: more examples

Text Encoding Initiative

Docbook

A scientific document

The generated MathML source

<section id="vavref">
<stitle>Vavilov theory</stitle>

<par>Vavilov<cite refid="bib-VAVI"/> derived a more accurate
straggling distribution by introducing the kinematic limit on the
maximum transferable energy in a single collision, rather than using
<inlinemath><math><msub><mi>E</mi><mrow><mtext>max</mtext></mrow></msub>
<mo>=</mo><mi>&infin;</mi></math></inlinemath>.

Now we can write<cite refid="bib-SCH1"/>: 

<eqnarray ><subeqn><math><mi>f</mi> <mfenced open='(' close=')'>
<mi>&epsi;</mi><mo>,</mo><mi>&delta;</mi><mi>s</mi></mfenced>
<mo>=</mo> <mfrac><mrow><mn>1</mn></mrow>
<mrow><mi>&xi;</mi></mrow>
</mfrac><msub><mi>&phi;</mi><mrow><mi>v</mi></mrow></msub>
<mfenced open='(' close=')'>
<msub><mi>&lambda;</mi><mrow><mi>v</mi></mrow></msub><mo>,</mo>
<mi>&kappa;</mi><mo>,</mo><msup><mi>&beta;</mi><mrow><mn>2</mn></mrow>
</msup></mfenced></math></subeqn></eqnarray> 
where
<eqnarray><subeqn><math><msub><mi>&phi;</mi><mrow><mi>v</mi></mrow></msub> 
<mfenced open='(' close=')'>
<msub><mi>&lambda;</mi><mrow><mi>v</mi></mrow></msub><mo>,</mo>
<mi>&kappa;</mi><mo>,</mo>
<msup><mi>&beta;</mi><mrow><mn>2</mn></mrow></msup></mfenced>  
  <mo>=</mo>   
<mfrac><mrow><mn>1</mn></mrow>
       <mrow><mn>2</mn><mi>&pi;</mi><mi>i</mi></mrow>
</mfrac>
<msubsup><mo>&int;</mo>
<mrow><mi>c</mi><mo>+</mo><mi>i</mi><mi>&infin;</mi></mrow>
<mrow><mi>c</mi><mo>-</mo><mi>i</mi><mi>&infin;</mi></mrow></msubsup>
<mi>&phi;</mi><mfenced open='(' close=')'><mi>s</mi></mfenced>
<msup><mi>e</mi><mrow><mi>&lambda;</mi><mi>s</mi></mrow></msup>
<mi>d</mi><mi>s</mi><mspace width='2cm'/><mi>c</mi><mo>&geq;</mo><mn>0</mn>
                 </math></subeqn>
                 
<subeqn><math><mi>&phi;</mi><mfenced open='(' close=')'><mi>s</mi></mfenced> 
<mo>=</mo><mo>exp</mo><mfenced open='[' close=']'><mi>&kappa;</mi>
<mrow><mo>(</mo><mn>1</mn><mo>+</mo><msup><mi>&beta;</mi>
      <mrow><mn>2</mn></mrow></msup><mi>&gamma;</mi><mo>)</mo></mrow>
</mfenced><mo>exp</mo><mfenced open='[' close=']'><mi>&psi;</mi> 
<mfenced open='(' close=')'><mi>s</mi></mfenced></mfenced>
<mo>,</mo> </math></subeqn>

vav-normal

The original document (formatted by LaTeX)

vav-screenacrobat

PDF display optimized for screen viewing

Priorities for future work

So what about PassiveTeX?


PREVIOUSFIRSTLASTNEXT