By and large, I am quite happy with the LaTeX support provided by wordpress, which hosts my blog (and many other maths blogs out there); it is certainly superior to the maths support of most other off-the-shelf blog formats I have looked at. But it does have some annoying bugs and quirks; a lot of perfectly good LaTeX gets converted into “Formula does not parse”.
It occurred to me that maybe one should start a page that collects all the known bugs so that they can be sent at some point to the wordpress programmers to fix. So, here is my initial list of known bugs: any other wordpress users out there are very welcome to contribute their own.
Convention: I will drop the “latex” when I want to show a fragment of LaTeX source code without making it compile, e.g.
$\int_{-\infty}^\infty e^{-\pi x^2}\ dx = 1$ becomes .
[Update, Feb 14: The bugs have now been fixed; see comments below.]
— The brackets bug —
This one comes up quite a lot: any LaTeX string that begins with a bracket [ automatically does not parse. For instance,
$[a,b]$ becomes .
A workaround here is to put some filler in front of the bracket, e.g.
${}[a,b]$ becomes .
$\null [a,b]$ becomes .
— The trivial LaTeX bug —
When applying LaTeX to a single character, the parser sometimes gives up:
$ $ becomes $latex $.
$0$ becomes .
This can of course be worked around by using filler:
${} 0$ becomes .
— The double spacing bug —
Most LaTeX strings that involve a double space seem to choke, e.g.
$x y$ becomes .
$a f$ becomes .
The workaround is, of course, not to use double spaces:
$x y$ becomes .
— The nested brackets bug —
If latex code contains brackets and is in turn contained in brackets, strange things can happen (and I don’t have a workaround for this, other than not to do it), in particular terminating the post prematurely:
$[[a,b]]$ becomes .
This sentence is not displayed.
70 comments
Comments feed for this article
10 February, 2009 at 4:18 pm
andrescaicedo
Hi,
Something I’ve noticed is that sometimes (more often than one would like) I get an error (Formula does not parse). I then rewrite the exact same thing, and the error disappears. Sometimes, writing in the HTML rather than VISUAL mode reveals the problem, for example some invisible piece of code (ending italics mode, or stuff like that) got inside the dollar signs.
Sometimes, I do not see any reason for the error, and the rewrite makes it go away.
Andres
10 February, 2009 at 4:40 pm
WordPress LaTeX Bug List | WPLover
[…] WordPress LaTeX Bug List […]
10 February, 2009 at 8:07 pm
tmr
I noticed that brackets error, but did not know about the double space problem. checking out in HTML mode is neat though.
10 February, 2009 at 9:57 pm
quantblog
I am new to latex embedded in WordPress – I agree its great but also frustrating.
I could never get multiple lines to parse, where they have &= .
So I just did them line by line, in chunks, ouch.
Im a linux user, fairly nw to LaTex. Not really a Lyx fan so far…
I found my best work-flow currently while I’m learning is to use one of the Latex online web based editors, namely codecogs – http://www.codecogs.com/components/equationeditor/equationeditor.php
10 February, 2009 at 10:18 pm
Gil
This is extremely useful, Terry,
(Who could imagine that it was the double space that made so much troubles…) I noticed that quite a few times in order to have a formula work I have to retype it from scratch. I found it hard to identify systematically what is going wrong. One thing I noted is that when I edit a formula and change the first symbol after “latex” the edited formula does not work (still did not find a way around it).
30 June, 2011 at 11:23 am
nhanttruong
I have a similar problem with retyping the formula from scratch.
I think it has something to do with copy and pasting latex: e.g. you get lazy typing
, so you first write A \trianglelefteq and copy and paste it 3 times. WordPress doesn’t like this, so it gives a Formula does not parse.
One thing I’ve found to work is to finish your code as usual, then copy the entire block and paste it to some other editor (e.g. the search bar in your browser) and finally copy and paste it back.
10 February, 2009 at 11:05 pm
Anonymous
http://codex.wordpress.org/Reporting_Bugs
11 February, 2009 at 12:47 am
anstei
The last bug is very strange indeed, since the resulting error is even different in the RSS feed: My reader printed
[${}[a,b]$] becomes [
img src=’http://l.wordpress.com/latex.php?latex=%7B%7D%5Ba%2Cb%5D&bg=ffffff&fg=545454&s=0′ alt='{}[a,b]‘ title=’{}[a,b]‘ class=’latex’ /
].
instead of displaying and parsing the img tag correctly, even in if the HTML-tags seem to be perfectly well. Also, “This sentence is not displayed.” is in fact displayed!
11 February, 2009 at 3:43 am
Américo Tavares
Brackets. To get for instance
sometimes I write
$\lbrack -\pi ,\pi\rbrack $,
instead of $[-\pi,\pi]$
Spaces. Usually I have to delete the blank space before a \ or before and after an =
In most cases this solves the problem.
11 February, 2009 at 6:20 am
Américo Tavares
Horizontal spacing. To have a thick space I write $x\;y$, that parses as
and $x\,y$ for a thin space
11 February, 2009 at 8:23 am
Américo Tavares
Nested brackets. $\left[ \left[ a,b\right] \right] $ parses as![\left[ \left[ a,b\right] \right] \left[ \left[ a,b\right] \right]](https://s0.wp.com/latex.php?latex=%5Cleft%5B+%5Cleft%5B+a%2Cb%5Cright%5D+%5Cright%5D+&bg=ffffff&fg=545454&s=0&c=20201002)
11 February, 2009 at 9:51 am
Kevin O'Bryant
If I could ask wordpress.com programmers to do one more thing, it would be to implement a PREVIEW button for comments. Its absence isn’t a latex bug, but it makes latex bugs particularly painful.
11 February, 2009 at 9:55 am
Terence Tao
The WordPress LaTeX plugin, by the way, is located here:
http://wordpress.org/extend/plugins/wp-latex/
I don’t see a place to report bugs for it, other than via the general link mentioned in an earlier comment (although that seems to be for “core” wordpress issues rather than for plugins).
11 February, 2009 at 11:20 am
jay
Kevin: there’s no comment preview on wordpress.com blogs due to security reasons.
The easiest work-around I guess is to get a wordpress account: even if not blogging yourself you’ll be able to use your account’s blog to preview your message and its LaTeX, and then simply copy and paste to whatever post you want to comment on when you’re ready.
11 February, 2009 at 4:29 pm
Blake Stacey
Ah, excellent idea. I didn’t notice the bracket bug, because I did my commutator expressions using a macro package I’d made for typing up my class notes — if you set it up with \renewcommand so that \comm{A}{B} gives
, the parser works. (Having macros for these things paid off, at least for me, when the expressions inside the commutator got big, so that I didn’t have to bother with \left and \right commands all the time.) Using one’s own style files with the LaTeXRender plugin requires tweaking the template it sticks TeX commands into, so I’m not sure it can be done on blogs hosted on wordpress.com.
12 February, 2009 at 1:29 am
Américo Tavares
Comment preview. I agree with jay’s advice. For those with a WordPress blog that is quite natural. To edit my previous comments I just used my blog. Actually I did it in an auxiliary blog I created mainly for editing purposes.
12 February, 2009 at 9:07 am
john
Dear Terry,
I have always wondered…..do you write your blog posts on emacs/notepad first and then transfer them to wordpress? Perhaps some bugs could be attributed to this.
12 February, 2009 at 11:44 am
Matt
Thanks for collating all these. Keep them coming and we’ll do us best to fix them up.
13 February, 2009 at 3:48 am
Dima
There is one more unpleasant bug of a different nature – improper handling of draft/autosaved posts. Recovering from an autosaved draft leads to all the backslashes being lost.
13 February, 2009 at 4:53 am
dweebydoofus
Dima also made a good point. One time I had to resort to the autosave option and the fact that I lost all \ really was troublesome.
As for inputing equations in comments I think that another method could be to use the online LateX equation editors that are around. For example: http://www.codecogs.com/components/equationeditor/equationeditor.php you create your equation and then copy and paste the LateX code into the LateX tags.
13 February, 2009 at 6:16 pm
luca
$REPEAT$ becomes
14 February, 2009 at 9:35 am
Hailin Wu
Hi Professor Tao,
Thank you for collecting the bugs and I’m happy to tell you that all of the LaTeX problems you mentioned in your post are fixed. Now WordPress should handle LaTeX math much better. Please let me know if you encounter any additional issue.
$ $ gives ‘no formula provided’, this is expected, as there IS no formula.
Luca: REPEAT is not allowed in our LaTeX package.
PS: I love abstract math (field theory in particular)
14 February, 2009 at 9:48 am
Terence Tao
Dear Hailin,
Thank you very much for the prompt fixes to the code!
15 February, 2009 at 8:15 pm
Writers block « Shores of the Dirac Sea
[…] Terrence Tao is compiling a Latex for WordPress bug collection. […]
16 February, 2009 at 1:05 pm
Sune Kristian Jakobsen
@Hailin Wu:
It used to be possible to copy Latex-images from the posts and comments into the your own comments (at least in firefox), but this doesn’t work anymore. This feature has saved me a lot of time. Could you please try to fix it?
16 February, 2009 at 3:03 pm
¡Funciona! LaTeX en WordPress « Francis (th)E mule Science’s News
[…] su blog “What’s new” y me encuentro con que un bug me ha resuelto la pregunta: “WordPress LaTeX bug collection drive“: $ latex <comandos> $, por […]
17 February, 2009 at 3:24 pm
Hailin
Firefox changed it’s image copying mechanism. It’s a FF bug.
18 February, 2009 at 11:58 am
Terence Tao
Dear Hailin,
A related issue: it seems that there does not seem to be any ALT-text attached to the LaTeX images now, whether in Firefox or in other browsers. (I have used this feature in the past to be able to paste LaTeX images into plain-text, which was also very useful.) If the ALT-text could be restored that would be very convenient.
19 February, 2009 at 9:47 am
Hailin
Dear Professor Tao,
Restored.
Just a note, now you can put nested brackets around expressions, and it will parse just fine. Ex:
$[[p, q]]$ becomes![[[p, q]] [[p, q]]](https://s0.wp.com/latex.php?latex=%5B%5Bp%2C+q%5D%5D&bg=ffffff&fg=545454&s=0&c=20201002)
![[[[x, y]]] [[[x, y]]]](https://s0.wp.com/latex.php?latex=%5B%5B%5Bx%2C+y%5D%5D%5D&bg=ffffff&fg=545454&s=0&c=20201002)
$[[[x, y]]]$ becomes
Certainly the old way still works, but it is not as easy as the one above:
$ \left[ \left[ a,b\right] \right] $ becomes
I’d avoid putting bracket directly outside of the whole latex expression, because […] is treated as shortcode and can cause side effects.
19 February, 2009 at 9:52 am
Terence Tao
Thanks again!
1 March, 2009 at 12:25 pm
Terence Tao
“open” seems to be some sort of reserved word, e.g. $\hbox{open}$ becomes
. The workaround is to insert some random braces, e.g. $hbox{op{}en}$ becomes
.
3 March, 2009 at 12:14 pm
Hailin
Right, the full list of reserved words are:
‘afterassignment’,
‘aftergroup’,
‘batchmode’,
‘catcode’,
‘closein’,
‘closeout’,
‘command’,
‘csname’,
‘document’,
‘def’,
‘errhelp’,
‘errcontextlines’,
‘errorstopmode’,
‘every’,
‘expandafter’,
‘immediate’,
‘include’,
‘input’,
‘jobname’,
‘loop’,
‘lowercase’,
‘makeat’,
‘meaning’,
‘message’,
‘name’,
‘newhelp’,
‘noexpand’,
‘nonstopmode’,
‘open’,
‘output’,
‘pagestyle’,
‘package’,
‘pathname’,
‘read’,
‘relax’,
‘repeat’,
‘shipout’,
‘show’,
‘scrollmode’,
‘special’,
‘syscall’,
‘toks’,
‘tracing’,
‘typeout’,
‘typein’,
‘uppercase’,
‘write’
3 March, 2009 at 12:18 pm
Hailin
One advice: your blog has a lot of comments, turning on comment threading is useful (Settings => Discussion).
18 March, 2009 at 12:55 am
ccarminat
I apologize if this question is somewhat out of topic.
I find the “framed theorems” used in this blog visually very effective, but I don’t understand how to realize this feature: is this latex or wordpress code?
Thanks,
c.c.
PS: from the source view, it looks it is the WP quotation but, even with the same theme (Tarski), I did not succeed in the task (but I’m a beginner).
3 April, 2009 at 1:17 pm
Terence Tao
This is not a WordPress LaTeX error per se, but it does tend to show up whenever LaTeX is used in comments: the inequality signs <, >, when occurring together, are parsed as HTML and so often all the text between such signs (when used in the mathematical sense) are simply lost.
The workaround here is to use < and > instead of < and >. Of course, one doesn’t want to break the HTML compatibility in order to save the mathematical symbols, but perhaps one compromise would be to not parse as HTML any expression between inequality signs which does not make sense as HTML, instead treating it as plaintext.
p.s. ccarminat, I’m using a modified version of the Tarski theme, with a slightly different CSS. The relevant code is
blockquote {
border-top:1px solid #000;
border-bottom:1px solid #000;
border-left:1px solid #000;
border-right:1px solid #000;
background:#FFFFFF;
color:#000;
margin:25px 25px 15px;
padding:5px 10px 0;
}
15 April, 2009 at 6:58 am
ccarminat
Thanks!
It looks your css code for quotation works with K2-light as well.
But, to fix the change one has to use Custom CSS Upgrade:
am I right?
15 May, 2009 at 6:34 am
Latex testing « Alanzed’s Blog
[…] how to deal with LaTeX in WordPress. They claim it is baked in, and Terrence Tao is starting a minor bug list, but I can’t get it to work without a […]
19 May, 2009 at 4:10 pm
Terence Tao
${\lambda}&fg=000000$ becomes
. In contrast, ${\mu}&fg=000000$ becomes
.
7 June, 2009 at 1:25 pm
ramanujantao
$|\psi \rangle_{AB} = \sum_{i,j} c_{ij}|i \rangle_{A} \otimes |j \rangle_{B}$ becomes
.
How would I fix this?
7 June, 2009 at 1:26 pm
ramanujantao
It seems to work on the comments but not on my blog.
8 October, 2009 at 9:48 pm
Terence Tao
Something very strange: the double-spaces bug is fixed in comments but not in posts. For instance, $a f$ parses correctly in comments as
, but not in posts.
14 October, 2009 at 10:30 am
lingpipe
I’m finding that $\big{$ fails, producing
(not parsing, as of 14 October 2009). But $\big|$ produces
. So I’m thinking it’s a bracket-matching parsing bug.
14 October, 2009 at 11:20 am
John Armstrong
lingpipe: | isn’t required to match. Consider, for instance, its use as an “evaluation bar”.
19 October, 2009 at 1:17 pm
lingpipe
@John Armstrong
1. Using $\big{$ isn’t supposed to invoke matching in LaTeX. It works just fine by itself outside of the context of WordPress’s plugin. Also, $\big{ f(x) \big}$ also fails to parse in the plugin.
2. The matching form of variable size parens would be invoked with $\left{ f(x) \right}$, but that also doesn’t work in the plugin. Also, the matching just requires count matching, not bracket matching — you can use $\right.$ (note the final period) to match any old left without displaying anything.
19 October, 2009 at 2:21 pm
John Armstrong
@lingpipe Maybe it’s supposed to be $\big\{$ ?
14 December, 2009 at 8:20 pm
Kim Kirkpatrick
@Terrence 8 Oct:
In WordPress posts, a double space becomes a space followed by & nbsp; (HTML entity space). The LaTeX parser should scan for such entities first.
Comments are filtered differently than posts; at least on my site, I can’t get double spaces in a comment. (That is, the spaces are in the text, show up again when editing, but HTML treats multiple spaces as one.)
21 December, 2009 at 12:22 pm
Graham Wheeler
I’m having a lot of difficulty with WP and LaTeX. For example, I am having problems with simple arithmetic equalities involving just integers, parentheses, plus minus and \times.
It seems nondeterministic. For example, I took one expression and started replicating it piece by piece to see where the failure first occurred. Eventually I replicated the entire expression, with the newly entered one parsing but the original one still failing to parse, even though they were now exactly identical!
An example of the things that fail for me (maybe they would work if I went through the replication process above but that is too tedious to be practical):
I’ve tried various combinations of whitespace to no avail.
21 December, 2009 at 12:59 pm
John Armstrong
Graham, I’m looking at your source code, and it seems you’re using some weird character instead of a keyboard hyphen as your minus sign. Replacing it with a standard keyboard hyphen, I test:
21 December, 2009 at 1:39 pm
Magi
Thanks John, let me check that. I’m using Windows Live Writer as my editor and perhaps it is transforming the character as I am just typing in a keyboard hyphen.
21 December, 2009 at 1:44 pm
Magi
You’re right – that is the problem. I’m not sure why WLW would transform the character inconsistently – when I re-entered the one line as I described above I was still using WLW so in some cases the hyphen is getting transformed and in others it is not. Very strange but at least I now I know how to fix it. Thanks very much!
21 December, 2009 at 3:52 pm
John Armstrong
WLW likely does some preprocessing. In fact, WordPress might do the same. Try copying the character ‘-‘ as it appears on the website (not in the input box) and see what happens. I know that it replaces a double-hyphen with an en-dash, and a triple one with an em-dash (‘–‘ and ‘—‘, respectively), and androgynous (keyboard) single and double quotes with opening and closing quotes. Try typing some of those combinations into WLW and watch closely what happens.
16 February, 2010 at 11:12 am
Vilyanur Chandra
Nice. Thanks for the bugs.
I am a newbie for Latex and it will help me to understand Latex more.
2 January, 2011 at 2:40 am
science and math
I cal also see that wordpress’es WYSIWYG editor sometimes automatically deletes blank space and other characters which also causes on latex formulas rendering.
30 January, 2011 at 4:56 am
converterpassion
Terry, thanks a lot for this initiative, and quantblog thanks for the Codecogs LaTeX editor tip. I was just about to start putting a lot of maths expressions on my blog, and here I found precisely what I needed to get started. Again, thanks a lot both of you.
As another newbie here, my experience so far is that writing the post – or at least the LaTeX – in HTML mode prevents the WP engine from doing something “smart” (i.e. unwanted) that inserts weird stuff into the latex code string. I also noted that the Codecogs editor is far more forgiving than the WP parser, so you need to train yourself before it gets right most of the time.
10 April, 2011 at 11:33 am
Pankaj Jyoti Mahanta
is it correct- $[a,b]$ ? how can we write a to the power 4?
24 July, 2011 at 6:19 am
Stephen F. Siegel
I have a very basic problem. On my blog, all of my inlined latex formulas render with a very low vertical alignment, as if the center of the latex formula were aligned with the baseline of the surrounding text. For example, when I write
, the middle of the x is aligned with the baseline just under the “e”. Do I have a problem with some setting?
6 February, 2012 at 6:09 am
Gerardo Beightol
When will you update this with more information?
11 August, 2012 at 8:47 am
Alexander Shamov
It also doesn’t like spaces before brackets:

“x )”
“x \}”
The workaround is not to use spaces there.
11 August, 2012 at 8:50 am
Alexander Shamov
And it also likes your blog much more than mine, since it seems to behave differently on the same input! Wow!
11 August, 2012 at 8:53 am
Alexander Shamov
No, I’m sorry, it’s just the difference between comments and posts. Anyway, it’s funny…
11 August, 2012 at 11:18 pm
Anonymous
With a bit configuration here:http://holdenweb.blogspot.com/2011/11/blogging-mathematics.html ,Blogger can support LaTex too,using Mathjax.
17 December, 2013 at 1:50 am
On some diophantine equations | Mathematical Exposition
[…] Please feel free to point out errors. A few may have inadvertently crept in due to the heavy editing involved(there were several LaTex issues- if you are having problems with typesetting math on wordpress, this webpage can be helpful: https://terrytao.wordpress.com/2009/02/10/wordpress-latex-bug-collection-drive/). […]
26 December, 2013 at 5:48 am
Murali
$\Latex$
26 December, 2013 at 8:13 am
Anonymous
Of course; “\Latex” is not a command! It is “$\LaTeX$”.
3 January, 2014 at 3:59 pm
A sporadic image resizing bug in WordPress LaTeX | What's new
[…] the problem is coming from and how one might mitigate it. (If nothing else, I can add it to the bug collection post, once it can be reliably […]
23 March, 2014 at 3:55 am
amarvashishth
it may not seem to work when preview under the Visual tab but works well when “Preview Changes” button is used.
4 October, 2015 at 9:11 am
JOYDEEP DUTTA
I am from India. I have just started a wordpress mathblog : convexityblog.wordpress.com
I just typed : $\latex0\in\partial f(x)$ but it is not giving me the symbolic output when I am saving the file. I would be happy if you kindly help me. When do I see the final output.
1 November, 2017 at 3:56 am
¡Funciona! LaTeX en WordPress | General | La Ciencia de la Mula Francis
[…] “What’s new” y me encuentro con que un bug me ha resuelto la pregunta: “WordPress LaTeX bug collection drive“: $ latex <comandos> $, por […]
13 January, 2021 at 10:13 am
Yaj Yaj
Reblogged this on Hice Las Cuentas.
13 January, 2021 at 10:42 am
michaelmross
Why is it rendered so faint? I’ve not seen that elsewhere. Seems like the default grayscale is wrong.
[Wordpress’s LaTeX does not incorporate the CSS style. My blog uses a black text colour instead of grey, but I have to explicitly change the text colour in LaTeX to match (usually through an external script that convertex LaTeX to wordpress format). In this particular post I did not do this. -T]