1 /* Copyright 2014 Clerk Ma
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 void char_warning_(internal_font_number f, eight_bits c)
25 if (tracing_lost_chars > 0)
27 if (show_missing == 0)
30 if (show_missing) /* add ! before 94/June/10 */
33 print_string("Missing character: there is no ");
36 print_nl("Missing character: there is no ");
40 if (show_numeric) /* bkph 93/Dec/21 */
47 print_char(48 + c / 100);
49 c = c - (c / 100) * 100; /* ? */
50 print_char(48 + c / 10);
55 c = c - (c / 100) * 100; /* ? */
56 if (c / 10 > 0) print_char(48 + c / 10);
58 print_char(48 + c % 10);
62 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
63 print_string(" in font ");
64 slow_print(font_name[f]);
66 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
67 /* if (show_missing) show_context(); */ /* in tex2.c 94/June/10 */
71 show_context(); /* not if its the nullfont */
74 if (show_missing == 0) /* show on screen 94/June/10 */
75 end_diagnostic(false);
77 missing_characters++; /* bkph 93/Dec/16 */
78 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
82 halfword new_character_(internal_font_number f, eight_bits c)
88 if (char_exists(char_info(f, c)))
105 sprintf(log_line, "dvi_swap %d", dvi_gone);
106 show_line(log_line, 0);
109 if (dvi_limit == dvi_buf_size)
111 write_dvi(0, half_buf - 1);
112 dvi_limit = half_buf;
113 dvi_offset = dvi_offset + dvi_buf_size;
118 write_dvi(half_buf, dvi_buf_size - 1);
119 dvi_limit = dvi_buf_size;
122 dvi_gone = dvi_gone + half_buf;
125 void dvi_four_(integer x)
128 dvi_out(x / 0100000000);
131 x = x + 010000000000;
132 x = x + 010000000000;
133 dvi_out((x / 0100000000) + 128);
137 dvi_out(x / 0200000);
143 void dvi_pop_(integer l)
145 if ((l == dvi_offset + dvi_ptr) && (dvi_ptr > 0))
151 void dvi_font_def_(internal_font_number f)
164 dvi_out(((f - 1) >> 8));
165 dvi_out(((f - 1) & 255));
172 dvi_out(font_check[f].b0);
173 dvi_out(font_check[f].b1);
174 dvi_out(font_check[f].b2);
175 dvi_out(font_check[f].b3);
176 dvi_four(font_size[f]);
177 dvi_four(font_dsize[f]);
178 dvi_out(length(font_area[f]));
179 dvi_out(length(font_name[f]));
181 for (k = str_start[font_area[f]]; k <= str_start[font_area[f] + 1] - 1; k++)
182 dvi_out(str_pool[k]);
184 for (k = str_start[font_name[f]]; k <= str_start[font_name[f] + 1] - 1; k++)
185 dvi_out(str_pool[k]);
188 void zmovement(scaled w, eight_bits o)
194 q = get_node(movement_node_size);
196 location(q) = dvi_offset + dvi_ptr;
215 switch(mstate + info(p))
217 case none_seen + yz_OK:
218 case none_seen + y_OK:
221 if (location(p) < dvi_gone)
225 k = location(p) - dvi_offset;
228 k = k + dvi_buf_size;
230 dvi_buf[k] = dvi_buf[k] + y1 - down1;
236 case none_seen + z_OK:
239 if (location(p) < dvi_gone)
243 k = location(p) - dvi_offset;
246 k = k + dvi_buf_size;
248 dvi_buf[k] = dvi_buf[k] + z1 - down1;
254 case none_seen + y_here:
255 case none_seen + z_here:
256 case y_seen + z_here:
257 case z_seen + y_here:
264 else switch (mstate + info(p))
266 case none_seen + y_here:
270 case none_seen + z_here:
274 case y_seen + z_here:
275 case z_seen + y_here:
288 if (abs(w) >= 8388608L) /* 2^23 */
295 if (abs(w) >= 32768L)
300 w = w + 16777216L; /* 2^24 */
301 //dvi_out(w / 65536L);
303 /* w = w % 65536L; */
334 if (info(q) == y_here)
336 dvi_out(o + y0 - down1);
359 dvi_out(o + z0 - down1);
382 void prune_movements_(integer l)
386 while (down_ptr != 0)
388 if (location(down_ptr) < l)
393 free_node(p, movement_node_size);
397 while (right_ptr != 0)
399 if (location(right_ptr) < l)
404 free_node(p, movement_node_size);
408 void special_out_(pointer p)
415 old_setting = selector;
416 selector = new_string;
418 #ifdef ALLOCATESTRING
419 if (pool_ptr + 32000 > current_pool_size)
420 str_pool = realloc_str_pool (increment_pool_size);
422 show_token_list(link(write_tokens(p)), 0, 10000000L);
424 show_token_list(link(write_tokens(p)), 0, pool_size - pool_ptr);
427 selector = old_setting;
430 if (cur_length < 256)
438 dvi_four(cur_length);
441 for (k = str_start[str_ptr]; k <= pool_ptr - 1; k++)
442 dvi_out(str_pool[k]);
444 pool_ptr = str_start[str_ptr];
447 void write_out_(pointer p)
450 /* integer oldmode; */
451 int oldmode; /* 1995/Jan/7 */
452 /* small_number j; */
453 int j; /* 1995/Jan/7 */
457 info(q) = right_brace_token + '}';
460 info(r) = end_write_token;
462 begin_token_list(write_tokens(p), write_text);
464 info(q) = left_brace_token + '{';
469 q = scan_toks(false, true);
472 if (cur_tok != end_write_token)
474 print_err("Unbalanced write command");
475 help2("On this page there's a \\write with fewer real {'s than }'s.",
476 "I can't handle that very well; good luck.");
483 while (!(cur_tok == end_write_token));
488 old_setting = selector;
495 if ((j == 17) && (selector == term_and_log))
504 selector = old_setting;
507 void out_what_(pointer p)
509 /* small_number j; */
510 int j; /* 1995/Jan/7 */
521 if (subtype(p) == write_node)
528 (void) a_close(write_file[j]);
530 if (subtype(p) == close_node)
531 write_open[j]= false;
534 cur_name = open_name(p);
535 cur_area = open_area(p);
536 cur_ext = open_ext(p);
538 if (cur_ext == 335) /* "" */
539 cur_ext = 785; /* => ".tex" */
541 pack_file_name(cur_name, cur_area, cur_ext);
543 while (! a_open_out(write_file[j]))
545 prompt_file_name("output file name", ".tex");
548 write_open[j] = true;
571 void hlist_out (void)
575 scaled save_h, save_v;
577 /* glue_ord g_order; */
578 int g_order; /* 95/Jan/7 */
580 int g_sign; /* 95/Jan/7 */
586 boolean outer_doing_leaders;
595 g_order = glue_order(this_box);
596 g_sign = glue_sign(this_box);
597 p = list_ptr(this_box);
603 if (cur_s > max_push)
606 save_loc = dvi_offset + dvi_ptr;
630 if (f <= 64 + font_base)
631 dvi_out(f - font_base - 1 + fnt_num_0);
633 /* if we allow greater than 256 fonts */
651 dvi_out(((f - 1) >> 8)); /* top byte */
652 dvi_out(((f - 1) & 255)); /* bottom byte */
663 cur_h = cur_h + char_width(f, char_info(f, c));
666 while (!(!is_char_node(p)));
676 if (list_ptr(p) == 0)
677 cur_h = cur_h + width(p);
682 cur_v = base_line + shift_amount(p);
686 if (type(p) == vlist_node)
693 cur_h = edge + width(p);
714 rule_wd = width(g) - cur_g;
716 if (g_sign != normal)
718 if (g_sign == stretching)
720 if (stretch_order(g) == g_order)
722 cur_glue = cur_glue + stretch(g);
723 glue_temp = glue_set(this_box) * cur_glue;
725 if (glue_temp > 1000000000.0)
726 glue_temp = 1000000000.0;
727 else if (glue_temp < -1000000000.0)
728 glue_temp = -1000000000.0;
730 cur_g = round(glue_temp);
733 else if (shrink_order(g) == g_order)
735 cur_glue = cur_glue - shrink(g);
736 glue_temp = glue_set(this_box) * cur_glue;
738 if (glue_temp > 1000000000.0)
739 glue_temp = 1000000000.0;
740 else if (glue_temp < -1000000000.0)
741 glue_temp = -1000000000.0;
743 cur_g = round(glue_temp);
747 rule_wd = rule_wd + cur_g;
749 if (subtype(p) >= a_leaders)
751 leader_box = leader_ptr(p);
753 if (type(leader_box) == rule_node)
755 rule_ht = height(leader_box);
756 rule_dp = depth(leader_box);
760 leader_wd = width(leader_box);
762 if ((leader_wd > 0) && (rule_wd > 0))
764 rule_wd = rule_wd + 10;
765 edge = cur_h + rule_wd;
768 if (subtype(p) == a_leaders)
771 cur_h = left_edge + leader_wd * ((cur_h - left_edge) / leader_wd);
774 cur_h = cur_h + leader_wd;
778 lq = rule_wd / leader_wd;
779 lr = rule_wd % leader_wd;
781 if (subtype(p) == c_leaders)
782 cur_h = cur_h + (lr / 2);
785 lx =(2 * lr + lq + 1) / (2 * lq + 2);
786 cur_h = cur_h + ((lr - (lq - 1)* lx) / 2);
790 while (cur_h + leader_wd <= edge)
792 cur_v = base_line + shift_amount(leader_box);
797 temp_ptr = leader_box;
798 outer_doing_leaders = doing_leaders;
799 doing_leaders = true;
801 if (type(leader_box) == vlist_node)
806 doing_leaders = outer_doing_leaders;
810 cur_h = save_h + leader_wd + lx;
824 cur_h = cur_h + width(p);
829 mem[lig_trick] = mem[lig_char(p)];
830 link(lig_trick) = link(p);
842 if ((rule_ht == -1073741824L)) /* - 2^30 */
843 rule_ht = height(this_box);
845 if ((rule_dp == -1073741824L)) /* - 2^30 */
846 rule_dp = depth(this_box);
848 rule_ht = rule_ht + rule_dp;
850 if ((rule_ht > 0) && (rule_wd > 0))
853 cur_v = base_line + rule_dp;
859 dvi_h = dvi_h + rule_wd;
862 cur_h = cur_h + rule_wd;
867 prune_movements(save_loc);
875 void vlist_out (void)
879 scaled save_h, save_v;
881 /* glue_ord g_order; */
882 int g_order; /* 95/Jan/7 */
884 int g_sign; /* 95/Jan/7 */
890 boolean outer_doing_leaders;
899 g_order = glue_order(this_box);
900 g_sign = glue_sign(this_box);
901 p = list_ptr(this_box);
907 if (cur_s > max_push)
910 save_loc = dvi_offset + dvi_ptr;
912 cur_v = cur_v - height(this_box);
919 confusion("vlistout");
928 if (list_ptr(p) == 0)
929 cur_v = cur_v + height(p) + depth(p);
932 cur_v = cur_v + height(p);
936 cur_h = left_edge + shift_amount(p);
939 if (type(p) == vlist_node)
946 cur_v = save_v + depth(p);
967 rule_ht = width(g) - cur_g;
969 if (g_sign != normal)
971 if (g_sign == stretching)
973 if (stretch_order(g) == g_order)
975 cur_glue = cur_glue + stretch(g);
976 glue_temp = glue_set(this_box) * cur_glue;
978 if (glue_temp > 1000000000.0)
979 glue_temp = 1000000000.0;
980 else if (glue_temp < -1000000000.0)
981 glue_temp = -1000000000.0;
983 cur_g = round(glue_temp);
986 else if (shrink_order(g) == g_order) /* BUG FIX !!! */
988 cur_glue = cur_glue - shrink(g);
989 glue_temp = glue_set(this_box) * cur_glue;
991 if (glue_temp > 1000000000.0)
992 glue_temp = 1000000000.0;
993 else if (glue_temp < -1000000000.0)
994 glue_temp = -1000000000.0;
996 cur_g = round(glue_temp);
1000 rule_ht = rule_ht + cur_g;
1002 if (subtype(p) >= a_leaders)
1004 leader_box = leader_ptr(p);
1006 if (type(leader_box) == rule_node)
1008 rule_wd = width(leader_box);
1013 leader_ht = height(leader_box) + depth(leader_box);
1015 if ((leader_ht > 0) && (rule_ht > 0))
1017 rule_ht = rule_ht + 10;
1018 edge = cur_v + rule_ht;
1021 if (subtype(p) == a_leaders)
1024 cur_v = top_edge + leader_ht * ((cur_v - top_edge) / leader_ht);
1027 cur_v = cur_v + leader_ht;
1031 lq = rule_ht / leader_ht;
1032 lr = rule_ht % leader_ht;
1034 if (subtype(p) == c_leaders)
1035 cur_v = cur_v + (lr / 2);
1038 lx = (2 * lr + lq + 1) / (2 * lq + 2);
1039 cur_v = cur_v + ((lr - (lq - 1) * lx) / 2);
1043 while (cur_v + leader_ht <= edge)
1045 cur_h = left_edge + shift_amount(leader_box);
1048 cur_v = cur_v + height(leader_box);
1051 temp_ptr = leader_box;
1052 outer_doing_leaders = doing_leaders;
1053 doing_leaders = true;
1055 if (type(leader_box) == vlist_node)
1060 doing_leaders = outer_doing_leaders;
1064 cur_v = save_v - height(leader_box) + leader_ht + lx;
1077 cur_v = cur_v + width(p);
1085 if ((rule_wd == -1073741824L)) /* -2^30 */
1086 rule_wd = width(this_box);
1088 rule_ht = rule_ht + rule_dp;
1089 cur_v = cur_v + rule_ht;
1091 if ((rule_ht > 0) && (rule_wd > 0))
1102 cur_v = cur_v + rule_ht;
1108 prune_movements(save_loc);
1116 void dvi_ship_out_(halfword p)
1123 if (tracing_output > 0)
1127 print_string("Completed box being shipped out");
1130 if (term_offset > max_print_line - 9)
1132 else if ((term_offset > 0) || (file_offset > 0))
1138 while ((count(j) == 0) && (j > 0))
1141 for (k = 0; k <= j; k++)
1143 print_int(count(k));
1153 if (tracing_output > 0)
1158 end_diagnostic(true);
1161 if ((height(p) > max_dimen) || (depth(p) > max_dimen) ||
1162 (height(p) + depth(p) + v_offset > max_dimen) ||
1163 (width(p) + h_offset > max_dimen))
1165 print_err("Huge page cannot be shipped out");
1166 help2("The page just created is more than 18 feet tall or",
1167 "more than 18 feet wide, so I suspect something went wrong.");
1170 if (tracing_output <= 0)
1173 print_nl("The following box has been deleted:");
1175 end_diagnostic(true);
1181 if (height(p) + depth(p) + v_offset > max_v)
1182 max_v = height(p) + depth(p) + v_offset;
1184 if (width(p) + h_offset > max_h)
1185 max_h = width(p) + h_offset;
1193 if (total_pages == 0)
1197 dvi_four(25400000L); /* magic DVI scale factor */
1198 dvi_four(473628672L); /* 7227 * 65536 */
1201 old_setting = selector;
1202 selector = new_string;
1203 print_string(" TeX output ");
1210 print_two(tex_time / 60);
1211 print_two(tex_time % 60);
1212 selector = old_setting;
1213 dvi_out(cur_length);
1215 for (s = str_start[str_ptr]; s <= pool_ptr - 1; s++)
1216 dvi_out(str_pool[s]);
1218 pool_ptr = str_start[str_ptr];
1221 page_loc = dvi_offset + dvi_ptr;
1224 for (k = 0; k <= 9; k++)
1228 last_bop = page_loc;
1229 cur_v = height(p) + v_offset;
1232 if (type(p) == vlist_node)
1242 if (tracing_output <= 0)
1252 if (tracing_stats > 1)
1254 print_nl("Memory usage before: ");
1255 print_int(var_used);
1257 print_int(dyn_used);
1265 if (tracing_stats > 1)
1267 print_string(" after: ");
1268 print_int(var_used);
1270 print_int(dyn_used);
1271 print_string("; still utouched: ");
1272 print_int(hi_mem_min - lo_mem_max - 1);
1277 void ship_out_(halfword p)
1279 switch (shipout_flag)
1288 void scan_spec_(group_code c, boolean three_codes)
1296 if (scan_keyword("to"))
1297 spec_code = exactly;
1298 else if (scan_keyword("spread"))
1299 spec_code = additional;
1302 spec_code = additional;
1307 scan_dimen(false, false, false);
1316 saved(0) = spec_code;
1318 save_ptr = save_ptr + 2;
1323 halfword hpack_(halfword p, scaled w, small_number m)
1331 int o; /* 95/Jan/7 */
1332 internal_font_number f;
1337 r = get_node(box_node_size);
1338 type(r) = hlist_node;
1340 shift_amount(r) = 0;
1341 q = r + list_offset;
1346 total_stretch[normal] = 0;
1347 total_shrink[normal] = 0;
1348 total_stretch[fil] = 0;
1349 total_shrink[fil] = 0;
1350 total_stretch[fill] = 0;
1351 total_shrink[fill] = 0;
1352 total_stretch[filll] = 0;
1353 total_shrink[filll] = 0;
1358 while (is_char_node(p))
1361 i = char_info(f, character(p));
1362 hd = height_depth(i);
1363 x = x + char_width(f, i);
1364 s = char_height(f, hd);
1369 s = char_depth(f, hd);
1388 if (type(p) >= rule_node)
1391 s = shift_amount(p);
1393 if (height(p) - s > h)
1396 if (depth(p) + s > d)
1404 if (adjust_tail != 0)
1406 while (link(q) != p)
1409 if (type(p) == adjust_node)
1411 link(adjust_tail) = adjust_ptr(p);
1413 while (link(adjust_tail) != 0)
1414 adjust_tail = link(adjust_tail);
1417 free_node(link(q), small_node_size);
1421 link(adjust_tail) = p;
1437 o = stretch_order(g);
1438 total_stretch[o] = total_stretch[o] + stretch(g);
1439 o = shrink_order(g);
1440 total_shrink[o] = total_shrink[o] + shrink(g);
1442 if (subtype(p) >= a_leaders)
1462 mem[lig_trick] = mem[lig_char(p)];
1463 link(lig_trick) = link(p);
1476 if (adjust_tail != 0)
1477 link(adjust_tail) = 0;
1482 if (m == additional)
1490 glue_sign(r) = normal;
1491 glue_order(r) = normal;
1497 if (total_stretch[filll] != 0)
1499 else if (total_stretch[fill] != 0)
1501 else if (total_stretch[fil] != 0)
1507 glue_sign(r) = stretching;
1509 if (total_stretch[o] != 0)
1510 glue_set(r) = x / ((double) total_stretch[o]);
1513 glue_sign(r) = normal;
1518 if (list_ptr(r) != 0)
1520 last_badness = badness(x, total_stretch[normal]);
1522 if (last_badness > hbadness)
1526 if (last_badness > 100)
1527 print_nl("Underfull");
1531 print_string(" \\hbox (badness ");
1532 print_int(last_badness);
1534 if (last_badness > 100) /* Y&Y TeX */
1535 underfull_hbox++; /* 1996/Feb/9 */
1544 if (total_shrink[filll] != 0)
1546 else if (total_shrink[fill] != 0)
1548 else if (total_shrink[fil] != 0)
1554 glue_sign(r) = shrinking;
1556 if (total_shrink[o] != 0)
1557 glue_set(r) =(- (integer) x) / ((double) total_shrink[o]);
1560 glue_sign(r) = normal;
1564 if ((total_shrink[o] < - (integer) x) && (o == 0) && (list_ptr(r) != 0))
1566 last_badness = 1000000L;
1569 if ((- (integer) x - total_shrink[normal] > hfuzz) || (hbadness < 100))
1571 if ((overfull_rule > 0) && (- (integer) x - total_shrink[0] > hfuzz))
1573 while (link(q) != 0)
1576 link(q) = new_rule();
1577 width(link(q)) = overfull_rule;
1581 print_nl("Overfull \\hbox (");
1582 print_scaled(- (integer) x - total_shrink[normal]);
1583 print_string("pt too wide");
1590 else if (o == normal)
1591 if (list_ptr(r) != 0)
1593 last_badness = badness(- (integer) x, total_shrink[normal]);
1595 if (last_badness > hbadness)
1598 print_nl("Tight \\hbox (badness ");
1599 print_int(last_badness);
1608 print_string(") has occurred while \\output is active");
1611 if (pack_begin_line != 0)
1613 if (pack_begin_line > 0)
1614 print_string(") in paragraph at lines ");
1616 print_string(") in alignment at lines ");
1618 print_int(abs(pack_begin_line));
1622 print_string(") detected at line ");
1628 font_in_short_display = null_font;
1629 short_display(list_ptr(r));
1633 end_diagnostic(true);
1639 halfword vpackage_(halfword p, scaled h, small_number m, scaled l)
1646 int o; /* 95/Jan/7 */
1649 r = get_node(box_node_size);
1650 type(r) = vlist_node;
1651 subtype(r) = min_quarterword;
1652 shift_amount(r) = 0;
1657 total_stretch[normal] = 0;
1658 total_shrink[normal] = 0;
1659 total_stretch[fil] = 0;
1660 total_shrink[fil] = 0;
1661 total_stretch[fill] = 0;
1662 total_shrink[fill] = 0;
1663 total_stretch[filll] = 0;
1664 total_shrink[filll] = 0;
1668 if (is_char_node(p))
1673 else switch (type(p))
1680 x = x + d + height(p);
1683 if (type(p) >= rule_node)
1686 s = shift_amount(p);
1688 if (width(p) + s > w)
1702 o = stretch_order(g);
1703 total_stretch[o] = total_stretch[o] + stretch(g);
1704 o = shrink_order(g);
1705 total_shrink[o] = total_shrink[o] + shrink(g);
1707 if (subtype(p) >= a_leaders)
1719 x = x + d + width(p);
1740 if (m == additional)
1748 glue_sign(r) = normal;
1749 glue_order(r) = normal;
1755 if (total_stretch[filll] != 0)
1757 else if (total_stretch[fill] != 0)
1759 else if (total_stretch[fil] != 0)
1765 glue_sign(r) = stretching;
1767 if (total_stretch[o] != 0)
1768 glue_set(r) = x / ((double) total_stretch[o]);
1771 glue_sign(r) = normal;
1776 if (list_ptr(r) != 0)
1778 last_badness = badness(x, total_stretch[normal]);
1780 if (last_badness > vbadness)
1784 if (last_badness > 100)
1785 print_nl("Underfull");
1789 print_string(" \\vbox (badness ");
1790 print_int(last_badness);
1792 if (last_badness > 100)
1793 underfull_vbox++; /* 1996/Feb/9 */
1802 if (total_shrink[filll] != 0)
1804 else if (total_shrink[fill] != 0)
1806 else if (total_shrink[fil] != 0)
1812 glue_sign(r) = shrinking;
1814 if (total_shrink[o] != 0)
1815 glue_set(r) =(- (integer) x)/ ((double) total_shrink[o]);
1818 glue_sign(r) = normal;
1822 if ((total_shrink[o] < - (integer) x) && (o == 0) && (list_ptr(r) != 0))
1824 last_badness = 1000000L;
1827 if ((- (integer) x - total_shrink[0] > vfuzz) || (vbadness < 100))
1830 print_nl("Overfull \\vbox (");
1831 print_scaled(- (integer) x - total_shrink[0]);
1832 print_string("pt too high");
1834 overfull_vbox++; /* 1996/Feb/9 */
1840 if (list_ptr(r) != 0)
1842 last_badness = badness(- (integer) x, total_shrink[normal]);
1843 if (last_badness > vbadness)
1846 print_nl("Tight \\vbox (badness ");
1847 print_int(last_badness);
1856 print_string(") has occurred while \\output is active");
1859 if (pack_begin_line != 0)
1861 print_string(") in alignment at lines ");
1862 print_int(abs(pack_begin_line));
1866 print_string(") detected at line ");
1874 end_diagnostic(true);
1880 void append_to_vlist_(halfword b)
1885 if (prev_depth > ignore_depth)
1887 d = width(baseline_skip) - prev_depth - height(b);
1889 if (d < line_skip_limit)
1890 p = new_param_glue(line_skip_code);
1893 p = new_skip_param(baseline_skip_code);
1894 width(temp_ptr) = d;
1902 prev_depth = depth(b);
1905 halfword new_noad (void)
1909 p = get_node(noad_size);
1911 subtype(p) = normal;
1912 mem[nucleus(p)].hh = empty_field;
1913 mem[subscr(p)].hh = empty_field;
1914 mem[supscr(p)].hh = empty_field;
1919 halfword new_style_(small_number s)
1923 p = get_node(style_node_size);
1924 type(p) = style_node;
1932 halfword new_choice (void)
1936 p = get_node(style_node_size);
1937 type(p) = choice_node;
1939 display_mlist(p) = 0;
1941 script_mlist(p) = 0;
1942 script_script_mlist(p) = 0;
1947 void show_info (void)
1949 show_node_list(info(temp_ptr));
1952 halfword fraction_rule_(scaled t)
1963 halfword overbar_(halfword b, scaled k, scaled t)
1969 q = fraction_rule(t);
1973 return vpackage(p, 0, 1, 1073741823L); /* 2^30 - 1 */
1976 halfword char_box_(internal_font_number f, quarterword c)
1982 q = char_info(f, c);
1983 hd = height_depth(q);
1985 width(b) = char_width(f, q) + char_italic(f, q);
1986 height(b) = char_height(f, hd);
1987 depth(b) = char_depth(f, hd);
1996 void stack_into_box_(halfword b, internal_font_number f, quarterword c)
2001 link(p) = list_ptr(b);
2003 height(b) = height(p);
2006 scaled height_plus_depth_(internal_font_number f, quarterword c)
2011 q = char_info(f, c);
2012 hd = height_depth(q);
2013 return char_height(f, hd) + char_depth(f, hd);
2016 halfword var_delimiter_(halfword d, small_number s, scaled v)
2019 internal_font_number f, g;
2020 quarterword c, x, y;
2027 /* small_number z; */
2028 int z; /* 95/Jan/7 */
2029 /* boolean large_attempt; */
2030 int large_attempt; /* 95/Jan/7 */
2034 large_attempt = false;
2040 if ((z != 0) || (x != 0))
2053 if ((y >= font_bc[g]) && (y <= font_ec[g]))
2056 q = char_info(g, y);
2060 if (char_tag(q) == ext_tag)
2067 hd = height_depth(q);
2068 u = char_height(g, hd) + char_depth(g, hd);
2080 if (char_tag(q) == list_tag)
2095 large_attempt = true;
2101 if (char_tag(q) == ext_tag)
2104 type(b) = vlist_node;
2105 r = font_info[exten_base[f] + rem_byte(q)].qqqq;
2107 u = height_plus_depth(f, c);
2109 q = char_info(f, c);
2110 width(b) = char_width(f, q) + char_italic(f, q);
2113 if (c != min_quarterword)
2114 w = w + height_plus_depth(f, c);
2118 if (c != min_quarterword)
2119 w = w + height_plus_depth(f, c);
2123 if (c != min_quarterword)
2124 w = w + height_plus_depth(f, c);
2134 if (ext_mid(r) != min_quarterword)
2140 if (c != min_quarterword)
2141 stack_into_box(b, f, c);
2145 for (m = 1; m <= n; m++)
2146 stack_into_box(b, f, c);
2150 if (c != min_quarterword)
2152 stack_into_box(b, f, c);
2155 for (m = 1; m <= n; m++)
2156 stack_into_box(b, f, c);
2162 stack_into_box(b, f, c);
2164 depth(b) = w - height(b);
2171 width(b) = null_delimiter_space;
2174 shift_amount(b) = half(height(b) - depth(b)) - axis_height(s);
2178 /* rebox_ etc used to follow here in tex4.c */