I write quite a bit about TeX and friends and inevitably refer to them by name in my posts.

Is there any way to replace every occurrence of TeX, LaTeX, or foo with custom HTML?

Reference: https://stackoverflow.com/q/8160514

  • From our help center: "Please note that the following subjects are considered off-topic here: ... Hosted scripts such as Wordpress.org and phpBB"
    – ale
    Aug 3, 2014 at 12:57
  • My apologies. I did read the help center since this is a new site to me (I'm usually on TeX.SX), that line must have missed my eye. I would recommend on Meta that the bullet's wording be revised, though. To me, 'hosted scripts' is a meaningless term. Aug 3, 2014 at 18:09

1 Answer 1


enter image description here Yes, there is a plugin called Text Replace for WordPress.org. You just enter a shortcut and what you want to replace it with:

{shortcut} => {replace with}

For your case, for instance:

LaTeX => <span class='latex'>L<sup>a</sup>T<sub>e</sub>X</span>
TeX => <span class='tex'>T<sub>e</sub>X</span>

By the way, I put LaTeX before TeX on purpose. If you read the plugin's page, you'll understand why.

Not the answer you're looking for? Browse other questions tagged or ask your own question.