| 1 |
/* equivalents.h |
| 2 |
|
| 3 |
Copyright 2009 Taco Hoekwater <[email protected]> |
| 4 |
|
| 5 |
This file is part of LuaTeX. |
| 6 |
|
| 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. |
| 11 |
|
| 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. |
| 16 |
|
| 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/>. |
| 19 |
*/ |
| 20 |
|
| 21 |
#ifndef EQUIVALENTS_H |
| 22 |
# define EQUIVALENTS_H |
| 23 |
|
| 24 |
/* |
| 25 |
|
| 26 |
Like the preceding parameters, the following quantities can be changed at compile |
| 27 |
time to extend or reduce \TeX's capacity. But if they are changed, it is |
| 28 |
necessary to rerun the initialization program \.{INITEX} @.INITEX@> to generate |
| 29 |
new tables for the production \TeX\ program. One can't simply make helter-skelter |
| 30 |
changes to the following constants, since certain rather complex initialization |
| 31 |
numbers are computed from them. They are defined here using \.{WEB} macros, |
| 32 |
instead of being put into \PASCAL's |const| list, in order to emphasize this |
| 33 |
distinction. |
| 34 |
|
| 35 |
*/ |
| 36 |
|
| 37 |
# define font_base 0 /* smallest internal font number; must not be less than |min_quarterword| */ |
| 38 |
# define biggest_reg 65535 /* the largest allowed register number; must be |< max_quarterword| */ |
| 39 |
# define number_regs 65536 /* |biggest_reg+1| */ |
| 40 |
# define number_attrs 65536 /* total numbeer of attributes */ |
| 41 |
# define biggest_char 1114111 /* 0x10FFFF, the largest allowed character number; must be |< max_halfword| */ |
| 42 |
# define too_big_char (biggest_char+1) /* 1114112, |biggest_char+1| */ |
| 43 |
# define special_char (biggest_char+2) /* 1114113, |biggest_char+2| */ |
| 44 |
# define number_chars (biggest_char+3) /* 1114112, |biggest_char+1| */ |
| 45 |
# define number_fonts (5535-font_base+1) |
| 46 |
# define biggest_lang 32767 |
| 47 |
# define too_big_lang 32768 |
| 48 |
# define text_size 0 /* size code for the largest size in a family */ |
| 49 |
# define script_size 1 /* size code for the medium size in a family */ |
| 50 |
# define script_script_size 2 /* size code for the smallest size in a family */ |
| 51 |
|
| 52 |
/* |
| 53 |
|
| 54 |
Each entry in |eqtb| is a |memory_word|. Most of these words are of type |
| 55 |
|two_halves|, and subdivided into three fields: |
| 56 |
|
| 57 |
\yskip\hangg 1) The |eq_level| (a quarterword) is the level of grouping at which |
| 58 |
this equivalent was defined. If the level is |level_zero|, the equivalent has |
| 59 |
never been defined; |level_one| refers to the outer level (outside of all |
| 60 |
groups), and this level is also used for global definitions that never go away. |
| 61 |
Higher levels are for equivalents that will disappear at the end of their group. |
| 62 |
@^global definitions@> |
| 63 |
|
| 64 |
\yskip\hangg 2) The |eq_type| (another quarterword) specifies what kind of entry |
| 65 |
this is. There are many types, since each \TeX\ primitive like \.{\\hbox}, |
| 66 |
\.{\\def}, etc., has its own special code. The list of command codes above |
| 67 |
includes all possible settings of the |eq_type| field. |
| 68 |
|
| 69 |
\yskip\hangg 3) The |equiv| (a halfword) is the current equivalent value. This |
| 70 |
may be a font number, a pointer into |mem|, or a variety of other things. |
| 71 |
|
| 72 |
Many locations in |eqtb| have symbolic names. The purpose of the next paragraphs |
| 73 |
is to define these names, and to set up the initial values of the equivalents. |
| 74 |
|
| 75 |
In the first region we have a single entry for the `null csname' of length zero. |
| 76 |
In luatex, the active characters and and single-letter control sequence names are |
| 77 |
part of the next region. |
| 78 |
|
| 79 |
Then comes region~2, which corresponds to the hash table that we will define |
| 80 |
later. The maximum address in this region is used for a dummy control sequence |
| 81 |
that is perpetually undefined. There also are several locations for control |
| 82 |
sequences that are perpetually defined (since they are used in error recovery). |
| 83 |
|
| 84 |
@ Region 3 of |eqtb| contains the |number_regs| \.{\\skip} registers, as well as |
| 85 |
the glue parameters defined here. It is important that the ``muskip'' parameters |
| 86 |
have larger numbers than the others. |
| 87 |
|
| 88 |
@ Region 4 of |eqtb| contains the local quantities defined here. The bulk of this |
| 89 |
region is taken up by five tables that are indexed by eight-bit characters; these |
| 90 |
tables are important to both the syntactic and semantic portions of \TeX. There |
| 91 |
are also a bunch of special things like font and token parameters, as well as the |
| 92 |
tables of \.{\\toks} and \.{\\box} registers. |
| 93 |
|
| 94 |
@ Region 5 of |eqtb| contains the integer parameters and registers defined here, |
| 95 |
as well as the |del_code| table. The latter table differs from the |
| 96 |
|cat_code..math_code| tables that precede it, since delimiter codes are fullword |
| 97 |
integers while the other kinds of codes occupy at most a halfword. This is what |
| 98 |
makes region~5 different from region~4. We will store the |eq_level| information |
| 99 |
in an auxiliary array of quarterwords that will be defined later. |
| 100 |
|
| 101 |
@ The integer parameters should really be initialized by a macro package; the |
| 102 |
following initialization does the minimum to keep \TeX\ from complete failure. |
| 103 |
|
| 104 |
@^null delimiter@> |
| 105 |
|
| 106 |
@ The final region of |eqtb| contains the dimension parameters defined here, and |
| 107 |
the |number_regs| \.{\\dimen} registers. |
| 108 |
|
| 109 |
*/ |
| 110 |
|
| 111 |
# define null_cs 1 /* equivalent of \.{\\csname\\endcsname} */ |
| 112 |
# define hash_base (null_cs+1) /* beginning of region 2, for the hash table */ |
| 113 |
# define frozen_control_sequence (hash_base+hash_size) /* for error recovery */ |
| 114 |
# define frozen_protection (frozen_control_sequence) /* inaccessible but definable */ |
| 115 |
# define frozen_cr (frozen_control_sequence+1) /* permanent `\.{\\cr}' */ |
| 116 |
# define frozen_end_group (frozen_control_sequence+2) /* permanent `\.{\\endgroup}' */ |
| 117 |
# define frozen_right (frozen_control_sequence+3) /* permanent `\.{\\right}' */ |
| 118 |
# define frozen_fi (frozen_control_sequence+4) /* permanent `\.{\\fi}' */ |
| 119 |
# define frozen_end_template (frozen_control_sequence+5) /* permanent `\.{\\endtemplate}' */ |
| 120 |
# define frozen_endv (frozen_control_sequence+6) /* second permanent `\.{\\endtemplate}' */ |
| 121 |
# define frozen_relax (frozen_control_sequence+7) /* permanent `\.{\\relax}' */ |
| 122 |
# define end_write (frozen_control_sequence+8) /* permanent `\.{\\endwrite}' */ |
| 123 |
# define frozen_dont_expand (frozen_control_sequence+9 ) /* permanent `\.{\\notexpanded:}' */ |
| 124 |
# define frozen_primitive (frozen_control_sequence+11 ) /* permanent `\.{\\primitive}' */ |
| 125 |
# define frozen_special (frozen_control_sequence+12 ) /* permanent `\.{\\special}' */ |
| 126 |
# define frozen_null_font (frozen_control_sequence+13 ) /* permanent `\.{\\nullfont}' */ |
| 127 |
# define font_id_base (frozen_null_font-font_base ) /* begins table of |number_fonts| permanent font identifiers */ |
| 128 |
# define undefined_control_sequence (frozen_null_font+number_fonts) |
| 129 |
# define glue_base (undefined_control_sequence+1) /* beginning of region 3 */ |
| 130 |
|
| 131 |
# define line_skip_code 0 /* interline glue if |baseline_skip| is infeasible */ |
| 132 |
# define baseline_skip_code 1 /* desired glue between baselines */ |
| 133 |
# define par_skip_code 2 /* extra glue just above a paragraph */ |
| 134 |
# define above_display_skip_code 3 /* extra glue just above displayed math */ |
| 135 |
# define below_display_skip_code 4 /* extra glue just below displayed math */ |
| 136 |
# define above_display_short_skip_code 5 /* glue above displayed math following short lines */ |
| 137 |
# define below_display_short_skip_code 6 /* glue below displayed math following short lines */ |
| 138 |
# define left_skip_code 7 /* glue at left of justified lines */ |
| 139 |
# define right_skip_code 8 /* glue at right of justified lines */ |
| 140 |
# define top_skip_code 9 /* glue at top of main pages */ |
| 141 |
# define split_top_skip_code 10 /* glue at top of split pages */ |
| 142 |
# define tab_skip_code 11 /* glue between aligned entries */ |
| 143 |
# define space_skip_code 12 /* glue between words (if not |zero_glue|) */ |
| 144 |
# define xspace_skip_code 13 /* glue after sentences (if not |zero_glue|) */ |
| 145 |
# define par_fill_skip_code 14 /* glue on last line of paragraph */ |
| 146 |
# define math_skip_code 15 |
| 147 |
# define thin_mu_skip_code 16 /* thin space in math formula */ |
| 148 |
# define med_mu_skip_code 17 /* medium space in math formula */ |
| 149 |
# define thick_mu_skip_code 18 /* thick space in math formula */ |
| 150 |
# define glue_pars 19 /* total number of glue parameters */ |
| 151 |
|
| 152 |
# define skip_base (glue_base+glue_pars) /* table of |number_regs| ``skip'' registers */ |
| 153 |
# define mu_skip_base (skip_base+number_regs) /* table of |number_regs| ``muskip'' registers */ |
| 154 |
# define local_base (mu_skip_base+number_regs) /* beginning of region 4 */ |
| 155 |
|
| 156 |
# define par_shape_loc (local_base) /* specifies paragraph shape */ |
| 157 |
# define output_routine_loc (local_base+1) /* points to token list for \.{\\output} */ |
| 158 |
# define every_par_loc (local_base+2) /* points to token list for \.{\\everypar} */ |
| 159 |
# define every_math_loc (local_base+3) /* points to token list for \.{\\everymath} */ |
| 160 |
# define every_display_loc (local_base+4) /* points to token list for \.{\\everydisplay} */ |
| 161 |
# define every_hbox_loc (local_base+5) /* points to token list for \.{\\everyhbox} */ |
| 162 |
# define every_vbox_loc (local_base+6) /* points to token list for \.{\\everyvbox} */ |
| 163 |
# define every_job_loc (local_base+7) /* points to token list for \.{\\everyjob} */ |
| 164 |
# define every_cr_loc (local_base+8) /* points to token list for \.{\\everycr} */ |
| 165 |
# define err_help_loc (local_base+9) /* points to token list for \.{\\errhelp} */ |
| 166 |
# define every_eof_loc (local_base+10) /* points to token list for \.{\\everyeof} */ |
| 167 |
|
| 168 |
# define backend_toks_base (local_base+11) |
| 169 |
# define backend_toks_last (local_base+20) |
| 170 |
|
| 171 |
# define toks_base (local_base+21) /* table of |number_regs| token list registers */ |
| 172 |
|
| 173 |
# define etex_pen_base (toks_base+number_regs) /* start of table of \eTeX's penalties */ |
| 174 |
# define inter_line_penalties_loc (etex_pen_base) /* additional penalties between lines */ |
| 175 |
# define club_penalties_loc (etex_pen_base+1) /* penalties for creating club lines */ |
| 176 |
# define widow_penalties_loc (etex_pen_base+2) /* penalties for creating widow lines */ |
| 177 |
# define display_widow_penalties_loc (etex_pen_base+3) /* ditto, just before a display */ |
| 178 |
# define etex_pens (etex_pen_base+4) /* end of table of \eTeX's penalties */ |
| 179 |
# define local_left_box_base (etex_pens) |
| 180 |
# define local_right_box_base (local_left_box_base+1) |
| 181 |
# define box_base (local_right_box_base+1) /* table of |number_regs| box registers */ |
| 182 |
# define cur_font_loc (box_base+number_regs) /* internal font number outside math mode */ |
| 183 |
# define internal_math_param_base (cur_font_loc+1 ) /* current math parameter data index */ |
| 184 |
# define cat_code_base (internal_math_param_base+1) /* current category code data index */ |
| 185 |
# define lc_code_base (cat_code_base+1) /* table of |number_chars| lowercase mappings */ |
| 186 |
# define uc_code_base (lc_code_base+1) /* table of |number_chars| uppercase mappings */ |
| 187 |
# define sf_code_base (uc_code_base+1) /* table of |number_chars| spacefactor mappings */ |
| 188 |
# define math_code_base (sf_code_base+1) /* table of |number_chars| math mode mappings */ |
| 189 |
# define int_base (math_code_base+1) /* beginning of region 5 */ |
| 190 |
|
| 191 |
# define pretolerance_code 0 /* badness tolerance before hyphenation */ |
| 192 |
# define tolerance_code 1 /* badness tolerance after hyphenation */ |
| 193 |
# define line_penalty_code 2 /* added to the badness of every line */ |
| 194 |
# define hyphen_penalty_code 3 /* penalty for break after discretionary hyphen */ |
| 195 |
# define ex_hyphen_penalty_code 4 /* penalty for break after explicit hyphen */ |
| 196 |
# define club_penalty_code 5 /* penalty for creating a club line */ |
| 197 |
# define widow_penalty_code 6 /* penalty for creating a widow line */ |
| 198 |
# define display_widow_penalty_code 7 /* ditto, just before a display */ |
| 199 |
# define broken_penalty_code 8 /* penalty for breaking a page at a broken line */ |
| 200 |
# define bin_op_penalty_code 9 /* penalty for breaking after a binary operation */ |
| 201 |
# define rel_penalty_code 10 /* penalty for breaking after a relation */ |
| 202 |
# define pre_display_penalty_code 11 /* penalty for breaking just before a displayed formula */ |
| 203 |
# define post_display_penalty_code 12 /* penalty for breaking just after a displayed formula */ |
| 204 |
# define inter_line_penalty_code 13 /* additional penalty between lines */ |
| 205 |
# define double_hyphen_demerits_code 14 /* demerits for double hyphen break */ |
| 206 |
# define final_hyphen_demerits_code 15 /* demerits for final hyphen break */ |
| 207 |
# define adj_demerits_code 16 /* demerits for adjacent incompatible lines */ |
| 208 |
# define mag_code 17 /* magnification ratio */ |
| 209 |
# define delimiter_factor_code 18 /* ratio for variable-size delimiters */ |
| 210 |
# define looseness_code 19 /* change in number of lines for a paragraph */ |
| 211 |
# define time_code 20 /* current time of day */ |
| 212 |
# define day_code 21 /* current day of the month */ |
| 213 |
# define month_code 22 /* current month of the year */ |
| 214 |
# define year_code 23 /* current year of our Lord */ |
| 215 |
# define show_box_breadth_code 24 /* nodes per level in |show_box| */ |
| 216 |
# define show_box_depth_code 25 /* maximum level in |show_box| */ |
| 217 |
# define hbadness_code 26 /* hboxes exceeding this badness will be shown by |hpack| */ |
| 218 |
# define vbadness_code 27 /* vboxes exceeding this badness will be shown by |vpack| */ |
| 219 |
# define pausing_code 28 /* pause after each line is read from a file */ |
| 220 |
# define tracing_online_code 29 /* show diagnostic output on terminal */ |
| 221 |
# define tracing_macros_code 30 /* show macros as they are being expanded */ |
| 222 |
# define tracing_stats_code 31 /* show memory usage if \TeX\ knows it */ |
| 223 |
# define tracing_paragraphs_code 32 /* show line-break calculations */ |
| 224 |
# define tracing_pages_code 33 /* show page-break calculations */ |
| 225 |
# define tracing_output_code 34 /* show boxes when they are shipped out */ |
| 226 |
# define tracing_lost_chars_code 35 /* show characters that aren't in the font */ |
| 227 |
# define tracing_commands_code 36 /* show command codes at |big_switch| */ |
| 228 |
# define tracing_restores_code 37 /* show equivalents when they are restored */ |
| 229 |
# define uc_hyph_code 38 /* hyphenate words beginning with a capital letter */ |
| 230 |
# define output_penalty_code 39 /* penalty found at current page break */ |
| 231 |
# define max_dead_cycles_code 40 /* bound on consecutive dead cycles of output */ |
| 232 |
# define hang_after_code 41 /* hanging indentation changes after this many lines */ |
| 233 |
# define floating_penalty_code 42 /* penalty for insertions heldover after a split */ |
| 234 |
# define global_defs_code 43 /* override \.{\\global} specifications */ |
| 235 |
# define cur_fam_code 44 /* current family */ |
| 236 |
# define escape_char_code 45 /* escape character for token output */ |
| 237 |
# define default_hyphen_char_code 46 /* value of \.{\\hyphenchar} when a font is loaded */ |
| 238 |
# define default_skew_char_code 47 /* value of \.{\\skewchar} when a font is loaded */ |
| 239 |
# define end_line_char_code 48 /* character placed at the right end of the buffer */ |
| 240 |
# define new_line_char_code 49 /* character that prints as |print_ln| */ |
| 241 |
# define language_code 50 /* current hyphenation table */ |
| 242 |
# define left_hyphen_min_code 51 /* minimum left hyphenation fragment size */ |
| 243 |
# define right_hyphen_min_code 52 /* minimum right hyphenation fragment size */ |
| 244 |
# define holding_inserts_code 53 /* do not remove insertion nodes from \.{\\box255} */ |
| 245 |
# define error_context_lines_code 54 /* maximum intermediate line pairs shown */ |
| 246 |
# define local_inter_line_penalty_code 55 /* local \.{\\interlinepenalty} */ |
| 247 |
# define local_broken_penalty_code 56 /* local \.{\\brokenpenalty} */ |
| 248 |
# define no_local_whatsits_code 57 /* counts local whatsits */ |
| 249 |
# define no_local_dirs_code 58 |
| 250 |
|
| 251 |
# define disable_lig_code 60 |
| 252 |
# define disable_kern_code 61 |
| 253 |
# define disable_space_code 62 |
| 254 |
# define cat_code_table_code 63 |
| 255 |
# define output_box_code 64 |
| 256 |
# define cur_lang_code 65 /* current language id */ |
| 257 |
# define ex_hyphen_char_code 66 |
| 258 |
# define hyphenation_min_code 67 /* minimum word length */ |
| 259 |
# define adjust_spacing_code 68 /* level of spacing adjusting */ |
| 260 |
# define protrude_chars_code 69 /* protrude chars at left/right edge of paragraphs */ |
| 261 |
# define output_mode_code 70 /* switch on PDF output if positive */ |
| 262 |
# define draft_mode_code 71 |
| 263 |
# define tracing_fonts_code 72 |
| 264 |
# define tracing_assigns_code 73 /* show assignments */ |
| 265 |
# define tracing_groups_code 74 /* show save/restore groups */ |
| 266 |
# define tracing_ifs_code 75 /* show conditionals */ |
| 267 |
# define tracing_scan_tokens_code 76 /* show pseudo file open and close */ |
| 268 |
# define tracing_nesting_code 77 /* show incomplete groups and ifs within files */ |
| 269 |
# define pre_display_direction_code 78 /* text direction preceding a display */ |
| 270 |
# define last_line_fit_code 79 /* adjustment for last line of paragraph */ |
| 271 |
# define saving_vdiscards_code 80 /* save items discarded from vlists */ |
| 272 |
# define saving_hyph_codes_code 81 /* save hyphenation codes for languages */ |
| 273 |
# define suppress_fontnotfound_error_code 82 /* suppress errors for missing fonts */ |
| 274 |
# define suppress_long_error_code 83 /* suppress errors for missing fonts */ |
| 275 |
# define suppress_ifcsname_error_code 84 /* suppress errors for failed \.{\\ifcsname} */ |
| 276 |
# define suppress_outer_error_code 85 /* suppress errors for \.{\\outer} */ |
| 277 |
# define suppress_mathpar_error_code 86 /* suppress errors for \.{\\par}} in math */ |
| 278 |
# define math_eqno_gap_step_code 87 /* factor/1000 used for distance between eq and eqno */ |
| 279 |
# define math_display_skip_mode_code 88 |
| 280 |
# define math_scripts_mode_code 89 |
| 281 |
# define math_nolimits_mode_code 90 /* obsolete */ |
| 282 |
# define math_rules_mode_code 91 |
| 283 |
# define math_rules_fam_code 92 |
| 284 |
# define math_italics_mode_code 93 /* obsolete */ |
| 285 |
# define synctex_code 94 /* is synctex file generation enabled ? */ |
| 286 |
# define shape_mode_code 95 |
| 287 |
# define first_valid_language_code 96 |
| 288 |
# define hyphenation_bounds_code 97 |
| 289 |
# define math_skip_mode_code 98 |
| 290 |
# define math_pre_display_gap_factor_code 99 |
| 291 |
# define hyphen_penalty_mode_code 100 |
| 292 |
# define automatic_hyphen_penalty_code 101 |
| 293 |
# define explicit_hyphen_penalty_code 102 |
| 294 |
# define automatic_hyphen_mode_code 103 |
| 295 |
# define compound_hyphen_mode_code 104 |
| 296 |
# define break_after_dir_mode_code 105 |
| 297 |
# define exception_penalty_code 106 |
| 298 |
|
| 299 |
# define pre_bin_op_penalty_code 107 |
| 300 |
# define pre_rel_penalty_code 108 |
| 301 |
# define math_penalties_mode_code 109 |
| 302 |
# define math_delimiters_mode_code 110 |
| 303 |
# define math_script_box_mode_code 111 /* obsolete */ |
| 304 |
# define math_script_char_mode_code 112 /* obsolete */ |
| 305 |
# define math_rule_thickness_mode_code 113 |
| 306 |
# define math_flatten_mode_code 114 |
| 307 |
|
| 308 |
# define copy_lua_input_nodes_code 115 |
| 309 |
# define suppress_primitive_error_code 116 |
| 310 |
# define fixup_boxes_code 117 |
| 311 |
# define glyph_dimensions_code 118 |
| 312 |
# define math_defaults_mode_code 119 /* > 0 : latex preferences */ |
| 313 |
# define discretionary_ligature_mode_code 120 |
| 314 |
# define partoken_context_code 121 |
| 315 |
# define show_stream_code 122 |
| 316 |
# define math_eq_dir_mode_code 123 |
| 317 |
# define var_fam_code 124 |
| 318 |
# define ignore_primitive_error_code 125 /*ignore some primitive/engine errors*/ |
| 319 |
# define math_empty_display_mode_code 126 |
| 320 |
|
| 321 |
# define backend_int_base_code (math_empty_display_mode_code+1) |
| 322 |
# define backend_int_last_code (backend_int_base_code+32) /* we need some 25 but take some slack */ |
| 323 |
|
| 324 |
# define tex_int_pars (backend_int_last_code+1) /* total number of integer parameters */ |
| 325 |
|
| 326 |
# define backend_int_base (int_base+backend_int_base_code) |
| 327 |
# define backend_int_last (int_base+backend_int_last_code) |
| 328 |
|
| 329 |
# define page_direction_code (tex_int_pars) |
| 330 |
# define body_direction_code (tex_int_pars+1) |
| 331 |
# define par_direction_code (tex_int_pars+2) |
| 332 |
# define text_direction_code (tex_int_pars+3) |
| 333 |
# define math_direction_code (tex_int_pars+4) |
| 334 |
# define line_direction_code (tex_int_pars+5) /* gets remapped so is no real register */ |
| 335 |
|
| 336 |
# define int_pars (tex_int_pars+5) /* total number of integer parameters */ |
| 337 |
|
| 338 |
# define dir_base (int_base+tex_int_pars) |
| 339 |
# define count_base (int_base+int_pars) /* |number_regs| user \.{\\count} registers */ |
| 340 |
# define attribute_base (count_base+number_regs) /* |number_attrs| user \.{\\attribute} registers */ |
| 341 |
# define del_code_base (attribute_base+number_attrs) /* |number_chars| delimiter code mappings */ |
| 342 |
# define dimen_base (del_code_base+1) /* beginning of region 6 */ |
| 343 |
|
| 344 |
# define par_indent_code 0 /* indentation of paragraphs */ |
| 345 |
# define math_surround_code 1 /* space around math in text */ |
| 346 |
# define line_skip_limit_code 2 /* threshold for |line_skip| instead of |baseline_skip| */ |
| 347 |
# define hsize_code 3 /* line width in horizontal mode */ |
| 348 |
# define vsize_code 4 /* page height in vertical mode */ |
| 349 |
# define max_depth_code 5 /* maximum depth of boxes on main pages */ |
| 350 |
# define split_max_depth_code 6 /* maximum depth of boxes on split pages */ |
| 351 |
# define box_max_depth_code 7 /* maximum depth of explicit vboxes */ |
| 352 |
# define hfuzz_code 8 /* tolerance for overfull hbox messages */ |
| 353 |
# define vfuzz_code 9 /* tolerance for overfull vbox messages */ |
| 354 |
# define delimiter_shortfall_code 10 /* maximum amount uncovered by variable delimiters */ |
| 355 |
# define null_delimiter_space_code 11 /* blank space in null delimiters */ |
| 356 |
# define script_space_code 12 /* extra space after subscript or superscript */ |
| 357 |
# define pre_display_size_code 13 /* length of text preceding a display */ |
| 358 |
# define display_width_code 14 /* length of line for displayed equation */ |
| 359 |
# define display_indent_code 15 /* indentation of line for displayed equation */ |
| 360 |
# define overfull_rule_code 16 /* width of rule that identifies overfull hboxes */ |
| 361 |
# define hang_indent_code 17 /* amount of hanging indentation */ |
| 362 |
# define h_offset_code 18 /* amount of horizontal offset when shipping pages out */ |
| 363 |
# define v_offset_code 19 /* amount of vertical offset when shipping pages out */ |
| 364 |
# define emergency_stretch_code 20 /* reduces badnesses on final pass of line-breaking */ |
| 365 |
# define page_left_offset_code 21 |
| 366 |
# define page_top_offset_code 22 |
| 367 |
# define page_right_offset_code 23 |
| 368 |
# define page_bottom_offset_code 24 |
| 369 |
# define px_dimen_code 25 |
| 370 |
# define page_width_code 26 /* page width of the output */ |
| 371 |
# define page_height_code 27 /* page height of the output */ |
| 372 |
|
| 373 |
# define backend_dimen_base (dimen_base+28) |
| 374 |
# define backend_dimen_last (dimen_base+37) |
| 375 |
|
| 376 |
# define dimen_pars (38) /* total number of dimension parameters */ |
| 377 |
|
| 378 |
# define scaled_base (dimen_base+dimen_pars) /* table of |number_regs| user-defined \.{\\dimen} registers */ |
| 379 |
# define eqtb_size (scaled_base+biggest_reg) /* largest subscript of |eqtb| */ |
| 380 |
|
| 381 |
extern memory_word *eqtb; |
| 382 |
|
| 383 |
extern halfword eqtb_top; /* maximum of the |eqtb| */ |
| 384 |
|
| 385 |
extern quarterword xeq_level[(eqtb_size + 1)]; |
| 386 |
extern void initialize_equivalents(void); |
| 387 |
|
| 388 |
# define eq_level_field(A) (A).hh.b1 |
| 389 |
# define eq_type_field(A) (A).hh.b0 |
| 390 |
# define equiv_field(A) (A).hh.rh |
| 391 |
|
| 392 |
# define eq_level(A) eq_level_field(eqtb[(A)]) /* level of definition */ |
| 393 |
# define eq_type(A) eq_type_field(eqtb[(A)]) /* command code for equivalent */ |
| 394 |
# define equiv(A) equiv_field(eqtb[(A)]) /* equivalent value */ |
| 395 |
|
| 396 |
# define set_eq_level(A,B) eq_level((A)) = (B) |
| 397 |
# define set_eq_type(A,B) eq_type((A)) = (B) |
| 398 |
# define set_equiv(A,B) equiv((A)) = (B) |
| 399 |
|
| 400 |
typedef struct save_record_ { |
| 401 |
quarterword type_; |
| 402 |
quarterword level_; |
| 403 |
memory_word word_; |
| 404 |
} save_record; |
| 405 |
|
| 406 |
extern save_record *save_stack; |
| 407 |
extern int save_ptr; /* first unused entry on |save_stack| */ |
| 408 |
extern int max_save_stack; /* maximum usage of save stack */ |
| 409 |
extern quarterword cur_level; /* current nesting level for groups */ |
| 410 |
extern group_code cur_group; /* current group type */ |
| 411 |
extern int cur_boundary; /* where the current level begins */ |
| 412 |
|
| 413 |
# define save_type(A) save_stack[(A)].type_ /* classifies a |save_stack| entry */ |
| 414 |
# define save_level(A) save_stack[(A)].level_ /* saved level for regions 5 and 6, or group code */ |
| 415 |
# define save_value(A) save_stack[(A)].word_.cint /* |eqtb| location or token or |save_stack| location */ |
| 416 |
# define save_word(A) save_stack[(A)].word_ /* |eqtb| entry */ |
| 417 |
|
| 418 |
/* |
| 419 |
|
| 420 |
We use the notation |saved(k)| to stand for an item that appears in location |
| 421 |
|save_ptr+k| of the save stack. |
| 422 |
|
| 423 |
*/ |
| 424 |
|
| 425 |
# define saved_type(A) save_stack[save_ptr+(A)].type_ |
| 426 |
# define saved_level(A) save_stack[save_ptr+(A)].level_ |
| 427 |
# define saved_value(A) save_stack[save_ptr+(A)].word_.cint |
| 428 |
|
| 429 |
# define set_saved_record(A,B,C,D) do { \ |
| 430 |
saved_type(A) = (quarterword)(B); \ |
| 431 |
saved_level(A) = (quarterword)(C); \ |
| 432 |
saved_value(A) = (D); \ |
| 433 |
} while (0) |
| 434 |
|
| 435 |
# define restore_old_value 0 /* |save_type| when a value should be restored later */ |
| 436 |
# define restore_zero 1 /* |save_type| when an undefined entry should be restored */ |
| 437 |
# define insert_token 2 /* |save_type| when a token is being saved for later use */ |
| 438 |
# define level_boundary 3 /* |save_type| corresponding to beginning of group */ |
| 439 |
# define saved_line 4 |
| 440 |
# define saved_adjust 5 |
| 441 |
# define saved_insert 6 |
| 442 |
# define saved_disc 7 |
| 443 |
# define saved_boxtype 8 |
| 444 |
# define saved_textdir 9 |
| 445 |
# define saved_eqno 10 |
| 446 |
# define saved_choices 11 |
| 447 |
# define saved_math 12 |
| 448 |
# define saved_boxcontext 13 |
| 449 |
# define saved_boxspec 14 |
| 450 |
# define saved_boxdir 15 |
| 451 |
# define saved_boxattr 16 |
| 452 |
# define saved_boxpack 17 |
| 453 |
# define saved_attrlist 18 |
| 454 |
# define saved_eqtb 19 |
| 455 |
|
| 456 |
extern void print_save_stack(void); |
| 457 |
|
| 458 |
# define int_par(A) eqtb[int_base+(A)].cint |
| 459 |
# define dimen_par(A) eqtb[dimen_base+(A)].cint |
| 460 |
# define loc_par(A) equiv(local_base+(A)) |
| 461 |
# define glue_par(A) equiv(glue_base+(A)) |
| 462 |
|
| 463 |
/* if nonzero, this magnification should be used henceforth */ |
| 464 |
|
| 465 |
extern int mag_set; |
| 466 |
extern void prepare_mag(void); |
| 467 |
|
| 468 |
/* |
| 469 |
|
| 470 |
@ Here are the group codes that are used to discriminate between different kinds |
| 471 |
of groups. They allow \TeX\ to decide what special actions, if any, should be |
| 472 |
performed when a group ends. \def\grp{\.{\char'173...\char'175}} |
| 473 |
|
| 474 |
Some groups are not supposed to be ended by right braces. For example, the `\.\$' |
| 475 |
that begins a math formula causes a |math_shift_group| to be started, and this |
| 476 |
should be terminated by a matching `\.\$'. Similarly, a group that starts with |
| 477 |
\.{\\left} should end with \.{\\right}, and one that starts with \.{\\begingroup} |
| 478 |
should end with \.{\\endgroup}. |
| 479 |
|
| 480 |
*/ |
| 481 |
|
| 482 |
typedef enum { |
| 483 |
bottom_level = 0, /* group code for the outside world */ |
| 484 |
simple_group, /* group code for local structure only */ |
| 485 |
hbox_group, /* code for `\.{\\hbox}\grp' */ |
| 486 |
adjusted_hbox_group, /* code for `\.{\\hbox}\grp' in vertical mode */ |
| 487 |
vbox_group, /* code for `\.{\\vbox}\grp' */ |
| 488 |
vtop_group, /* code for `\.{\\vtop}\grp' */ |
| 489 |
align_group, /* code for `\.{\\halign}\grp', `\.{\\valign}\grp' */ |
| 490 |
no_align_group, /* code for `\.{\\noalign}\grp' */ |
| 491 |
output_group, /* code for output routine */ |
| 492 |
math_group, /* code for, e.g., `\.{\char'136}\grp' */ |
| 493 |
disc_group, /* code for `\.{\\discretionary}\grp\grp\grp' */ |
| 494 |
insert_group, /* code for `\.{\\insert}\grp', `\.{\\vadjust}\grp' */ |
| 495 |
vcenter_group, /* code for `\.{\\vcenter}\grp' */ |
| 496 |
math_choice_group, /* code for `\.{\\mathchoice}\grp\grp\grp\grp' */ |
| 497 |
semi_simple_group, /* code for `\.{\\begingroup...\\endgroup}' */ |
| 498 |
math_shift_group, /* code for `\.{\$...\$}' */ |
| 499 |
math_left_group, /* code for `\.{\\left...\\right}' */ |
| 500 |
local_box_group, /* code for `\.{\\localleftbox...\\localrightbox}' */ |
| 501 |
split_off_group, /* box code for the top part of a \.{\\vsplit} */ |
| 502 |
split_keep_group, /* box code for the bottom part of a \.{\\vsplit} */ |
| 503 |
preamble_group, /* box code for the preamble processing in an alignment */ |
| 504 |
align_set_group, /* box code for the final item pass in an alignment */ |
| 505 |
fin_row_group /* box code for a provisory line in an alignment */ |
| 506 |
} tex_group_codes; |
| 507 |
|
| 508 |
typedef enum { |
| 509 |
new_graf_par_code = 0, |
| 510 |
local_box_par_code, |
| 511 |
hmode_par_par_code, |
| 512 |
penalty_par_code, |
| 513 |
math_par_code, |
| 514 |
} tex_par_codes ; |
| 515 |
|
| 516 |
typedef enum { |
| 517 |
display_style = 0, /* |subtype| for \.{\\displaystyle} */ |
| 518 |
cramped_display_style, /* |subtype| for \.{\\crampeddisplaystyle} */ |
| 519 |
text_style, /* |subtype| for \.{\\textstyle} */ |
| 520 |
cramped_text_style, /* |subtype| for \.{\\crampedtextstyle} */ |
| 521 |
script_style, /* |subtype| for \.{\\scriptstyle} */ |
| 522 |
cramped_script_style, /* |subtype| for \.{\\crampedscriptstyle} */ |
| 523 |
script_script_style, /* |subtype| for \.{\\scriptscriptstyle} */ |
| 524 |
cramped_script_script_style, /* |subtype| for \.{\\crampedscriptscriptstyle} */ |
| 525 |
} math_style_subtypes; |
| 526 |
|
| 527 |
typedef enum { /* this could move to directions.h */ |
| 528 |
dir_TLT = 0, |
| 529 |
dir_TRT, |
| 530 |
dir_LTL, |
| 531 |
dir_RTT, |
| 532 |
} dir_codes; |
| 533 |
|
| 534 |
# define max_group_code local_box_group /* which is wrong, but is what the web says */ |
| 535 |
|
| 536 |
extern int cur_cmd; /* current command set by |get_next| */ |
| 537 |
extern halfword cur_chr; /* operand of current command */ |
| 538 |
extern halfword cur_cs; /* control sequence found here, zero if none found */ |
| 539 |
extern halfword cur_tok; /* packed representative of |cur_cmd| and |cur_chr| */ |
| 540 |
|
| 541 |
extern void show_cur_cmd_chr(void); |
| 542 |
|
| 543 |
extern void new_save_level(group_code c); /* begin a new level of grouping */ |
| 544 |
extern void eq_destroy(memory_word w); /* gets ready to forget |w| */ |
| 545 |
extern void eq_save(halfword p, quarterword l); /* saves |eqtb[p]| */ |
| 546 |
extern void eq_define(halfword p, quarterword t, halfword e); /* new data for |eqtb| */ |
| 547 |
extern void eq_word_define(halfword p, int w); |
| 548 |
extern void geq_define(halfword p, quarterword t, halfword e); /* global |eq_define| */ |
| 549 |
extern void geq_word_define(halfword p, int w); /* global |eq_word_define| */ |
| 550 |
extern void save_for_after(halfword t); |
| 551 |
extern void unsave(void); /* pops the top level off the save stack */ |
| 552 |
extern void show_save_groups(void); |
| 553 |
|
| 554 |
# define level_zero 0 /* level for undefined quantities */ |
| 555 |
# define level_one 1 /* outermost level for defined quantities */ |
| 556 |
|
| 557 |
extern void show_eqtb(halfword n); |
| 558 |
|
| 559 |
/* \csname \ifcsname */ |
| 560 |
|
| 561 |
extern halfword last_cs_name; |
| 562 |
|
| 563 |
/* |
| 564 |
The *_par macros expand to the variables that are (in most cases) also accessible |
| 565 |
at the users end. Most are registers but some are in the (stack) lists. |
| 566 |
|
| 567 |
More *_par will move here : there is no real need for thse macros but because there |
| 568 |
were already a bunch and because they were defined all over the place we moved them |
| 569 |
here. |
| 570 |
|
| 571 |
*/ |
| 572 |
|
| 573 |
#define space_skip_par glue_par(space_skip_code) |
| 574 |
#define xspace_skip_par glue_par(xspace_skip_code) |
| 575 |
#define math_skip_par glue_par(math_skip_code) |
| 576 |
#define math_skip_mode int_par(math_skip_mode_code) |
| 577 |
|
| 578 |
#define pre_display_size_par dimen_par(pre_display_size_code) |
| 579 |
#define display_width_par dimen_par(display_width_code) |
| 580 |
#define display_indent_par dimen_par(display_indent_code) |
| 581 |
#define math_surround_par dimen_par(math_surround_code) |
| 582 |
|
| 583 |
#define display_skip_mode_par int_par(math_display_skip_mode_code) |
| 584 |
#define math_eqno_gap_step_par int_par(math_eqno_gap_step_code) |
| 585 |
|
| 586 |
#define body_direction_par int_par(body_direction_code) |
| 587 |
#define page_direction_par int_par(page_direction_code) |
| 588 |
#define par_direction_par int_par(par_direction_code) |
| 589 |
#define text_direction_par int_par(text_direction_code) |
| 590 |
#define math_direction_par int_par(math_direction_code) |
| 591 |
|
| 592 |
#define shape_mode_par int_par(shape_mode_code) |
| 593 |
#define hyphenation_bounds_par int_par(hyphenation_bounds_code) |
| 594 |
#define first_valid_language_par int_par(first_valid_language_code) |
| 595 |
|
| 596 |
#define hsize_par dimen_par(hsize_code) |
| 597 |
#define vsize_par dimen_par(vsize_code) |
| 598 |
#define hfuzz_par dimen_par(hfuzz_code) |
| 599 |
#define vfuzz_par dimen_par(vfuzz_code) |
| 600 |
#define hbadness_par int_par(hbadness_code) |
| 601 |
#define vbadness_par int_par(vbadness_code) |
| 602 |
|
| 603 |
#define baseline_skip_par glue_par(baseline_skip_code) |
| 604 |
#define par_indent_par dimen_par(par_indent_code) |
| 605 |
#define hang_indent_par dimen_par(hang_indent_code) |
| 606 |
#define hang_after_par int_par(hang_after_code) |
| 607 |
#define left_skip_par glue_par(left_skip_code) |
| 608 |
#define right_skip_par glue_par(right_skip_code) |
| 609 |
|
| 610 |
#define emergency_stretch_par dimen_par(emergency_stretch_code) |
| 611 |
#define pretolerance_par int_par(pretolerance_code) |
| 612 |
#define tolerance_par int_par(tolerance_code) |
| 613 |
#define looseness_par int_par(looseness_code) |
| 614 |
#define adjust_spacing_par int_par(adjust_spacing_code) |
| 615 |
#define adj_demerits_par int_par(adj_demerits_code) |
| 616 |
#define protrude_chars_par int_par(protrude_chars_code) |
| 617 |
#define line_penalty_par int_par(line_penalty_code) |
| 618 |
#define last_line_fit_par int_par(last_line_fit_code) |
| 619 |
#define double_hyphen_demerits_par int_par(double_hyphen_demerits_code) |
| 620 |
#define final_hyphen_demerits_par int_par(final_hyphen_demerits_code) |
| 621 |
#define inter_line_penalty_par int_par(inter_line_penalty_code) |
| 622 |
#define club_penalty_par int_par(club_penalty_code) |
| 623 |
#define broken_penalty_par int_par(broken_penalty_code) |
| 624 |
#define display_widow_penalty_par int_par(display_widow_penalty_code) |
| 625 |
#define widow_penalty_par int_par(widow_penalty_code) |
| 626 |
#define line_skip_limit_par dimen_par(line_skip_limit_code) |
| 627 |
|
| 628 |
#define delimiter_shortfall_par dimen_par(delimiter_shortfall_code) |
| 629 |
#define null_delimiter_space_par dimen_par(null_delimiter_space_code) |
| 630 |
#define script_space_par dimen_par(script_space_code) |
| 631 |
#define max_depth_par dimen_par(max_depth_code) |
| 632 |
#define box_max_depth_par dimen_par(box_max_depth_code) |
| 633 |
#define split_max_depth_par dimen_par(split_max_depth_code) |
| 634 |
#define overfull_rule_par dimen_par(overfull_rule_code) |
| 635 |
#define box_max_depth_par dimen_par(box_max_depth_code) |
| 636 |
#define top_skip_par glue_par(top_skip_code) |
| 637 |
#define split_top_skip_par glue_par(split_top_skip_code) |
| 638 |
|
| 639 |
#define cur_fam_par int_par(cur_fam_code) |
| 640 |
#define var_fam_par int_par(var_fam_code) |
| 641 |
#define pre_display_direction_par int_par(pre_display_direction_code) |
| 642 |
#define pre_display_penalty_par int_par(pre_display_penalty_code) |
| 643 |
#define post_display_penalty_par int_par(post_display_penalty_code) |
| 644 |
|
| 645 |
#define cur_fam_par_in_range ((cur_fam_par>=0)&&(cur_fam_par<256)) |
| 646 |
#define var_fam_par_in_range ((var_fam_par>=0)&&(var_fam_par<256)) |
| 647 |
|
| 648 |
#define local_inter_line_penalty_par int_par(local_inter_line_penalty_code) |
| 649 |
#define local_broken_penalty_par int_par(local_broken_penalty_code) |
| 650 |
#define local_left_box_par equiv(local_left_box_base) |
| 651 |
#define local_right_box_par equiv(local_right_box_base) |
| 652 |
|
| 653 |
#define end_line_char_par int_par(end_line_char_code) |
| 654 |
#define new_line_char_par int_par(new_line_char_code) |
| 655 |
#define escape_char_par int_par(escape_char_code) |
| 656 |
|
| 657 |
#define end_line_char_inactive ((end_line_char_par < 0) || (end_line_char_par > 127)) |
| 658 |
|
| 659 |
#define delimiter_factor_par int_par(delimiter_factor_code) |
| 660 |
#define bin_op_penalty_par int_par(bin_op_penalty_code) |
| 661 |
#define rel_penalty_par int_par(rel_penalty_code) |
| 662 |
#define pre_bin_op_penalty_par int_par(pre_bin_op_penalty_code) |
| 663 |
#define pre_rel_penalty_par int_par(pre_rel_penalty_code) |
| 664 |
#define math_penalties_mode_par int_par(math_penalties_mode_code) |
| 665 |
#define null_delimiter_space_par dimen_par(null_delimiter_space_code) |
| 666 |
#define disable_lig_par int_par(disable_lig_code) |
| 667 |
#define disable_kern_par int_par(disable_kern_code) |
| 668 |
#define disable_space_par int_par(disable_space_code) |
| 669 |
#define math_scripts_mode_par int_par(math_scripts_mode_code) |
| 670 |
#define math_rules_mode_par int_par(math_rules_mode_code) |
| 671 |
#define math_rules_fam_par int_par(math_rules_fam_code) |
| 672 |
|
| 673 |
#define thin_mu_skip_par glue_par(thin_mu_skip_code) |
| 674 |
#define med_mu_skip_par glue_par(med_mu_skip_code) |
| 675 |
#define thick_mu_skip_par glue_par(thick_mu_skip_code) |
| 676 |
|
| 677 |
#define every_math_par equiv(every_math_loc) |
| 678 |
#define every_display_par equiv(every_display_loc) |
| 679 |
#define every_cr_par equiv(every_cr_loc) |
| 680 |
#define every_hbox_par equiv(every_hbox_loc) |
| 681 |
#define every_vbox_par equiv(every_vbox_loc) |
| 682 |
#define every_eof_par equiv(every_eof_loc) |
| 683 |
#define every_par_par equiv(every_par_loc) |
| 684 |
#define err_help_par equiv(err_help_loc) |
| 685 |
|
| 686 |
#define no_local_whatsits_par int_par(no_local_whatsits_code) |
| 687 |
#define no_local_dirs_par int_par(no_local_dirs_code) |
| 688 |
|
| 689 |
#define prev_depth_par cur_list.prev_depth_field |
| 690 |
#define prev_graf_par cur_list.pg_field |
| 691 |
#define tail_par cur_list.tail_field |
| 692 |
#define head_par cur_list.head_field |
| 693 |
#define mode_par cur_list.mode_field |
| 694 |
#define dirs_par cur_list.dirs_field |
| 695 |
#define space_factor_par cur_list.space_factor_field |
| 696 |
#define incompleat_noad_par cur_list.incompleat_noad_field |
| 697 |
#define mode_line_par cur_list.ml_field |
| 698 |
#define aux_par cur_list.eTeX_aux_field |
| 699 |
#define delim_par aux_par |
| 700 |
|
| 701 |
#define par_shape_par_ptr equiv(par_shape_loc) |
| 702 |
#define inter_line_penalties_par_ptr equiv(inter_line_penalties_loc) |
| 703 |
#define club_penalties_par_ptr equiv(club_penalties_loc) |
| 704 |
#define widow_penalties_par_ptr equiv(widow_penalties_loc) |
| 705 |
#define display_widow_penalties_par_ptr equiv(display_widow_penalties_loc) |
| 706 |
|
| 707 |
#define page_width_par dimen_par(page_width_code) |
| 708 |
#define page_height_par dimen_par(page_height_code) |
| 709 |
#define h_offset_par dimen_par(h_offset_code) |
| 710 |
#define v_offset_par dimen_par(v_offset_code) |
| 711 |
#define page_left_offset_par dimen_par(page_left_offset_code) |
| 712 |
#define page_top_offset_par dimen_par(page_top_offset_code) |
| 713 |
#define page_right_offset_par dimen_par(page_right_offset_code) |
| 714 |
#define page_bottom_offset_par dimen_par(page_bottom_offset_code) |
| 715 |
#define px_dimen_par dimen_par(px_dimen_code) |
| 716 |
|
| 717 |
#define max_dead_cycles_par int_par(max_dead_cycles_code) |
| 718 |
#define output_box_par int_par(output_box_code) |
| 719 |
#define holding_inserts_par int_par(holding_inserts_code) |
| 720 |
#define output_routine_par equiv(output_routine_loc) |
| 721 |
#define floating_penalty_par int_par(floating_penalty_code) |
| 722 |
|
| 723 |
#define mag_par int_par(mag_code) |
| 724 |
|
| 725 |
#define global_defs_par int_par(global_defs_code) |
| 726 |
#define cat_code_table_par int_par(cat_code_table_code) |
| 727 |
#define saving_vdiscards_par int_par(saving_vdiscards_code) |
| 728 |
|
| 729 |
#define tracing_output_par int_par(tracing_output_code) |
| 730 |
#define tracing_stats_par int_par(tracing_stats_code) |
| 731 |
#define tracing_online_par int_par(tracing_online_code) |
| 732 |
#define tracing_paragraphs_par int_par(tracing_paragraphs_code) |
| 733 |
#define tracing_nesting_par int_par(tracing_nesting_code) |
| 734 |
#define tracing_lost_chars_par int_par(tracing_lost_chars_code) |
| 735 |
#define tracing_scan_tokens_par int_par(tracing_scan_tokens_code) |
| 736 |
#define tracing_ifs_par int_par(tracing_ifs_code) |
| 737 |
#define tracing_commands_par int_par(tracing_commands_code) |
| 738 |
#define tracing_macros_par int_par(tracing_macros_code) |
| 739 |
#define tracing_assigns_par int_par(tracing_assigns_code) |
| 740 |
#define tracing_fonts_par int_par(tracing_fonts_code) |
| 741 |
#define tracing_pages_par int_par(tracing_pages_code) |
| 742 |
#define tracing_restores_par int_par(tracing_restores_code) |
| 743 |
#define tracing_groups_par int_par(tracing_groups_code) |
| 744 |
|
| 745 |
#define show_box_depth_par int_par(show_box_depth_code) |
| 746 |
#define show_box_breadth_par int_par(show_box_breadth_code) |
| 747 |
|
| 748 |
#define pausing_par int_par(pausing_code) |
| 749 |
|
| 750 |
#define suppress_outer_error_par int_par(suppress_outer_error_code) |
| 751 |
#define suppress_long_error_par int_par(suppress_long_error_code) |
| 752 |
#define suppress_mathpar_error_par int_par(suppress_mathpar_error_code) |
| 753 |
#define suppress_fontnotfound_error_par int_par(suppress_fontnotfound_error_code) |
| 754 |
#define suppress_ifcsname_error_par int_par(suppress_ifcsname_error_code) |
| 755 |
#define suppress_primitive_error_par int_par(suppress_primitive_error_code) |
| 756 |
#define error_context_lines_par int_par(error_context_lines_code) |
| 757 |
#define copy_lua_input_nodes_par int_par(copy_lua_input_nodes_code) |
| 758 |
|
| 759 |
#define math_pre_display_gap_factor_par int_par(math_pre_display_gap_factor_code) |
| 760 |
|
| 761 |
#define time_par int_par(time_code) |
| 762 |
#define day_par int_par(day_code) |
| 763 |
#define month_par int_par(month_code) |
| 764 |
#define year_par int_par(year_code) |
| 765 |
|
| 766 |
#define output_mode_par int_par(output_mode_code) |
| 767 |
#define draft_mode_par int_par(draft_mode_code) |
| 768 |
#define synctex_par int_par(synctex_code) |
| 769 |
|
| 770 |
#define language_par int_par(language_code) |
| 771 |
#define uc_hyph_par int_par(uc_hyph_code) |
| 772 |
#define left_hyphen_min_par int_par(left_hyphen_min_code) |
| 773 |
#define right_hyphen_min_par int_par(right_hyphen_min_code) |
| 774 |
#define ex_hyphen_char_par int_par(ex_hyphen_char_code) |
| 775 |
#define hyphen_penalty_par int_par(hyphen_penalty_code) |
| 776 |
#define ex_hyphen_penalty_par int_par(ex_hyphen_penalty_code) |
| 777 |
#define default_hyphen_char_par int_par(default_hyphen_char_code) |
| 778 |
#define default_skew_char_par int_par(default_skew_char_code) |
| 779 |
#define saving_hyph_codes_par int_par(saving_hyph_codes_code) |
| 780 |
#define ignore_primitive_error_par int_par(ignore_primitive_error_code) |
| 781 |
|
| 782 |
#define hyphen_penalty_mode_par int_par(hyphen_penalty_mode_code) |
| 783 |
#define automatic_hyphen_penalty_par int_par(automatic_hyphen_penalty_code) |
| 784 |
#define explicit_hyphen_penalty_par int_par(explicit_hyphen_penalty_code) |
| 785 |
#define automatic_hyphen_mode_par int_par(automatic_hyphen_mode_code) |
| 786 |
#define compound_hyphen_mode_par int_par(compound_hyphen_mode_code) |
| 787 |
#define break_after_dir_mode_par int_par(break_after_dir_mode_code) |
| 788 |
#define exception_penalty_par int_par(exception_penalty_code) |
| 789 |
|
| 790 |
#define cur_lang_par int_par(cur_lang_code) |
| 791 |
#define cur_font_par equiv(cur_font_loc) |
| 792 |
|
| 793 |
#define fixup_boxes_par int_par(fixup_boxes_code) |
| 794 |
#define glyph_dimensions_par int_par(glyph_dimensions_code) |
| 795 |
#define math_eq_dir_mode_par int_par(math_eq_dir_mode_code) |
| 796 |
#define discretionary_ligature_mode_par int_par(discretionary_ligature_mode_code) |
| 797 |
#define partoken_context_code_par int_par(partoken_context_code) |
| 798 |
|
| 799 |
#define show_stream_par int_par(show_stream_code) |
| 800 |
|
| 801 |
#define math_empty_display_mode_par int_par(math_empty_display_mode_code) |
| 802 |
|
| 803 |
/* */ |
| 804 |
|
| 805 |
#define math_use_current_family_code 7 |
| 806 |
|
| 807 |
/* obsolete */ |
| 808 |
|
| 809 |
#define math_italics_mode_par int_par(math_italics_mode_code) |
| 810 |
#define math_script_char_mode_par int_par(math_script_char_mode_code) |
| 811 |
#define math_script_box_mode_par int_par(math_script_box_mode_code) |
| 812 |
#define math_nolimits_mode_par int_par(math_nolimits_mode_code) |
| 813 |
#define math_flatten_mode_par int_par(math_flatten_mode_code) |
| 814 |
#define math_defaults_mode_par int_par(math_defaults_mode_code) |
| 815 |
#define math_rule_thickness_mode_par int_par(math_rule_thickness_mode_code) |
| 816 |
#define math_delimiters_mode_par int_par(math_delimiters_mode_code) |
| 817 |
|
| 818 |
/* |
| 819 |
#define box(A) equiv(box_base+(A)) |
| 820 |
#define box(A) eqtb[box_base+(A)].hh.rh |
| 821 |
*/ |
| 822 |
|
| 823 |
#define attribute(A) equiv(attribute_base+(A)) |
| 824 |
#define box(A) equiv(box_base+(A)) |
| 825 |
#define count(A) equiv(count_base+(A)) |
| 826 |
#define dimen(A) equiv(scaled_base+(A)) |
| 827 |
#define mu_skip(A) equiv(mu_skip_base+(A)) |
| 828 |
#define skip(A) equiv(skip_base+(A)) |
| 829 |
#define toks(A) equiv(toks_base+(A)) |
| 830 |
|
| 831 |
#define get_tex_attribute_register(j) attribute(j) |
| 832 |
#define get_tex_box_register(j) box(j) |
| 833 |
#define get_tex_count_register(j) count(j) |
| 834 |
#define get_tex_dimen_register(j) dimen(j) |
| 835 |
#define get_tex_mu_skip_register(j) mu_skip(j) |
| 836 |
#define get_tex_skip_register(j) skip(j) |
| 837 |
|
| 838 |
#define font_id_text(A) cs_text(font_id_base+(A)) |
| 839 |
|
| 840 |
#define end_template_token (cs_token_flag+frozen_end_template) |
| 841 |
#define end_write_token (cs_token_flag+end_write) |
| 842 |
|
| 843 |
/* for now here */ |
| 844 |
|
| 845 |
#define xspace_skip_subtype (xspace_skip_code + 1) |
| 846 |
#define space_skip_subtype (space_skip_code + 1) |
| 847 |
|
| 848 |
/* |
| 849 |
|
| 850 |
hyphen_penalty_mode_par automatic_disc (-) explicit_disc (\-) |
| 851 |
--------------------------------------------------------------------------------- |
| 852 |
0 (default) ex_hyphen_penalty_par ex_hyphen_penalty_par |
| 853 |
1 hyphen_penalty_par hyphen_penalty_par |
| 854 |
2 ex_hyphen_penalty_par hyphen_penalty_par |
| 855 |
3 hyphen_penalty_par ex_hyphen_penalty_par |
| 856 |
4 automatic_hyphen_penalty_par explicit_disc_penalty_par |
| 857 |
5 ex_hyphen_penalty_par explicit_disc_penalty_par |
| 858 |
6 hyphen_penalty_par explicit_disc_penalty_par |
| 859 |
7 automatic_hyphen_penalty_par ex_hyphen_penalty_par |
| 860 |
8 automatic_hyphen_penalty_par hyphen_penalty_par |
| 861 |
*/ |
| 862 |
|
| 863 |
#define set_automatic_disc_penalty(n) \ |
| 864 |
switch (hyphen_penalty_mode_par) { \ |
| 865 |
case 0: \ |
| 866 |
case 2: \ |
| 867 |
case 5: \ |
| 868 |
/* we take ex_hyphen_penalty */ \ |
| 869 |
disc_penalty(n) = ex_hyphen_penalty_par; \ |
| 870 |
break; \ |
| 871 |
case 1: \ |
| 872 |
case 3: \ |
| 873 |
case 6: \ |
| 874 |
/* we take hyphen_penalty */ \ |
| 875 |
disc_penalty(n) = hyphen_penalty_par; \ |
| 876 |
break; \ |
| 877 |
case 4: \ |
| 878 |
case 7: \ |
| 879 |
case 8: \ |
| 880 |
/* we take automatic_hyphen_penalty */ \ |
| 881 |
disc_penalty(n) = automatic_hyphen_penalty_par; \ |
| 882 |
break; \ |
| 883 |
default: \ |
| 884 |
/* what we've done since the beginning */ \ |
| 885 |
disc_penalty(n) = ex_hyphen_penalty_par; \ |
| 886 |
break; \ |
| 887 |
} |
| 888 |
|
| 889 |
#define set_explicit_disc_penalty(n) \ |
| 890 |
switch (hyphen_penalty_mode_par) { \ |
| 891 |
case 0: \ |
| 892 |
case 3: \ |
| 893 |
case 7: \ |
| 894 |
/* we take ex_hyphen_penalty */ \ |
| 895 |
disc_penalty(n) = ex_hyphen_penalty_par; \ |
| 896 |
break; \ |
| 897 |
case 1: \ |
| 898 |
case 2: \ |
| 899 |
case 8: \ |
| 900 |
/* we take hyphen_penalty */ \ |
| 901 |
disc_penalty(n) = hyphen_penalty_par; \ |
| 902 |
break; \ |
| 903 |
case 4: \ |
| 904 |
case 5: \ |
| 905 |
case 6: \ |
| 906 |
/* we take automatic_hyphen_penalty */ \ |
| 907 |
disc_penalty(n) = explicit_hyphen_penalty_par; \ |
| 908 |
break; \ |
| 909 |
default: \ |
| 910 |
/* what we've done since the beginning */ \ |
| 911 |
disc_penalty(n) = ex_hyphen_penalty_par; \ |
| 912 |
break; \ |
| 913 |
} |
| 914 |
|
| 915 |
#endif |