Skip to content →

23 search results for "latexrender"

LatexRender plugin for wordpress under Panther

After
three days of desperate trial-and-error I seem to have managed to get latexrender working for
wordpress under Mac
OS X.
First things first : if you only want to include some
symbols in your blog-posts the easiest way to do so is to use mimetex and the
corresponding
wordpress-plugin
written by Steve Mayer. Follow the
instructions and you will be able to include a limited subset of LaTeX
in your blog within 10 minutes.
If you want more, you have to
work a lot harder. The starting point is to follow Steve’s
blog-entries on latexrender
.
But then under Mac OS X you will probably get error messages
when you activate the plugin. The reason seems to be that most versions
of imagemagick available for
OS X require X-terminal support and PHP gets confused between the two
shells. A typical error message is

Warning:
copy(70afbabac176169545d01f4bd91f3055.gif): failed to open

stream:
No such file or directory in
/Users/lieven/Sites/wordpress/latexrender/class.latexrender.php on
line

269

[Unparseable or potentially dangerous latex
formula. Error 6 ]

As suggested by Steve Mayer there are
two roads to obtain more information on what goes wrong. The first is to
uncomment the _unlink commands _ at the end of the
_class.latexrender.php_ file and look in the _wordpress/latexrender/tmp_
directory for which conversions were done and which failed. The normal
latexrender-procedure is : tex->dvi->ps->gif. Probably you will
get all files but the gifs!

Another (and more useful) source of
informations is to look in the _error-log_ of the Apache-WebServer and
see whether you get things like

This is dvips(k) 5.94a
Copyright 2003 Radical Eye Software (www.radicaleye.com)
\\’
TeX output 2004.08.30:1433\\’ ->
0d48700a5dde6d746813733d26dd8df8.ps

. [1]
sh: line 1:
gs: command not found
convert: no decode delegate for this image
format

/Users/lieven/Sites/weblog/latexrender/tmp/
0d48700a5dde6d746813733d26dd8df8.ps\\’.

convert: missing an image
filename/Users/lieven/Sites/weblog/latexrender/tmp/
0d48700a5dde6d746813733d26dd8df8.gif\\’.

identify: unable to
open image 0d48700a5dde6d746813733d26dd8df8.gif\\': No such file
or directory.
identify: missing an image
filename
0d48700a5dde6d746813733d26dd8df8.gif\\’.

`

Here the essential point is that the webserver doesn’t
seem to be able to find GhostScript (even if you have several versions
installed).

To bypass these problems I did two essential
things : (1) in the _class.latexrender.php_ file I rewrote the
conversions so as to use _pdflatex_ instead of tex (to get
immediately a pdf-file rather than the tex->dvi->ps process) and then
use _convert_ to translate this pdf-file into a gif-file. (2) the
version of _convert_ and _include_ (both part of the
ImageMagick package) are those provided by Fink but you should be extremely
careful to install the imagemagick-nox package and not
the imagemagick package! After the command
sudo fink
install imagemagick-nox

you are presented with several
configuration choices. Do _not_ choose on auto-pilot the default
choices but look for options specifying that there is no X-support!
After this, everything should work. If you want to have a look at how
I changed the PHP files, mail
me
.

Leave a Comment

wp-latex’ sweet revenge : wp+MathJax-> ePub

In the early days of math-blogging, one was happy to get LaTeXRender working. Some years later, the majority of math-blogs were using the, more user-friendly, wp-latex plugin to turn LaTeX-code into png-images. Today, everyone uses MathJax which works with modern CSS and web fonts instead of equation images, so equations scale with surrounding text at all zoom levels.

However, MathJax has one downside : it doesn’t parse in ePub-readers. Peter Krautzberger wrote a post Epub and mathematics in which he suggested two methods to turn MathJax into ePub, but after dozens of experiments I still fail to reproduce these.

No doubt, someone will soon come up with a working alternative, but for the impatient here’s a quick but dirty method to turn your MathJax powered wordpress post into ePub :

the tools

  • download and install the ePub export plugin. It automatically creates an ePub file when a post or page is published or updated. The ePubs are stored in the uploads directory (to be found in the wp-contents directory).
  • download and install the wp-latex plugin. MathJax uses the normal \$ tex-delimeters whereas wp-latex requires \$latex, so this plugin doesn’t interfere with the default use of MathJax.
  • download the wp2latex python script. It converts a standard LaTeX file into a format that is ready to be copied into WordPress.

the routine

  • Edit the post you want to convert to ePub. Copy the contents of the post box to a file say post1.tex and save this in the same directory containing the latex2wp.py script.
  • In Terminal go to that directory and type the command ‘python latex2wp.py post1.tex’. It will produce a new file post1 in the same directory.
  • Copy the contents of post1 into the post box of your WordPress-post and press the update button. This time the TeX-commands in your post will be rendered using wp-latex and the ePub export-plugin will have created an ePub-version of it.
  • Locate this newly created ePub file in the relevant wp-contents/uploads/ folder (file has a number.epub name) and, if wanted, change its name into something easier to recognize and copy it somewhere outside the uploads directory. This will be your desired ePub-version of the post.
  • Replace the contents of the post box of your WordPress-post with the contents of the post1.tex file and hit the ‘Update’ button, to restore your original post (powered by MathJax).
  • Email your ePub-file to your iPad and open it with iBooks. Not quite as nice as MathJax-parsed TeX but a lot better than reading unparsed TeX-commands.
Leave a Comment

changes (ahead)

In view or recents events & comments, some changes have been made or will be made shortly :

categories : Sanitized the plethora of wordpress-categories to which posts belong. At the moment there are just 5 categories : ‘stories’ and ‘web’ (for all posts with low math-content) and three categories ‘level1’, ‘level2’ and ‘level3’, loosely indicating the math-difficulty of a post.

MathJax : After years of using LatexRender and WP-Latex, we’ll change to MathJax from now on. I’ll try to convert older posts as soon as possible. (Update : did a global search and replace. ‘Most’ LaTeX works, major exceptions being matrices and xymatrix commands. I’ll try to fix those later with LatexRender.)

theme : The next couple of days, the layout of this site may change randomly as I’ll be trying out things with the Swift wordpress theme. Hopefully, this will converge to a new design by next week.

name : Neverendingbooks will be renamed to something more math-related. Clearly, the new name will depend on the topics to be covered. On the main index page a pop-up poll will appear in the lower right-hand corner after 10 seconds. Please fill in the topics you’d like us to cover (no name or email required).

This poll will close on friday 21st at 12 CET and its outcome will influence name/direction of this blog. Use it also if you have a killer newname-suggestion. Among the responses so far, a funnier one : “An intro to, or motivation for non-commutative geometry, aimed at undergraduates. As a rule, I’d take what you think would be just right for undergrads, and then trim it down a little more.”

guest-posts : If you’d like to be a guest-blogger here at irregular times, please contact me. The first guest-post will be on noncommutative topology and the interpretation of quantum physics, and will appear soon. So, stay tuned…

2 Comments

Can't find what you're looking for? Try refining your search: