3 % Copyright
2009-2010 Taco Hoekwater
<taco@@luatex.org
>
5 % This file is part of LuaTeX.
7 % LuaTeX is free software
; you can redistribute it and
/or modify it under
8 % the terms of the GNU General Public License as published by the Free
9 % Software Foundation
; either version
2 of the License
, or
(at your
10 % option
) any later version.
12 % LuaTeX is distributed in the hope that it will be useful
, but WITHOUT
13 % ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY or
14 % FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 % License for more details.
17 % You should have received a copy of the GNU General Public License along
18 % with LuaTeX
; if not
, see
<http
://www.gnu.org
/licenses
/>.
27 @ The symbolic names for glue parameters are put into \TeX's hash table
28 by using the routine called |primitive|
, defined below. Let us enter them
29 now
, so that we don't have to list all those parameter names anywhere else.
32 void initialize_commands
(void
)
35 primitive_tex
("lineskip", assign_glue_cmd
, glue_base
+ line_skip_code
, glue_base
);
36 primitive_tex
("baselineskip", assign_glue_cmd
, glue_base
+ baseline_skip_code
, glue_base
);
37 primitive_tex
("parskip", assign_glue_cmd
, glue_base
+ par_skip_code
, glue_base
);
38 primitive_tex
("abovedisplayskip", assign_glue_cmd
, glue_base
+ above_display_skip_code
, glue_base
);
39 primitive_tex
("belowdisplayskip", assign_glue_cmd
, glue_base
+ below_display_skip_code
, glue_base
);
40 primitive_tex
("abovedisplayshortskip", assign_glue_cmd
, glue_base
+ above_display_short_skip_code
, glue_base
);
41 primitive_tex
("belowdisplayshortskip", assign_glue_cmd
, glue_base
+ below_display_short_skip_code
, glue_base
);
42 primitive_tex
("leftskip", assign_glue_cmd
, glue_base
+ left_skip_code
, glue_base
);
43 primitive_tex
("rightskip", assign_glue_cmd
, glue_base
+ right_skip_code
, glue_base
);
44 primitive_tex
("topskip", assign_glue_cmd
, glue_base
+ top_skip_code
, glue_base
);
45 primitive_tex
("splittopskip", assign_glue_cmd
, glue_base
+ split_top_skip_code
, glue_base
);
46 primitive_tex
("tabskip", assign_glue_cmd
, glue_base
+ tab_skip_code
, glue_base
);
47 primitive_tex
("spaceskip", assign_glue_cmd
, glue_base
+ space_skip_code
, glue_base
);
48 primitive_tex
("xspaceskip", assign_glue_cmd
, glue_base
+ xspace_skip_code
, glue_base
);
49 primitive_tex
("parfillskip", assign_glue_cmd
, glue_base
+ par_fill_skip_code
, glue_base
);
50 primitive_tex
("thinmuskip", assign_mu_glue_cmd
, glue_base
+ thin_mu_skip_code
, glue_base
+ thin_mu_skip_code
);
51 primitive_tex
("medmuskip", assign_mu_glue_cmd
, glue_base
+ med_mu_skip_code
, glue_base
+ thin_mu_skip_code
);
52 primitive_tex
("thickmuskip", assign_mu_glue_cmd
, glue_base
+ thick_mu_skip_code
, glue_base
+ thin_mu_skip_code
);
53 primitive_luatex
("mathsurroundskip", assign_glue_cmd
, glue_base
+ math_skip_code
, glue_base
);
54 primitive_tex
("output", assign_toks_cmd
, output_routine_loc
, local_base
);
55 primitive_tex
("everypar", assign_toks_cmd
, every_par_loc
, local_base
);
56 primitive_tex
("everymath", assign_toks_cmd
, every_math_loc
, local_base
);
57 primitive_tex
("everydisplay", assign_toks_cmd
, every_display_loc
, local_base
);
58 primitive_tex
("everyhbox", assign_toks_cmd
, every_hbox_loc
, local_base
);
59 primitive_tex
("everyvbox", assign_toks_cmd
, every_vbox_loc
, local_base
);
60 primitive_tex
("everyjob", assign_toks_cmd
, every_job_loc
, local_base
);
61 primitive_tex
("everycr", assign_toks_cmd
, every_cr_loc
, local_base
);
62 primitive_tex
("errhelp", assign_toks_cmd
, err_help_loc
, local_base
);
64 /* The integer parameter names must be entered into the hash table
*/
66 primitive_tex
("pretolerance", assign_int_cmd
, int_base
+ pretolerance_code
, int_base
);
67 primitive_tex
("tolerance", assign_int_cmd
, int_base
+ tolerance_code
, int_base
);
68 primitive_tex
("linepenalty", assign_int_cmd
, int_base
+ line_penalty_code
, int_base
);
69 primitive_tex
("hyphenpenalty", assign_int_cmd
, int_base
+ hyphen_penalty_code
, int_base
);
70 primitive_tex
("exhyphenpenalty", assign_int_cmd
, int_base
+ ex_hyphen_penalty_code
, int_base
);
71 primitive_tex
("clubpenalty", assign_int_cmd
, int_base
+ club_penalty_code
, int_base
);
72 primitive_tex
("widowpenalty", assign_int_cmd
, int_base
+ widow_penalty_code
, int_base
);
73 primitive_tex
("displaywidowpenalty", assign_int_cmd
, int_base
+ display_widow_penalty_code
, int_base
);
74 primitive_tex
("brokenpenalty", assign_int_cmd
, int_base
+ broken_penalty_code
, int_base
);
75 primitive_tex
("binoppenalty", assign_int_cmd
, int_base
+ bin_op_penalty_code
, int_base
);
76 primitive_tex
("relpenalty", assign_int_cmd
, int_base
+ rel_penalty_code
, int_base
);
77 primitive_tex
("predisplaypenalty", assign_int_cmd
, int_base
+ pre_display_penalty_code
, int_base
);
78 primitive_tex
("postdisplaypenalty", assign_int_cmd
, int_base
+ post_display_penalty_code
, int_base
);
79 primitive_tex
("interlinepenalty", assign_int_cmd
, int_base
+ inter_line_penalty_code
, int_base
);
80 primitive_tex
("doublehyphendemerits", assign_int_cmd
, int_base
+ double_hyphen_demerits_code
, int_base
);
81 primitive_tex
("finalhyphendemerits", assign_int_cmd
, int_base
+ final_hyphen_demerits_code
, int_base
);
82 primitive_tex
("adjdemerits", assign_int_cmd
, int_base
+ adj_demerits_code
, int_base
);
83 primitive_tex
("mag", assign_int_cmd
, int_base
+ mag_code
, int_base
);
84 primitive_tex
("delimiterfactor", assign_int_cmd
, int_base
+ delimiter_factor_code
, int_base
);
85 primitive_tex
("looseness", assign_int_cmd
, int_base
+ looseness_code
, int_base
);
86 primitive_tex
("time", assign_int_cmd
, int_base
+ time_code
, int_base
);
87 primitive_tex
("day", assign_int_cmd
, int_base
+ day_code
, int_base
);
88 primitive_tex
("month", assign_int_cmd
, int_base
+ month_code
, int_base
);
89 primitive_tex
("year", assign_int_cmd
, int_base
+ year_code
, int_base
);
90 primitive_tex
("showboxbreadth", assign_int_cmd
, int_base
+ show_box_breadth_code
, int_base
);
91 primitive_tex
("showboxdepth", assign_int_cmd
, int_base
+ show_box_depth_code
, int_base
);
92 primitive_tex
("hbadness", assign_int_cmd
, int_base
+ hbadness_code
, int_base
);
93 primitive_tex
("vbadness", assign_int_cmd
, int_base
+ vbadness_code
, int_base
);
94 primitive_tex
("pausing", assign_int_cmd
, int_base
+ pausing_code
, int_base
);
95 primitive_tex
("tracingonline", assign_int_cmd
, int_base
+ tracing_online_code
, int_base
);
96 primitive_tex
("tracingmacros", assign_int_cmd
, int_base
+ tracing_macros_code
, int_base
);
97 primitive_tex
("tracingstats", assign_int_cmd
, int_base
+ tracing_stats_code
, int_base
);
98 primitive_tex
("tracingparagraphs", assign_int_cmd
, int_base
+ tracing_paragraphs_code
, int_base
);
99 primitive_tex
("tracingpages", assign_int_cmd
, int_base
+ tracing_pages_code
, int_base
);
100 primitive_tex
("tracingoutput", assign_int_cmd
, int_base
+ tracing_output_code
, int_base
);
101 primitive_tex
("tracinglostchars", assign_int_cmd
, int_base
+ tracing_lost_chars_code
, int_base
);
102 primitive_tex
("tracingcommands", assign_int_cmd
, int_base
+ tracing_commands_code
, int_base
);
103 primitive_tex
("tracingrestores", assign_int_cmd
, int_base
+ tracing_restores_code
, int_base
);
104 primitive_tex
("uchyph", assign_int_cmd
, int_base
+ uc_hyph_code
, int_base
);
105 primitive_tex
("outputpenalty", assign_int_cmd
, int_base
+ output_penalty_code
, int_base
);
106 primitive_tex
("maxdeadcycles", assign_int_cmd
, int_base
+ max_dead_cycles_code
, int_base
);
107 primitive_tex
("hangafter", assign_int_cmd
, int_base
+ hang_after_code
, int_base
);
108 primitive_tex
("floatingpenalty", assign_int_cmd
, int_base
+ floating_penalty_code
, int_base
);
109 primitive_tex
("globaldefs", assign_int_cmd
, int_base
+ global_defs_code
, int_base
);
110 primitive_tex
("fam", assign_int_cmd
, int_base
+ cur_fam_code
, int_base
);
111 primitive_tex
("escapechar", assign_int_cmd
, int_base
+ escape_char_code
, int_base
);
112 primitive_tex
("defaulthyphenchar", assign_int_cmd
, int_base
+ default_hyphen_char_code
, int_base
);
113 primitive_tex
("defaultskewchar", assign_int_cmd
, int_base
+ default_skew_char_code
, int_base
);
114 primitive_tex
("endlinechar", assign_int_cmd
, int_base
+ end_line_char_code
, int_base
);
115 primitive_tex
("newlinechar", assign_int_cmd
, int_base
+ new_line_char_code
, int_base
);
116 primitive_tex
("language", assign_int_cmd
, int_base
+ language_code
, int_base
);
117 primitive_tex
("setlanguage", assign_int_cmd
, int_base
+ cur_lang_code
, int_base
);
118 primitive_tex
("firstvalidlanguage", assign_int_cmd
, int_base
+ first_valid_language_code
, int_base
);
119 primitive_tex
("exhyphenchar", assign_int_cmd
, int_base
+ ex_hyphen_char_code
, int_base
);
120 primitive_tex
("lefthyphenmin", assign_int_cmd
, int_base
+ left_hyphen_min_code
, int_base
);
121 primitive_tex
("righthyphenmin", assign_int_cmd
, int_base
+ right_hyphen_min_code
, int_base
);
122 primitive_tex
("holdinginserts", assign_int_cmd
, int_base
+ holding_inserts_code
, int_base
);
123 primitive_tex
("errorcontextlines", assign_int_cmd
, int_base
+ error_context_lines_code
, int_base
);
124 primitive_luatex
("nokerns", assign_int_cmd
, int_base
+ disable_kern_code
, int_base
);
125 primitive_luatex
("noligs", assign_int_cmd
, int_base
+ disable_lig_code
, int_base
);
126 primitive_luatex
("nospaces", assign_int_cmd
, int_base
+ disable_space_code
, int_base
);
127 primitive_luatex
("catcodetable", assign_int_cmd
, int_base
+ cat_code_table_code
, int_base
);
128 primitive_luatex
("outputbox", assign_int_cmd
, int_base
+ output_box_code
, int_base
);
129 primitive_luatex
("outputmode", assign_int_cmd
, int_base
+ output_mode_code
, int_base
);
130 primitive_luatex
("adjustspacing", assign_int_cmd
, int_base
+ adjust_spacing_code
, int_base
);
131 primitive_luatex
("protrudechars", assign_int_cmd
, int_base
+ protrude_chars_code
, int_base
);
132 primitive_luatex
("tracingfonts", assign_int_cmd
, int_base
+ tracing_fonts_code
, int_base
);
133 primitive_luatex
("draftmode", assign_int_cmd
, int_base
+ draft_mode_code
, int_base
);
134 primitive_tex
("parindent", assign_dimen_cmd
, dimen_base
+ par_indent_code
, dimen_base
);
135 primitive_tex
("mathsurround", assign_dimen_cmd
, dimen_base
+ math_surround_code
, dimen_base
);
136 primitive_tex
("lineskiplimit", assign_dimen_cmd
, dimen_base
+ line_skip_limit_code
, dimen_base
);
137 primitive_tex
("hsize", assign_dimen_cmd
, dimen_base
+ hsize_code
, dimen_base
);
138 primitive_tex
("vsize", assign_dimen_cmd
, dimen_base
+ vsize_code
, dimen_base
);
139 primitive_tex
("maxdepth", assign_dimen_cmd
, dimen_base
+ max_depth_code
, dimen_base
);
140 primitive_tex
("splitmaxdepth", assign_dimen_cmd
, dimen_base
+ split_max_depth_code
, dimen_base
);
141 primitive_tex
("boxmaxdepth", assign_dimen_cmd
, dimen_base
+ box_max_depth_code
, dimen_base
);
142 primitive_tex
("hfuzz", assign_dimen_cmd
, dimen_base
+ hfuzz_code
, dimen_base
);
143 primitive_tex
("vfuzz", assign_dimen_cmd
, dimen_base
+ vfuzz_code
, dimen_base
);
144 primitive_tex
("delimitershortfall", assign_dimen_cmd
, dimen_base
+ delimiter_shortfall_code
, dimen_base
);
145 primitive_tex
("nulldelimiterspace", assign_dimen_cmd
, dimen_base
+ null_delimiter_space_code
, dimen_base
);
146 primitive_tex
("scriptspace", assign_dimen_cmd
, dimen_base
+ script_space_code
, dimen_base
);
147 primitive_tex
("predisplaysize", assign_dimen_cmd
, dimen_base
+ pre_display_size_code
, dimen_base
);
148 primitive_tex
("displaywidth", assign_dimen_cmd
, dimen_base
+ display_width_code
, dimen_base
);
149 primitive_tex
("displayindent", assign_dimen_cmd
, dimen_base
+ display_indent_code
, dimen_base
);
150 primitive_tex
("overfullrule", assign_dimen_cmd
, dimen_base
+ overfull_rule_code
, dimen_base
);
151 primitive_tex
("hangindent", assign_dimen_cmd
, dimen_base
+ hang_indent_code
, dimen_base
);
152 primitive_tex
("hoffset", assign_dimen_cmd
, dimen_base
+ h_offset_code
, dimen_base
);
153 primitive_tex
("voffset", assign_dimen_cmd
, dimen_base
+ v_offset_code
, dimen_base
);
154 primitive_tex
("emergencystretch", assign_dimen_cmd
, dimen_base
+ emergency_stretch_code
, dimen_base
);
155 primitive_luatex
("pagewidth", assign_dimen_cmd
, dimen_base
+ page_width_code
, dimen_base
);
156 primitive_luatex
("pageheight", assign_dimen_cmd
, dimen_base
+ page_height_code
, dimen_base
);
157 primitive_luatex
("pxdimen", assign_dimen_cmd
, dimen_base
+ px_dimen_code
, dimen_base
);
159 /* Many of \TeX's primitives need no |equiv|
, since they are identifiable
160 by their |eq_type| alone. These primitives are loaded into the hash table
163 primitive_tex
(" ", ex_space_cmd
, 0, 0);
164 primitive_tex
("/", ital_corr_cmd
, 0, 0);
165 primitive_tex
("accent", accent_cmd
, 0, 0);
166 primitive_tex
("advance", advance_cmd
, 0, 0);
167 primitive_tex
("afterassignment", after_assignment_cmd
, 0, 0);
168 primitive_tex
("aftergroup", after_group_cmd
, 0, 0);
169 primitive_tex
("begingroup", begin_group_cmd
, 0, 0);
170 primitive_tex
("char", char_num_cmd
, 0, 0);
171 primitive_tex
("csname", cs_name_cmd
, 0, 0);
172 primitive_luatex
("lastnamedcs", cs_name_cmd
, 1, 0);
173 primitive_luatex
("begincsname", cs_name_cmd
, 2, 0);
174 primitive_tex
("delimiter", delim_num_cmd
, 0, 0);
175 primitive_luatex
("Udelimiter", delim_num_cmd
, 1, 0);
176 primitive_tex
("divide", divide_cmd
, 0, 0);
177 primitive_tex
("endcsname", end_cs_name_cmd
, 0, 0);
178 primitive_tex
("endgroup", end_group_cmd
, 0, 0);
179 cs_text
(frozen_end_group
) = maketexstring
("endgroup");
180 eqtb
[frozen_end_group
] = eqtb
[cur_val
];
181 primitive_tex
("expandafter", expand_after_cmd
, 0, 0);
182 primitive_tex
("font", def_font_cmd
, 0, 0);
183 primitive_luatex
("letterspacefont", letterspace_font_cmd
, 0, 0);
184 primitive_luatex
("expandglyphsinfont", normal_cmd
, expand_font_code
, 0);
185 primitive_luatex
("copyfont", copy_font_cmd
, 0, 0);
186 primitive_luatex
("setfontid", set_font_id_cmd
, 0, 0);
187 primitive_tex
("fontdimen", assign_font_dimen_cmd
, 0, 0);
188 primitive_tex
("halign", halign_cmd
, 0, 0);
189 primitive_tex
("hrule", hrule_cmd
, 0, 0);
190 primitive_luatex
("nohrule", no_hrule_cmd
, 0, 0);
191 primitive_tex
("ignorespaces", ignore_spaces_cmd
, 0, 0);
192 primitive_tex
("insert", insert_cmd
, 0, 0);
193 primitive_luatex
("leftghost", char_ghost_cmd
, 0, 0);
194 primitive_tex
("mark", mark_cmd
, 0, 0);
195 primitive_tex
("mathaccent", math_accent_cmd
, 0, 0);
196 primitive_luatex
("Umathaccent", math_accent_cmd
, 1, 0);
197 primitive_tex
("mathchar", math_char_num_cmd
, 0, 0);
198 primitive_luatex
("Umathchar", math_char_num_cmd
, 1, 0);
199 primitive_luatex
("Umathcharnum", math_char_num_cmd
, 2, 0);
200 primitive_tex
("mathchoice", math_choice_cmd
, 0, 0);
201 primitive_luatex
("Ustack", math_choice_cmd
, 1, 0);
202 primitive_tex
("multiply", multiply_cmd
, 0, 0);
203 primitive_tex
("noalign", no_align_cmd
, 0, 0);
204 primitive_tex
("noboundary", boundary_cmd
, 0, 0);
205 primitive_tex
("boundary", boundary_cmd
, 1, 0);
206 primitive_tex
("protrusionboundary", boundary_cmd
, 2, 0);
207 primitive_tex
("wordboundary", boundary_cmd
, 3, 0);
208 primitive_tex
("noexpand", no_expand_cmd
, 0, 0);
209 primitive_luatex
("primitive", no_expand_cmd
, 1, 0);
210 primitive_tex
("nonscript", non_script_cmd
, 0, 0);
211 primitive_tex
("omit", omit_cmd
, 0, 0);
212 primitive_tex
("parshape", set_tex_shape_cmd
, par_shape_loc
, par_shape_loc
);
213 primitive_tex
("penalty", break_penalty_cmd
, 0, 0);
214 primitive_tex
("prevgraf", set_prev_graf_cmd
, 0, 0);
215 primitive_tex
("radical", radical_cmd
, 0, 0);
216 primitive_luatex
("Uradical", radical_cmd
, 1, 0);
217 primitive_luatex
("Uroot", radical_cmd
, 2, 0);
218 primitive_luatex
("Uunderdelimiter", radical_cmd
, 3, 0);
219 primitive_luatex
("Uoverdelimiter", radical_cmd
, 4, 0);
220 primitive_luatex
("Udelimiterunder", radical_cmd
, 5, 0);
221 primitive_luatex
("Udelimiterover", radical_cmd
, 6, 0);
222 primitive_luatex
("Uhextensible", radical_cmd
, 7, 0);
223 primitive_tex
("read", read_to_cs_cmd
, 0, 0);
224 primitive_tex
("relax", relax_cmd
, too_big_char
, too_big_char
);
225 cs_text
(frozen_relax
) = maketexstring
("relax");
226 eqtb
[frozen_relax
] = eqtb
[cur_val
];
227 primitive_luatex
("rightghost", char_ghost_cmd
, 1, 0);
228 primitive_tex
("setbox", set_box_cmd
, 0, 0);
229 primitive_tex
("the", the_cmd
, 0, 0);
230 primitive_luatex
("toksapp", combine_toks_cmd
, 0, 0);
231 primitive_luatex
("tokspre", combine_toks_cmd
, 1, 0);
232 primitive_luatex
("etoksapp", combine_toks_cmd
, 2, 0);
233 primitive_luatex
("etokspre", combine_toks_cmd
, 3, 0);
234 primitive_tex
("toks", toks_register_cmd
, 0, 0);
235 primitive_tex
("vadjust", vadjust_cmd
, 0, 0);
236 primitive_tex
("valign", valign_cmd
, 0, 0);
237 primitive_tex
("vcenter", vcenter_cmd
, 0, 0);
238 primitive_tex
("vrule", vrule_cmd
, 0, 0);
239 primitive_luatex
("novrule", no_vrule_cmd
, 0, 0);
240 primitive_tex
("par", par_end_cmd
, too_big_char
, too_big_char
); /* cf.\ |scan_file_name|
*/
242 par_token
= cs_token_flag
+ par_loc
;
243 @
<Create a bunch of primitives@
>;
244 @
<Create the math param primitives@
>;
245 @
<Create another bunch of primitives@
>;
249 @ These are in a separate module due to a CWEAVE limitation.
251 @
<Create a bunch of primitives@
>=
254 The processing of \.
{\\input
} involves the |start_input| subroutine
,
255 which will be declared later
; the processing of \.
{\\endinput
} is trivial.
258 primitive_tex
("input", input_cmd
, 0, 0);
259 primitive_tex
("endinput", input_cmd
, 1, 0);
260 primitive_tex
("topmark", top_bot_mark_cmd
, top_mark_code
, 0);
261 primitive_tex
("firstmark", top_bot_mark_cmd
, first_mark_code
, 0);
262 primitive_tex
("botmark", top_bot_mark_cmd
, bot_mark_code
, 0);
263 primitive_tex
("splitfirstmark", top_bot_mark_cmd
, split_first_mark_code
, 0);
264 primitive_tex
("splitbotmark", top_bot_mark_cmd
, split_bot_mark_code
, 0);
265 primitive_luatex
("clearmarks", mark_cmd
, clear_marks_code
, 0);
266 primitive_etex
("marks", mark_cmd
, marks_code
, 0);
267 primitive_etex
("topmarks", top_bot_mark_cmd
, top_mark_code
+ marks_code
, 0);
268 primitive_etex
("firstmarks", top_bot_mark_cmd
, first_mark_code
+ marks_code
, 0);
269 primitive_etex
("botmarks", top_bot_mark_cmd
, bot_mark_code
+ marks_code
, 0);
270 primitive_etex
("splitfirstmarks", top_bot_mark_cmd
, split_first_mark_code
+ marks_code
, 0);
271 primitive_etex
("splitbotmarks", top_bot_mark_cmd
, split_bot_mark_code
+ marks_code
, 0);
274 The hash table is initialized with `\.
{\\count
}'
, `\.
{\\attribute
}'
,
275 `\.
{\\dimen
}'
, `\.
{\\skip
}'
, and `\.
{\\muskip
}' all having |register|
276 as their command code
; they are distinguished by the |chr_code|
, which
277 is either |int_val|
, |attr_val|
, |dimen_val|
, |glue_val|
, or |mu_val|.
280 primitive_tex
("count", register_cmd
, int_val_level
, 0);
281 primitive_luatex
("attribute", register_cmd
, attr_val_level
, 0);
282 primitive_tex
("dimen", register_cmd
, dimen_val_level
, 0);
283 primitive_tex
("skip", register_cmd
, glue_val_level
, 0);
284 primitive_tex
("muskip", register_cmd
, mu_val_level
, 0);
286 primitive_tex
("spacefactor", set_aux_cmd
, hmode
, 0);
287 primitive_tex
("prevdepth", set_aux_cmd
, vmode
, 0);
288 primitive_tex
("deadcycles", set_page_int_cmd
, 0, 0);
289 primitive_tex
("insertpenalties", set_page_int_cmd
, 1, 0);
290 primitive_tex
("wd", set_box_dimen_cmd
, width_offset
, 0);
291 primitive_tex
("ht", set_box_dimen_cmd
, height_offset
, 0);
292 primitive_tex
("dp", set_box_dimen_cmd
, depth_offset
, 0);
293 primitive_tex
("lastpenalty", last_item_cmd
, lastpenalty_code
, 0);
294 primitive_tex
("lastkern", last_item_cmd
, lastkern_code
, 0);
295 primitive_tex
("lastskip", last_item_cmd
, lastskip_code
, 0);
296 primitive_tex
("inputlineno", last_item_cmd
, input_line_no_code
, 0);
297 primitive_tex
("badness", last_item_cmd
, badness_code
, 0);
298 primitive_luatex
("luatexversion", last_item_cmd
, luatex_version_code
, 0);
299 primitive_luatex
("lastsavedboxresourceindex", last_item_cmd
, last_saved_box_resource_index_code
, 0);
300 primitive_luatex
("lastsavedimageresourceindex", last_item_cmd
, last_saved_image_resource_index_code
, 0);
301 primitive_luatex
("lastsavedimageresourcepages", last_item_cmd
, last_saved_image_resource_pages_code
, 0);
302 primitive_luatex
("lastxpos", last_item_cmd
, last_x_pos_code
, 0);
303 primitive_luatex
("lastypos", last_item_cmd
, last_y_pos_code
, 0);
304 primitive_luatex
("randomseed", last_item_cmd
, random_seed_code
, 0);
306 primitive_tex
("number", convert_cmd
, number_code
, 0);
307 primitive_tex
("romannumeral", convert_cmd
, roman_numeral_code
, 0);
308 primitive_tex
("string", convert_cmd
, string_code
, 0);
309 primitive_tex
("csstring", convert_cmd
, cs_string_code
, 0);
310 primitive_tex
("meaning", convert_cmd
, meaning_code
, 0);
311 primitive_etex
("eTeXVersion", convert_cmd
, etex_code
, 0);
312 primitive_tex
("fontname", convert_cmd
, font_name_code
, 0);
313 primitive_luatex
("fontid", convert_cmd
, font_id_code
, 0);
314 primitive_luatex
("luatexrevision", convert_cmd
, luatex_revision_code
, 0);
315 primitive_luatex
("luatexdatestamp", convert_cmd
, luatex_date_code
, 0);
316 primitive_luatex
("luatexbanner", convert_cmd
, luatex_banner_code
, 0);
317 primitive_luatex
("leftmarginkern", convert_cmd
, left_margin_kern_code
, 0);
318 primitive_luatex
("rightmarginkern", convert_cmd
, right_margin_kern_code
, 0);
319 primitive_luatex
("uniformdeviate", convert_cmd
, uniform_deviate_code
, 0);
320 primitive_luatex
("normaldeviate", convert_cmd
, normal_deviate_code
, 0);
321 primitive_core
("directlua", convert_cmd
, lua_code
, 0);
322 primitive_luatex
("luafunction", convert_cmd
, lua_function_code
, 0);
323 primitive_luatex
("luaescapestring", convert_cmd
, lua_escape_string_code
, 0);
324 primitive_luatex
("mathstyle", convert_cmd
, math_style_code
, 0);
325 primitive_luatex
("expanded", convert_cmd
, expanded_code
, 0);
326 primitive_tex
("jobname", convert_cmd
, job_name_code
, 0);
327 primitive_luatex
("formatname", convert_cmd
, format_name_code
, 0);
328 primitive_luatex
("Uchar", convert_cmd
, uchar_code
, 0);
330 primitive_luatex
("Umathcharclass", convert_cmd
, math_char_class_code
, 0);
331 primitive_luatex
("Umathcharfam", convert_cmd
, math_char_fam_code
, 0);
332 primitive_luatex
("Umathcharslot", convert_cmd
, math_char_slot_code
, 0);
334 primitive_tex
("if", if_test_cmd
, if_char_code
, 0);
335 primitive_tex
("ifcat", if_test_cmd
, if_cat_code
, 0);
336 primitive_tex
("ifnum", if_test_cmd
, if_int_code
, 0);
337 primitive_tex
("ifdim", if_test_cmd
, if_dim_code
, 0);
338 primitive_tex
("ifodd", if_test_cmd
, if_odd_code
, 0);
339 primitive_tex
("ifvmode", if_test_cmd
, if_vmode_code
, 0);
340 primitive_tex
("ifhmode", if_test_cmd
, if_hmode_code
, 0);
341 primitive_tex
("ifmmode", if_test_cmd
, if_mmode_code
, 0);
342 primitive_tex
("ifinner", if_test_cmd
, if_inner_code
, 0);
343 primitive_tex
("ifvoid", if_test_cmd
, if_void_code
, 0);
345 primitive_tex
("ifhbox", if_test_cmd
, if_hbox_code
, 0);
346 primitive_tex
("ifvbox", if_test_cmd
, if_vbox_code
, 0);
347 primitive_tex
("ifx", if_test_cmd
, ifx_code
, 0);
348 primitive_tex
("ifeof", if_test_cmd
, if_eof_code
, 0);
349 primitive_tex
("iftrue", if_test_cmd
, if_true_code
, 0);
350 primitive_tex
("iffalse", if_test_cmd
, if_false_code
, 0);
351 primitive_tex
("ifcase", if_test_cmd
, if_case_code
, 0);
352 primitive_luatex
("ifprimitive", if_test_cmd
, if_primitive_code
, 0);
353 primitive_tex
("fi", fi_or_else_cmd
, fi_code
, 0);
354 cs_text
(frozen_fi
) = maketexstring
("fi");
355 eqtb
[frozen_fi
] = eqtb
[cur_val
];
356 primitive_tex
("or", fi_or_else_cmd
, or_code
, 0);
357 primitive_tex
("else", fi_or_else_cmd
, else_code
, 0);
360 \TeX\ always knows at least one font
, namely the null font. It has no
361 characters
, and its seven parameters are all equal to zero.
364 primitive_tex
("nullfont", set_font_cmd
, null_font
, 0);
365 cs_text
(frozen_null_font
) = maketexstring
("nullfont");
366 eqtb
[frozen_null_font
] = eqtb
[cur_val
];
368 primitive_tex
("span", tab_mark_cmd
, span_code
, tab_mark_cmd_code
);
369 primitive_luatex
("aligntab", tab_mark_cmd
, tab_mark_cmd_code
, tab_mark_cmd_code
);
370 primitive_luatex
("alignmark", mac_param_cmd
, tab_mark_cmd_code
, tab_mark_cmd_code
);
371 primitive_tex
("cr", car_ret_cmd
, cr_code
, cr_code
);
372 cs_text
(frozen_cr
) = maketexstring
("cr");
373 eqtb
[frozen_cr
] = eqtb
[cur_val
];
374 primitive_tex
("crcr", car_ret_cmd
, cr_cr_code
, cr_code
);
375 cs_text
(frozen_end_template
) = maketexstring
("endtemplate");
376 cs_text
(frozen_endv
) = maketexstring
("endtemplate");
377 set_eq_type
(frozen_endv
, endv_cmd
);
378 set_equiv
(frozen_endv
, null_list
);
379 set_eq_level
(frozen_endv
, level_one
);
380 eqtb
[frozen_end_template
] = eqtb
[frozen_endv
];
381 set_eq_type
(frozen_end_template
, end_template_cmd
);
383 primitive_tex
("pagegoal", set_page_dimen_cmd
, 0, 0);
384 primitive_tex
("pagetotal", set_page_dimen_cmd
, 1, 0);
385 primitive_tex
("pagestretch", set_page_dimen_cmd
, 2, 0);
386 primitive_tex
("pagefilstretch", set_page_dimen_cmd
, 3, 0);
387 primitive_tex
("pagefillstretch", set_page_dimen_cmd
, 4, 0);
388 primitive_tex
("pagefilllstretch", set_page_dimen_cmd
, 5, 0);
389 primitive_tex
("pageshrink", set_page_dimen_cmd
, 6, 0);
390 primitive_tex
("pagedepth", set_page_dimen_cmd
, 7, 0);
393 Either \.
{\\dump
} or \.
{\\end
} will cause |main_control| to enter the
394 endgame
, since both of them have `|stop|' as their command code.
397 primitive_tex
("end", stop_cmd
, 0, 0);
398 primitive_tex
("dump", stop_cmd
, 1, 0);
400 primitive_tex
("hskip", hskip_cmd
, skip_code
, 0);
401 primitive_tex
("hfil", hskip_cmd
, fil_code
, 0);
402 primitive_tex
("hfill", hskip_cmd
, fill_code
, 0);
403 primitive_tex
("hss", hskip_cmd
, ss_code
, 0);
404 primitive_tex
("hfilneg", hskip_cmd
, fil_neg_code
, 0);
405 primitive_tex
("vskip", vskip_cmd
, skip_code
, 0);
406 primitive_tex
("vfil", vskip_cmd
, fil_code
, 0);
407 primitive_tex
("vfill", vskip_cmd
, fill_code
, 0);
408 primitive_tex
("vss", vskip_cmd
, ss_code
, 0);
409 primitive_tex
("vfilneg", vskip_cmd
, fil_neg_code
, 0);
410 primitive_tex
("mskip", mskip_cmd
, mskip_code
, 0);
411 primitive_tex
("kern", kern_cmd
, explicit_kern
, 0);
412 primitive_tex
("mkern", mkern_cmd
, mu_glue
, 0);
413 primitive_tex
("moveleft", hmove_cmd
, 1, 0);
414 primitive_tex
("moveright", hmove_cmd
, 0, 0);
415 primitive_tex
("raise", vmove_cmd
, 1, 0);
416 primitive_tex
("lower", vmove_cmd
, 0, 0);
417 primitive_tex
("box", make_box_cmd
, box_code
, 0);
418 primitive_tex
("copy", make_box_cmd
, copy_code
, 0);
419 primitive_tex
("lastbox", make_box_cmd
, last_box_code
, 0);
420 primitive_tex
("vsplit", make_box_cmd
, vsplit_code
, 0);
421 primitive_tex
("tpack", make_box_cmd
, tpack_code
, 0);
422 primitive_tex
("vpack", make_box_cmd
, vpack_code
, 0);
423 primitive_tex
("hpack", make_box_cmd
, hpack_code
, 0);
424 primitive_tex
("vtop", make_box_cmd
, vtop_code
, 0);
425 primitive_tex
("vbox", make_box_cmd
, vtop_code
+ vmode
, 0);
426 primitive_tex
("hbox", make_box_cmd
, vtop_code
+ hmode
, 0);
427 primitive_tex
("shipout", leader_ship_cmd
, a_leaders
- 1, 0); /* |ship_out_flag
=leader_flag-1|
*/
428 primitive_tex
("leaders", leader_ship_cmd
, a_leaders
, 0);
429 primitive_tex
("cleaders", leader_ship_cmd
, c_leaders
, 0);
430 primitive_tex
("xleaders", leader_ship_cmd
, x_leaders
, 0);
431 primitive_luatex
("gleaders", leader_ship_cmd
, g_leaders
, 0);
432 primitive_luatex
("boxdir", assign_box_dir_cmd
, 0, 0);
433 primitive_tex
("indent", start_par_cmd
, 1, 0);
434 primitive_tex
("noindent", start_par_cmd
, 0, 0);
435 primitive_luatex
("quitvmode", start_par_cmd
, 2, 0);
436 primitive_tex
("unpenalty", remove_item_cmd
, penalty_node
, 0);
437 primitive_tex
("unkern", remove_item_cmd
, kern_node
, 0);
438 primitive_tex
("unskip", remove_item_cmd
, glue_node
, 0);
439 primitive_tex
("unhbox", un_hbox_cmd
, box_code
, 0);
440 primitive_tex
("unhcopy", un_hbox_cmd
, copy_code
, 0);
441 primitive_tex
("unvbox", un_vbox_cmd
, box_code
, 0);
442 primitive_tex
("unvcopy", un_vbox_cmd
, copy_code
, 0);
443 primitive_tex
("-", discretionary_cmd
, explicit_disc
, 0);
444 primitive_tex
("discretionary", discretionary_cmd
, discretionary_disc
, 0);
445 primitive_luatex
("localleftbox", assign_local_box_cmd
, 0, 0);
446 primitive_luatex
("localrightbox", assign_local_box_cmd
, 1, 0);
448 primitive_luatex
("Ustartmath", math_shift_cs_cmd
, text_style
, 0);
449 primitive_luatex
("Ustopmath", math_shift_cs_cmd
, cramped_text_style
, 0);
450 primitive_luatex
("Ustartdisplaymath", math_shift_cs_cmd
, display_style
, 0);
451 primitive_luatex
("Ustopdisplaymath", math_shift_cs_cmd
, cramped_display_style
, 0);
452 primitive_tex
("eqno", eq_no_cmd
, 0, 0);
453 primitive_tex
("leqno", eq_no_cmd
, 1, 0);
454 primitive_tex
("mathord", math_comp_cmd
, ord_noad_type
, 0);
455 primitive_tex
("mathop", math_comp_cmd
, op_noad_type_normal
, 0);
456 primitive_tex
("mathbin", math_comp_cmd
, bin_noad_type
, 0);
457 primitive_tex
("mathrel", math_comp_cmd
, rel_noad_type
, 0);
458 primitive_tex
("mathopen", math_comp_cmd
, open_noad_type
, 0);
459 primitive_tex
("mathclose", math_comp_cmd
, close_noad_type
, 0);
460 primitive_tex
("mathpunct", math_comp_cmd
, punct_noad_type
, 0);
461 primitive_tex
("mathinner", math_comp_cmd
, inner_noad_type
, 0);
462 primitive_tex
("underline", math_comp_cmd
, under_noad_type
, 0);
463 primitive_tex
("overline", math_comp_cmd
, over_noad_type
, 0);
464 primitive_tex
("displaylimits", limit_switch_cmd
, op_noad_type_normal
, 0);
465 primitive_tex
("limits", limit_switch_cmd
, op_noad_type_limits
, 0);
466 primitive_tex
("nolimits", limit_switch_cmd
, op_noad_type_no_limits
, 0);
467 primitive_tex
("displaystyle", math_style_cmd
, display_style
, 0);
468 primitive_tex
("textstyle", math_style_cmd
, text_style
, 0);
469 primitive_tex
("scriptstyle", math_style_cmd
, script_style
, 0);
470 primitive_tex
("scriptscriptstyle", math_style_cmd
, script_script_style
, 0);
471 primitive_luatex
("crampeddisplaystyle", math_style_cmd
, cramped_display_style
, 0);
472 primitive_luatex
("crampedtextstyle", math_style_cmd
, cramped_text_style
, 0);
473 primitive_luatex
("crampedscriptstyle", math_style_cmd
, cramped_script_style
, 0);
474 primitive_luatex
("crampedscriptscriptstyle", math_style_cmd
, cramped_script_script_style
, 0);
475 primitive_luatex
("Usuperscript", super_sub_script_cmd
, sup_mark_cmd
, sup_mark_cmd
);
476 primitive_luatex
("Usubscript", super_sub_script_cmd
, sub_mark_cmd
, sup_mark_cmd
);
477 primitive_tex
("above", above_cmd
, above_code
, 0);
478 primitive_tex
("over", above_cmd
, over_code
, 0);
479 primitive_tex
("atop", above_cmd
, atop_code
, 0);
480 primitive_luatex
("Uskewed", above_cmd
, skewed_code
, 0);
481 primitive_tex
("abovewithdelims", above_cmd
, delimited_code
+ above_code
, 0);
482 primitive_tex
("overwithdelims", above_cmd
, delimited_code
+ over_code
, 0);
483 primitive_tex
("atopwithdelims", above_cmd
, delimited_code
+ atop_code
, 0);
484 primitive_luatex
("Uskewedwithdelims", above_cmd
, delimited_code
+ skewed_code
, 0);
485 primitive_tex
("left", left_right_cmd
, left_noad_side
, 0);
486 primitive_tex
("right", left_right_cmd
, right_noad_side
, 0);
487 primitive_tex
("middle", left_right_cmd
, middle_noad_side
, 0);
488 primitive_tex
("Uleft", left_right_cmd
, 10+left_noad_side
, 0);
489 primitive_tex
("Uright", left_right_cmd
, 10+right_noad_side
, 0);
490 primitive_tex
("Umiddle", left_right_cmd
, 10+middle_noad_side
, 0);
491 primitive_luatex
("Uvextensible", left_right_cmd
, 10+no_noad_side
, 0);
492 cs_text
(frozen_right
) = maketexstring
("right");
493 eqtb
[frozen_right
] = eqtb
[cur_val
];
495 primitive_tex
("long", prefix_cmd
, 1, 0);
496 primitive_tex
("outer", prefix_cmd
, 2, 0);
497 primitive_tex
("global", prefix_cmd
, 4, 0);
498 primitive_tex
("def", def_cmd
, 0, 0);
499 primitive_tex
("gdef", def_cmd
, 1, 0);
500 primitive_tex
("edef", def_cmd
, 2, 0);
501 primitive_tex
("xdef", def_cmd
, 3, 0);
502 primitive_tex
("let", let_cmd
, normal
, 0);
503 primitive_tex
("futurelet", let_cmd
, normal
+ 1, 0);
504 primitive_luatex
("letcharcode", let_cmd
, normal
+ 2, 0);
505 primitive_tex
("chardef", shorthand_def_cmd
, char_def_code
, 0);
506 primitive_tex
("mathchardef", shorthand_def_cmd
, math_char_def_code
, 0);
507 primitive_luatex
("Umathchardef", shorthand_def_cmd
, xmath_char_def_code
, 0);
508 primitive_luatex
("Umathcharnumdef", shorthand_def_cmd
, umath_char_def_code
, 0);
509 primitive_tex
("countdef", shorthand_def_cmd
, count_def_code
, 0);
510 primitive_luatex
("attributedef", shorthand_def_cmd
, attribute_def_code
, 0);
511 primitive_tex
("dimendef", shorthand_def_cmd
, dimen_def_code
, 0);
512 primitive_tex
("skipdef", shorthand_def_cmd
, skip_def_code
, 0);
513 primitive_tex
("muskipdef", shorthand_def_cmd
, mu_skip_def_code
, 0);
514 primitive_tex
("toksdef", shorthand_def_cmd
, toks_def_code
, 0);
515 primitive_tex
("catcode", def_char_code_cmd
, cat_code_base
, cat_code_base
);
516 primitive_tex
("mathcode", def_char_code_cmd
, math_code_base
, cat_code_base
);
517 primitive_tex
("lccode", def_char_code_cmd
, lc_code_base
, cat_code_base
);
518 primitive_tex
("uccode", def_char_code_cmd
, uc_code_base
, cat_code_base
);
519 primitive_tex
("sfcode", def_char_code_cmd
, sf_code_base
, cat_code_base
);
520 primitive_tex
("delcode", def_del_code_cmd
, del_code_base
, del_code_base
);
521 primitive_tex
("textfont", def_family_cmd
, text_size
, 0);
522 primitive_tex
("scriptfont", def_family_cmd
, script_size
, 0);
523 primitive_tex
("scriptscriptfont", def_family_cmd
, script_script_size
, 0);
524 primitive_luatex
("Umathquad", set_math_param_cmd
, math_param_quad
, 0);
525 primitive_luatex
("Umathaxis", set_math_param_cmd
, math_param_axis
, 0);
527 @ These are in a separate module due to a CWEAVE limitation.
529 @
<Create the math param primitives@
>=
530 primitive_luatex
("Umathoperatorsize", set_math_param_cmd
, math_param_operator_size
, 0);
531 primitive_luatex
("Umathoverbarkern", set_math_param_cmd
, math_param_overbar_kern
, 0);
532 primitive_luatex
("Umathoverbarrule", set_math_param_cmd
, math_param_overbar_rule
, 0);
533 primitive_luatex
("Umathoverbarvgap", set_math_param_cmd
, math_param_overbar_vgap
, 0);
534 primitive_luatex
("Umathunderbarkern", set_math_param_cmd
, math_param_underbar_kern
, 0);
535 primitive_luatex
("Umathunderbarrule", set_math_param_cmd
, math_param_underbar_rule
, 0);
536 primitive_luatex
("Umathunderbarvgap", set_math_param_cmd
, math_param_underbar_vgap
, 0);
537 primitive_luatex
("Umathradicalkern", set_math_param_cmd
, math_param_radical_kern
, 0);
538 primitive_luatex
("Umathradicalrule", set_math_param_cmd
, math_param_radical_rule
, 0);
539 primitive_luatex
("Umathradicalvgap", set_math_param_cmd
, math_param_radical_vgap
, 0);
540 primitive_luatex
("Umathradicaldegreebefore", set_math_param_cmd
, math_param_radical_degree_before
, 0);
541 primitive_luatex
("Umathradicaldegreeafter", set_math_param_cmd
, math_param_radical_degree_after
, 0);
542 primitive_luatex
("Umathradicaldegreeraise", set_math_param_cmd
, math_param_radical_degree_raise
, 0);
543 primitive_luatex
("Umathstackvgap", set_math_param_cmd
, math_param_stack_vgap
, 0);
544 primitive_luatex
("Umathstacknumup", set_math_param_cmd
, math_param_stack_num_up
, 0);
545 primitive_luatex
("Umathstackdenomdown", set_math_param_cmd
, math_param_stack_denom_down
, 0);
546 primitive_luatex
("Umathfractionrule", set_math_param_cmd
, math_param_fraction_rule
, 0);
547 primitive_luatex
("Umathfractionnumvgap", set_math_param_cmd
, math_param_fraction_num_vgap
, 0);
548 primitive_luatex
("Umathfractionnumup", set_math_param_cmd
, math_param_fraction_num_up
, 0);
549 primitive_luatex
("Umathfractiondenomvgap", set_math_param_cmd
, math_param_fraction_denom_vgap
, 0);
550 primitive_luatex
("Umathfractiondenomdown", set_math_param_cmd
, math_param_fraction_denom_down
, 0);
551 primitive_luatex
("Umathfractiondelsize", set_math_param_cmd
, math_param_fraction_del_size
, 0);
552 primitive_luatex
("Umathskewedfractionvgap", set_math_param_cmd
, math_param_skewed_fraction_vgap
, 0);
553 primitive_luatex
("Umathskewedfractionhgap", set_math_param_cmd
, math_param_skewed_fraction_hgap
, 0);
554 primitive_luatex
("Umathlimitabovevgap", set_math_param_cmd
, math_param_limit_above_vgap
, 0);
555 primitive_luatex
("Umathlimitabovebgap", set_math_param_cmd
, math_param_limit_above_bgap
, 0);
556 primitive_luatex
("Umathlimitabovekern", set_math_param_cmd
, math_param_limit_above_kern
, 0);
557 primitive_luatex
("Umathlimitbelowvgap", set_math_param_cmd
, math_param_limit_below_vgap
, 0);
558 primitive_luatex
("Umathlimitbelowbgap", set_math_param_cmd
, math_param_limit_below_bgap
, 0);
559 primitive_luatex
("Umathlimitbelowkern", set_math_param_cmd
, math_param_limit_below_kern
, 0);
560 primitive_luatex
("Umathunderdelimitervgap", set_math_param_cmd
, math_param_under_delimiter_vgap
, 0);
561 primitive_luatex
("Umathunderdelimiterbgap", set_math_param_cmd
, math_param_under_delimiter_bgap
, 0);
562 primitive_luatex
("Umathoverdelimitervgap", set_math_param_cmd
, math_param_over_delimiter_vgap
, 0);
563 primitive_luatex
("Umathoverdelimiterbgap", set_math_param_cmd
, math_param_over_delimiter_bgap
, 0);
564 primitive_luatex
("Umathsubshiftdrop", set_math_param_cmd
, math_param_sub_shift_drop
, 0);
565 primitive_luatex
("Umathsupshiftdrop", set_math_param_cmd
, math_param_sup_shift_drop
, 0);
566 primitive_luatex
("Umathsubshiftdown", set_math_param_cmd
, math_param_sub_shift_down
, 0);
567 primitive_luatex
("Umathsubsupshiftdown", set_math_param_cmd
, math_param_sub_sup_shift_down
, 0);
568 primitive_luatex
("Umathsubtopmax", set_math_param_cmd
, math_param_sub_top_max
, 0);
569 primitive_luatex
("Umathsupshiftup", set_math_param_cmd
, math_param_sup_shift_up
, 0);
570 primitive_luatex
("Umathsupbottommin", set_math_param_cmd
, math_param_sup_bottom_min
, 0);
571 primitive_luatex
("Umathsupsubbottommax", set_math_param_cmd
, math_param_sup_sub_bottom_max
, 0);
572 primitive_luatex
("Umathsubsupvgap", set_math_param_cmd
, math_param_subsup_vgap
, 0);
573 primitive_luatex
("Umathspaceafterscript", set_math_param_cmd
, math_param_space_after_script
, 0);
574 primitive_luatex
("Umathconnectoroverlapmin", set_math_param_cmd
, math_param_connector_overlap_min
, 0);
575 primitive_luatex
("Umathordordspacing", set_math_param_cmd
, math_param_ord_ord_spacing
, 0);
576 primitive_luatex
("Umathordopspacing", set_math_param_cmd
, math_param_ord_op_spacing
, 0);
577 primitive_luatex
("Umathordbinspacing", set_math_param_cmd
, math_param_ord_bin_spacing
, 0);
578 primitive_luatex
("Umathordrelspacing", set_math_param_cmd
, math_param_ord_rel_spacing
, 0);
579 primitive_luatex
("Umathordopenspacing", set_math_param_cmd
, math_param_ord_open_spacing
, 0);
580 primitive_luatex
("Umathordclosespacing", set_math_param_cmd
, math_param_ord_close_spacing
, 0);
581 primitive_luatex
("Umathordpunctspacing", set_math_param_cmd
, math_param_ord_punct_spacing
, 0);
582 primitive_luatex
("Umathordinnerspacing", set_math_param_cmd
, math_param_ord_inner_spacing
, 0);
583 primitive_luatex
("Umathopordspacing", set_math_param_cmd
, math_param_op_ord_spacing
, 0);
584 primitive_luatex
("Umathopopspacing", set_math_param_cmd
, math_param_op_op_spacing
, 0);
585 primitive_luatex
("Umathopbinspacing", set_math_param_cmd
, math_param_op_bin_spacing
, 0);
586 primitive_luatex
("Umathoprelspacing", set_math_param_cmd
, math_param_op_rel_spacing
, 0);
587 primitive_luatex
("Umathopopenspacing", set_math_param_cmd
, math_param_op_open_spacing
, 0);
588 primitive_luatex
("Umathopclosespacing", set_math_param_cmd
, math_param_op_close_spacing
, 0);
589 primitive_luatex
("Umathoppunctspacing", set_math_param_cmd
, math_param_op_punct_spacing
, 0);
590 primitive_luatex
("Umathopinnerspacing", set_math_param_cmd
, math_param_op_inner_spacing
, 0);
591 primitive_luatex
("Umathbinordspacing", set_math_param_cmd
, math_param_bin_ord_spacing
, 0);
592 primitive_luatex
("Umathbinopspacing", set_math_param_cmd
, math_param_bin_op_spacing
, 0);
593 primitive_luatex
("Umathbinbinspacing", set_math_param_cmd
, math_param_bin_bin_spacing
, 0);
594 primitive_luatex
("Umathbinrelspacing", set_math_param_cmd
, math_param_bin_rel_spacing
, 0);
595 primitive_luatex
("Umathbinopenspacing", set_math_param_cmd
, math_param_bin_open_spacing
, 0);
596 primitive_luatex
("Umathbinclosespacing", set_math_param_cmd
, math_param_bin_close_spacing
, 0);
597 primitive_luatex
("Umathbinpunctspacing", set_math_param_cmd
, math_param_bin_punct_spacing
, 0);
598 primitive_luatex
("Umathbininnerspacing", set_math_param_cmd
, math_param_bin_inner_spacing
, 0);
599 primitive_luatex
("Umathrelordspacing", set_math_param_cmd
, math_param_rel_ord_spacing
, 0);
600 primitive_luatex
("Umathrelopspacing", set_math_param_cmd
, math_param_rel_op_spacing
, 0);
601 primitive_luatex
("Umathrelbinspacing", set_math_param_cmd
, math_param_rel_bin_spacing
, 0);
602 primitive_luatex
("Umathrelrelspacing", set_math_param_cmd
, math_param_rel_rel_spacing
, 0);
603 primitive_luatex
("Umathrelopenspacing", set_math_param_cmd
, math_param_rel_open_spacing
, 0);
604 primitive_luatex
("Umathrelclosespacing", set_math_param_cmd
, math_param_rel_close_spacing
, 0);
605 primitive_luatex
("Umathrelpunctspacing", set_math_param_cmd
, math_param_rel_punct_spacing
, 0);
606 primitive_luatex
("Umathrelinnerspacing", set_math_param_cmd
, math_param_rel_inner_spacing
, 0);
607 primitive_luatex
("Umathopenordspacing", set_math_param_cmd
, math_param_open_ord_spacing
, 0);
608 primitive_luatex
("Umathopenopspacing", set_math_param_cmd
, math_param_open_op_spacing
, 0);
609 primitive_luatex
("Umathopenbinspacing", set_math_param_cmd
, math_param_open_bin_spacing
, 0);
610 primitive_luatex
("Umathopenrelspacing", set_math_param_cmd
, math_param_open_rel_spacing
, 0);
611 primitive_luatex
("Umathopenopenspacing", set_math_param_cmd
, math_param_open_open_spacing
, 0);
612 primitive_luatex
("Umathopenclosespacing", set_math_param_cmd
, math_param_open_close_spacing
, 0);
613 primitive_luatex
("Umathopenpunctspacing", set_math_param_cmd
, math_param_open_punct_spacing
, 0);
614 primitive_luatex
("Umathopeninnerspacing", set_math_param_cmd
, math_param_open_inner_spacing
, 0);
615 primitive_luatex
("Umathcloseordspacing", set_math_param_cmd
, math_param_close_ord_spacing
, 0);
616 primitive_luatex
("Umathcloseopspacing", set_math_param_cmd
, math_param_close_op_spacing
, 0);
617 primitive_luatex
("Umathclosebinspacing", set_math_param_cmd
, math_param_close_bin_spacing
, 0);
618 primitive_luatex
("Umathcloserelspacing", set_math_param_cmd
, math_param_close_rel_spacing
, 0);
619 primitive_luatex
("Umathcloseopenspacing", set_math_param_cmd
, math_param_close_open_spacing
, 0);
620 primitive_luatex
("Umathcloseclosespacing", set_math_param_cmd
, math_param_close_close_spacing
, 0);
621 primitive_luatex
("Umathclosepunctspacing", set_math_param_cmd
, math_param_close_punct_spacing
, 0);
622 primitive_luatex
("Umathcloseinnerspacing", set_math_param_cmd
, math_param_close_inner_spacing
, 0);
623 primitive_luatex
("Umathpunctordspacing", set_math_param_cmd
, math_param_punct_ord_spacing
, 0);
624 primitive_luatex
("Umathpunctopspacing", set_math_param_cmd
, math_param_punct_op_spacing
, 0);
625 primitive_luatex
("Umathpunctbinspacing", set_math_param_cmd
, math_param_punct_bin_spacing
, 0);
626 primitive_luatex
("Umathpunctrelspacing", set_math_param_cmd
, math_param_punct_rel_spacing
, 0);
627 primitive_luatex
("Umathpunctopenspacing", set_math_param_cmd
, math_param_punct_open_spacing
, 0);
628 primitive_luatex
("Umathpunctclosespacing", set_math_param_cmd
, math_param_punct_close_spacing
, 0);
629 primitive_luatex
("Umathpunctpunctspacing", set_math_param_cmd
, math_param_punct_punct_spacing
, 0);
630 primitive_luatex
("Umathpunctinnerspacing", set_math_param_cmd
, math_param_punct_inner_spacing
, 0);
631 primitive_luatex
("Umathinnerordspacing", set_math_param_cmd
, math_param_inner_ord_spacing
, 0);
632 primitive_luatex
("Umathinneropspacing", set_math_param_cmd
, math_param_inner_op_spacing
, 0);
633 primitive_luatex
("Umathinnerbinspacing", set_math_param_cmd
, math_param_inner_bin_spacing
, 0);
634 primitive_luatex
("Umathinnerrelspacing", set_math_param_cmd
, math_param_inner_rel_spacing
, 0);
635 primitive_luatex
("Umathinneropenspacing", set_math_param_cmd
, math_param_inner_open_spacing
, 0);
636 primitive_luatex
("Umathinnerclosespacing", set_math_param_cmd
, math_param_inner_close_spacing
, 0);
637 primitive_luatex
("Umathinnerpunctspacing", set_math_param_cmd
, math_param_inner_punct_spacing
, 0);
638 primitive_luatex
("Umathinnerinnerspacing", set_math_param_cmd
, math_param_inner_inner_spacing
, 0);
640 @ These are in a separate module due to a CWEAVE limitation.
642 @
<Create another bunch of primitives@
>=
643 primitive_luatex
("Umathcode", extdef_math_code_cmd
, math_code_base
, math_code_base
);
644 primitive_luatex
("Udelcode", extdef_del_code_cmd
, del_code_base
, del_code_base
);
645 primitive_luatex
("Umathcodenum", extdef_math_code_cmd
, math_code_base
+ 1, math_code_base
);
646 primitive_luatex
("Udelcodenum", extdef_del_code_cmd
, del_code_base
+ 1, del_code_base
);
647 primitive_tex
("hyphenation", hyph_data_cmd
, 0, 0);
648 primitive_tex
("patterns", hyph_data_cmd
, 1, 0);
649 primitive_luatex
("prehyphenchar", hyph_data_cmd
, 2, 0);
650 primitive_luatex
("posthyphenchar", hyph_data_cmd
, 3, 0);
651 primitive_luatex
("preexhyphenchar", hyph_data_cmd
, 4, 0);
652 primitive_luatex
("postexhyphenchar", hyph_data_cmd
, 5, 0);
653 primitive_luatex
("hyphenationmin", hyph_data_cmd
, 6, 0);
654 primitive_luatex
("hjcode", hyph_data_cmd
, 7, 0);
655 primitive_tex
("hyphenchar", assign_font_int_cmd
, 0, 0);
656 primitive_tex
("skewchar", assign_font_int_cmd
, 1, 0);
657 primitive_luatex
("lpcode", assign_font_int_cmd
, lp_code_base
, 0);
658 primitive_luatex
("rpcode", assign_font_int_cmd
, rp_code_base
, 0);
659 primitive_luatex
("efcode", assign_font_int_cmd
, ef_code_base
, 0);
660 primitive_luatex
("tagcode", assign_font_int_cmd
, tag_code
, 0);
661 primitive_luatex
("ignoreligaturesinfont", assign_font_int_cmd
, no_lig_code
, 0);
662 primitive_tex
("batchmode", set_interaction_cmd
, batch_mode
, 0);
663 primitive_tex
("nonstopmode", set_interaction_cmd
, nonstop_mode
, 0);
664 primitive_tex
("scrollmode", set_interaction_cmd
, scroll_mode
, 0);
665 primitive_tex
("errorstopmode", set_interaction_cmd
, error_stop_mode
, 0);
666 primitive_tex
("openin", in_stream_cmd
, 1, 0);
667 primitive_tex
("closein", in_stream_cmd
, 0, 0);
668 primitive_tex
("message", message_cmd
, 0, 0);
669 primitive_tex
("errmessage", message_cmd
, 1, 0);
670 primitive_tex
("lowercase", case_shift_cmd
, lc_code_base
, lc_code_base
);
671 primitive_tex
("uppercase", case_shift_cmd
, uc_code_base
, lc_code_base
);
672 primitive_tex
("show", xray_cmd
, show_code
, 0);
673 primitive_tex
("showbox", xray_cmd
, show_box_code
, 0);
674 primitive_tex
("showthe", xray_cmd
, show_the_code
, 0);
675 primitive_tex
("showlists", xray_cmd
, show_lists
, 0);
677 primitive_tex
("openout", extension_cmd
, open_code
, 0);
678 primitive_tex
("write", extension_cmd
, write_code
, 0);
680 primitive_tex
("closeout", extension_cmd
, close_code
, 0);
681 primitive_tex
("special", extension_cmd
, special_code
, 0);
682 cs_text
(frozen_special
) = maketexstring
("special");
683 eqtb
[frozen_special
] = eqtb
[cur_val
];
684 primitive_tex
("immediate", extension_cmd
, immediate_code
, 0);
685 primitive_luatex
("localinterlinepenalty", assign_int_cmd
, int_base
+ local_inter_line_penalty_code
, int_base
);
686 primitive_luatex
("localbrokenpenalty", assign_int_cmd
, int_base
+ local_broken_penalty_code
, int_base
);
687 primitive_luatex
("pagedir", assign_dir_cmd
, int_base
+ page_direction_code
, dir_base
);
688 primitive_luatex
("bodydir", assign_dir_cmd
, int_base
+ body_direction_code
, dir_base
);
689 primitive_luatex
("pardir", assign_dir_cmd
, int_base
+ par_direction_code
, dir_base
);
690 primitive_luatex
("textdir", assign_dir_cmd
, int_base
+ text_direction_code
, dir_base
);
691 primitive_luatex
("mathdir", assign_dir_cmd
, int_base
+ math_direction_code
, dir_base
);
692 primitive_luatex
("pageleftoffset", assign_dimen_cmd
, dimen_base
+ page_left_offset_code
, dimen_base
);
693 primitive_luatex
("pagetopoffset", assign_dimen_cmd
, dimen_base
+ page_top_offset_code
, dimen_base
);
694 primitive_luatex
("pagerightoffset", assign_dimen_cmd
, dimen_base
+ page_right_offset_code
, dimen_base
);
695 primitive_luatex
("pagebottomoffset", assign_dimen_cmd
, dimen_base
+ page_bottom_offset_code
, dimen_base
);
696 primitive_luatex
("saveboxresource", extension_cmd
, save_box_resource_code
, 0);
697 primitive_luatex
("useboxresource", extension_cmd
, use_box_resource_code
, 0);
698 primitive_luatex
("saveimageresource", extension_cmd
, save_image_resource_code
, 0);
699 primitive_luatex
("useimageresource", extension_cmd
, use_image_resource_code
, 0);
700 primitive_luatex
("savepos", normal_cmd
, save_pos_code
, 0);
701 primitive_luatex
("savecatcodetable", normal_cmd
, save_cat_code_table_code
, 0);
702 primitive_luatex
("initcatcodetable", normal_cmd
, init_cat_code_table_code
, 0);
703 primitive_luatex
("setrandomseed", normal_cmd
, set_random_seed_code
, 0);
704 primitive_luatex
("latelua", normal_cmd
, late_lua_code
, 0);
705 primitive_luatex
("insertht", convert_cmd
, insert_ht_code
, 0);
706 primitive_luatex
("dviextension", extension_cmd
, dvi_extension_code
, 0);
707 primitive_luatex
("dvifeedback", feedback_cmd
, dvi_feedback_code
, 0);
708 primitive_luatex
("dvivariable", variable_cmd
, dvi_variable_code
, 0);
709 primitive_luatex
("pdfextension", extension_cmd
, pdf_extension_code
, 0);
710 primitive_luatex
("pdffeedback", feedback_cmd
, pdf_feedback_code
, 0);
711 primitive_luatex
("pdfvariable", variable_cmd
, pdf_variable_code
, 0);
712 primitive_luatex
("mathoption", option_cmd
, math_option_code
, 0);
715 some of the internal integer parameters are not associated with actual
719 primitive_no
("nolocalwhatsits", assign_int_cmd
, int_base
+ no_local_whatsits_code
, int_base
);
720 primitive_no
("nolocaldirs", assign_int_cmd
, int_base
+ no_local_dirs_code
, int_base
);
724 void initialize_etex_commands
(void
)
726 primitive_etex
("lastnodetype", last_item_cmd
, last_node_type_code
, 0);
727 primitive_etex
("eTeXversion", last_item_cmd
, eTeX_version_code
, 0);
728 primitive_etex
("eTeXminorversion", last_item_cmd
, eTeX_minor_version_code
, 0);
729 primitive_etex
("eTeXrevision", convert_cmd
, eTeX_revision_code
, 0);
732 First we implement the additional \eTeX\ parameters in the table of equivalents.
735 primitive_etex
("everyeof", assign_toks_cmd
, every_eof_loc
, local_base
);
736 primitive_etex
("tracingassigns", assign_int_cmd
, int_base
+ tracing_assigns_code
, int_base
);
737 primitive_etex
("tracinggroups", assign_int_cmd
, int_base
+ tracing_groups_code
, int_base
);
738 primitive_etex
("tracingifs", assign_int_cmd
, int_base
+ tracing_ifs_code
, int_base
);
739 primitive_etex
("tracingscantokens", assign_int_cmd
, int_base
+ tracing_scan_tokens_code
, int_base
);
740 primitive_etex
("tracingnesting", assign_int_cmd
, int_base
+ tracing_nesting_code
, int_base
);
741 primitive_etex
("predisplaydirection", assign_int_cmd
, int_base
+ pre_display_direction_code
, int_base
);
742 primitive_etex
("lastlinefit", assign_int_cmd
, int_base
+ last_line_fit_code
, int_base
);
743 primitive_etex
("savingvdiscards", assign_int_cmd
, int_base
+ saving_vdiscards_code
, int_base
);
744 primitive_etex
("savinghyphcodes", assign_int_cmd
, int_base
+ saving_hyph_codes_code
, int_base
);
745 primitive_luatex
("suppressfontnotfounderror", assign_int_cmd
, int_base
+ suppress_fontnotfound_error_code
, int_base
);
746 primitive_luatex
("suppresslongerror", assign_int_cmd
, int_base
+ suppress_long_error_code
, int_base
);
747 primitive_luatex
("suppressmathparerror", assign_int_cmd
, int_base
+ suppress_mathpar_error_code
, int_base
);
748 primitive_luatex
("suppressifcsnameerror", assign_int_cmd
, int_base
+ suppress_ifcsname_error_code
, int_base
);
749 primitive_luatex
("suppressoutererror", assign_int_cmd
, int_base
+ suppress_outer_error_code
, int_base
);
750 primitive_luatex
("matheqnogapstep", assign_int_cmd
, int_base
+ math_eqno_gap_step_code
, int_base
);
751 primitive_luatex
("mathdisplayskipmode", assign_int_cmd
, int_base
+ math_display_skip_mode_code
, int_base
);
752 primitive_luatex
("mathscriptsmode", assign_int_cmd
, int_base
+ math_scripts_mode_code
, int_base
);
753 primitive_luatex
("synctex", assign_int_cmd
, int_base
+ synctex_code
, int_base
);
755 primitive_etex
("currentgrouplevel", last_item_cmd
, current_group_level_code
, 0);
756 primitive_etex
("currentgrouptype", last_item_cmd
, current_group_type_code
, 0);
758 primitive_etex
("currentiflevel", last_item_cmd
, current_if_level_code
, 0);
759 primitive_etex
("currentiftype", last_item_cmd
, current_if_type_code
, 0);
760 primitive_etex
("currentifbranch", last_item_cmd
, current_if_branch_code
, 0);
761 primitive_etex
("fontcharwd", last_item_cmd
, font_char_wd_code
, 0);
762 primitive_etex
("fontcharht", last_item_cmd
, font_char_ht_code
, 0);
763 primitive_etex
("fontchardp", last_item_cmd
, font_char_dp_code
, 0);
764 primitive_etex
("fontcharic", last_item_cmd
, font_char_ic_code
, 0);
766 primitive_etex
("parshapelength", last_item_cmd
, par_shape_length_code
, 0);
767 primitive_etex
("parshapeindent", last_item_cmd
, par_shape_indent_code
, 0);
768 primitive_etex
("parshapedimen", last_item_cmd
, par_shape_dimen_code
, 0);
770 primitive_etex
("showgroups", xray_cmd
, show_groups
, 0);
773 The \.
{\\showtokens
} command displays a token list.
776 primitive_etex
("showtokens", xray_cmd
, show_tokens
, 0);
779 The \.
{\\unexpanded
} primitive prevents expansion of tokens much as
780 the result from \.
{\\the
} applied to a token variable. The
781 \.
{\\detokenize
} primitive converts a token list into a list of
782 character tokens much as if the token list were written to a file. We
783 use the fact that the command modifiers for \.
{\\unexpanded
} and
784 \.
{\\detokenize
} are odd whereas those for \.
{\\the
} and \.
{\\showthe
}
788 primitive_etex
("unexpanded", the_cmd
, 1, 0);
789 primitive_etex
("detokenize", the_cmd
, show_tokens
, 0);
792 The \.
{\\showifs
} command displays all currently active conditionals.
795 primitive_etex
("showifs", xray_cmd
, show_ifs
, 0);
798 The \.
{\\interactionmode
} primitive allows to query and set the interaction mode.
801 primitive_etex
("interactionmode", set_page_int_cmd
, 2, 0);
804 The |scan_tokens| feature of \eTeX\ defines the \.
{\\scantokens
} primitive.
807 primitive_etex
("scantokens", input_cmd
, 2, 0);
808 primitive_luatex
("scantextokens", input_cmd
, 3, 0);
810 primitive_etex
("readline", read_to_cs_cmd
, 1, 0);
812 primitive_etex
("unless", expand_after_cmd
, 1, 0);
813 primitive_etex
("ifdefined", if_test_cmd
, if_def_code
, 0);
814 primitive_etex
("ifcsname", if_test_cmd
, if_cs_code
, 0);
815 primitive_etex
("iffontchar", if_test_cmd
, if_font_char_code
, 0);
816 primitive_luatex
("ifincsname", if_test_cmd
, if_in_csname_code
, 0);
817 primitive_luatex
("ifabsnum", if_test_cmd
, if_abs_num_code
, 0);
818 primitive_luatex
("ifabsdim", if_test_cmd
, if_abs_dim_code
, 0);
821 The |protected| feature of \eTeX\ defines the \.
{\\protected
} prefix
822 command for macro definitions. Such macros are protected against
823 expansions when lists of expanded tokens are built
, e.g.
, for \.
{\\edef
}
824 or during \.
{\\write
}.
827 primitive_etex
("protected", prefix_cmd
, 8, 0);
830 Here are the additional \eTeX\ primitives for expressions.
833 primitive_etex
("numexpr", last_item_cmd
, eTeX_expr
- int_val_level
+ int_val_level
, 0);
834 primitive_etex
("dimexpr", last_item_cmd
, eTeX_expr
- int_val_level
+ dimen_val_level
, 0);
835 primitive_etex
("glueexpr", last_item_cmd
, eTeX_expr
- int_val_level
+ glue_val_level
, 0);
836 primitive_etex
("muexpr", last_item_cmd
, eTeX_expr
- int_val_level
+ mu_val_level
, 0);
838 primitive_etex
("gluestretchorder", last_item_cmd
, glue_stretch_order_code
, 0);
839 primitive_etex
("glueshrinkorder", last_item_cmd
, glue_shrink_order_code
, 0);
840 primitive_etex
("gluestretch", last_item_cmd
, glue_stretch_code
, 0);
841 primitive_etex
("glueshrink", last_item_cmd
, glue_shrink_code
, 0);
843 primitive_etex
("mutoglue", last_item_cmd
, mu_to_glue_code
, 0);
844 primitive_etex
("gluetomu", last_item_cmd
, glue_to_mu_code
, 0);
847 The \.
{\\pagediscards
} and \.
{\\splitdiscards
} commands share the
848 command code |un_vbox| with \.
{\\unvbox
} and \.
{\\unvcopy
}, they are
849 distinguished by their |chr_code| values |last_box_code| and
850 |vsplit_code|. These |chr_code| values are larger than |box_code| and
854 primitive_etex
("pagediscards", un_vbox_cmd
, last_box_code
, 0);
855 primitive_etex
("splitdiscards", un_vbox_cmd
, vsplit_code
, 0);
858 The \.
{\\interlinepenalties
}, \.
{\\clubpenalties
}, \.
{\\widowpenalties
},
859 and \.
{\\displaywidowpenalties
} commands allow to define arrays of
860 penalty values to be used instead of the corresponding single values.
863 primitive_etex
("interlinepenalties", set_etex_shape_cmd
, inter_line_penalties_loc
, etex_pen_base
);
864 primitive_etex
("clubpenalties", set_etex_shape_cmd
, club_penalties_loc
, etex_pen_base
);
865 primitive_etex
("widowpenalties", set_etex_shape_cmd
, widow_penalties_loc
, etex_pen_base
);
866 primitive_etex
("displaywidowpenalties", set_etex_shape_cmd
, display_widow_penalties_loc
, etex_pen_base
);