<!DOCTYPE HTML>
<html>
<head>
<title>Worksheet</title>
<meta charset="UTF-8">
<style>
.content .MJXp-display, .content .MathJax_Display {
display: inline-block !important;
margin: .1em 0 .1em 1em !important;
width: auto !important;
}
</style>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS": {
webFont: 'Latin-Modern',
preferredFont: 'Latin-Modern',
availableFonts: ['Latin-Modern'],
}
});
</script>
<script type="text/javascript" src="./MathJax.js?config=TeX-AMS_HTML">
</script>
</head>
<body>
<div class="content">
<p><strong>1. </strong>Which of the fractions below represents a whole broken into a total of 7 equal parts? Select all that apply.
</p>
<p>
$$A)\ \frac{1}{7}$$ $$B)\ \frac{2}{7}$$ $$C)\ \frac{1}{8}$$ $$D)\ \frac{6}{7}$$ $$E)\ \frac{7}{8}$$
</p>
<p>
<strong>2. </strong>
You cut a pizza into 6 equal pieces. If you eat one piece, what fraction of the pizza did you eat?
</p>
<p>
Choose one: [ \(\frac{1}{3}\) | \(\frac{1}{4}\) | \(\frac{1}{5}\) | \(\frac{1}{6}\) ]
</p>
</div>
</body>
</html>wkhtmltopdf --javascript-delay 10000 test.html output.pdf

wkhtmltopdf --javascript-delay 10000 test.html output.pdf--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Chris,
> 2. The MathJax manual indicates that I can set webFont to null to force the use of local font files stored at <mathjax>/jax/output/HTML-CSS/fonts/. However, if I do this and open test.html in Firefox, I get this:
> My goal is to render PDFs in wkhtmltopdf using only local fonts, but MathJax seems to have difficulty finding the local Latin-Modern font. Is this just a configuration issue?
I'm afraid that's a known bug in MathJax. Only our MathJax fonts and the regular STIX can be used when locally installed. But I'm curious why you want to force local fonts since you seem to be using a local copy of MathJax anyway.
> Furthermore, if I inspect the 1 character in the fraction 1/7, it's using a TeX image font instead of a real font - <mathjax>/fonts/HTML-CSS/TeX/png/Main/Regular/141/0031.png?rev=2.6.0
Falling back to image fonts is expected behavior when no webfont or compatible local font can be found.
> In wkhtmltopdf, which is my actual target renderer, the behavior is stranger. With webFont: 'Latin-Modern', it uses some sans-serif font:
I can't say much except that there have been various issues with wkhtmltopdf in the past; most of them are unfixable as QTWebKit strips too from WebKit for MathJax to work reliably.
You might have more luck using the SVG output; that's not local fonts but technically not webfonts either.
Hi Chris,
> Are these just the fonts bundled with MathJax?That's correct. They are in the `fonts` folder.> but it's really bold in wkhtmltopdf, even with blacker: 1:Too bad. I'm guessing another QTWebKit issue.> It seems to take over 10 seconds to render though.If that refers to the sample in the OP (10 equations), then that's very slow. Does the page render faster in a regular browser? In that case it would be yet another wkhtmltopdf problem.
You could try to pre-process the HTML with mathjax-node and then send it to wkhtmltopdf for print; soon enough that will be able to use the CommonHTML output, not just the SVG.Peter.
I wouldn't touch that. It's a timeout for when MathJax stops detecting that a webfont has loaded. Setting it to 0 means disabling webfonts.
To answer your question, there's no signal from browsers. A spec for that only came out last year and has poor implementation status http://caniuse.com/#feat=font-loading
Webfont download detection is the nastiest, subtlest thing. Davide's hacks are phenomenal and you shouldn't mess with them.
Peter.