Phil
--
Phillip Lord, Phone: +44 (0) 191 222 7827
Lecturer in Bioinformatics, Email: philli...@newcastle.ac.uk
School of Computing Science, http://homepages.cs.ncl.ac.uk/phillip.lord
Room 914 Claremont Tower, skype: russet_apples
Newcastle University, msn: m...@russet.org.uk
NE1 7RU twitter: phillord
I think what the questioner had in mind was to give a toggle on the
page that would either show the original TeX code or the typeset code,
so that you could switch between the two, rather than simply turning
off MathJax entirely. But that is just a guess.
If that is what was requested, there is no direct way to do that, but
it could be done with some javascript code. For instance, adding
<script>
function removeTypeset() {
var HTML = MathJax.HTML, jax = MathJax.Hub.getAllJax();
for (var i = 0, m = jax.length; i < m; i++) {
var script = jax[i].SourceElement(), tex = jax[i].originalText;
if (script.type.match(/display/)) {tex = "\\["+tex+"\\]"} else
{tex = "\\("+tex+"\\)"}
jax[i].Remove();
var preview = script.previousSibling;
if (preview && preview.className === "MathJax_Preview") {
preview.parentNode.removeChild(preview);
}
preview = HTML.Element("span",{className:"MathJax_Preview"},[tex]);
script.parentNode.insertBefore(preview,script);
}
}
function showTypeset(show) {
MathJax.Hub.Queue(show ? ["Reprocess",MathJax.Hub] : removeTypeset);
}
</script>
<style>
.MathJax_Preview {color:black ! important}
</style>
to the <head> section of your page, and
<label>
<input type="checkbox" onchange="showTypeset(this.value)"
checked="checked" />
Show Typeset Mathematics
</label>
to the body of the page will add a checkbox that lets you turn on and
off the typeset mathematics. When turned off, the mathematics will
show as its original TeX code (with delimiters), and when on as the
typeset code.
Hope that does what you need.
Davide
"Davide P. Cervone" <dp...@union.edu> writes:
>> Easiest solution is to switch javascript off. This will do other things
>> as well of course.
>
> I think what the questioner had in mind was to give a toggle on the page that
> would either show the original TeX code or the typeset code, so that you
> could switch between the two, rather than simply turning off MathJax
> entirely. But that is just a guess.
You can get to the underlying TeX with a right click, cannot you not?
Never worked out whether this was the real underlying code or generated.
But it's close enough.
Phil
Yes, but there may be other reasons to not have the math be typeset
(copy and paste of whole paragraphs at a time, for example).
> Never worked out whether this was the real underlying code or
> generated.
It is the original.
Davide