-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathluametalatex.ini
167 lines (164 loc) · 4.88 KB
/
luametalatex.ini
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
% Based on lualatex.ini, originally written 2008 by Karl Berry. Public domain.
\input luametatexconfig.tex
\begingroup
\catcode`\{=1 %
\catcode`\}=2 %
% Set up job name quoting before latex.ltx
% Web2c pdfTeX/XeTeX quote job names containing spaces, but LuaTeX does
% not do this at the engine level. The behaviour can be changed using
% a callback. Originally this code was loaded via lualatexquotejobname.tex
% but that required a hack around latex.ltx: the behaviour has been altered
% to allow the callback route to be used directly.
\global\everyjob{\directlua{require("lualatexquotejobname.lua")}}
\global\chardef\eTeXversion=2
\global\def\eTeXrevision{.2}
\global\let\Ulmtxmathaccent\mathaccent
\global\expandafter\let\expandafter\mathaccent\directlua{
token.put_next(token.new(0, token.command_id'math_accent'))
}
\endgroup
\let\LMLTsaveddump\dump
\let\dump\relax
\let\tracingmarks\undefined
\input latex.ltx
\let\dump\LMLTsaveddump
%
\makeatletter
\def\DeclareFixedFont#1#2#3#4#5#6{%
\begingroup
\math@fontsfalse
\every@math@size{}%
\fontsize{#6}\z@
\usefont{#2}{#3}{#4}{#5}%
\global\lmltx@letfont#1\font
\endgroup
}%
\def\set@fontsize#1#2#3{%
\@defaultunits\@tempdimb#2pt\relax\@nnil
\edef\f@size{\strip@pt\@tempdimb}%
\@defaultunits\@tempdimc#3pt\relax\@nnil
\edef\f@baselineskip{\the\@tempdimc}%
\edef\f@linespread{#1}%
\let\baselinestretch\f@linespread
\def\size@update{%
\baselineskip\f@baselineskip\relax
\baselineskip\f@linespread\baselineskip
\normalbaselineskip\baselineskip
\setbox\strutbox\hbox{%
\vrule\@height.7\baselineskip
\@depth.3\baselineskip
\@width\z@}%
\let\size@update\relax}%
}
\AddToHook{package/scrbase/after}[luametalatex]{%
\def\scr@AfterEndGroupIfArgIsRelaxTillptNnil#1\@nnil{%
\endgroup
\Ifstr{\detokenize{#1}}{\detokenize{\p@}}{\@firstoftwo}{%
\Ifstrstart{\detokenize{#1}}{\detokenize{\relax}}{%
\scr@IfArgIsRelaxAfterRelaxTillptNnil #1\@nnil
}{\@secondoftwo}%
}%
}%
\def\scr@IfArgIsRelaxAfterRelaxTillptNnil\relax#1pt\@nnil{%
\Ifstr{\detokenize{#1}}{\detokenize{\p@}}{\@firstoftwo}{%
\Ifstrstart{\detokenize{#1}}{\detokenize{\relax}}{%
\scr@IfArgIsRelaxAfterRelaxTillptNnil #1\@nnil
}{\@secondoftwo}%
}%
}%
\def\scr@TestGlueAssignTillNil#1\@nil{%
\begingroup
\afterassignment\scr@AfterEndGroupIfArgIsRelaxTillptNnil
\@tempskipa=#1\p@\@nnil
}%
\def\scr@TestDimensionAssignTillNil#1\@nil{%
\begingroup
\afterassignment\scr@AfterEndGroupIfArgIsRelaxTillptNnil
\@tempdima=#1\p@\@nnil
}%
}%
\protected\def\lmltx@@patch@scr@@defaultunits{%
\def\scr@@@defaultunits##1##2##3minus##4minus##5\@nnil{%
\ifx\relax##2\relax
\@defaultunits\@tempskipa##3\p@\relax\@nnil
##1\@tempskipa
\else
\@defaultunits\@tempskipa\z@\@plus##3\p@\relax\@nnil
##1\@tempskipa
\@defaultunits\@tempskipa##2\p@\relax\@nnil
\advance##1\@tempskipa
\fi
\ifx\relax##4\relax\else
\@defaultunits\@tempskipa\z@\@minus ##4\p@\relax\@nnil
\advance##1\@tempskipa
\fi
}%
}%
\AddToHook{class/scrartcl/after}[luametalatex]{%
\lmltx@@patch@scr@@defaultunits
}%
\AddToHook{class/scrreprt/after}[luametalatex]{%
\lmltx@@patch@scr@@defaultunits
}%
\AddToHook{class/scrbook/after}[luametalatex]{%
\lmltx@@patch@scr@@defaultunits
}%
\AddToHook{class/scrlttr2/after}[luametalatex]{%
\lmltx@@patch@scr@@defaultunits
}%
\AddToHook{package/csquotes/after}[luametalatex]{%
\long\def\csq@quote@i#1#2#3{%
\csq@bqgroup
\lmltx@letfont\csq@font\font
% \expandafter\let\expandafter\csq@font\the\font
#1\csq@oqopen@i#3%
\expandafter\ifnum\fontid\font=\fontid\csq@font\else\expandafter\csq@font\fi
\csq@qclose@i{#2}%
}%
\long\edef\@frenchquotespace{\unexpanded\expandafter{\@frenchquotespace}\relax}%
}%
\AddToHook{package/microtype/after}[luametalatex]{%
\input{luametalatex-microtype.sty}%
}%
\AddToHook{package/animate/after}[luametalatex]{%
\def\@anim@@countxformlist#1:#2,#3\@nil{%
\ifx\relax#2\relax%
\the\numexpr#1%
\else%
\ifx\relax#3\relax%
\the\numexpr#1%
\else%
\expandafter\@anim@@countxformlist\the\numexpr #1+1\relax:#3\@nil%
\fi%
\fi%
}%
}%
\makeatother
%
\ExplSyntaxOn
\cs_set:Npn \__tl_analysis_extract_charcode_aux:w #1 \s_stop { \__tl_analysis_extract_charcode_aux_ii:w #1 \s_stop }
\exp_last_unbraced:NNf
\cs_set:Npn
\__tl_analysis_extract_charcode_aux_ii:w
{
\use:e {
#1 ~ \tl_to_str:n {U+} #2 ~ #3
}
\s_stop
}
{ " #2 }
\cs_set:Npn \__tl_analysis_extract_charcode: {
\exp_after:wN \__tl_analysis_extract_charcode_aux:w
\token_to_meaning:N \l__tl_analysis_token \s_stop
}
\ExplSyntaxOff
%
\everyjob \expandafter {%
\the\everyjob
\directlua {%
luatexbase.callbacktypes.kerning = 2
luatexbase.callbacktypes.ligaturing = 2
}%
}%
%
\dump