Skip to content →

Category: web

Latexrender and dvonn boards

In order
to blog a bit about Dvonn-strategy, I made myself a simple Dvonn
LaTeX-template which works very well on paper but which gets mutilated
by Latexrender, for example the first situation of the looks
like

$~\xymatrix@=.3cm @!C @R=.7cm{ & & \Black{2} \connS & &
\bull{d}{5} \conn & & \bull{e}{5} \conn & & \bull{f}{5} \conn & &
\bull{g}{5} \conn & & \bull{h}{5} \conn & & \SWhite \connS & & \SWhite
\connS & & \SWhite \conneS & & \\ & \bull{b}{4} \conn & & \SBlack
\connS & & \Black{6} \connS & & \bull{e}{4} \conn& & \bull{f}{4} \conn &
& \bull{g}{4} \conn & & \bull{h}{4} \conn & & \SWhite \connS & &
\SWhite \connS & & \SWhite \conneS & \\ \SBlack \connbeginS & &
\SBlack \connS & & \BDvonn{7} \connS & & \bull{d}{3} \conn & & \SBlack
\connS & & \BDvonn{6} \connS & & \bull{g}{3} \conn & & \bull{h}{3}
\conn & & \Dvonn \connS & & \SWhite \connS & & \SWhite \connendS \\ &
\Black{5} \connbeginS & & \bull{b}{2} \conn & & \SBlack \connS & &
\bull{d}{2} \conn & & \bull{e}{2} \conn & & \bull{f}{2} \conn & &
\bull{g}{2} \conn & & \bull{h}{2} \conn & & \SWhite \connS & & \SWhite
\connendS & \\ & & \bull{a}{1} \con & & \bull{b}{1} \con & & \Black{5}
\conS & & \bull{d}{1} \con & & \bull{e}{1} \con & & \bull{f}{1} \con & &
\bull{g}{1} \con & & \bull{h}{1} \con & & \White{2} & &} $

The
reason behind this unwanted clipping is that Latexrender uses
**convert** to take the relevant part of a ps-page containing only the
TeXed formula on an empty page by performing clipping and then converts
it into a GIF-file (or any other format you desire). The obvious way
round this is to enlarge my template by adding two additional rows and
columns and putting visible nonsense there (such as dots) to enlarge the
relevant part so that no clipping is done of essential info. But then
(1) the picture generated becomes even larger than that above and (2) I
don’t want you to see the extra nonsensical dots… The essential line
in the **class.latexrender.php** file is

$command =
$this->_convert_path." -density ".$this->_formula_density.
" -trim -transparent \"#FFFFFF\" ".$this->_tmp_filename.".ps ".
$this->_tmp_filename.".".$this->_image_format;

