[pdftex] Ruby in TeX

Nagy Bence tipogral at freemail.hu
Fri Feb 13 18:14:24 CET 2004


Dear all,

I made a small and dirty pdfTeX expansion: a new primitive
named \calc, which allows to make calculations using Ruby
commands. Example:

\newdimen\testdimen
\calc\testdimen{sin(PI/180*45)}

Using of TeX-variables is possible too (without their units).

{\catcode`t=12\catcode`p=12\gdef\@STRIPPT#1pt{#1}}
\def\value{\expandafter\@STRIPPT\the#1}
\calc\testdimen{sin(PI/180*\value\angle)}

If you want to try it: install Ruby 1.8.x (the C-compiler
will search the Ruby header files in the
/usr/lib/ruby/1.8/i686-linux-gnu directory) then compile the
patched pdfTeX sources. And enjoy!

Greetings,

Bence


More information about the pdftex mailing list