The distribution contains the following files:
- latex2wp.py: the conversion program
- latex2wpstyle.py: specifies typesetting options, and environments and macros recognized during the conversion
- readme.txt: some basic information on how to use LaTeX2WP
- terrystyle.py: 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 latex2wpstyle.py (make a copy before editing it); comparing it to terrystyle.py, 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.
Pingback: A bash workflow script for LaTeX2WP « Christian Marks
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.
Thanks.
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.
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.”
Pingback: First Draft | Eigenpost
Pingback: $latex LaTeX$ na WordPress – porada « FIKSACJE
Pingback: LaTeX na WordPress – porada « FIKSACJE
It is giving the following error:
Traceback (most recent call last):
File “E:\latex2wp.py”, line 657, in
s=extractbody(s)
File “E:\latex2wp.py”, line 140, in extractbody
for i in range(1,(len(L)+1)/2) :
TypeError: ‘float’ object cannot be interpreted as an integer
Pingback: De Latex a WordPress « Memorandum Matemático
I am getting the same error as Sumit Kumar Jha.
The program works with python 2.7.3 but not with 3.2.3. At least this is the case on my windows 7 machine.
i get the same error as sumit kumar jha, i.e. the html file isn’t even created.
I’ve ported it to Python 3, feel free to comment and patch. https://github.com/ziyuang/latex2wppy3
Pingback: LaTeX and WordPress.com | Thiago G. Martins
@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?
Pingback: [¯|¯] Scrivere formule matematiche con LaTeX su WordPress | » Esercizi svolti di Matematica
Pingback: De Latex a WordPress | Notas breves de Matemáticas
Hello,
I have downloaded and used the converter, and found it very useful.
I have also written a short post on my blog, providing a link to this page, for others who might want to download the converter for themselves.
Thanks for this awesome tool.
Nihan
PS: a link to my blog: http://properphysics.wordpress.com/2015/04/18/using-latex-on-wordpress/
Pingback: Tools for Writing Mathematical Blog Posts | Rob Hubbard's Blog
Hello,
I think this programme is pretty cool but it seems like both $$…$$ and \[…\] are not working properly. I have read my html file, and found out that there are no
…..
part in html but instead the html file is already aligned in the centre. I have no idea how to fix this problem as I know nothing about python, so I am writing a comment here to possibly get a respond from you. (Moreover, hyperlink, colouring and attaching photo also have the same issue)
By the way, I am a Macbook user, with macOS Sierra, version 10.12 and as a python programme, I use terminal that is equipped in mac from the beginning
One thing that would be very useful is to work with \input from multiple files, but also work with tikzautomata (although that may be very difficult! :).
My brother suggested I might like this website.
He was entirely right. This post actually made my day.
You can not imagine simply how much time I had spent for this information! Thanks!
I am receiving the following error
: File name too long
import-im6.q16: not authorized `re’ @ error/constitute.c/WriteImage/1037.
from: can’t read /var/mail/sys
from: can’t read /var/mail/latex2wpstyle
./latex2wp.py: line 33: syntax error near unexpected token `(‘
./latex2wp.py: line 33: `count = dict()’
There is a line in latex2wp that looks like `count = dict()’ ?
The error was received on Ubuntu 18.04.3 LTS
Pingback: LaTeX Teste… – Letras Católicas