XSL-TeX Experiment
Monday, 15. May 2006, 12:29:57
The idea behind XSL-TeX was to develop experimental LaTeX like mathematical markup that fits well in X(HT)ML + XSLT + CSS, X(HT)ML + XSLT + XSL FO and X(HT)ML + JS + CSS frameworks. Basically it is just experiment intended to find out whether it is worth to send non-XML input to browsers, as well as CSS and XSL formatters. It is inspired by CanonML initiative.
The basic conceptual problem with LaTeX like input syntax is that there is no natural way to apply CSS selectors, Xpath, and DOM Core to LaTeX like markup due to highly non-uniform syntax where one has no analog of hierarchical tree with elements and attributes. In addition such a markup is unlikely to be suitable for client side usage as XSLT and/or JS needed to transform LaTeX like input into something suitable for rendering in browser (X(HT)ML+CSS, MathML, SVG) makes rendering slow and non incremental.
Due to this reasons XSL-TeX inititaive was abandoned almost as quickly as arised. However some resources (convertors, style sheets) for handling XSL-TeX are available and if someone is interested in taking non-XML approach (s)he can reuse these style sheets.
Below is brief summary of input syntax and available tools.
Input Syntax (Brief summary)
Inline formula: $E = mc^2$
Displayed formula: $$E = mc^2$$
Subscripts: Base_{subscript} or Base_s
Superscripts: Base^{superscript} or Base^s
Stacked indices: Base_{sub}^{sup} or Base^{sup}_{sub} or Base_s^s or Base^s_s
Presubscript: \inf{sub}Base
Presuperscript: \sur{sup}Base
Stacked prescripts: \pre{sup}{sub}Base
Fractions: \frac{numerator}{denominator}
Overscripts: \stackrel{over}{Base}
Underscripts: \stackrev{Base}{under}
Overbrace: \overbrace{Base}
Overbrace with inscription: \overbrace{Base}^{over}
Underbrace: \underbrace{Base}
Underbrace with inscription: \underbrace{Base}_{under}
Square root: \sqrt{radicand}
Radical: \rad{radix}{radicand}
Operators: \ope{U} \ope{U}_{sub} \ope{U}^{sup} \ope{U}_{sub}^{sup}
Common Operators: ∑ ∑_{sub} ∑^{sup} ∑_{sub}^{sup}
Fences:
\left( content \right)
\left[ content \right]
\left{ content \right}
\left| content \right|
\left. content \right|
Fences with indices:
\left( content \right)_{sub}
\left[ content \right]_{s}
\left{ content \right}_{sub}^{sup}
\left| content \right|^{sup}_{sub}
\left. content \right|_0^1
Vectors: \vector{entry}{entry}{entry}{entry}
Matrices:
\matrix{
\row{cell}{cell}{cell}
\row{cell}{cell}{cell}
\row{cell}{cell}{cell}
}
Determinants:
\det{
\row{cell}{cell}{cell}
\row{cell}{cell}{cell}
\row{cell}{cell}{cell}
}
Cases:
\cases{
\case{value}{scope}
\case{value}{scope}
}
Bold: \mathbf{Bold}
Italic: \mathsl{Italic}
Strike: \strike{Strike}
Overline: \overline{overline}
Underline:\underline{underline}
Linebreak: \\
Softbreak (wrap point): \wrap
Character escapes: \{ \} \_ \^ \s (for $) \b (for \)
Style sheets for XSL-TeX
xsltex.xslt
XSLT style sheet that transforms XSL-TeX into XML and is suitable for rendering XSL-TeX in Opera 9.
See examples of using this style sheet.
It is not recommended to use this method for delivery (transforamtions are better to be done on author side).
xsltex.js
JavaScript that transforms XSL-TeX into XML. It can be used for rendering XSL-TeX in Opera 9.
Some examples of using this JS are available.
As in case of XSLT, transforamtions are better to be done on author side.
Converters
XSL-TeX in Action
Online converter for transforming XSL-TeX into XML and/or XHTML. Output can be formatted in Opera 9 and/or
Prince 5 using CSS. There are some examples of XHTML output produced by this convertor.
Can be used offline.
tex2xml.js
Macro for EmEditor that can be used to convert XSL-TeX to XML during authoring process.
It converts selected part of mathematical expression only.
Works in EmEditor version 5 (or 4 Professional). Can be enabled from
-[Macros]
--[Select...]
drop down menu in EmEditor.
xsl-tex.js
Macro for EmEditor that can be used to convert XSL-TeX to XML during authoring process.
It converts selected document fragment containing mathematical expressions.
Works in EmEditor version 5 (or 4 Professional). Can be enabled from
-[Macros]
--[Select...]
drop down menu in EmEditor.
The basic conceptual problem with LaTeX like input syntax is that there is no natural way to apply CSS selectors, Xpath, and DOM Core to LaTeX like markup due to highly non-uniform syntax where one has no analog of hierarchical tree with elements and attributes. In addition such a markup is unlikely to be suitable for client side usage as XSLT and/or JS needed to transform LaTeX like input into something suitable for rendering in browser (X(HT)ML+CSS, MathML, SVG) makes rendering slow and non incremental.
Due to this reasons XSL-TeX inititaive was abandoned almost as quickly as arised. However some resources (convertors, style sheets) for handling XSL-TeX are available and if someone is interested in taking non-XML approach (s)he can reuse these style sheets.
Below is brief summary of input syntax and available tools.
Input Syntax (Brief summary)
Inline formula: $E = mc^2$
Displayed formula: $$E = mc^2$$
Subscripts: Base_{subscript} or Base_s
Superscripts: Base^{superscript} or Base^s
Stacked indices: Base_{sub}^{sup} or Base^{sup}_{sub} or Base_s^s or Base^s_s
Presubscript: \inf{sub}Base
Presuperscript: \sur{sup}Base
Stacked prescripts: \pre{sup}{sub}Base
Fractions: \frac{numerator}{denominator}
Overscripts: \stackrel{over}{Base}
Underscripts: \stackrev{Base}{under}
Overbrace: \overbrace{Base}
Overbrace with inscription: \overbrace{Base}^{over}
Underbrace: \underbrace{Base}
Underbrace with inscription: \underbrace{Base}_{under}
Square root: \sqrt{radicand}
Radical: \rad{radix}{radicand}
Operators: \ope{U} \ope{U}_{sub} \ope{U}^{sup} \ope{U}_{sub}^{sup}
Common Operators: ∑ ∑_{sub} ∑^{sup} ∑_{sub}^{sup}
Fences:
\left( content \right)
\left[ content \right]
\left{ content \right}
\left| content \right|
\left. content \right|
Fences with indices:
\left( content \right)_{sub}
\left[ content \right]_{s}
\left{ content \right}_{sub}^{sup}
\left| content \right|^{sup}_{sub}
\left. content \right|_0^1
Vectors: \vector{entry}{entry}{entry}{entry}
Matrices:
\matrix{
\row{cell}{cell}{cell}
\row{cell}{cell}{cell}
\row{cell}{cell}{cell}
}
Determinants:
\det{
\row{cell}{cell}{cell}
\row{cell}{cell}{cell}
\row{cell}{cell}{cell}
}
Cases:
\cases{
\case{value}{scope}
\case{value}{scope}
}
Bold: \mathbf{Bold}
Italic: \mathsl{Italic}
Strike: \strike{Strike}
Overline: \overline{overline}
Underline:\underline{underline}
Linebreak: \\
Softbreak (wrap point): \wrap
Character escapes: \{ \} \_ \^ \s (for $) \b (for \)
Style sheets for XSL-TeX
xsltex.xslt
XSLT style sheet that transforms XSL-TeX into XML and is suitable for rendering XSL-TeX in Opera 9.
See examples of using this style sheet.
It is not recommended to use this method for delivery (transforamtions are better to be done on author side).
xsltex.js
JavaScript that transforms XSL-TeX into XML. It can be used for rendering XSL-TeX in Opera 9.
Some examples of using this JS are available.
As in case of XSLT, transforamtions are better to be done on author side.
Converters
XSL-TeX in Action
Online converter for transforming XSL-TeX into XML and/or XHTML. Output can be formatted in Opera 9 and/or
Prince 5 using CSS. There are some examples of XHTML output produced by this convertor.
Can be used offline.
tex2xml.js
Macro for EmEditor that can be used to convert XSL-TeX to XML during authoring process.
It converts selected part of mathematical expression only.
Works in EmEditor version 5 (or 4 Professional). Can be enabled from
-[Macros]
--[Select...]
drop down menu in EmEditor.
xsl-tex.js
Macro for EmEditor that can be used to convert XSL-TeX to XML during authoring process.
It converts selected document fragment containing mathematical expressions.
Works in EmEditor version 5 (or 4 Professional). Can be enabled from
-[Macros]
--[Select...]
drop down menu in EmEditor.