I write on a variety of topics, only some of which it's appropriate to have mathematical typesetting for. To avoid triggering a math rendering engine on unrelated use of $purious dollar sign$, while activating it when $\text{necessary}\wedge\text{appropriate}$, I decided to restrict them to only <… lang="x-mathjax">. Here's how that's done (for v3):

MathJax = {
	tex: {
		inlineMath: [
			['$', '$']
		]
	},
	startup: {
		elements: [':lang("x-mathjax")']
	}
};

I also recommend adding the following CSS to the admin-area with a userstyle or something:

.mce-content-body :lang("x-mathjax") {
	background-color: peachpuff;
}

One thought on “WordPress: Restrict MathJax to a class

Leave a Reply

Your email address will not be published. Required fields are marked *

Warning: This site uses Akismet to filter spam. Until or unless I can find a suitable replacement anti-spam solution, this means that (per their indemnification document) all commenters' IP addresses will be sent to Automattic, Inc., who may choose to share such with 3rd parties.
If this is unacceptable to you, I highly recommend using an anonymous proxy or public Wi-Fi connection when commenting.