This is our blog. It's mainly about programming, web developement and design, social web, coding habits and advice and miscellaneous geekery. You can subscribe to the feeds to never miss a bit.
WPTeX: Create a book from your Wordpress blog
During the last two days I was working on a php program that I use on another website (wordpress blog) and that I wanted to share it with you, people.
Here’s what it’s about: Imagine you have a Wordpress blog, or that you’re planning to have one. WPTeX will help you generate a PDF ebook from your blog with the best typeseting tool available: LaTeX!
Another use: Imagine that you want to write your book, but you’re very lazy to start it. My advice: Create a wordpress blog, post your articles at your rythm like every blogger do, and when you want to create your book, use WPTeX
Check out the project in its own micro-site and tell me what you think :)
P.S. This is the first release, many features will be added, so stay tuned ! ;-)
Enjoyed this post? please subscribe to our feeds to stay informed.
Comment [27]
I just downloaded WPTex and tried running it according it your instructions and all I get is a blank /wptex/index.php page. I’m not really sure why. I tried leaving the index field blank during the setup and got the following error repeated about 50 times:
Warning: Invalid argument supplied for foreach() in /home/opendial/public_html/blog/wptex/libs/functions.php on line 190
This is an ingenious idea, by the way. It just appears to need to have some bugs ironed out.
There is a bug in the script. If no keywords are specified, it gives an error:
Warning: Invalid argument supplied for foreach() in /[host path]/wptex/libs/functions.php on line 190.
Also the mini-site has some (minor) inconsistencies: in some places the license is stated to be as LGPL, in other GPL. Last but not least, you may want to specify “chmod 775” instead of “chmod 666” for the tmp directory.
Hope this helps.
Some more suggestions: you might want to use utf8x (from the LaTeX package ucs) as input encoding to avoid having the user changing from applemac to latin1. As most WP blogs are in UTF-8, it makes sense anyway.
You should also put some notes on the LaTeX packages requirement: I saw a reference to “pscal” which is included in pstricks, and also put a warning of some sorts that indicates that the use of certain characters will break LaTeX compilation (unless you escape them).
This is a good idea (and I wish you luck in developing it), but having a pdf converter is less useful than having an .epub converter. The upcoming Adobe reader (Adobe Digital Editions) will support .epub format (which is the new official standard for ebooks). See http://www.idpf.org/specs.htm
Hi,
Thank you for this script. I got everything working, but the PDF generated does seems corrupted. I tryed several times – followiing your instructions, but when I double-clic on book.pdf, I get “there was an error opening this document. The file is damaged and could not be repaired”. Too sad. Would you have an idea of what is wrong?
Gérald
Hi there, great job. I’ve been looking for something like this – I think.
I downloaded the zip-file, unzipped it, uploaded the wptex directory to the server now I am using the link you recommend, but it says “404 Page not found on this server” the directory is there and I did chmod it to 777…
I am on a Mac
I had no problem installing WPTeX, but when I run it I get memory allocation errors (my allowed memory size for PHP is 16Mb). I do have about 4.5 years of blogging history. My database dumps (via mysqldump) to a 3Mb file. When I bump the memory_limit directive in php.ini to 32M WPTeX runs fine. Just wanted to let anyone else know if they run in to this problem.
Just to clarify better what I wrote earlier, I think some notes should be put:
- Currently BBCodes and other similar codes used by plugins will break compilation (they’re not put in verbatim blocks, and I doubt it can be done automatically): for example I put a lot of source code posts in my blog and those generate a lot of errors.
- If wptex creates files with pstricks requirement, it should be written somewhere that it will only work with plain latex and not pdflatex.
does it support wpmu? generate the pdf ebook for a specific blog? thanks!
Nice program but i have a few problems with the tex-file. It chokes on markdown i use in my blogposts. For example, i like to like with something like [here the site](http here the address).
would it be difficult to extend your program to include these markdown-syntax?
also i use LatexRender to have tex-symbols in my posts. it is easy enough to do a find-and-replace on opening and closing [ tex ]-tags and replace them with a $-sign, but still it would be nice if the program does it for you…
again thanks for a great program.
First, you’ve made a magnificent start but at this point it’s definitely just a start.
Here are a few things I’ve found in just the first cut:
1. “Table of Contents” appears in French (?)
2. It doesn’t seem to be handling embedded HTML gracefully.
Example: <blockquote>…</blockquote>
appears literally.
3. Escaped characters aren’t being translated.
Example: “ (left double quote)
As time allows I may look into the code and propose approaches to solving some of these problems.
But it’s still a good start!
I’ve got a suggestion on handling anchors: they should be handled as footnotes.
Commenting is closed for this article.
« Previous post: Mid-century art to the rescue: 15 resources to get inspired and learn how to draw the 50's way
Next post: »
Me vs. Digg (Round 1)