Skip to content →

Tag: Tiger

latexrender plugin for wordpress under tiger

Promises and pie-crusts are made to be broken, a wiser man once
said. Still, promises have a much longer life-span and sometimes their
real content becomes redundant over time.

A year ago, I
promised
to document how I got the
LaTeXRender Plugin for WordPress
working under OS X. The procedure
consisted of some trial-and-error operations, installing non-standard
versions of software and hardcoding certain directories throughout
certain files…

Not something I was looking forward
to when I decided to upgrade this WordPress blog but,
surprisingly, things went pretty smoothly this time (Mac-technology
has improved a lot). So, please don’t worry too much about this
post
and follow the (late) instructions below.

First
things first : I will assume you have the ‘generic’ LaTeX
running under Tiger (10.4),that is, use the i-Installer to download BOTH
LaTeX and Imagemagick! Further, in order to get WordPress up and
running, have the standard
MySQL 4.0 package
installed for 10.3 (not version
4.1…) and don’t use the generic Mac-PHP version, but
instead download Marc
Liyanage’s PHP5 package
which has plenty of additional
packages installed (notably, GDlib and MCRYPT which comes in handy if
you want to fight spam-comments using BotCheck).

\r
\n

Download wp-
latexrender.zip
and follow the instructions given to the letter
(there is one undocumented extra directory you have to fill in at the
start of the latexrender-plugin.php file). There is
just one additional thing to do. Find in the
class.latexrender.php file the line starting
with

// convert dvi file to postscript using
  dvips

and include the following lines just before it
:

// begin of workaround // extending the PATH
  environmental variable Soldpath =
  getenv(“PATH”); Swhere_imagemagick_is =
  “/usr/local/bin”; if (Soldpath) { Swhere_imagemagick_is .=
  “:Soldpath”;} putenv(“PATH=Swhere_imagemagick_is”); //
  end of workaround 

activate the plugin and it
should work! Still, there are three things you may want to change. In
the latex.php file uncomment the indicated lines as
you will be using htmlArea to input your posts. In addition, if you
have the MarkDown-plugin enabled, it is best to append additional
lines such as

 Slatex_formula =
  str_replace(“_”,”_”,Slatex_formula);     Slatex_formula
  =
  str_replace(“_”,”_”,Slatex_formula); 

(
between the first ” ” should be the beginning and end
em-tag respectively) or underscores will be interpreted as em-tags.
If you run into additional similar problems, the procedure is to
comment-out the line

 
  unlink(Sthis->_tmp_dir.”/”.Sthis->_tmp_filename.”.tex”); 
  

near the end of class.latexrender.php , look in the
tmp directory for the TeX-file, detect the problem and add similar
lines to the ones above to solve it. Another useful thing to do
is to add TeX-packages in the class.latexrender.php file. My own
version has the following predefined symbols and loaded
packages

 function wrap_formula(Slatex_formula) { 
  Sstring  =
  “\\documentclass[“.Sthis->_font_size.”pt]{“.Sthis->_latexclass
  .”}\\n”;  Sstring .=
  “\\usepackage[latin1]{inputenc}\\n”;  Sstring .=
  “\\usepackage{amsmath}\\n”;  Sstring .=
  “\\usepackage{amsfonts}\\n”;  Sstring .=
  “\\usepackage{amssymb}\\n”;  Sstring .=
  “\\usepackage{xy}\\n”;  Sstring .=
  “\\xyoption{all}\\n”;  Sstring .=
  “\\\\newcommand{\\vtx}[1]{*+[o][F-]{Scriptscriptstyle
  #1}}\\n”;  Sstring .= “\\\\newcommand{\\mathbb{C}c}{\\Bbbk}\\n”; 
  Sstring .= “\\\\newcommand{\\mathbb{C}}{\\mathbb{C}}\\n”;  Sstring .=
  “\\\\newcommand{\\mathbb{Q}}{\\mathbb{Q}}\\n”;  Sstring .=
  “\\\\newcommand{\\mathbb{Z}}{\\mathbb{Z}}\\n”;  Sstring .=
  “\\\\newcommand{\\mathbb{N}}{\\mathbb{N}}\\n”;  Sstring .=
  “\\\\newcommand{\\mathbf}[1]{{\\\\text{\\em \\usefont{OT1}{cmtt}{m}{n}
  #1}}}\\n”;  Sstring .= “\\pagestyle{empty}\\n”;  Sstring
  .= “\\begin{document}\\n”;  Sstring .=
  “S”.Slatex_formula.”S\\n”;  Sstring .=
  “\\end{document}\\n”;          return Sstring;     }  
  

which, among other things, allow all commenters to add
quiver-pictures using xymatrix and vtx to depict vertices. Oh yes, you
can allow comments to include LaTeX-code by uncommenting the
line

  // add_filter(‘comment_text’,
  ‘addlatex’); 

in the latexrender-plugin.php
file (but before you do make sure you have spam under control, such as
with BotCheck mentioned above). That’s all for now. If you want
to use TeX in a comment, make sure to put the code between tags [ tex
] and [ /tex ] (omitting the extra spaces). If you want me to add
other LaTeX-packages, leave a comment.

Leave a Comment

tiger tracks

I got
Tracks working under Tiger by trial and error starting with a suggestion
from Jan who found a fix here. From this I stumbled on for an hour or so on my iMac
untill near the very end I found that the tracks-page itself now
has a Tiger-section. So, let’s try to do it all over again from fresh on
my regular machine (a little iBook).

Start with
this page
and read it all the way to the comments. There is a
comment by Jamie on installing Rails and MySQL on a fresh Tiger which
looks like the thing I want followed immediately by another post by Jose
Marinez on
Installing Ruby on Rails on Tiger
which I decided to follow by the
letter (with one noticeable exception!). So first I downloaded the Rails
installer on Tiger
. Next, an install of the Standard version of
MySQL. I used version 4.0 for OS
X 10.3 !!!! NOT 4.1 !!!!
. I installed MySQL and the StartUpItem.
Next, I opened Terminal and typed the following commands

– cd
/usr/local/mysql
– sudo chown -R mysql data/
– sudo echo
– sudo ./bin/mysqld_safe &

and verified it by performing a
simple test

/usr/local/mysql/bin/mysql test

Next, I
secured everything by having a root-password

/usr/local/mysql/bin/mysqladmin -u root password
__*

Then I remembered that I’d better
not have to type the whole path so I did a

echo ‘export
PATH=/usr/local/mysql/bin:$PATH’ >> ~/.bash_profile

Also, I want
to admin MySQL via phpmyadmin so I
installed it. Then I enabled my webserver to use PHP using this post though I
did use vi rather than pico! Next, i did a check whether everything
worked fine by typing in safari

http://localhost/~lieven/phpmyadmin/index.php

Followed by
a

sudo gem install mysql –
–with-mysql-dir=/usr/local/mysql

Now, it is time to get the Tracks-package
and to follow these instructions And, it works! Here is the proof :

Leave a Comment

balm or poison

Don’t try
to follow the previous post unless you want to end up in a neverending
(sic!) series of re-installs, unrecognized harddisks at start-up and a
few kernel-panics!

At this moment I know of NO safe way to use Carbon Copy Cloner
to make a bootable clone of my HD. Here is the only way I managed to
make a bootable copy :

– before you start, click on the
target-partition of the external HD and use _File/Get Info_ and
uncheck under _Ownership & Permissions_ the box _Ignore
ownership on this volume_
– this might be enough for you but I
had to use DiskUtility to _Erase_ the externet HD-partition.
– then follow the previous post (that is do _sudo open_ on CCC
and then proceed as usual BUT make sure in your
prefernces only the box _Make Bootable_ is checked and certainly
no syncing-options!)

A bit too drastic for me. Its a bit like
: make a DMG of your MacintoshHD and do a restore on an empty external
partition. It seems that Tiger and Panther have very different
DNA-samples bringing a lot of excellent free- and shareware developers
near a nervous breakdown. Have the Apple-people ever heard of something
like _backwards compatibility_? Anyway, I’m not going to try
making another backup again until Mike Bombich has released a
Tiger-version of CCC!

Also, don’t try to follow the suggestions
of my Tracks
post
. It certainly is not enough to get tracks running under Tiger
(and probably also not under Panther as at the time I did a strange mix
of following this path and doing some manual installs using the Hivelogic
page
. This time, I got strange errors coming from the Ruby-MySQL
dialogue. I’m not going to try installing MySQL, PHP and Tracks before
someone like Marc
Lyanage
tells that it is safe to use the Panther-packages under
Tiger!

So, for the moment I’m just going to use my minimal
system (Tiger+Xcode Tools+TeX (following the instructions from this page
)+some excellent free and shareware like DevonThink , Pod2Go
, VoodooPad , SubEthaEdit ,
QuickSilver , Transmit and NetNewsWire ) until the
experts have tamed Tiger. Meanwhile, I’ll just confine myself to the
_Dashboard-Kintergarten_ !

Leave a Comment