Well, I suspect that if you include the image but mark it display:none
you could use javascript to change the display to visible if
window.MathJax is defined (i.e., if you have included MathJax in the
page). Something like
<span id="MathJax-Badge" style="display:none">
<a href="
http://www.mathjax.org/">
<img title="Powered by MathJax" src="
http://www.mathjax.org/
badge.gif" border="0" alt="Powered by MathJax" />
</a>
</span>
<script type="text/javascript">
if (window.MathJax) {document.getElementById("MathJax-
Badge").style.display = ""}
</script>
should work (this is untested, but is the right idea). If you include
MathJax on every page and only want to show the badge on pages that
include math, you could do
<script type="text/javascript">
MathJax.Hub.Queue(function () {
if (MathJax.Hub.getAllJax().length) {
document.getElementById("MathJax-Badge").style.display = "";
}
});
</script>
which checks to see if there is any math on the page (after MathJax
typesets it), and displays the badge only when there is.
If you want the badge to take up the room that it normally does but
just not be shown, use visibility:hidden instead of display:none.
Hope that fits the bill.
Davide