Latex on the blog

by on January 22, 2011

WP-Latex plugin installed! Converts inline $LaTeX$ code into PNG images that are displayed in your blog posts and comments. Use either [ latex]e^{i pi} + 1 = 0[/latex] or \$ latex e^{i pi} + 1 = 0\$ syntax (less the whitespace before the word “latex”), to generate $e^{i pi} + 1 = 0$ or $e^{i pi} + 1 = 0$

The %latex latex\$ in the comments works now, the issue was with the comments.php code in the Thesis theme – currently (since 1.7, and I’m using 1.8 at time of writing) the stock Thesis code doesn’t apply any filters to the comment body. This disables many plugins that operate ont he comments. Luckily the fix is relatively simple (DIY themes user account required to view).

```You'll have to modify /lib/classes/comments.php

Around line 276 you'll see:
if (\$output) echo \$output;

Change it to:
if (\$output) echo apply_filters('comment_text',\$output);```

In the version of the file I had installed, there are two copies of the offending if, echo statement. I changed both – the second one was necessary (although maybe not sufficient, I didn’t feel like changing the first instance back to test that – the stock editor in my host’s control panel wouldn’t give me line numbers and I have a newer version of Thesis than the fix was for anyway).

Anyway, the point is that you can go nuts and put (inline) latex into the comments now.