Difference between revisions of "LuaTeX"

From Wiki
Jump to navigation Jump to search
m (MTX_FONTS_AUTOLOAD (needs a better description and better place))
m (→‎Environmental variables: more notes without any head and tail)
Line 35: Line 35:
 
== Environmental variables ==
 
== Environmental variables ==
  
(move to some more appropriate place)
+
''(move to some more appropriate place)''
  
 
=== TEXMFCACHE ===
 
=== TEXMFCACHE ===
 +
 +
=== OSFONTDIR ===
 +
export OSFONTDIR=/Library/Fonts
  
 
=== reloading font database when fonts are not found ===
 
=== reloading font database when fonts are not found ===
Line 43: Line 46:
 
  MTX.FONTS.AUTOLOAD
 
  MTX.FONTS.AUTOLOAD
 
  MTX_FONTS_AUTOLOAD
 
  MTX_FONTS_AUTOLOAD
 +
 +
== Fonts ==
 +
Some useful commands:
 +
mtxrun --script fonts --reload
 +
mtxrun --script font --list --pattern=adobe

Revision as of 14:30, 15 April 2008

LuaTeX is an extended version of PdfTeX using Lua, as an embedded scripting language. The LuaTeX project's main objective is to provide an open and configurable variant of TeX while at the same time offering downward compatibility.

The project started in the summer of 2005, and has since progressed into a first official early beta that was released during the TUG2007 conference in San Diego. Development is supported by a grant from Colorado State University and the TeX User groups.

The official website offers some more information.

Links

Some tricks

Testing for UTF-8-aware TeX

(By Taco); this hint should be place to a better location on the wiki

For luatex, one may test if \luatexrevision is defined.

The next weird macro definition should work for testing xetex/luatex, because only xetex and luatex accept 5- and 6-byte caret notation (hex 22 == double quote):

\def\"{0}\expandafter\def\csname^^^^^00022\endcsname{1}
\ifnum\"=0 \message{tex82}\else\message{newstuff}\fi

But that is not quite the same as testing for native UTF-8. Better is a trick like this:

\def\test#1#2!{\def\secondarg{#2}}
\test χ!\relax % That's Chi, a 2-byte utf-8 sequence
\ifx\secondarg\empty \message{newstuff}\else \message{tex82}\fi

ConTeXt offers \beginNEWTEX ... \endNEWTEX to test if one is using LuaTeX or XeTeX.

Environmental variables

(move to some more appropriate place)

TEXMFCACHE

OSFONTDIR

export OSFONTDIR=/Library/Fonts

reloading font database when fonts are not found

If you want your font database to be reloaded whenever a non-existing font is asked for in LuaTeX, you need to set one of the variables:

MTX.FONTS.AUTOLOAD
MTX_FONTS_AUTOLOAD

Fonts

Some useful commands:

mtxrun --script fonts --reload
mtxrun --script font --list --pattern=adobe