I have posted a new version of LaTeX2WP, a program that converts a LaTeX file into a format that is ready to be copied into WordPress.
The new version fixes some bugs and has some new features:
- Thanks to code contributed by Radu Grigore, it is now possible to nest bold inside italic, and there is a better overall support for font styles. (Which is also easier to customize.)
-
eqnarray*is now supported. - LaTeX commands are correctly “tokenized” before certain macros are applied. For example, LaTeX2WP recognizes the macro \P for \mathop{\mathbb P}. In the previous version, however, the above transformation would also be applied to the initial \P in \Phi. Thanks to Terry Tao and “ccarminat” for noticing this bug.
- Commands such as \$ and \% now work in math mode. (\& does not work, but this seems to be a WordPress problem.) Thanks to Atri Rudra for noticing this bug.
- Quotation marks are applied to the URL in \href and \hrefnospan. The lack of such quotation marks sometimes creates problems with \hrefnosnap.

12 comments
Comments feed for this article
March 1, 2009 at 4:57 pm
Derrick Stolee
Could the \& problem be due to confusion with the “&” needed by HTML?
March 1, 2009 at 4:58 pm
Derrick Stolee
By that, I mean “&” (see how this confusion can arise?)
March 1, 2009 at 5:23 pm
luca
I tried all combinations: leaving \& as it is, replacing it with \&, and replacing it with just &, and none works.
March 1, 2009 at 7:53 pm
mike
\%26 does the trick.
March 1, 2009 at 8:09 pm
luca
D’oh! I didn’t think of that.
March 3, 2009 at 10:33 am
andrescaicedo
Hi,
Thanks a lot for this! I’ve been using it, and it really simplifies things. Two questions: 1. Can we use macros? (As in: Define a new theorem environment or make global definitions? The usual latex way does not work, maybe it is too much to ask for now.)
2. Can we modify the counters, so for example, the first theorem in a post is theorem 7 rather than 1?
Also, there seems to be a problem if I want to have remarks in roman font ({\rm …} does not seem to work).
March 3, 2009 at 1:01 pm
luca
You can define new theorem environments and new macros by editing the latex2wpstyle.py file. There are some instructions on how to do so in readme.txt and in latex2wpstyle.py. If you encounter difficulties, please post a comment on the Using LaTeX2WP page.
You can also change the style of theorem-like environments so they are displayed in roman instead of italic, but (in the present version) you cannot do it selectively for only one environment. {\rm …} and \setcounter are not recognized.
You could modify the counters by editing latex2wp.py (after, I suggest, saving a back-up copy). For example, if you want the counter for theorems to start at 7, you should add the line
count[T["theorem"]] = 6before the line
ref = {}March 28, 2009 at 9:22 am
ugroh
Great tool, very helpful and I hope the \cite-command including literature will be supported too.
But now my stupid question: Where do I have to add a comment, so that
\S16 will be translated into §16 (\S = § in LaTeX)?
Thanks
Ulrich
September 20, 2009 at 10:27 am
Phase-space optics 2: Instantaneous correlation and pseudo-symbolic computation in MATLAB « Reflections
[...] Typeset using LaTeX2WP script by Luca [...]
May 8, 2010 at 11:03 pm
As Farkas the eye can see « Christian Marks
[...] xclip utility makes quick work of copying the output of LaTeX2WP to the WordPress editor. The [...]
August 4, 2010 at 6:52 pm
anwibuma
Please, how to install latex in wordpress
April 3, 2011 at 7:11 pm
starsaminf
No se puede instalar latex en wordpress, lo q se puede hacer es instalar la utilidad xclip