So
I needed to delve into the [manual pages for the convert command](http://amath.colorado.edu/computing/software/man/convert.html)
of the ImageMagick-package. To my surprise, the *-trim* option (which I
thought to adjust somewhat by adding parameters) doesn’t exist! Still, I
got around my second problem using the *crop* option and around the
first by using the very useful *geometry* option. The latter is also
useful if you find that the size of the output of Latexrender is not
compatible with the size of your regular text. Of course you can amend
this somewhat by using the *extarticle* documentclass (as suggested) but
if you want to further adjust it, use for example

-geometry
86%

to size the output to exactly 86% (or whatever you need).
So, whenever I want to do some Dvonn-blogging from now on I’ll change my
class.latexrender.php file as follows

$command =
$this->_convert_path." -crop 0x0-10% -crop 0x0+10% -density
".$this->_formula_density. " -geometry 80%
-transparent \"#FFFFFF\" ".$this->_tmp_filename.".ps ".
$this->_tmp_filename.".".$this->_image_format;

which
produces the output

$\xymatrix@=.3cm @R=.7cm{.& & & & & & & & & &
& & & \\ & & & \Black{2} \connS & & \bull{d}{5} \conn & & \bull{e}{5}
\conn & & \bull{f}{5} \conn & & \bull{g}{5} \conn & & \bull{h}{5} \conn
& & \SWhite \connS & & \SWhite \connS & & \SWhite \conneS & & & \\ & &
\bull{b}{4} \conn & & \SBlack \connS & & \Black{6} \connS & &
\bull{e}{4} \conn& & \bull{f}{4} \conn & & \bull{g}{4} \conn & &
\bull{h}{4} \conn & & \SWhite \connS & & \SWhite \connS & & \SWhite
\conneS & & \\ & \SBlack \connbeginS & & \SBlack \connS & &
\BDvonn{7} \connS & & \bull{d}{3} \conn & & \SBlack \connS & &
\BDvonn{6} \connS & & \bull{g}{3} \conn & & \bull{h}{3} \conn & &
\Dvonn \connS & & \SWhite \connS & & \SWhite \connendS & . \\ & &
\Black{5} \connbeginS & & \bull{b}{2} \conn & & \SBlack \connS & &
\bull{d}{2} \conn & & \bull{e}{2} \conn & & \bull{f}{2} \conn & &
\bull{g}{2} \conn & & \bull{h}{2} \conn & & \SWhite \connS & & \SWhite
\connendS & & \\ & & & \bull{a}{1} \con & & \bull{b}{1} \con & &
\Black{5} \conS & & \bull{d}{1} \con & & \bull{e}{1} \con & &
\bull{f}{1} \con & & \bull{g}{1} \con & & \bull{h}{1} \con & & \White{2}
& & & \\ . & & & & & & & & & & & & & } $

which (I hope) you will
find slightly better…

Leave a Comment

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

lulu neverendingbooks



Half a year ago, it all started with NeverEndingBooks in which I set out a rather modest goal:

Why NeverEndingBooks? We all complain about exaggerated prices of mathematical books from
certain publishers, poor quality of editing and refereeing offered, as well as far too stringent book-contracts. Rather than lamenting about this, NeverEndingBooks gives itself one year to learn (and report) about the many aspects of the book-production cycle and to explore whether an alternative exists. If at the end of this year we will have produced at least one book this experiment will be considered a success. If,
however, we find out that it is an impossible task, we will explain where it all went wrong and why it is better to stick to an established PublishingHouse and accept its terms.

I assume we did manage to do it after all as you may check by visiting our storefront :
www.lulu.com/neverendingbooks
. However, it all turned out to be quite different from what I had in mind half a year ago. So, perhaps it’s time to recap.

Originally, I’d planned to partner-up with the publisher-on-demand LightningSource but in the process they did require a VAT-number. In Belgium, the safest way to get one is to set up a non-profit organization (a VZW as we call
it). But then you have to write down your legal statutes, get them published in the Moniteur Belge (at a hefty price) but what really put me off was that you have to set up a “board of directors” consisting of at least three
people. I don’t mind following a folly but if I have to involve others I usually pass, so I abandoned the whole idea.

Still, I couldn’t help talking about the VAT-problem and at a certain time there was an idea to revive a sleeping VZW (=non-profit organization) of the Belgian Mathematical Society, the MaRC (MAthematical Research Centre), the statutes of which allowed to become a publishing house. But, this wouldn’t involve just two other people but the whole BMS so I decided
to forget all about it and have a short vacation in France together with a few (former)PhD-students.



Given plenty of sun, cheese and whine (not necessarily in that order) sooner or later we had to talk about _the_ problem. For Raf it was the first time he heard about it but when we realized I thought one could easily publish books well under 25 dollars he was immediately interested and insisted we should set up a board of directors and continue with the plan.

The different roles to play in the board were more or less self-evident : I had to be the treasurer (given the fact that I was the only with a secure, though small, income), Geert had to become chairman (being the only one possessing suits), Raf would be secretary (being the only one who could write better Flemish than English) and Jan or Stijn would do PR (as they are the only ones having enough social skills).

So, we went back willing to go through the whole process (at least 3 months) of obtaining a VAT-number.

But then Raf got so interested in the whole idea that he explored other possibilities (I think he was more motivated by the fact that his sister wanted to publish her thesis rather than anything else) and came up with lulu.com.

No legal hassle, no VAT-numbers, nothing required (or so it seemed). Still, before risking his sister’s thesis he wanted to check the service out and as it is a lot easier to take a book lying around rather than write one yourself he took my version 2 and published it at Lulu’s (since then this version is nicknamed Rothko@n).

Although I gave him the permission to do so, it didn’t feel right that people should pay even a small amount for a nicely bound unedited version 2. So, the last month and a half I’ve been editing and partially rewriting version 2 and the two volumes are now available!

Major changes are to the 4 middle chapters. There is now chapter 3 “Etale Technology” which contains all of the etale tricks scattered earlier in two chapters, chapter 4 ‚”Quiver Representations” collects all the
quiver material (again, scattered throughout the previous version). Chapter 5 ‚”Semisimple Representations” now includes recent material such as Raf’s characterization of the smooth locus of Cayley-smooth orders and our (together with Geert) classification of the central singularities, and chapter 6 ‚”Nilpotent Representations” now includes the material on Brauer-Severi varities which was in version 1 but somehow didn’t make it to version 2 before.

Leave a Comment