- Added handling of different XSLT processors in makefile.
- Added upright text inside math environment.
 - Fixed a couple of math mode problems.
1 parent ce97fc5 commit 71673000104f685ef2e88b1f1194bfea048ee1ee
cedwards authored on 8 Jan 2004
Showing 4 changed files
View
37
Makefile
# $Id$
 
 
all: xml2html.xsl xml2latex.xsl
 
xml2html.xsl: format-master.xml xml2xslt.xsl Makefile
Xalan -p format "'html'" format-master.xml xml2xslt.xsl > xml2html.xsl
ifeq ($(XSLT),xalan-c)
Xalan -p format "'html'" $< xml2xslt.xsl > $@
else
ifeq ($(XSLT),xalan-j)
xalan -param format "'html'" $< xml2xslt.xsl > $@
else
saxon $< xml2xslt.xsl format=html > $@
endif
endif
 
xml2latex.xsl: format-master.xml xml2xslt.xsl Makefile
Xalan -p format "'latex'" format-master.xml xml2xslt.xsl > xml2latex.xsl
ifeq ($(XSLT),xalan-c)
Xalan -p format "'latex'" $< xml2xslt.xsl > $@
else
ifeq ($(XSLT),xalan-j)
xalan -param format "'latex'" $< xml2xslt.xsl > $@
else
saxon $< xml2xslt.xsl format=latex > $@
endif
endif
 
View
18
format-master.xml
<latex>~</latex>
<html><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></html>
</template>
 
<template name="non-breaking-space-math" match="non-breaking-space" mode="math">
<template name="non-breaking-space-math" match="non-breaking-space|nbsp" mode="math">
<latex>~</latex>
<html><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></html>
</template>
</html>
</template>
 
<!-- Roman (upright) text inside math environments. -->
<template name="math-text" match="text" mode="math">
<latex>\mathrm{<xsl:apply-templates mode="math"/>}</latex>
<html><xsl:apply-templates mode="math"/></html>
</template>
<!-- Digit grouping separator character for large numbers. SI conventions say this should be a space (but we could make it a comma if desired). -->
<template name="digit-group-separator" match="digit-group-separator|digitsep">
<common>
<xsl:call-template name="non-breaking-space"/>
</common>
</template>
 
<template name="digit-group-separator" match="digit-group-separator">
<template name="digit-group-separator-math" match="digit-group-separator|digitsep" mode="math">
<common>
<xsl:call-template name="non-breaking-space"/>
</common>
</template>
<common> = </common>
</template>
 
<template name="approximately-equals-operator-math" match="approximately-equals|approximately-equal-to|approx" mode="math">
<latex>{\approx}</latex>
<html><xsl:text disable-output-escaping="yes">&amp;#8776;</xsl:text></html>
</template>
<template name="approximately-equals-operator" match="approximately-equals|approximately-equal-to|approx">
<latex>\(\approx\)</latex>
<html><xsl:text disable-output-escaping="yes">&amp;#8776;</xsl:text></html>
</template>
<template name="approximately-equals-operator" match="approximately-equals|approximately-equal-to|approx">
<latex>{\approx}</latex>
<html><xsl:text disable-output-escaping="yes">&amp;#8776;</xsl:text></html>
</template>
<template name="degree-sign-math" match="degree-sign" mode="math">
<latex>^{\circ}</latex>
<html><xsl:text disable-output-escaping="yes">&amp;#176;</xsl:text></html>
View
7
xml2html.xsl
<xsl-out:template name="page-break" match="page-break|new-page"/>
<xsl-out:template name="non-breaking-space" match="non-breaking-space|nbsp"><xsl:text disable-output-escaping="yes" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">&amp;nbsp;</xsl:text></xsl-out:template>
 
<xsl-out:template name="non-breaking-space-math" match="non-breaking-space" mode="math"><xsl:text disable-output-escaping="yes" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">&amp;nbsp;</xsl:text></xsl-out:template>
<xsl-out:template name="non-breaking-space-math" match="non-breaking-space|nbsp" mode="math"><xsl:text disable-output-escaping="yes" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">&amp;nbsp;</xsl:text></xsl-out:template>
<xsl-out:template name="ellipsis-sign" match="ellipsis-sign|etc|ellipsis|dots"><xsl:text disable-output-escaping="yes" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">&amp;#8230;</xsl:text></xsl-out:template>
 
<TR xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><TD ALIGN="RIGHT"><xsl:apply-templates select="left"/></TD><TD ALIGN="CENTER"><xsl:apply-templates select="middle"/></TD><TD ALIGN="LEFT"><xsl:apply-templates select="right"/></TD></TR>
</xsl-out:template>
 
<xsl-out:template name="math-text" match="text" mode="math"><xsl:apply-templates mode="math" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/></xsl-out:template>
<xsl-out:template name="digit-group-separator" match="digit-group-separator|digitsep">
<xsl:call-template name="non-breaking-space" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>
</xsl-out:template>
 
<xsl-out:template name="digit-group-separator" match="digit-group-separator">
<xsl-out:template name="digit-group-separator-math" match="digit-group-separator|digitsep" mode="math">
<xsl:call-template name="non-breaking-space" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>
</xsl-out:template>
View
xml2latex.xsl