| 1 |
% $Id: lualatexiniconfig.tex 28991 2013-01-30 20:46:39Z hosny $ |
| 2 |
% Enable and prefix LuaTeX primitives for LaTeX-based formats |
| 3 |
% Assumes LuaTeX 0.39.x or greater. |
| 4 |
% Manuel Pégourié-Gonnard, 2009. Public domain. |
| 5 |
\begingroup |
| 6 |
\catcode`\{=1 |
| 7 |
\catcode`\}=2 |
| 8 |
\directlua{ |
| 9 |
% etex and pdftex primitives are enabled without prefixing |
| 10 |
% as well as extented Unicode math primitives (see below) |
| 11 |
tex.enableprimitives('', |
| 12 |
tex.extraprimitives('etex', 'pdftex', 'umath')) |
| 13 |
% other primitives are prefixed with luatex (see below) |
| 14 |
tex.enableprimitives('luatex', |
| 15 |
tex.extraprimitives('core', 'omega', 'aleph', 'luatex')) |
| 16 |
} |
| 17 |
\endgroup |
| 18 |
\endinput |
| 19 |
|
| 20 |
% Rationale for primitives prefixing. |
| 21 |
% |
| 22 |
% 1 All current macro packages run smoothly on top of pdf(e)TeX, so those |
| 23 |
% primitives are left untouched. |
| 24 |
% |
| 25 |
% 2 Other non-TeX82 primitives in LuaTeX may cause name clashes with |
| 26 |
% existing macros in macro packages, especially when they use very |
| 27 |
% "natural" names such as \outputbox, \mathstyle etc. Such a |
| 28 |
% probability for name clashes is undesirable, since the most existing |
| 29 |
% LaTeX documents that run without change under LuaTeX, the better. |
| 30 |
% |
| 31 |
% 3 The LuaTeX team doesn't want to apply a systematic prefixing policy, |
| 32 |
% but kindly provided a tool allowing prefixes to be applied. So we |
| 33 |
% chose to use it. Previously, we even disabled the extra primitives, |
| 34 |
% but now we feel it's better to enable them with systematic |
| 35 |
% prefexing, in order to avoid that each and every macro package (or |
| 36 |
% user) enables them with various and inconsistent prefixes (including |
| 37 |
% the empty prefix). |
| 38 |
% |
| 39 |
% 4 The 'luatex' prefix was chosen since it is already used as a prefix |
| 40 |
% for some primitives, such as \luatexversion: this way, those |
| 41 |
% promitive don't end up with a double prefix (see |
| 42 |
% tex.enableprimitives in the luatex manual for details). |
| 43 |
% |
| 44 |
% 5 The \directlua primitive is provided both with its natural name |
| 45 |
% (allowing easy detection of LuaTeX-besed formats) and a prefixed |
| 46 |
% version \luatexdirectlua (for consistency with \luatexlatelua). |
| 47 |
% |
| 48 |
% 6 All primitives dealing with Unicode math already begin with \U, |
| 49 |
% and maybe will match the names of XeTeX primitives some day, so |
| 50 |
% LuaTeX (starting from 0.75.0) allows listing them separately (the |
| 51 |
% special 'umath' keyword above), and they are now provided unprefixed. |
| 52 |
% But because they are also listed with the 'luatex' keyword, they are |
| 53 |
% duplicated with \luatex prefix, which allows for backword |
| 54 |
% compatability with previous version of the format. |
| 55 |
% |
| 56 |
% 7 Various remarks: |
| 57 |
% (a) The obvious drawback of such a prefixing policy is that the names |
| 58 |
% used by LaTeX or generic macro writer won't match the names used |
| 59 |
% in the manual. We hope this is compensated by the gain in |
| 60 |
% backwards compatibility. |
| 61 |
% |
| 62 |
% (b) The final name of some primitive may sound strange, namely those |
| 63 |
% already containing the name of an engine, such as |
| 64 |
% \luatexOmegaVersion. However, since LuaTeX is not a drop-in |
| 65 |
% replacement for Omega/Aleph, we felt it wrong to provide |
| 66 |
% \OmegaVersion. |
| 67 |
% |
| 68 |
% (c) Maybe some day we'll feel it's better to provide all |
| 69 |
% primitives without prefixing. If this happens, it |
| 70 |
% will be easy to add the unprefixed primitives in the format while |
| 71 |
% keeping the prefixed names for compatibility. It wouldn't work the |
| 72 |
% other way round; i.e., belaatedly realizing that we should not |
| 73 |
% provide the unprefixed primitives would then cause break |
| 74 |
% any LuaTeX-specific macro packages that had been written. |
| 75 |
% |
| 76 |
% --Manuel and Karl, September 2009. |