Well, Firefox 6 and above have beforeprint and afterprint handlers, so
I suppose it would be possible to use those to switch to SVG, but
since the processing of math is asynchronous, I'm not sure it would
work (the handlers would return before the math was redisplayed).
> Assuming not, is it possible at least to alert users of Firefox
> without the fonts installed when they print? Then, they could be
> directed to a page that instructs them to install the fonts or
> change to the SVG jax. Or are there other workarounds?
You could use the "@media print" CSS to control the display of a
message that suggests switching to SVG output for printing. For
example:
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
styles: {
"#MJ_PrintWarning": {display: "none"},
"@media print": {
"#MJ_PrintWarning": {
display: "block",
border: "2px solid #800",
color: "#800",
padding: "1em", margin: ".5em 2em 1em 2em",
"text-align": "center",
"font-size": "small"
}
}
}
});
if (MathJax.Hub.Browser.isFirefox) {
MathJax.Hub.Register.StartupHook("onLoad",function () {
var message = MathJax.HTML.Element("div",{
id:"MJ_PrintWarning", style: {display:"none"}
},["Select the SVG renderer in the MathJax contextual menu " +
"for better printing results"]);
document.body.insertBefore(message,document.body.firstChild);
});
MathJax.Hub.Register.MessageHook("Renderer Selected",function
(message) {
var warning = document.getElementById("MJ_PrintWarning");
warning.style.display = (message[1] === "SVG" ? "none" : "");
});
MathJax.Hub.Queue(function () {
if (MathJax.Hub.config.menuSettings.renderer !== "SVG") {
document.getElementById("MJ_PrintWarning").style.display = "";
}
});
}
</script>
(placed BEFORE the script that loads MathJax.js) would insert a
message at the top of the document that would appear only in print for
Firefox except when the SVG output render is selected.
Perhaps that is what you are looking for.
Davide