summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/latexconfig/lualatexiniconfig.tex
blob: f61ca7f485f908cd7a983fd47dba4c38b1faa12a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
% $Id$
% Enable and prefix LuaTeX primitives for LaTeX-based formats
% Assumes LuaTeX 0.39.x or greater.
% Manuel Pégourié-Gonnard, 2009. Public domain.
\begingroup
\catcode`\{=1
\catcode`\}=2
\directlua{
  % etex and pdftex primitives are enabled without prefixing
  % as well as extented Unicode math primitives (see below)
  tex.enableprimitives('', 
    tex.extraprimitives('etex', 'pdftex', 'umath'))
  % other primitives are prefixed with luatex (see below)
  tex.enableprimitives('luatex', 
    tex.extraprimitives('core', 'omega', 'aleph', 'luatex'))
  }
\endgroup
\endinput

% Rationale for primitives prefixing.
%
% 1 All current macro packages run smoothly on top of pdf(e)TeX, so those
%   primitives are left untouched.
% 
% 2 Other non-TeX82 primitives in LuaTeX may cause name clashes with
%   existing macros in macro packages, especially when they use very
%   "natural" names such as \outputbox, \mathstyle etc. Such a
%   probability for name clashes is undesirable, since the most existing
%   LaTeX documents that run without change under LuaTeX, the better.
%   
% 3 The LuaTeX team doesn't want to apply a systematic prefixing policy,
%   but kindly provided a tool allowing prefixes to be applied. So we
%   chose to use it.  Previously, we even disabled the extra primitives,
%   but now we feel it's better to enable them with systematic
%   prefexing, in order to avoid that each and every macro package (or
%   user) enables them with various and inconsistent prefixes (including
%   the empty prefix).
%   
% 4 The 'luatex' prefix was chosen since it is already used as a prefix
%   for some primitives, such as \luatexversion: this way, those
%   promitive don't end up with a double prefix (see
%   tex.enableprimitives in the luatex manual for details).
%   
% 5 The \directlua primitive is provided both with its natural name
%   (allowing easy detection of LuaTeX-besed formats) and a prefixed
%    version \luatexdirectlua (for consistency with \luatexlatelua).
%   
% 6 All primitives dealing with Unicode math already begin with \U,
%   and maybe will match the names of XeTeX primitives some day, so
%   LuaTeX (starting from 0.75.0) allows listing them separately (the
%   special 'umath' keyword above), and they are now provided unprefixed.
%   But because they are also listed with the 'luatex' keyword, they are
%   duplicated with \luatex prefix, which allows for backword
%   compatability with previous version of the format.
%     
% 7 Various remarks:
% (a) The obvious drawback of such a prefixing policy is that the names
%     used by LaTeX or generic macro writer won't match the names used
%     in the manual.  We hope this is compensated by the gain in
%     backwards compatibility.
%     
% (b) The final name of some primitive may sound strange, namely those
%     already containing the name of an engine, such as
%     \luatexOmegaVersion.  However, since LuaTeX is not a drop-in
%     replacement for Omega/Aleph, we felt it wrong to provide
%     \OmegaVersion.
%     
% (c) Maybe some day we'll feel it's better to provide all
%     primitives without prefixing. If this happens, it
%     will be easy to add the unprefixed primitives in the format while
%     keeping the prefixed names for compatibility. It wouldn't work the
%     other way round; i.e., belaatedly realizing that we should not
%     provide the unprefixed primitives would then cause break
%     any LuaTeX-specific macro packages that had been written.
%
% --Manuel and Karl, September 2009.