Skip to content →

Tag: LaTeX

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

ASCII math

To
a large extent mathematics has to do with elaborate typography. Many
youngsters have been attracted over the centuries to maths because they
wanted to understand the meaning of these beautiful pages filled with
integrals, partial derivatives and other bizarre hieroglyphs. But now we
have come to the point that this obsession for symbols is working
against mathematics…
Have you ever wondered why there are so
few mathematics-pages on the net compared to computer-science pages
(apart from the fact that a lot more exiting things are happening in
web-technology these days than in mathematics), why forums dedicated to
math-problems never get off the ground (apart from boring housework
sites) or why it is so seldom that you discuss serious math with
colleagues or students via emails (apart from the fact that more and
more mathematicians seem to turn off their sharing mode) ???
One of the reasons might be that our default way of writing and
communicating math (LaTeX) is incompatible with either HTML or email
(and for those of you who think that LaTeX2HTML or
tth or similar programs offer an alternative, just
try to make an attractive looking website with them and prove me
wrong).
If we want mathematics to survive and flourish (and
whether you like it or not that may depend heavily on its
web-visibility) it is high time to develop some
ascii-math, that is, a way to write mathematical formulas in
plain typewriter symbols. This cannot be totally impossible as
programming languages are capable of defining a large number of
complicated objects with ascii and for those of you who discard the idea
on beauty-reasons, I never found a piece of code in a computer
book particularly ugly.
Of course I realise that not too many
people will be willing to make this paradigm-shift right now, but can we
at least ask of people introducing new symbols to add as an appendix to
their paper a suggestion for the transition to ascii-symbols for
those who value the net and/or sharing more than they do. Thank
you!

Leave a Comment

COLgo

COL is a map-coloring game invented by Colin Vout.
Two players Left (bLack) and Right (white) take turns in coloring the
map subject to the rule that no two neighboring regions may be colored
the same. The last player to be able to move wins the game. For my talk
on combinatorial game theory in two weeks, I choose for a simplified
version of COL, namely COLgo which is played with go-stoned on a
(partial) go-board. Each spot has 4 neighbors (North, East, South and
West). For example, the picture on the left is a legal COLgo-position on
a 5×5 board. COL is a simple game to illustrate some of the key features
of game theory. In sharp contrast to other games, one has a general
result on the possible values of a COL-position : each position has
value $z$ or $z+\\bigstar$ where $z$ is a (Conway)-number (that is, a
dyadic integer) and where $\\bigstar$ is the fuzzy game {0|0}. In
the talk I will give a proof of this result (there are not so many
results in combinatorial game theory one can prove from scratch in 50
minutes but this is one of them). Of course, to illustrate the result I
had to find positions which have counter-intuitive values such as 1/2.
The picture on the left is an example of such a position on a 5×5 board
but surely one must be able to find 1/2-positions on a 4×4 board
(perhaps even on a 3×3?). If you have an example, please tell me.

On a slightly different matter : I used the psgo.sty package in LaTeX to print the (partial)
go-boards and positions. If I ever write out the notes I’ll post them
here but they will be in Dutch.

Leave a Comment