public final class WebPageOutputOptionsBuilder extends Object
WebPageOutputOptions instances
for various common scenarios.
This replaces WebPageOutputOptionsTemplates, which is now deprecated and will be removed
in SnuggleTeX 1.4| Constructor and Description |
|---|
WebPageOutputOptionsBuilder() |
| Modifier and Type | Method and Description |
|---|---|
static WebPageOutputOptions |
createHTML4Options()
Creates
WebPageOutputOptions used to serve up an HTML 4 page, possibly including
MathML and other XML islands. |
static WebPageOutputOptions |
createHTML5MathJaxOptions()
Creates
WebPageOutputOptions suitable for creating an HTML 5 web page with
embedded MathML, using MathJax for cross-browser rendering of the MathML. |
static WebPageOutputOptions |
createHTML5MathJaxOptions(String customMathJaxUrl)
Creates
WebPageOutputOptions suitable for creating an HTML 5 web page with
embedded MathML, using MathJax for cross-browser rendering of the MathML. |
static WebPageOutputOptions |
createHTML5Options()
Creates
WebPageOutputOptions used to serve up an HTML 5 page, with MathML and any
other XML islands "adopted" into HTML 4 by having their namespace details removed. |
static WebPageOutputOptions |
createIEMathPlayerSpecificOptions()
Creates
WebPageOutputOptions suitable for deploying solely in Internet
Explorer having the MathPlayer plug-in installed. |
static WebPageOutputOptions |
createLegacyCrossBrowserOptions()
Creates
WebPageOutputOptions that would previously have been considered
"cross-browser" in that it works on both Mozilla (i.e. |
static WebPageOutputOptions |
createMozillaSpecificOptions()
Creates
WebPageOutputOptions suitable for deploying solely in a Mozilla-based
browser, such as Firefox, using its native support for MathML. |
static WebPageOutputOptions |
createUniversalStylesheetOptions(String clientStylesheetUrl)
Create "Cross-browser" XHTML + MathML suitable for deploying to Mozilla and
Internet Explorer + MathPlayer using a client-side XSLT often called the "Universal StyleSheet".
|
static WebPageOutputOptions |
createUniversalStylesheetOptions(String clientStylesheetUrl,
String rendererPreference) |
static WebPageOutputOptions |
createXHTMLMathJaxOptions()
Creates
WebPageOutputOptions suitable for creating an XHTML + MathML web page,
using MathJax for cross-browser rendering of the MathML. |
static WebPageOutputOptions |
createXHTMLMathJaxOptions(String customMathJaxUrl)
Creates
WebPageOutputOptions suitable for creating an XHTML + MathML web page,
using MathJax for cross-browser rendering of the MathML. |
static WebPageOutputOptions |
createXHTMLOptions()
Creates
WebPageOutputOptions used to serve up an XHTML page, possibly including
MathML and other XML islands. |
public static final WebPageOutputOptions createXHTMLMathJaxOptions()
WebPageOutputOptions suitable for creating an XHTML + MathML web page,
using MathJax for cross-browser rendering of the MathML.
This is one of the most effective web page outputs.
createHTML5MathJaxOptions()public static final WebPageOutputOptions createXHTMLMathJaxOptions(String customMathJaxUrl)
WebPageOutputOptions suitable for creating an XHTML + MathML web page,
using MathJax for cross-browser rendering of the MathML.
This is one of the most effective web page outputs.
customMathJaxUrl - custom MathJax URL, which can be used to point to a local
installation of MathJax or pass custom configuration details to MathJax.createHTML5MathJaxOptions()public static final WebPageOutputOptions createHTML5MathJaxOptions()
WebPageOutputOptions suitable for creating an HTML 5 web page with
embedded MathML, using MathJax for cross-browser rendering of the MathML.
This is one of the most effective web page outputs.
createXHTMLMathJaxOptions()public static final WebPageOutputOptions createHTML5MathJaxOptions(String customMathJaxUrl)
WebPageOutputOptions suitable for creating an HTML 5 web page with
embedded MathML, using MathJax for cross-browser rendering of the MathML.
This is one of the most effective web page outputs.
customMathJaxUrl - custom MathJax URL, which can be used to point to a local
installation of MathJax or pass custom configuration details to MathJax.createXHTMLMathJaxOptions()public static final WebPageOutputOptions createMozillaSpecificOptions()
WebPageOutputOptions suitable for deploying solely in a Mozilla-based
browser, such as Firefox, using its native support for MathML.
This is a niche output kept around for legacy purposes. You should look at some of the newer HTML5 + MathJax-related options for better compatibility and easier deployment.
This is intended to be served as application/xhtml+xml with
encoding declared via HTTP header and meta element.
This will display as an XML tree on IE, which is not useful.
public static final WebPageOutputOptions createIEMathPlayerSpecificOptions()
WebPageOutputOptions suitable for deploying solely in Internet
Explorer having the MathPlayer plug-in installed.
This is a niche output kept around for legacy purposes. You should look at some of the newer HTML5 + MathJax-related options for better compatibility and easier deployment.
text/html, containing prefixed MathML islands.
This only works on IE clients with the MathPlayer plug-in preinstalled, but is a good option if that's your target audience.
This will display wrongly on IE6/7 if MathPlayer is not installed.
public static final WebPageOutputOptions createUniversalStylesheetOptions(String clientStylesheetUrl)
See XSLT Stylesheets for MathML for more details.
You must specify a URL for the client-side XSLT stylesheet that will be referenced in the resulting web page so that it is available to browsers. You will need to take into account security restrictions, such as "same domain", so will probably need to make sure you put the XSLT somewhere that is "local" to where you are serving up your pages.
Note that the SnuggleTeX source distribution contains a slightly fixed version of the USS that works in versions of IE newer than 6, but hasn't been extensively tested.
This is a niche output kept around for legacy purposes. You should look at some of the newer HTML5 + MathJax-related options for better compatibility and easier deployment.
The pref:renderer attribute on the html element will be set
to mathplayer-dl.
public static final WebPageOutputOptions createUniversalStylesheetOptions(String clientStylesheetUrl, String rendererPreference)
public static final WebPageOutputOptions createLegacyCrossBrowserOptions()
WebPageOutputOptions that would previously have been considered
"cross-browser" in that it works on both Mozilla (i.e. Firefox) and Internet Explorer 6+
(provided the MathPlayer plugin is installed).
This is a niche output kept around for legacy purposes. You should look at some of the newer HTML5 + MathJax-related options for better compatibility and easier deployment.
W3CConstants.XHTML_11_MATHML_20_PUBLIC_IDENTIFIER
and System identifier defined in W3CConstants.XHTML_11_MATHML_20_SYSTEM_IDENTIFIER.
The charset is declared only in the meta element in order
to appease MathPlayer.
This is intended to be served as application/xhtml+xml
Works on both Mozilla and IE6/7 (provided MathPlayer has been installed). This will display wrongly on IE6/7 if MathPlayer is not installed.
The main issue with this is that IE will want to download the relevant DTD, which hinders performance slightly.
public static final WebPageOutputOptions createXHTMLOptions()
WebPageOutputOptions used to serve up an XHTML page, possibly including
MathML and other XML islands. These islands would normally need further processing before
hitting a browser, so this output is probably not useful on its own.
public static final WebPageOutputOptions createHTML4Options()
WebPageOutputOptions used to serve up an HTML 4 page, possibly including
MathML and other XML islands. These islands would normally need further processing before
hitting a browser, so this output is probably not useful on its own.
public static final WebPageOutputOptions createHTML5Options()
WebPageOutputOptions used to serve up an HTML 5 page, with MathML and any
other XML islands "adopted" into HTML 4 by having their namespace details removed.
These islands would normally need further processing before hitting a browser, so this output is probably not useful on its own.
Copyright © 2008–2026 The University of Edinburgh. All rights reserved.