check .cmdname for its meaning, can be one of the following
token.commands() = {
[0]="relax",
"left_brace",
"right_brace",
"math_shift",
"tab_mark",
"car_ret",
"mac_param",
"sup_mark",
"sub_mark",
"endv",
"spacer",
"letter",
"other_char",
"par_end",
"stop",
"delim_num",
"char_num",
"math_char_num",
"mark",
"node",
"xray",
"make_box",
"hmove",
"vmove",
"un_hbox",
"un_vbox",
"remove_item",
"hskip",
"vskip",
"mskip",
"kern",
"mkern",
"leader_ship",
"halign",
"valign",
"no_align",
"vrule",
"hrule",
"novrule",
"nohrule",
"insert",
"vadjust",
"ignore_spaces",
"after_assignment",
"after_group",
"break_penalty",
"start_par",
"ital_corr",
"accent",
"math_accent",
"discretionary",
"eq_no",
"left_right",
"math_comp",
"limit_switch",
"above",
"math_style",
"math_choice",
"non_script",
"vcenter",
"case_shift",
"message",
"normal",
"extension",
"option",
"lua_function_call",
"lua_bytecode_call",
"lua_call",
"in_stream",
"begin_group",
"end_group",
"omit",
"ex_space",
"boundary",
"radical",
"super_sub_script",
"no_super_sub_script",
"math_shift_cs",
"end_cs_name",
"char_ghost",
"assign_local_box",
"char_given",
"math_given",
"xmath_given",
"last_item",
"toks_register",
"assign_toks",
"assign_int",
"assign_attr",
"assign_dimen",
"assign_glue",
"assign_mu_glue",
"assign_font_dimen",
"assign_font_int",
"assign_hang_indent",
"set_aux",
"set_prev_graf",
"set_page_dimen",
"set_page_int",
"set_box_dimen",
"set_tex_shape",
"set_etex_shape",
"def_char_code",
"def_del_code",
"extdef_math_code",
"extdef_del_code",
"def_family",
"set_math_param",
"set_font",
"def_font",
"register",
"assign_box_direction",
"assign_box_dir",
"assign_direction",
"assign_dir",
"combinetoks",
"advance",
"multiply",
"divide",
"prefix",
"let",
"shorthand_def",
"def_lua_call",
"read_to_cs",
"def",
"set_box",
"hyph_data",
"set_interaction",
"letterspace_font",
"expand_font",
"copy_font",
"set_font_id",
"undefined_cs",
"expand_after",
"no_expand",
"input",
"lua_expandable_call",
"lua_local_call",
"if_test",
"fi_or_else",
"cs_name",
"convert",
"variable",
"feedback",
"the",
"top_bot_mark",
"call",
"long_call",
"outer_call",
"long_outer_call",
"end_template",
"dont_expand",
"glue_ref",
"shape_ref",
"box_ref",
"data",
}
(call long_call outer_call long_outer_call) are user-defined macro.
\directlua
is executed'. (The tokens still have category codes, just not the ones you expected!)\A
a little, hopefully that makes things clearer). Btw, the French word is régime (we also had that typo in the LaTeX3 doc at some point).runtoks()
/ coroutines to run TeX from Lua /scan_*
functions. There's alsoput_token
.scan_toks
can do as well, there's roughly one answer on the site that use it so far and documentation isn't great, tex.stackexchange.com/a/555222/250119, pair with expandafter and some other and can read value of token list as well. Print table of token objects from Lua to TeX is easy