TeX Live 2009: LuaLaTeX rolls on Debian (and the others)

January 23, 2010 by Daniel Stender · 2 comments · Printer friendly version
Filed under: TeX 

Previous posting on this issue here.

1. TeX Live 2009 at Debian unstable

Since my Debian Unstable/”Sid” jumped over to TeX Live 2009 a couple of days before (after being backward with 2007 as standard TeX distribution for a long time they skipped 2008 which is really pleasing, see also here) it’s now possible to run LuaLateX without a manual install – the relevant LaTeX format files have been included in Tex Live 2009 and the lualatex executable is now available on the console (LuaTeX version 0.50). The relevant macro packages (see http://tug.ctan.org/tex-archive/macros/luatex/, github collection) are made available most convenient through the new packet texlive-luatex (2009-7). Pretty soon the whole smack is going to be available also at mostly unstable branch Debian derivates like Ubuntu. TeX Live also runs on  other operating systems.

2. Hello world!

So now a rudimentary LuaLateX document like:

\documentclass{article}
\usepackage[utf8]{luainputenc}

\begin{document}
Hello world!
\end{document}

… runs. By the way, luainputenc (doc) calls luatextra (doc) which is also included in the texlive-luatex bundle.

3. Running Lua code from within the document

But Luatex is not only an alternative project which you could use to replace the other up-to-date Unicode capable/pdf creating LaTeX engine XeTeX (BTW see an introduction to XeTeX in German here), the advantage of LuaTeX is that the scripting language Lua is implemented into the engine which converts it to a kind of “eierlegende Wollmilchsau” one could say in German (for a collection of advantages of that approach see here). On the professional level that means that the rebuild engine could have been made much more faster in processing and versatile than everything which has been possible before (see Kastrup’s presentation at BachoTeX 2008) – on the user level it just means that it is possible to run Lua code while processing the document.  Lua code can be called from the macro package but also from within the document (a for somewhat comparable TeX project is Perltex). Let’s give it a try:

\documentclass{article}
\usepackage[utf8]{luainputenc}

\begin{document}
So it's time to say:
\begin{luacode}
tex.print("Hello world!")
\end{luacode}
\end{document}

Results in:

But more significant:

\documentclass{article}
\usepackage[utf8]{luainputenc}

\begin{document}
A random number:
\begin{luacode}
tex.print(math.random())
\end{luacode}
\end{document}

Results in:

4. Font selection

The one about font selection would be the next question. The availables packets are not quite mature but LuaTeX is under heavy development. The packet luaotfload (doc) is made for the purpose of font switching, the packet loads automatically with luainputenc resp. luatextra. The usage is the same as with the True/Opentype fontloader which is provided for the Plain/ConTeXt sister (see here). The basic usage would be something like:

\documentclass{article}
\usepackage[utf8]{luainputenc}
\font\myfont="FreeSans.ttf"

\begin{document}
\myfont Mahābhārata
\end{document}

The font file has to be in the working directory. An alternative is going to be the LuaTeX implementation of Fontspec, which is known from XeTeX (see here) and which employs a font file lookup. An experimental 2.0 version (.dtx and makefile) is provided by Khaled Hosny at his Github account. But I couldn’t get it to run so far.

Comments

2 responses to “TeX Live 2009: LuaLaTeX rolls on Debian (and the others)”
  1. Daniel Stender says:

    It seems that the packets already slided through to testing also, see: http://weblog.elzevir.fr/2010/01/encore-des-paquets-debian-et-ubuntu/

  2. Dominik Wujastyk says:

    https://launchpad.net/~aelmahmoudy/+archive/tl2009

    has been making TL-2009 available for quite a while through synaptic.

    Dominik

Speak your mind:

You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">