diff options
Diffstat (limited to 'source/luametatex/source/tex')
-rw-r--r-- | source/luametatex/source/tex/texadjust.c | 2 | ||||
-rw-r--r-- | source/luametatex/source/tex/texalign.c | 2 | ||||
-rw-r--r-- | source/luametatex/source/tex/texbuildpage.c | 22 | ||||
-rw-r--r-- | source/luametatex/source/tex/texcommands.c | 4 | ||||
-rw-r--r-- | source/luametatex/source/tex/texdumpdata.c | 2 | ||||
-rw-r--r-- | source/luametatex/source/tex/texequivalents.h | 10 | ||||
-rw-r--r-- | source/luametatex/source/tex/texinserts.c | 2 | ||||
-rw-r--r-- | source/luametatex/source/tex/texlinebreak.c | 27 | ||||
-rw-r--r-- | source/luametatex/source/tex/texmainbody.c | 4 | ||||
-rw-r--r-- | source/luametatex/source/tex/texmaincontrol.c | 2 | ||||
-rw-r--r-- | source/luametatex/source/tex/texnesting.c | 4 | ||||
-rw-r--r-- | source/luametatex/source/tex/texpackaging.c | 10 | ||||
-rw-r--r-- | source/luametatex/source/tex/texrules.c | 2 | ||||
-rw-r--r-- | source/luametatex/source/tex/textypes.h | 8 |
14 files changed, 51 insertions, 50 deletions
diff --git a/source/luametatex/source/tex/texadjust.c b/source/luametatex/source/tex/texadjust.c index 775fd546d..a91439ea3 100644 --- a/source/luametatex/source/tex/texadjust.c +++ b/source/luametatex/source/tex/texadjust.c @@ -151,7 +151,7 @@ void tex_set_vadjust(halfword target) tex_normal_paragraph(vadjust_par_context); tex_push_nest(); cur_list.mode = internal_vmode; - cur_list.prev_depth = ignore_depth_criterium_par; + cur_list.prev_depth = ignore_depth_criterion_par; } void tex_run_vadjust(void) diff --git a/source/luametatex/source/tex/texalign.c b/source/luametatex/source/tex/texalign.c index e82a9eaae..8de3adff9 100644 --- a/source/luametatex/source/tex/texalign.c +++ b/source/luametatex/source/tex/texalign.c @@ -1068,7 +1068,7 @@ static void tex_aux_initialize_span(halfword p) if (cur_list.mode == restricted_hmode) { cur_list.space_factor = default_space_factor; } else { - cur_list.prev_depth = ignore_depth_criterium_par; + cur_list.prev_depth = ignore_depth_criterion_par; tex_normal_paragraph(span_par_context); } lmt_alignment_state.cur_span = p; diff --git a/source/luametatex/source/tex/texbuildpage.c b/source/luametatex/source/tex/texbuildpage.c index 5079e926e..a2d9051db 100644 --- a/source/luametatex/source/tex/texbuildpage.c +++ b/source/luametatex/source/tex/texbuildpage.c @@ -704,7 +704,7 @@ void tex_build_page(void) Compute the badness, |b|, of the current page, using |awful_bad| if the box is too full. The |c| variable holds the costs. */ - halfword badness, criterium; + halfword badness, criterion; /*tex This could actually be a callback but not now. First we will experiment a lot with this yet undocumented trick. @@ -728,29 +728,29 @@ void tex_build_page(void) } } if (badness >= awful_bad) { - criterium = badness; /* trigger fireup */ + criterion = badness; /* trigger fireup */ } else if (penalty <= eject_penalty) { - criterium = penalty; /* trigger fireup */ + criterion = penalty; /* trigger fireup */ } else if (badness < infinite_bad) { - criterium = badness + penalty + lmt_page_builder_state.insert_penalties; + criterion = badness + penalty + lmt_page_builder_state.insert_penalties; } else { - criterium = deplorable; + criterion = deplorable; } if (lmt_page_builder_state.insert_penalties >= 10000) { - criterium = awful_bad; + criterion = awful_bad; } { - int moveon = criterium <= lmt_page_builder_state.least_cost; - int fireup = criterium == awful_bad || penalty <= eject_penalty; + int moveon = criterion <= lmt_page_builder_state.least_cost; + int fireup = criterion == awful_bad || penalty <= eject_penalty; if (tracing_pages_par > 0) { - tex_aux_display_page_break_cost(badness, penalty, criterium, moveon, fireup); + tex_aux_display_page_break_cost(badness, penalty, criterion, moveon, fireup); } if (moveon) { halfword insert = node_next(page_insert_head); lmt_page_builder_state.best_break = current; lmt_page_builder_state.best_size = page_goal; lmt_page_builder_state.insert_penalties = 0; - lmt_page_builder_state.least_cost = criterium; + lmt_page_builder_state.least_cost = criterion; while (insert != page_insert_head) { split_best_insert(insert) = split_last_insert(insert); insert = node_next(insert); @@ -1146,7 +1146,7 @@ static void tex_aux_fire_up(halfword c) ++lmt_page_builder_state.dead_cycles; tex_push_nest(); cur_list.mode = internal_vmode; - cur_list.prev_depth = ignore_depth_criterium_par; + cur_list.prev_depth = ignore_depth_criterion_par; cur_list.mode_line = -lmt_input_state.input_line; tex_begin_token_list(output_routine_par, output_text); tex_new_save_level(output_group); diff --git a/source/luametatex/source/tex/texcommands.c b/source/luametatex/source/tex/texcommands.c index 239394859..26ae7cef9 100644 --- a/source/luametatex/source/tex/texcommands.c +++ b/source/luametatex/source/tex/texcommands.c @@ -279,7 +279,7 @@ void tex_initialize_commands(void) tex_primitive(luatex_command, "alignmentcellsource", internal_int_cmd, alignment_cell_source_code, internal_int_base); tex_primitive(luatex_command, "alignmentwrapsource", internal_int_cmd, alignment_wrap_source_code, internal_int_base); /* tex_primitive(luatex_command, "pageboundarypenalty", internal_int_cmd, page_boundary_penalty_code, internal_int_base); */ - tex_primitive(luatex_command, "linebreakcriterium", internal_int_cmd, line_break_criterium_code, internal_int_base); + tex_primitive(luatex_command, "linebreakcriterion", internal_int_cmd, line_break_criterion_code, internal_int_base); tex_primitive(luatex_command, "eufactor", internal_int_cmd, eu_factor_code, internal_int_base); /*tex dimensions */ @@ -310,7 +310,7 @@ void tex_initialize_commands(void) tex_primitive(luatex_command, "pxdimen", internal_dimen_cmd, px_dimen_code, internal_dimen_base); tex_primitive(luatex_command, "tabsize", internal_dimen_cmd, tab_size_code, internal_dimen_base); tex_primitive(luatex_command, "pageextragoal", internal_dimen_cmd, page_extra_goal_code, internal_dimen_base); - tex_primitive(luatex_command, "ignoredepthcriterium", internal_dimen_cmd, ignore_depth_criterium_code, internal_dimen_base); /* mostly for myself, tutorials etc */ + tex_primitive(luatex_command, "ignoredepthcriterion", internal_dimen_cmd, ignore_depth_criterion_code, internal_dimen_base); /* mostly for myself, tutorials etc */ tex_primitive(luatex_command, "shortinlinemaththreshold", internal_dimen_cmd, short_inline_math_threshold_code, internal_dimen_base); /*tex Probably never used with \UNICODE\ omnipresent now: */ diff --git a/source/luametatex/source/tex/texdumpdata.c b/source/luametatex/source/tex/texdumpdata.c index 1500ec78b..137c12ba9 100644 --- a/source/luametatex/source/tex/texdumpdata.c +++ b/source/luametatex/source/tex/texdumpdata.c @@ -287,7 +287,7 @@ static void tex_aux_undump_fmt_data(dumpstream f) /*tex This should go elsewhere. */ - cur_list.prev_depth = ignore_depth_criterium_par; + cur_list.prev_depth = ignore_depth_criterion_par; } /* diff --git a/source/luametatex/source/tex/texequivalents.h b/source/luametatex/source/tex/texequivalents.h index 4aeb32a81..b129cb047 100644 --- a/source/luametatex/source/tex/texequivalents.h +++ b/source/luametatex/source/tex/texequivalents.h @@ -223,7 +223,7 @@ 590023 => down to 1024 * 512 == 524288 ==> 85% = 445644 => prime 445633/445649 will make a much larger format and we gain nothing. Actually, because we have extra hash - anyway, this whole 85\% criterium is irrelevant: we only need to make sure that we have + anyway, this whole 85\% criterion is irrelevant: we only need to make sure that we have enough room for the frozen sequences (assuming we stay within the concept). primes: @@ -573,7 +573,7 @@ typedef enum int_codes { alignment_cell_source_code, alignment_wrap_source_code, /* page_boundary_penalty_code, */ - line_break_criterium_code, + line_break_criterion_code, /* This one was added as experiment to \LUATEX\ (answer to a forwarded question) but as it didn't get tested it will go away. \CONTEXT\ doesn't need it and we don't need to be @@ -639,7 +639,7 @@ typedef enum dimen_codes { px_dimen_code, tab_size_code, page_extra_goal_code, - ignore_depth_criterium_code, + ignore_depth_criterion_code, short_inline_math_threshold_code, /*tex total number of dimension parameters */ number_dimen_pars, @@ -1380,7 +1380,7 @@ extern void tex_forced_word_define (int g, halfword p, singleword flag, halfword # define display_widow_penalty_par count_parameter(display_widow_penalty_code) # define orphan_penalty_par count_parameter(orphan_penalty_code) /*define page_boundary_penalty_par count_parameter(page_boundary_penalty_code) */ /* now in |\pageboundary| */ -# define line_break_criterium_par count_parameter(line_break_criterium_code) +# define line_break_criterion_par count_parameter(line_break_criterion_code) # define broken_penalty_par count_parameter(broken_penalty_code) # define line_skip_limit_par dimen_parameter(line_skip_limit_code) @@ -1395,7 +1395,7 @@ extern void tex_forced_word_define (int g, halfword p, singleword flag, halfword # define split_max_depth_par dimen_parameter(split_max_depth_code) # define overfull_rule_par dimen_parameter(overfull_rule_code) # define box_max_depth_par dimen_parameter(box_max_depth_code) -# define ignore_depth_criterium_par dimen_parameter(ignore_depth_criterium_code) +# define ignore_depth_criterion_par dimen_parameter(ignore_depth_criterion_code) # define short_inline_math_threshold_par dimen_parameter(short_inline_math_threshold_code) # define top_skip_par glue_parameter(top_skip_code) diff --git a/source/luametatex/source/tex/texinserts.c b/source/luametatex/source/tex/texinserts.c index 5a76ebaad..c47295223 100644 --- a/source/luametatex/source/tex/texinserts.c +++ b/source/luametatex/source/tex/texinserts.c @@ -451,7 +451,7 @@ void tex_run_insert(void) tex_normal_paragraph(insert_par_context); tex_push_nest(); cur_list.mode = internal_vmode; - cur_list.prev_depth = ignore_depth_criterium_par; + cur_list.prev_depth = ignore_depth_criterion_par; } void tex_finish_insert_group(void) diff --git a/source/luametatex/source/tex/texlinebreak.c b/source/luametatex/source/tex/texlinebreak.c index 821613c60..0c2445ffe 100644 --- a/source/luametatex/source/tex/texlinebreak.c +++ b/source/luametatex/source/tex/texlinebreak.c @@ -1407,7 +1407,7 @@ static void tex_aux_post_line_break(const line_break_properties *properties, hal A core aspect of the linebreak algorithm is the calculation of badness. The formula currently used has evolved with the tex versions before Don Knuth settled on this approach. And I (HH) admit that I see no real reason to change something here. The only possible extension could - be changing the hardcoded |loose_criterium| of 99 and |decent_criterium| of 12. These could + be changing the hardcoded |loose_criterion| of 99 and |decent_criterion| of 12. These could become parameters instead. When looking at the code you will notice a loop that runs from |very_loose_fit| to |tight_fit| with the following four steps: @@ -1427,11 +1427,12 @@ static void tex_aux_post_line_break(const line_break_properties *properties, hal experiment. However, the result is not that spectacular: I'm pretty sure that users will not be able to choose consistently what result looks better, but who knows. For the moment I keep it, if only to be able to discuss it as useless extension. Configuring the value s - is done with |\linebreakcriterium| which gets split into 4 parts (2 bytes per criterium). + is done with |\linebreakcriterion| which gets split into 4 parts (2 bytes per criterion). It is probably hard to explain to users what a different setting does and although one can force different output in narrow raggedright text it would probbably enough to just make - the |decent_criterium| configureable. Anyway, because we're talking heuristics and pretty + + the |decent_criterion| configureable. Anyway, because we're talking heuristics and pretty good estimates from Don Knuth here, it would be pretentious to suggest that I really did research this fuzzy topic (if it was worth the effort at all). @@ -1485,22 +1486,22 @@ halfword tex_badness(scaled t, scaled s) } } -inline static void tex_split_line_break_criterium(halfword criterium, halfword *semi_tight, halfword *decent, halfword *semi_loose, halfword *loose) { - *semi_tight = (criterium >> 24) & 0x7F; - *decent = (criterium >> 16) & 0x7F; - *semi_loose = (criterium >> 8) & 0x7F; - *loose = criterium & 0x7F; +inline static void tex_split_line_break_criterion(halfword criterion, halfword *semi_tight, halfword *decent, halfword *semi_loose, halfword *loose) { + *semi_tight = (criterion >> 24) & 0x7F; + *decent = (criterion >> 16) & 0x7F; + *semi_loose = (criterion >> 8) & 0x7F; + *loose = criterion & 0x7F; if (! *semi_tight) { - *semi_tight = semi_tight_criterium; + *semi_tight = semi_tight_criterion; } if (! *decent) { - *decent = decent_criterium; + *decent = decent_criterion; } if (! *semi_loose) { - *semi_loose = semi_loose_criterium; + *semi_loose = semi_loose_criterion; } if (! *loose) { - *loose = loose_criterium; + *loose = loose_criterion; } } @@ -1629,7 +1630,7 @@ static void tex_aux_try_break( */ halfword semi_tight, decent, semi_loose, loose; /*tex in par node */ - tex_split_line_break_criterium(line_break_criterium_par, &semi_tight, &decent, &semi_loose, &loose); + tex_split_line_break_criterion(line_break_criterion_par, &semi_tight, &decent, &semi_loose, &loose); /*tex Make sure that |pi| is in the proper range; */ if (penalty >= infinite_penalty) { /*tex this breakpoint is inhibited by infinite penalty */ diff --git a/source/luametatex/source/tex/texmainbody.c b/source/luametatex/source/tex/texmainbody.c index 707882a6b..4bc419df7 100644 --- a/source/luametatex/source/tex/texmainbody.c +++ b/source/luametatex/source/tex/texmainbody.c @@ -375,11 +375,11 @@ void tex_main_body(void) } /*tex - We assume that |ignore_depth_criterium_par| is unchanged. If needed we can always do + We assume that |ignore_depth_criterion_par| is unchanged. If needed we can always do this: */ - /* cur_list.prev_depth = ignore_depth_criterium_par; */ + /* cur_list.prev_depth = ignore_depth_criterion_par; */ /*tex Ready to go, so come to life. */ diff --git a/source/luametatex/source/tex/texmaincontrol.c b/source/luametatex/source/tex/texmaincontrol.c index 0489b67ac..c51a636b3 100644 --- a/source/luametatex/source/tex/texmaincontrol.c +++ b/source/luametatex/source/tex/texmaincontrol.c @@ -6711,7 +6711,7 @@ void tex_initialize_variables(void) pre_short_inline_penalty_par = max_integer; post_short_inline_penalty_par = max_integer; variable_family_par = -1, - ignore_depth_criterium_par = ignore_depth; + ignore_depth_criterion_par = ignore_depth; aux_get_date_and_time(&time_par, &day_par, &month_par, &year_par, &lmt_engine_state.utc_time); } } diff --git a/source/luametatex/source/tex/texnesting.c b/source/luametatex/source/tex/texnesting.c index 87ca7715a..65e32a333 100644 --- a/source/luametatex/source/tex/texnesting.c +++ b/source/luametatex/source/tex/texnesting.c @@ -224,7 +224,7 @@ void tex_initialize_nesting(void) cur_list.delimiter = null; cur_list.prev_graf = 0; cur_list.mode_line = 0; - cur_list.prev_depth = ignore_depth; /*tex |ignore_depth_criterium_par| is not yet available! */ + cur_list.prev_depth = ignore_depth; /*tex |ignore_depth_criterion_par| is not yet available! */ cur_list.space_factor = default_space_factor; cur_list.incomplete_noad = null; cur_list.direction_stack = null; @@ -367,7 +367,7 @@ void tex_show_activities(void) case vmode: case internal_vmode: { - if (n.prev_depth <= ignore_depth_criterium_par) { + if (n.prev_depth <= ignore_depth_criterion_par) { tex_print_format("%l[prevdepth ignored"); } else { tex_print_format("%l[prevdepth %D", n.prev_depth, pt_unit); diff --git a/source/luametatex/source/tex/texpackaging.c b/source/luametatex/source/tex/texpackaging.c index 185b80c1b..83ace07fa 100644 --- a/source/luametatex/source/tex/texpackaging.c +++ b/source/luametatex/source/tex/texpackaging.c @@ -2376,7 +2376,7 @@ void tex_run_vcenter(void) tex_normal_paragraph(vcenter_par_context); tex_push_nest(); cur_list.mode = internal_vmode; - cur_list.prev_depth = ignore_depth_criterium_par; + cur_list.prev_depth = ignore_depth_criterion_par; if (every_vbox_par) { tex_begin_token_list(every_vbox_par, every_vbox_text); } @@ -2791,14 +2791,14 @@ void tex_append_to_vlist(halfword b, int location, const line_break_properties * { if (location >= 0) { halfword result = null; - halfword next_depth = ignore_depth_criterium_par; + halfword next_depth = ignore_depth_criterion_par; int prev_set = 0; int check_depth = 0; if (lmt_append_to_vlist_callback(b, location, cur_list.prev_depth, &result, &next_depth, &prev_set, &check_depth)) { if (prev_set) { cur_list.prev_depth = next_depth; } - if (check_depth && result && (cur_list.prev_depth > ignore_depth_criterium_par)) { + if (check_depth && result && (cur_list.prev_depth > ignore_depth_criterion_par)) { /*tex We only deal with a few types and one can always at the \LUA\ end check for some of these and decide not to apply the correction. @@ -2820,7 +2820,7 @@ void tex_append_to_vlist(halfword b, int location, const line_break_properties * return; } } - if (cur_list.prev_depth > ignore_depth_criterium_par) { + if (cur_list.prev_depth > ignore_depth_criterion_par) { halfword glue = tex_aux_depth_correction(b, properties); tex_tail_append(glue); } @@ -3429,7 +3429,7 @@ void tex_begin_box(int boxcontext, scaled shift, halfword slot) update_tex_internal_dir_state(0); cur_list.mode = - mode; if (mode == vmode) { - cur_list.prev_depth = ignore_depth_criterium_par; + cur_list.prev_depth = ignore_depth_criterion_par; if (every_vbox_par) { tex_begin_token_list(every_vbox_par, every_vbox_text); } diff --git a/source/luametatex/source/tex/texrules.c b/source/luametatex/source/tex/texrules.c index 7d9adb7ef..c0c122945 100644 --- a/source/luametatex/source/tex/texrules.c +++ b/source/luametatex/source/tex/texrules.c @@ -176,7 +176,7 @@ void tex_aux_run_vrule(void) void tex_aux_run_hrule(void) { tex_tail_append(tex_aux_scan_rule_spec(h_rule_type, cur_chr)); - cur_list.prev_depth = ignore_depth_criterium_par; + cur_list.prev_depth = ignore_depth_criterion_par; } void tex_aux_run_mrule(void) diff --git a/source/luametatex/source/tex/textypes.h b/source/luametatex/source/tex/textypes.h index a3ceea681..683ee2e5a 100644 --- a/source/luametatex/source/tex/textypes.h +++ b/source/luametatex/source/tex/textypes.h @@ -169,10 +169,10 @@ extern halfword tex_badness( # define deplorable 100000 /*tex more than |inf_bad|, but less than |awful_bad| */ # define large_width_excess 7230584 # define small_stretchability 1663497 -# define loose_criterium 99 -# define semi_loose_criterium 12 /* same as |decent_criterium| */ -# define decent_criterium 12 -# define semi_tight_criterium 12 /* same as |decent_criterium| */ +# define loose_criterion 99 +# define semi_loose_criterion 12 /* same as |decent_criterion| */ +# define decent_criterion 12 +# define semi_tight_criterion 12 /* same as |decent_criterion| */ # define max_calculated_badness 8189 # define default_rule 26214 /*tex 0.4pt */ |