Using LaTeX2WP

The distribution contains the following files:

  • the conversion program
  • specifies typesetting options, and environments and macros recognized during the conversion
  • readme.txt: some basic information on how to use LaTeX2WP
  • sets the typesetting options in the style of Terry Tao’s blog.
  • macrosblog.tex: defines LaTeX commands recognized by LaTeX2WP for typsetting colors, links to URLs, and images, so that LaTeX files containing such commands can be typeset and previewed offline
  • example.tex: a sample post showing how to use the main functionalities recognized by LaTeX2WP
  • post-template.tex: a starting point for writing a post in LaTeX; it imports various packages and macros so that pictures, hyperlinks etc. can be seen in the preview the same way they will appear in the post.
  • knuth.png: a picture (from xkcd, Copyright Randall Munroe) required to preview example.tex
  • gpl.txt: the text of the GNU General Public License
  • changelog.txt: a list of changes from previous versions.

By looking at example.tex, it should be easy to see how to get started. Indeed, just starting to write LaTeX, and seeing what happens with the conversion should be fine.

Your mathematical posts do not have to look like mine. A number of stylistic changes can be made by editing (make a copy before editing it); comparing it to, and reading the comments in the code, should help understand how to make such changes.

It is possible to add your own LaTeX macros, if they do not involve passing of parameters. It wouldn’t be too hard to add support for arbitrary LaTeX macros and environments, but right now I have run out of energy (maybe during the Summer).

Another limitation is that there is no support for footnotes, and no support for bibliographic references. I will definitely work on this during the Summer.

When LaTeX2WP cannot do what you want, you can always put HTML code in the scope of a \ifblog . . . \fi. The conversion will output such HTML code verbatim, and it will be ignored in the LaTeX preview. Conversely, anything in the scope of \iftex . . . \fi is compiled in the LaTeX preview but skipped in the conversion.

18 thoughts on “Using LaTeX2WP

  1. Pingback: A bash workflow script for LaTeX2WP « Christian Marks

  2. Hi, is there a way to write equations such that they appear centered in WordPress? I’ve tried using both \[ ‘equation’ \] and \begin{equation} \end{equations} without luck.


  3. WordPress seems to be changing the html I get from latex2wp. I’ve only had a problem starting today. I was able to make two posts using latex2wp html that turned out perfect. Strangely, even when I post the html of one of these old successful posts into a new draft post wordpress still changes it.

    In particular it seems they are removing some of my ‘s, which results in my boxes surrounding way more text than they should.

  4. In my above comment the last sentence was meant to be

    “In particular it seems they are removing some of my div code for boxes, which results in my boxes surrounding way more text than they should.”

  5. Pingback: First Draft | Eigenpost

  6. Pingback:     $latex LaTeX$ na WordPress – porada « FIKSACJE

  7. Pingback:     LaTeX na WordPress – porada « FIKSACJE

  8. It is giving the following error:
    Traceback (most recent call last):
    File “E:\”, line 657, in
    File “E:\”, line 140, in extractbody
    for i in range(1,(len(L)+1)/2) :
    TypeError: ‘float’ object cannot be interpreted as an integer

  9. Pingback: De Latex a WordPress « Memorandum Matemático

  10. Pingback: LaTeX and | Thiago G. Martins

  11. @ziyuang I’ve tried to change the files so that subsubsections would be supported but with little success. Do you think you can give me a hand?

  12. Pingback: [¯|¯] Scrivere formule matematiche con LaTeX su WordPress | » Esercizi svolti di Matematica

  13. Pingback: De Latex a WordPress | Notas breves de Matemáticas

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s