% Appendix to the Errors of TeX paper (updated) %\magnification=\magstephalf%\pageno=35\input logmac* 10 Mar 1978L1. Rename a few external variables to make their first six letters unique.D2. Initialize \\{escape_char} to $-1$, not 0 [it will be set to the first character input]. @240L3. Fix bug: The test `$\\{id}<\O{200}$' was supposed to distinguish one-letter identifiers from longer (packed) ones, but negative values of \\{id} also pass this test. @356B4. Fix bug: I wrote `{\bf while} $\alpha\land(\beta\lor\gamma)$' when I meant `{\bf while} $(\alpha\land\beta)\lor\gamma$'. @259R5. Initialize the input routines in |INITEX| [at this time a short, separate program not under user control], in case errors occur. @1337E6. Don't initialize \\{mem} in |INITEX|, it wastes time. @164B7. Change `\\{new_line}' [which denotes a lexical scanning state] to `\\{next_line}' [which denotes \\{carriage_return} and \\{line_feed}] in print commands.F8. Include additional test `$\\{mem}[p] \ne 0\; \land$' in \\{check_mem}. @168M9. Fix inconsistency between the \\{eq_level} conventions of \\{macro_def} and \\{eq_define}. @277# About six hours of debugging time today.# |INITEX| appears to work, and the test routine got through \\{start_input}, \\{chcode} [the \TeX78 command for assigning a \\{cat_code}], \\{get_next}, and \\{back_input} the first time.* 11 Mar 1978I10. Insert space before `|(|' on terminal when opening a new file. @537F11. Put `$p\gets \\{link}(p)$' into the loop of \\{show_token_list}, so that it doesn't loop forever. @292L12. Shift the last item found by \\{scan_toks} into the \\{info} field. [With |SAIL| all packing of fields was done by arithmetic operations, not by the compiler.] @474B13\>12. Fix the previous bugfix: I shifted by the wrong amount. @474I14. Add a feature that prints a warning when the end of a file page occurs within a macro definition or call. [System dependent.] @336# Unintended bugs in my test routine [a format intended eventually to typeset {\it The Art of Computer Programming\/}] helped check out the error recovery mechanisms. For example, I had `|\lft{#}|' instead of `|\lft{##}|' inside a macro, and three cases of improper |{|~and~|}| nesting.F15. Add the forgotten case `\\{set_font}:' to \\{eq_destroy}. @275C16. Change |\require| to |\input|. @376F17. Add code for the case $\\{cur_cmd}=0$ [later known as the case `$\,t\ge\\{cs_token_flag}$'] when scanning a tokenlist. @357# That's the first ``big'' error I've spotted so far.I18. Introduce a `|d|' option in the error routine, to facilitate debugging. @84L19. Assign a floating-point constant \\{ignore_depth} to \\{prev_depth}, instead of assigning the integer constant \\{flag} [since \\{prev_depth} is type \\{real} in \TeX78]. @215I20. Improve the readability and spacing of \\{show_node_list} output. @182,187F21. Set the variable $v$ before using the {\bf case} construction in \\{show_node_list}, because there's one case where $v$ didn't receive a value [as part of the field unpacking]. @182# About seven hours today.* 12 Mar 1978# One hour to enter yesterday's corrections and recompile.# At this point \TeX\ correctly located further unintended syntax errors in |acphdr| [the test file].I22. Insert \\{debug_help} into \\{succumb}, giving a chance to look at memory before the system dies. @93D23. Use \\{eq_destroy} wherever necessary in \\{unsave}. @283L24. Change `$t \gets (t-1)$ mod 8' to `$t \gets (t-1)$ land~7' in \\{id_name}, since |SAIL| has $-1$~mod~$8 = -1$. [At this time, \\{id_name} is a routine that unpacks control sequence names, according to a scheme that will become obsolete after change \#422.]S25. Remove the space that appears at end of paragraph. (I hadn't anticipated that.) @816L26. Throw away unwanted \\{line_feed} after getting a \\{carriage_return} in response to \\{in_chr_w} [a system routine for input from the terminal]. @83B27. Delete spurious call to \\{flush_list} in \\{end_token_list}. @324# Why did I make such a silly mistake?F28. Fix bug in \\{get_x_token}: I forgot to say `\\{macro_call}' (which is the main point of that routine)! @380# While tracking that bug down, I found out incidentally that kerning is okay.# Also \TeX\ correctly caught an error |0p| for |0pt|.L29. Fix bug in \\{scan_spec} ({\bf while} instead of {\bf repeat}). @404M30. Make the table entries for |\hfill| and |\hskip| consistent with the program conventions. @1058L31. Disable unforeseen coercion: When \\{scan_spec} put \\{hsize} on \\{save_stack}, the value changed from \\{real} to \\{integer}. @645I32. Use `|*|' instead of `|-1.0|' for running dimensions of rules in \\{show_node_list}. @176D33. Clear \\{mem}[\\{head}] to null in \\{push_nest} [in \TeX82, this will be done by \\{get_avail}]. @216# A vrule link got clobbered because I forgot to do this.I34. Translate ASCII control codes to special form when displaying them. @48,68# Ligatures work, but \\{show_node_list} showed them funny.F35. Remember to clear parameters off \\{save_stack} in \\{package} routine. @1086# About eight hours today.* 13 Mar 1978D36. Introduce a new variable \\{hang_first} [later the sign of \\{hang_after}]. @849E37\>36. Simplify the new code, realizing that if $\\{hang_indent}=0$ then \\{hang_first} is irrelevant. @848# Time sharing is very slow today, so I'm mostly reading technical reports while waiting\/ {\bf three hours} for compiler, editor, and loading routine.# I'm not counting this as debugging time!# (Came back in the evening.)P38. Spruce up the comments in the \\{line_break} routine, which appears to be almost working. @813D39. Rethink the setting of \\{best_line}; it's 1 too high in many cases. [The final line of a paragraph was handled in a treacherous way.] @874D40. Compute proper initialization for \\{prev_depth} when beginning an |\hbox| with a paragraph inside. [This refers to a special `paragraph box' construction, used when an hbox of specified size becomes overfull; \TeX78 doesn't have the concept of internal vertical mode.] @1083D41. Also initialize \\{tail} in that case. @1083M42. Also put the result of line-breaking into the correct list.T43. Fix a typo in the \\{free_node} routine (`\\{link}' not `\\{llink}'); by strange chance it had been harmless until today. @130F44. Fix bug: \\{post_line_break} forgot to set \\{adjust_tail}. @889D45. Update \\{act_width} properly when looking for end of word while line breaking. @866B46. Repair the ``tricky'' part of \\{get_node}: I used the \\{info} field when I meant to say \\{llink}. @127# Now the |\corners| macro of |acphdr| works! [See |\setcornerrules| in {\it The \TeX book}, page 417.]D47. Reset \\{contrib_tail} properly in \\{build_page}. @995T48. Fix typo (|-| for |+|) in computation of \\{page_total}. @1004S49. Change the page-breaking logic: \TeX\ reached \\{fire_up} with $\\{best_page_break}=\\{null}$ in one case, since the badness was too bad. @1005M50. Perform the operation \\{delete_token_ref}(\\{top_mark}) only when $\\{top_mark}\ne0$. @1012F51. Make \\{scan_toks} omit the initial |{| of an |\output| routine. @473I52. Insert a comma to make memory usage statistics look better. @639# About seven good hours of debugging today.# Tomorrow will be first-output day (I hope).* 14 Mar 1978# (Came in evening after sleeping most of day, to get computer at better time.)# (Some day we will have personal computers and will live more normally.)# 8:30pm, began to enter corrections to yesterday's problems.I53. Issue an error message for non-character in filename or in font name. @771I54. Display `|...|' for omitted stuff in \\{show_context} routine. @643L55. Watch out for the |SAIL| syntax `$\alpha+\beta\mathbin{\rm lsh}\gamma$'; it doesn't shift $\alpha+\beta$ left (only $\beta$). @464# That error was very hard to track down; it created a spurious link field and sent $\\{hash}[0]=\null$|\beta| to the scanner!# I could have found this bug an hour sooner if I had looked at the correct stack entries for \\{name} and \\{token_type}.D56. Show the correct page number when tracing pages before output is shipped. @638F57. Remember to nullify a box after using it. @1079I58. Issue an error message if\/ |\box255| isn't consumed by the output routine. @1015# I'm having trouble with the |BAIL| debugger; it makes an illegal memory reference and dies, when single-stepping past the entry to recursive procedures \\{hlist_out} and \\{vlist_out}. So I have to reload and be careful to go thru these procedures at high speed.P59. Fix bug in comment (memory parameter description said $\ge$ not $\le$). @11B60. Fix typo in definition of rule output (said $x,y$ not $\\{x0},\\{y0}$). [This part of the code went away when |DVI| files were introduced.]B61. Correct the embarrassing bug in shellsort, where I said `$\le\\{str}[k]$' not `$\le t$'. [The first \TeX\ had to sort all output by vertical position on page.]M62. Make \\{start_input} set up \\{job_name} in the form needed by \\{shipout}; it uses obsolete conventions. @532,537L63. Insert |(| and |)| into the |SAIL| macro definition of \\{new_string}. [This macro was for pre-|DVI| output.]M64. Unscramble the parameters of \\{out_rule}: The declaration was $(\\{x0},\\{y0},\\{x1},\\{y1})$ while the call was $(\\{x0},\\{x1},\\{y0},\\{y1})$.# 4:30am, \TeX's first page is successfully output!# (It was `|\titlepage\setcpage1\corners\eject\end|'.)* 15 Mar 1978# 10:30pm. Today I'm instrumenting the line-breaking routine and putting it through a bunch of tests.# (The inserted instrumentation had bugs that won't be mentioned here.)C65. Don't abort the job when \\{eq_destroy} redefines a \TeX\ control sequence. @275# The first word of a paragraph won't be hyphenated \dots\ so be it!T66. Fix the typo in \\{line_break} that spoils the test for `letters in the same font'. @896# The effect of that typo was to suppress all hyphenation attempts.B67\>25. Replace the space at paragraph end by fillglue, not by zero. @816L68. Pack the hyphen character properly into its node. @582T69. Fix a typo (`{\tentex\char'30}' for `|+|') in the computation of \\{break_width}. @838M70. Change the |\end| maneuver; the present code doesn't end the job, since I forgot that \\{back_input} uses \\{cur_tok}. @1054A71. Add a parameter to \\{try_break}, since the width is different at a discretionary hyphen. [This problem will be solved differently in \TeX82, when discretionaries become much more general.] @840F72. Bypass kern nodes in pre-hyphenation. @896F73. Supply code for the forgotten case `$<$ |"a"|' in pre-hyphenation. [This case was later generalized to a test of \\{lc_code}.] @897B74. Change $\\{mem}[q]$ to $\\{prev_break}(q)$ in the reverse-linking loop. @878# (Such blunders. Am I getting feeble-minded?)A75. Introduce special logic for \\{eject_penalty}; I was wrong to think that forced ejection was exactly like an infinitely negative penalty. @851A76. Use $(1+b)^2-p^2$ when computing demerits with $p<0$. @859# 6:30am. The line-breaking algorithm appears to be working fine and efficiently. On small measures (about 20 characters per line), it gives overfull boxes instead of spaced out ones. Surprising but satisfactory.* 16 Mar 1978# 9pm. The plan for tonight is to test page breaking and more paragraphing.G77. Insert `|\topskip|' glue at beginning of page. @1001I78. Add `|\pausing|' feature. @363M79. Fix discrepancy: In \\{make_accent} I called \\{vpackage} with a pointer to the first list item, but \\{vpackage} itself assumes that the parameter is a pointer to that pointer. [The \\{vpackage} of \TeX82 will be different.] @668# I checked for other lapses like that. Result: 14 calls OK, 12 NG.M80. Create a new temporary list head location, \\{hold_head}, since there's a case where \\{vpackage} is improperly called with parameter \\{temp_head}. [At this time \\{vpackage} uses \\{temp_head} to make a list of all insertions found.] @1014# 11:30pm. The machine is tied up again.F81. Write code to handle charnodes in vlists; I forgot that I'd decided to allow them. [Later I prohibited them again!] @669F82. Combine the page lists before pruning off glue in \\{fire_up}; otherwise the pruning doesn't go far enough. @1017B83\>25. Fix typo where line-breaking starts: `\\{fill_glue}' should be `\\{new_glue}(\\{fill_glue})'. @816I84. Add |/q| to |xspool| command (cosmetic change). [This changes a system command that causes \TeX\ output to be printed on the Xerox Graphics Printer (XGP), the progenitor of future laser printers; the |/q| option says that the queue of printing requests should be displayed on the user's terminal.] @642E85. Don't write a form feed after the last page of output. @642# To fix this, I reorganized \\{ship_out}, and it became simpler.T86. Correct a typo (`{\tentex\char'30}' for `|+|') in the \\{vlist_node} case within \\{hlist_out}. [The output routines were quite different at this time, because output went directly to the XGP.] @622I87. Change the message `|completed page|' to `|Completed for page|'. @638B88\>48. Fix yet another typo in the computation of \\{page_total}: My original code said $\\{stretch}(p)$ instead of $\\{stretch}(q)$ (terrible). @1004P89. Document the dirty trick about \\{bot_mark}'s reference count. [That trick is, fortunately, no longer useful.] @1016A90. Rethink the algorithm for contributing an insertion: The original code tests for a page break after incrementing the totals but before the \\{contrib_list} is updated. [\TeX78 handles insertions in a hardwired manner that will be greatly generalized in \TeX82.]F91. Fix \\{get_node} again: After the variable memory overflows, control falls through to \\{found} instead of going to the \\{overflow} call. @125# I spent several hours tracking down that data structure bug!B92. Change \\{new_line} to \\{next_line} in yet another print command (see \#7).A93\>75. Amend the line-breaking algorithm: |\break| in paragraph doesn't work with really bad breaks. @851# A problem to be diagnosed tomorrow: Each time I run the test program, the amount of memory in use grows by 13 cells not returned.# Seven hours tonight.* 17 Mar 1978G94. Introduce \\{dead_cycles} to keep |\end| active until \\{ship_out} occurs. @1054E95. Don't call \\{line_break} with an empty list. @1096S96. Take proper account of the (infinite) fillglue when computing the width of a paragraph line preceding a display. @1146M97. Add a new parameter to \\{hpack} so that \\{line_break} won't be called at the wrong time. [This is for the soon-to-be-obsolete feature described in \#40.]L98. Give a warning message if there's an |\hfill| in the middle of a paragraph; fillglue upsets the line breaker, because floating-point calculations don't have sufficient accuracy. @869# I spent an hour looking for another bug in \TeX, but the following one was in \MF: The \\{xgp_height} data in fonts had been supplied wrong.# It took two hours to recompile 32 fonts with proto-\MF.R99. Make \\{show_node_list} and \\{show_token_list} more robust in the presence of software bugs. @182D100\>97. Do not remove nodes with \\{eject_penalty}, when the new parameter to \\{hpack} is \\{true}.E101\>97. Put a fast exit into \\{hpack}; e.g., at glue nodes, test `{\bf if} \\{paragraphing} $\land$ $\langle$current width is large$\rangle$'.# 2am. I have to go to bed ``early'' tonight.* 18 Mar 1978# 3:30pm. (Saturday)I102. Add a parameter to \\{check_mem} (to suppress display unless needed). @167G103. Introduce a user-settable parameter |\maxdepth|, and pass it as a parameter to \\{vpackage}. @668# I realized the need for |\maxdepth| while fixing insertions (see \#90).G104. Introduce a user-settable parameter for \\{line_break}: The constant 2.0 in my original algorithm becomes |\jpar| [later |\tolerance|], to be set like |\tracing|. @828D105. Reclaim the \\{eject_penalty} nodes removed during line-breaking. @879# (Those were the 13 extra nodes reported on Thursday.)# The \\{init_align} procedure worked right the first time!# Also \\{init_row}, \\{init_col}. But then\thinspace\dotsS106. Rethink the command codes: \\{endv} in a token list has too high a code for the assumptions of \\{get_next}. @207A107. Add a \\{prev_cmd} variable for processing delimited macro parameters; the original algorithm loses track of braces. [The rules will change slightly in \TeX82, and \\{rbrace_ptr} will take on a similar function.] @400S108. Make the \\{get_next} routine intercept |&| and |\cr| tokens. @342# I'd thought I could just put |&| and |\cr| into \\{big_switch} [i.e., in the stomach of \TeX, not the eyes]; that was a great big mistake.R109. Make more error checks on \\{endv}; e.g., it must not occur in a macro definition or call. @780S110\>108. No, rethink alignments again; the new program still fails! @768# For the first time I can glimpse the hairiness of alignment in general (e.g., `|\halign{\u#\v&...|' when |\u| and |\v| are defined to include |&|'s and possible alignments themselves).# I think there's a ``simple'' solution, by considering only whether an alignment is currently active [in \S342].# 11:30pm. Went to bed.* 19 Mar 1978# Woke up with ``better'' idea on how to handle |&| and |\cr|.# (Namely, to consider a special kind of\/ |\def| whose parameters don't interrupt on |&|'s and |\cr|'s.)# But replaced this by a much better idea (to introduce \\{align_state}).# 11pm. Began to use computer. Performed major surgery (inserting \\{align_state} and updating the associated routines and documentation).D111. Pop the alignment stacks in \\{fin_align}. @800T112\>110. Fix a (newly inserted) typo in \\{show_context}. @314D113\>110. Set \\{align_state} false when a live |&| or |\cr| is found. [Originally \\{align_state} was of type \\{boolean}.] @789I114. Insert |\cr| when `|}|' occurs prematurely in an alignment. @1132M115. Remember to record \\{glue_stretch} when packaging an unset node. @796# I had a mistake in |acphdr| definition of\/ |\quoteformat|; also extra spaces.# My first test programs, used before today, were contrived to test macro expansion, line-breaking, and page layout.# Next I'm using a test program based on Volume 2.C116. Make carriage-return, space, and tab equivalent for macro matching. @348F117. Omit the reference count node when displaying a mark. @176B118. Correct a silly slip: I wrote `\\{type_displacement}' instead of `\\{value_displacement}' when packing data in a penalty node. @158M119. Don't go to \\{build_page} after seeing |\noindent|; \TeX\ isn't ready for that. [In the original program, this was an instance of a bad {\bf goto}.] @1091# I had undesired spaces coming thru the scanner in my macro definitions of\/ |\tenpoint| [see {\it The \TeX book}, page 414].# 4am. \TeX\ now knows enough to typeset page 1 of Volume 2!# Also it did its first ``math formula'' (namely `|$X$|') without crucial error.# (Except that the italic correction was missing for some reason.)D120. Remember to decrement \\{cur_level} in \\{fin_align}. [The routines will eventually become more general and use \\{unsave} here.] @800D121. Remember to increment \\{cur_level} in error corrections by \\{handle_right_brace}. [A better procedure will be adopted later.] @1069T122. Fix a typo: (`|{|' instead of `|}|') in error message for $\\{mmode}+ \\{math_shift}$. @1065R123\>99. Make \\{show_noad_list} more robust and more like the new \\{show_node_list}. [The routines will be combined in \TeX82.] @690L124. Fix a typo in \\{char_box}: should say \\{font_info_real}. [In \TeX78 a single array is used for both \\{real} and \\{integer}; in \TeX82 things will be \\{scaled}.] @554B125. Fix typos in the definitions of \\{default_rule_thickness} and \\{big_op_spacing}; they shouldn't start at \\{mathex}(7). @701B126. Reverse the \\{before} and \\{after} conventions in math nodes. @1196# I had them backwards; this turned hyphenation on just before math, and off just after it!# Seven and a half hours debugging today. Got through the test program a little more. But \TeX\ blew up on `|$Y+1$|'; tomorrow I hope to find out why.* 20 Mar 1978# 8pm. I decided to work next on a super-hairy formula.C127. Change `|\ascii|' to `|\cc|' (character code). [This name will change again later, to `|\char|'.] @265E128. Don't bother to store a penalty node at the beginning of |$$| when the paragraph-so-far fits on a single line, since such a penalty has already been stored. [These conventions will change later, and the |\predisplaypenalty| will always be stored.] @1203S129. Avoid reference to \\{tail} in \\{build_page}, if $\\{nest_ptr}>0$. @995B130. Correct a silly slip in \\{math_comp} (the exact opposite of what I did in \#118). @1158B131. Rectify my mental lapse in \\{make_fraction}; I said \\{nucleus} instead of \\{thickness}. @743F132. Mask off the math class when scanning delimiters. @1160C133. Allow an optional space after |\def{...}|. [This decision will be retracted later.] @473# My test example is so complicated it causes the semantic stacks to overflow!L134. Don't test for no pages output by looking at the channel status. @642T135. Fix typo in definition of\/ |\mathop| (\\{open_noad} not \\{op_noad}). @1156A136. Rewrite \\{fin_mlist}, because `|\left(...\above...\right)|' doesn't parse correctly; the |\left| goes into the numerator, the |\right| into the denominator. @1184B137. Correct the use of \\{depth_threshold} in \\{print_subsidiary_data}: Simple fields get shown while others look empty. @692I138\>78. Return the carriage before showing the first line of a new file when pausing. @538M139. Fix bug: The call \\{show_noad_list}(\\{mem}[|..|]) should be \\{show_noad_list}(|..|), in the \\{incompleat_noad} case of \\{show_activities}. @219# 3am. The whole messy formula has been parsed correctly into a tree.# The easy part is done, now comes the harder part.F140. Don't shift single characters down in \\{make_op}. @749D141. Make \\{clean_box} return a box (as its name implies), not an hlist. @720# Font info still isn't quite right, it has the wrong value of \\{quad}.A142. Retain the italic correction when doing \\{rebox}; can make $\\{glue_set}\ne0$ a flag for this. [A better solution will be adopted later.] @715B143. Fix the bug that makes \\{rebox} bomb out: $\\{value}(p)$ should be $\\{value}(\\{mem}[p])$. @715# 6am; ten hours today. \TeX\ didn't do |$\pi\over2$| correctly, but was close.# I found that the \\{rebox} problem (\#142) went away when I fixed the \\{clean_box} problem (\#141); but I will leave the extra stuff about $\\{glue_set} \ne 0$ in the program anyway, just for weird cases.E144. Omit extra levels of boxing when possible in \\{clean_box}. @721# (To do this, I need to face the \\{rebox} problem anyway.)* 21 Mar 1978# 10pm. The computer is rather heavily loaded tonight.F145. Don't forget \\{thickness} when making a square-root sign (see \#131). [The rule thickness will later be derived from the character height.] @737L146. Define $p$ local to the \\{make_fraction} routine. @743# Unwittingly using the global $p$ was a disaster.I147. Don't show the amount of \\{glue_set} when it's zero. @186D148\>142. Make \\{glue_set} nonzero in the result of \\{var_delimiter}. @706F149. Fix bug: The \\{math_glue} function didn't return any result. @716T150. Fix typo in \\{char_box} ($c$ not $w$); this caused a subscripted~$P$ to come out the same width as an unsubscripted~$P$. [Later changes in the rules will move this computation to \S755.] @709P151\>144. Revise \\{clean_box} to do operations that are needed often because of the \\{rebox} change. @720D152. Use the new \\{clean_box} to avoid a bug in |\sqrt{\raise...}|. @737Q153. Change the definition of\/ |\not| so that it's a relation (which will butt against the following relation). [All math symbols and Greek letters are defined in |INITEX| at this time, not in a changeable format definition.]I154. Give error message `{\tt Large delimiter must be in mathex font}', instead of calling \\{confusion}, since the error can occur. [This particular error is impossible in \TeX82.] @706F155. Change the use of $p$ in \\{var_delimiter}; it isn't always set when I say {\bf goto} \\{found}. @706# Another font problem now surfaced: The mathex meta-font didn't compute \TeX\ info in a machine-independent way. (It took two hours to correct this.)D156. Don't forget to set $\\{type}(b)$ in all relevant cases of \\{var_delimiter}. @708B157. Use the correct sign convention for \\{shift_amount} in \\{hpackage}. @653F158. Always kern by \\{delta} when there's no superscript. @755M159. Declare \\{space_table} to be $[0\,.\,.\,6,0\,.\,.\,6]$ not $[0\,.\,.\,7,0\,.\,.\,7]$; otherwise its entries are pre\-loaded into the wrong positions. [The \\{space_table} in \TeX78 is $7\times7$; it will become $8\times8$ in \TeX82, represented as a string called \\{math_spacing}.] @764C160. Use a negative value, not zero, to represent a null delimiter. [Actually zero will come back again later.] @685C161\>127. Change |\cc| to |\char|. @265L162. Don't use tricky subtraction on packed data when changing $q$ to an \\{ord_noad} in \\{mlist_to_hlist}; subtraction isn't always safe. @729B163. Fix two typos in the \\{space_table} (|*| for |0|). @764F164. Initialize \\{cur_size} everywhere (I forgot it in two places). @703A165. Reset \\{op_noad} before resetting \\{bin_noad}. @728F166. Treat $\\{display_style}+\\{cramped}$ the same as \\{display_style} inside \\{make_op}. @749B167. Shift the character correctly in the non-|\displaystyle| case of \\{make_op}. @749# Still another font problem: The italic corrections are wrong because the corresponding array was declared \\{real} in proto-\MF\ (and italic corrections were used in nonstandard way in |mathex|).B168. Use \\{depth} instead of \\{height} in \\{var_delimiter}. [Later, both were used.] @714Q169. Skew the accents according to the font \\{slant}. [Soon retracted.] @741# At this point I think nearly all the math routines have been exercised.# Tomorrow they should work!# Eight hours debugging today.* 22 Mar 1978# (Wednesday, but actually Thursday: I began at midnight because I was proofreading a paper.)# I checked out the font access tables, slowly (i.e., all the |\mathcode| and special-character name entries were catalogued).Q170\>169. Do {\bf not\/} consider slants after all in the math accent routine, since slanted math letters are put differently into fonts. @741B171. Don't use $q$ for two different things simultaneously in \\{make_math_accent}. @738F172. Fix bug in \\{compact_list} (I forgot to advance the loop variable). [This procedure became unnecessary in \TeX82.]M173. Avoid conflict between \\{var_delimiter} and \\{mlist_to_hlist}, which want to use \\{temp_head} simultaneously. @713T174. Fix bad typo in \\{overbar} routine ($b$ for $p$). @705# Finally \TeX\ got to \\{after_math} after dealing with that hairy formula\thinspace\dotsT175. Fix another bad typo: $p$ for $b$ this time. @1199L176. Insert more parentheses (twice) because of `|lsh|' precedence in |SAIL|. @1199M177\>36. Use the new hanging-indentation conventions when formatting displayed equations. @1199Q178. Recompute penalties so that break is allowed after \\{punct_noad}s. @761F179. Center the large delimiters vertically. @749Q180. Round all rule sizes (up) before drawing them. @589Q181. Provide more space over $x$ in $\sqrt x$, and more space atop vincula. @705,737Q182. Make large delimiters large enough to cover formula height (important for subscripts, superscripts). @762I183. Insert |/ntn=33| on XGP prompt message so that complex math won't blow the device driver. [See \#84.]P184\>161. Update the comment about the meaning of\/ |\char|, since it can be used in math mode. @208# Six hours today.* 23 Mar 1978# 11pm, Maundy Thursday.C185\>104. Make |\tracing| and |\jpar| follow block structure. @283# It took me two hours to enter yesterday's corrections, because the changes were so numerous.M186. Fix bad call on \\{begin_token_list} when marks are to be scanned. @396# Now the formula looks like it should, modulo problems in fonts.Q187. Prevent an exponent from going below baseline + xheight/4. @758B188. Change \\{quad} to \\{math_quad} when finishing a displayLines 1–500 of 2392. Load more
% Appendix to the Errors of TeX paper (updated) %\magnification=\magstephalf %\pageno=35 \input logmac * 10 Mar 1978 L1. Rename a few external variables to make their first six letters unique. D2. Initialize \\{escape_char} to $-1$, not 0 [it will be set to the first character input]. @240 L3. Fix bug: The test `$\\{id}<\O{200}$' was supposed to distinguish one-letter identifiers from longer (packed) ones, but negative values of \\{id} also pass this test. @356 B4. Fix bug: I wrote `{\bf while} $\alpha\land(\beta\lor\gamma)$' when I meant `{\bf while} $(\alpha\land\beta)\lor\gamma$'. @259 R5. Initialize the input routines in |INITEX| [at this time a short, separate program not under user control], in case errors occur. @1337 E6. Don't initialize \\{mem} in |INITEX|, it wastes time. @164 B7. Change `\\{new_line}' [which denotes a lexical scanning state] to `\\{next_line}' [which denotes \\{carriage_return} and \\{line_feed}] in print commands. F8. Include additional test `$\\{mem}[p] \ne 0\; \land$' in \\{check_mem}. @168 M9. Fix inconsistency between the \\{eq_level} conventions of \\{macro_def} and \\{eq_define}. @277 # About six hours of debugging time today. # |INITEX| appears to work, and the test routine got through \\{start_input}, \\{chcode} [the \TeX78 command for assigning a \\{cat_code}], \\{get_next}, and \\{back_input} the first time. * 11 Mar 1978 I10. Insert space before `|(|' on terminal when opening a new file. @537 F11. Put `$p\gets \\{link}(p)$' into the loop of \\{show_token_list}, so that it doesn't loop forever. @292 L12. Shift the last item found by \\{scan_toks} into the \\{info} field. [With |SAIL| all packing of fields was done by arithmetic operations, not by the compiler.] @474 B13\>12. Fix the previous bugfix: I shifted by the wrong amount. @474 I14. Add a feature that prints a warning when the end of a file page occurs within a macro definition or call. [System dependent.] @336 # Unintended bugs in my test routine [a format intended eventually to typeset {\it The Art of Computer Programming\/}] helped check out the error recovery mechanisms. For example, I had `|\lft{#}|' instead of `|\lft{##}|' inside a macro, and three cases of improper |{|~and~|}| nesting. F15. Add the forgotten case `\\{set_font}:' to \\{eq_destroy}. @275 C16. Change |\require| to |\input|. @376 F17. Add code for the case $\\{cur_cmd}=0$ [later known as the case `$\,t\ge\\{cs_token_flag}$'] when scanning a tokenlist. @357 # That's the first ``big'' error I've spotted so far. I18. Introduce a `|d|' option in the error routine, to facilitate debugging. @84 L19. Assign a floating-point constant \\{ignore_depth} to \\{prev_depth}, instead of assigning the integer constant \\{flag} [since \\{prev_depth} is type \\{real} in \TeX78]. @215 I20. Improve the readability and spacing of \\{show_node_list} output. @182,187 F21. Set the variable $v$ before using the {\bf case} construction in \\{show_node_list}, because there's one case where $v$ didn't receive a value [as part of the field unpacking]. @182 # About seven hours today. * 12 Mar 1978 # One hour to enter yesterday's corrections and recompile. # At this point \TeX\ correctly located further unintended syntax errors in |acphdr| [the test file]. I22. Insert \\{debug_help} into \\{succumb}, giving a chance to look at memory before the system dies. @93 D23. Use \\{eq_destroy} wherever necessary in \\{unsave}. @283 L24. Change `$t \gets (t-1)$ mod 8' to `$t \gets (t-1)$ land~7' in \\{id_name}, since |SAIL| has $-1$~mod~$8 = -1$. [At this time, \\{id_name} is a routine that unpacks control sequence names, according to a scheme that will become obsolete after change \#422.] S25. Remove the space that appears at end of paragraph. (I hadn't anticipated that.) @816 L26. Throw away unwanted \\{line_feed} after getting a \\{carriage_return} in response to \\{in_chr_w} [a system routine for input from the terminal]. @83 B27. Delete spurious call to \\{flush_list} in \\{end_token_list}. @324 # Why did I make such a silly mistake? F28. Fix bug in \\{get_x_token}: I forgot to say `\\{macro_call}' (which is the main point of that routine)! @380 # While tracking that bug down, I found out incidentally that kerning is okay. # Also \TeX\ correctly caught an error |0p| for |0pt|. L29. Fix bug in \\{scan_spec} ({\bf while} instead of {\bf repeat}). @404 M30. Make the table entries for |\hfill| and |\hskip| consistent with the program conventions. @1058 L31. Disable unforeseen coercion: When \\{scan_spec} put \\{hsize} on \\{save_stack}, the value changed from \\{real} to \\{integer}. @645 I32. Use `|*|' instead of `|-1.0|' for running dimensions of rules in \\{show_node_list}. @176 D33. Clear \\{mem}[\\{head}] to null in \\{push_nest} [in \TeX82, this will be done by \\{get_avail}]. @216 # A vrule link got clobbered because I forgot to do this. I34. Translate ASCII control codes to special form when displaying them. @48,68 # Ligatures work, but \\{show_node_list} showed them funny. F35. Remember to clear parameters off \\{save_stack} in \\{package} routine. @1086 # About eight hours today. * 13 Mar 1978 D36. Introduce a new variable \\{hang_first} [later the sign of \\{hang_after}]. @849 E37\>36. Simplify the new code, realizing that if $\\{hang_indent}=0$ then \\{hang_first} is irrelevant. @848 # Time sharing is very slow today, so I'm mostly reading technical reports while waiting\/ {\bf three hours} for compiler, editor, and loading routine. # I'm not counting this as debugging time! # (Came back in the evening.) P38. Spruce up the comments in the \\{line_break} routine, which appears to be almost working. @813 D39. Rethink the setting of \\{best_line}; it's 1 too high in many cases. [The final line of a paragraph was handled in a treacherous way.] @874 D40. Compute proper initialization for \\{prev_depth} when beginning an |\hbox| with a paragraph inside. [This refers to a special `paragraph box' construction, used when an hbox of specified size becomes overfull; \TeX78 doesn't have the concept of internal vertical mode.] @1083 D41. Also initialize \\{tail} in that case. @1083 M42. Also put the result of line-breaking into the correct list. T43. Fix a typo in the \\{free_node} routine (`\\{link}' not `\\{llink}'); by strange chance it had been harmless until today. @130 F44. Fix bug: \\{post_line_break} forgot to set \\{adjust_tail}. @889 D45. Update \\{act_width} properly when looking for end of word while line breaking. @866 B46. Repair the ``tricky'' part of \\{get_node}: I used the \\{info} field when I meant to say \\{llink}. @127 # Now the |\corners| macro of |acphdr| works! [See |\setcornerrules| in {\it The \TeX book}, page 417.] D47. Reset \\{contrib_tail} properly in \\{build_page}. @995 T48. Fix typo (|-| for |+|) in computation of \\{page_total}. @1004 S49. Change the page-breaking logic: \TeX\ reached \\{fire_up} with $\\{best_page_break}=\\{null}$ in one case, since the badness was too bad. @1005 M50. Perform the operation \\{delete_token_ref}(\\{top_mark}) only when $\\{top_mark}\ne0$. @1012 F51. Make \\{scan_toks} omit the initial |{| of an |\output| routine. @473 I52. Insert a comma to make memory usage statistics look better. @639 # About seven good hours of debugging today. # Tomorrow will be first-output day (I hope). * 14 Mar 1978 # (Came in evening after sleeping most of day, to get computer at better time.) # (Some day we will have personal computers and will live more normally.) # 8:30pm, began to enter corrections to yesterday's problems. I53. Issue an error message for non-character in filename or in font name. @771 I54. Display `|...|' for omitted stuff in \\{show_context} routine. @643 L55. Watch out for the |SAIL| syntax `$\alpha+\beta\mathbin{\rm lsh}\gamma$'; it doesn't shift $\alpha+\beta$ left (only $\beta$). @464 # That error was very hard to track down; it created a spurious link field and sent $\\{hash}[0]=\null$|\beta| to the scanner! # I could have found this bug an hour sooner if I had looked at the correct stack entries for \\{name} and \\{token_type}. D56. Show the correct page number when tracing pages before output is shipped. @638 F57. Remember to nullify a box after using it. @1079 I58. Issue an error message if\/ |\box255| isn't consumed by the output routine. @1015 # I'm having trouble with the |BAIL| debugger; it makes an illegal memory reference and dies, when single-stepping past the entry to recursive procedures \\{hlist_out} and \\{vlist_out}. So I have to reload and be careful to go thru these procedures at high speed. P59. Fix bug in comment (memory parameter description said $\ge$ not $\le$). @11 B60. Fix typo in definition of rule output (said $x,y$ not $\\{x0},\\{y0}$). [This part of the code went away when |DVI| files were introduced.] B61. Correct the embarrassing bug in shellsort, where I said `$\le\\{str}[k]$' not `$\le t$'. [The first \TeX\ had to sort all output by vertical position on page.] M62. Make \\{start_input} set up \\{job_name} in the form needed by \\{shipout}; it uses obsolete conventions. @532,537 L63. Insert |(| and |)| into the |SAIL| macro definition of \\{new_string}. [This macro was for pre-|DVI| output.] M64. Unscramble the parameters of \\{out_rule}: The declaration was $(\\{x0},\\{y0},\\{x1},\\{y1})$ while the call was $(\\{x0},\\{x1},\\{y0},\\{y1})$. # 4:30am, \TeX's first page is successfully output! # (It was `|\titlepage\setcpage1\corners\eject\end|'.) * 15 Mar 1978 # 10:30pm. Today I'm instrumenting the line-breaking routine and putting it through a bunch of tests. # (The inserted instrumentation had bugs that won't be mentioned here.) C65. Don't abort the job when \\{eq_destroy} redefines a \TeX\ control sequence. @275 # The first word of a paragraph won't be hyphenated \dots\ so be it! T66. Fix the typo in \\{line_break} that spoils the test for `letters in the same font'. @896 # The effect of that typo was to suppress all hyphenation attempts. B67\>25. Replace the space at paragraph end by fillglue, not by zero. @816 L68. Pack the hyphen character properly into its node. @582 T69. Fix a typo (`{\tentex\char'30}' for `|+|') in the computation of \\{break_width}. @838 M70. Change the |\end| maneuver; the present code doesn't end the job, since I forgot that \\{back_input} uses \\{cur_tok}. @1054 A71. Add a parameter to \\{try_break}, since the width is different at a discretionary hyphen. [This problem will be solved differently in \TeX82, when discretionaries become much more general.] @840 F72. Bypass kern nodes in pre-hyphenation. @896 F73. Supply code for the forgotten case `$<$ |"a"|' in pre-hyphenation. [This case was later generalized to a test of \\{lc_code}.] @897 B74. Change $\\{mem}[q]$ to $\\{prev_break}(q)$ in the reverse-linking loop. @878 # (Such blunders. Am I getting feeble-minded?) A75. Introduce special logic for \\{eject_penalty}; I was wrong to think that forced ejection was exactly like an infinitely negative penalty. @851 A76. Use $(1+b)^2-p^2$ when computing demerits with $p<0$. @859 # 6:30am. The line-breaking algorithm appears to be working fine and efficiently. On small measures (about 20 characters per line), it gives overfull boxes instead of spaced out ones. Surprising but satisfactory. * 16 Mar 1978 # 9pm. The plan for tonight is to test page breaking and more paragraphing. G77. Insert `|\topskip|' glue at beginning of page. @1001 I78. Add `|\pausing|' feature. @363 M79. Fix discrepancy: In \\{make_accent} I called \\{vpackage} with a pointer to the first list item, but \\{vpackage} itself assumes that the parameter is a pointer to that pointer. [The \\{vpackage} of \TeX82 will be different.] @668 # I checked for other lapses like that. Result: 14 calls OK, 12 NG. M80. Create a new temporary list head location, \\{hold_head}, since there's a case where \\{vpackage} is improperly called with parameter \\{temp_head}. [At this time \\{vpackage} uses \\{temp_head} to make a list of all insertions found.] @1014 # 11:30pm. The machine is tied up again. F81. Write code to handle charnodes in vlists; I forgot that I'd decided to allow them. [Later I prohibited them again!] @669 F82. Combine the page lists before pruning off glue in \\{fire_up}; otherwise the pruning doesn't go far enough. @1017 B83\>25. Fix typo where line-breaking starts: `\\{fill_glue}' should be `\\{new_glue}(\\{fill_glue})'. @816 I84. Add |/q| to |xspool| command (cosmetic change). [This changes a system command that causes \TeX\ output to be printed on the Xerox Graphics Printer (XGP), the progenitor of future laser printers; the |/q| option says that the queue of printing requests should be displayed on the user's terminal.] @642 E85. Don't write a form feed after the last page of output. @642 # To fix this, I reorganized \\{ship_out}, and it became simpler. T86. Correct a typo (`{\tentex\char'30}' for `|+|') in the \\{vlist_node} case within \\{hlist_out}. [The output routines were quite different at this time, because output went directly to the XGP.] @622 I87. Change the message `|completed page|' to `|Completed for page|'. @638 B88\>48. Fix yet another typo in the computation of \\{page_total}: My original code said $\\{stretch}(p)$ instead of $\\{stretch}(q)$ (terrible). @1004 P89. Document the dirty trick about \\{bot_mark}'s reference count. [That trick is, fortunately, no longer useful.] @1016 A90. Rethink the algorithm for contributing an insertion: The original code tests for a page break after incrementing the totals but before the \\{contrib_list} is updated. [\TeX78 handles insertions in a hardwired manner that will be greatly generalized in \TeX82.] F91. Fix \\{get_node} again: After the variable memory overflows, control falls through to \\{found} instead of going to the \\{overflow} call. @125 # I spent several hours tracking down that data structure bug! B92. Change \\{new_line} to \\{next_line} in yet another print command (see \#7). A93\>75. Amend the line-breaking algorithm: |\break| in paragraph doesn't work with really bad breaks. @851 # A problem to be diagnosed tomorrow: Each time I run the test program, the amount of memory in use grows by 13 cells not returned. # Seven hours tonight. * 17 Mar 1978 G94. Introduce \\{dead_cycles} to keep |\end| active until \\{ship_out} occurs. @1054 E95. Don't call \\{line_break} with an empty list. @1096 S96. Take proper account of the (infinite) fillglue when computing the width of a paragraph line preceding a display. @1146 M97. Add a new parameter to \\{hpack} so that \\{line_break} won't be called at the wrong time. [This is for the soon-to-be-obsolete feature described in \#40.] L98. Give a warning message if there's an |\hfill| in the middle of a paragraph; fillglue upsets the line breaker, because floating-point calculations don't have sufficient accuracy. @869 # I spent an hour looking for another bug in \TeX, but the following one was in \MF: The \\{xgp_height} data in fonts had been supplied wrong. # It took two hours to recompile 32 fonts with proto-\MF. R99. Make \\{show_node_list} and \\{show_token_list} more robust in the presence of software bugs. @182 D100\>97. Do not remove nodes with \\{eject_penalty}, when the new parameter to \\{hpack} is \\{true}. E101\>97. Put a fast exit into \\{hpack}; e.g., at glue nodes, test `{\bf if} \\{paragraphing} $\land$ $\langle$current width is large$\rangle$'. # 2am. I have to go to bed ``early'' tonight. * 18 Mar 1978 # 3:30pm. (Saturday) I102. Add a parameter to \\{check_mem} (to suppress display unless needed). @167 G103. Introduce a user-settable parameter |\maxdepth|, and pass it as a parameter to \\{vpackage}. @668 # I realized the need for |\maxdepth| while fixing insertions (see \#90). G104. Introduce a user-settable parameter for \\{line_break}: The constant 2.0 in my original algorithm becomes |\jpar| [later |\tolerance|], to be set like |\tracing|. @828 D105. Reclaim the \\{eject_penalty} nodes removed during line-breaking. @879 # (Those were the 13 extra nodes reported on Thursday.) # The \\{init_align} procedure worked right the first time! # Also \\{init_row}, \\{init_col}. But then\thinspace\dots S106. Rethink the command codes: \\{endv} in a token list has too high a code for the assumptions of \\{get_next}. @207 A107. Add a \\{prev_cmd} variable for processing delimited macro parameters; the original algorithm loses track of braces. [The rules will change slightly in \TeX82, and \\{rbrace_ptr} will take on a similar function.] @400 S108. Make the \\{get_next} routine intercept |&| and |\cr| tokens. @342 # I'd thought I could just put |&| and |\cr| into \\{big_switch} [i.e., in the stomach of \TeX, not the eyes]; that was a great big mistake. R109. Make more error checks on \\{endv}; e.g., it must not occur in a macro definition or call. @780 S110\>108. No, rethink alignments again; the new program still fails! @768 # For the first time I can glimpse the hairiness of alignment in general (e.g., `|\halign{\u#\v&...|' when |\u| and |\v| are defined to include |&|'s and possible alignments themselves). # I think there's a ``simple'' solution, by considering only whether an alignment is currently active [in \S342]. # 11:30pm. Went to bed. * 19 Mar 1978 # Woke up with ``better'' idea on how to handle |&| and |\cr|. # (Namely, to consider a special kind of\/ |\def| whose parameters don't interrupt on |&|'s and |\cr|'s.) # But replaced this by a much better idea (to introduce \\{align_state}). # 11pm. Began to use computer. Performed major surgery (inserting \\{align_state} and updating the associated routines and documentation). D111. Pop the alignment stacks in \\{fin_align}. @800 T112\>110. Fix a (newly inserted) typo in \\{show_context}. @314 D113\>110. Set \\{align_state} false when a live |&| or |\cr| is found. [Originally \\{align_state} was of type \\{boolean}.] @789 I114. Insert |\cr| when `|}|' occurs prematurely in an alignment. @1132 M115. Remember to record \\{glue_stretch} when packaging an unset node. @796 # I had a mistake in |acphdr| definition of\/ |\quoteformat|; also extra spaces. # My first test programs, used before today, were contrived to test macro expansion, line-breaking, and page layout. # Next I'm using a test program based on Volume 2. C116. Make carriage-return, space, and tab equivalent for macro matching. @348 F117. Omit the reference count node when displaying a mark. @176 B118. Correct a silly slip: I wrote `\\{type_displacement}' instead of `\\{value_displacement}' when packing data in a penalty node. @158 M119. Don't go to \\{build_page} after seeing |\noindent|; \TeX\ isn't ready for that. [In the original program, this was an instance of a bad {\bf goto}.] @1091 # I had undesired spaces coming thru the scanner in my macro definitions of\/ |\tenpoint| [see {\it The \TeX book}, page 414]. # 4am. \TeX\ now knows enough to typeset page 1 of Volume 2! # Also it did its first ``math formula'' (namely `|$X$|') without crucial error. # (Except that the italic correction was missing for some reason.) D120. Remember to decrement \\{cur_level} in \\{fin_align}. [The routines will eventually become more general and use \\{unsave} here.] @800 D121. Remember to increment \\{cur_level} in error corrections by \\{handle_right_brace}. [A better procedure will be adopted later.] @1069 T122. Fix a typo: (`|{|' instead of `|}|') in error message for $\\{mmode}+ \\{math_shift}$. @1065 R123\>99. Make \\{show_noad_list} more robust and more like the new \\{show_node_list}. [The routines will be combined in \TeX82.] @690 L124. Fix a typo in \\{char_box}: should say \\{font_info_real}. [In \TeX78 a single array is used for both \\{real} and \\{integer}; in \TeX82 things will be \\{scaled}.] @554 B125. Fix typos in the definitions of \\{default_rule_thickness} and \\{big_op_spacing}; they shouldn't start at \\{mathex}(7). @701 B126. Reverse the \\{before} and \\{after} conventions in math nodes. @1196 # I had them backwards; this turned hyphenation on just before math, and off just after it! # Seven and a half hours debugging today. Got through the test program a little more. But \TeX\ blew up on `|$Y+1$|'; tomorrow I hope to find out why. * 20 Mar 1978 # 8pm. I decided to work next on a super-hairy formula. C127. Change `|\ascii|' to `|\cc|' (character code). [This name will change again later, to `|\char|'.] @265 E128. Don't bother to store a penalty node at the beginning of |$$| when the paragraph-so-far fits on a single line, since such a penalty has already been stored. [These conventions will change later, and the |\predisplaypenalty| will always be stored.] @1203 S129. Avoid reference to \\{tail} in \\{build_page}, if $\\{nest_ptr}>0$. @995 B130. Correct a silly slip in \\{math_comp} (the exact opposite of what I did in \#118). @1158 B131. Rectify my mental lapse in \\{make_fraction}; I said \\{nucleus} instead of \\{thickness}. @743 F132. Mask off the math class when scanning delimiters. @1160 C133. Allow an optional space after |\def{...}|. [This decision will be retracted later.] @473 # My test example is so complicated it causes the semantic stacks to overflow! L134. Don't test for no pages output by looking at the channel status. @642 T135. Fix typo in definition of\/ |\mathop| (\\{open_noad} not \\{op_noad}). @1156 A136. Rewrite \\{fin_mlist}, because `|\left(...\above...\right)|' doesn't parse correctly; the |\left| goes into the numerator, the |\right| into the denominator. @1184 B137. Correct the use of \\{depth_threshold} in \\{print_subsidiary_data}: Simple fields get shown while others look empty. @692 I138\>78. Return the carriage before showing the first line of a new file when pausing. @538 M139. Fix bug: The call \\{show_noad_list}(\\{mem}[|..|]) should be \\{show_noad_list}(|..|), in the \\{incompleat_noad} case of \\{show_activities}. @219 # 3am. The whole messy formula has been parsed correctly into a tree. # The easy part is done, now comes the harder part. F140. Don't shift single characters down in \\{make_op}. @749 D141. Make \\{clean_box} return a box (as its name implies), not an hlist. @720 # Font info still isn't quite right, it has the wrong value of \\{quad}. A142. Retain the italic correction when doing \\{rebox}; can make $\\{glue_set}\ne0$ a flag for this. [A better solution will be adopted later.] @715 B143. Fix the bug that makes \\{rebox} bomb out: $\\{value}(p)$ should be $\\{value}(\\{mem}[p])$. @715 # 6am; ten hours today. \TeX\ didn't do |$\pi\over2$| correctly, but was close. # I found that the \\{rebox} problem (\#142) went away when I fixed the \\{clean_box} problem (\#141); but I will leave the extra stuff about $\\{glue_set} \ne 0$ in the program anyway, just for weird cases. E144. Omit extra levels of boxing when possible in \\{clean_box}. @721 # (To do this, I need to face the \\{rebox} problem anyway.) * 21 Mar 1978 # 10pm. The computer is rather heavily loaded tonight. F145. Don't forget \\{thickness} when making a square-root sign (see \#131). [The rule thickness will later be derived from the character height.] @737 L146. Define $p$ local to the \\{make_fraction} routine. @743 # Unwittingly using the global $p$ was a disaster. I147. Don't show the amount of \\{glue_set} when it's zero. @186 D148\>142. Make \\{glue_set} nonzero in the result of \\{var_delimiter}. @706 F149. Fix bug: The \\{math_glue} function didn't return any result. @716 T150. Fix typo in \\{char_box} ($c$ not $w$); this caused a subscripted~$P$ to come out the same width as an unsubscripted~$P$. [Later changes in the rules will move this computation to \S755.] @709 P151\>144. Revise \\{clean_box} to do operations that are needed often because of the \\{rebox} change. @720 D152. Use the new \\{clean_box} to avoid a bug in |\sqrt{\raise...}|. @737 Q153. Change the definition of\/ |\not| so that it's a relation (which will butt against the following relation). [All math symbols and Greek letters are defined in |INITEX| at this time, not in a changeable format definition.] I154. Give error message `{\tt Large delimiter must be in mathex font}', instead of calling \\{confusion}, since the error can occur. [This particular error is impossible in \TeX82.] @706 F155. Change the use of $p$ in \\{var_delimiter}; it isn't always set when I say {\bf goto} \\{found}. @706 # Another font problem now surfaced: The mathex meta-font didn't compute \TeX\ info in a machine-independent way. (It took two hours to correct this.) D156. Don't forget to set $\\{type}(b)$ in all relevant cases of \\{var_delimiter}. @708 B157. Use the correct sign convention for \\{shift_amount} in \\{hpackage}. @653 F158. Always kern by \\{delta} when there's no superscript. @755 M159. Declare \\{space_table} to be $[0\,.\,.\,6,0\,.\,.\,6]$ not $[0\,.\,.\,7,0\,.\,.\,7]$; otherwise its entries are pre\-loaded into the wrong positions. [The \\{space_table} in \TeX78 is $7\times7$; it will become $8\times8$ in \TeX82, represented as a string called \\{math_spacing}.] @764 C160. Use a negative value, not zero, to represent a null delimiter. [Actually zero will come back again later.] @685 C161\>127. Change |\cc| to |\char|. @265 L162. Don't use tricky subtraction on packed data when changing $q$ to an \\{ord_noad} in \\{mlist_to_hlist}; subtraction isn't always safe. @729 B163. Fix two typos in the \\{space_table} (|*| for |0|). @764 F164. Initialize \\{cur_size} everywhere (I forgot it in two places). @703 A165. Reset \\{op_noad} before resetting \\{bin_noad}. @728 F166. Treat $\\{display_style}+\\{cramped}$ the same as \\{display_style} inside \\{make_op}. @749 B167. Shift the character correctly in the non-|\displaystyle| case of \\{make_op}. @749 # Still another font problem: The italic corrections are wrong because the corresponding array was declared \\{real} in proto-\MF\ (and italic corrections were used in nonstandard way in |mathex|). B168. Use \\{depth} instead of \\{height} in \\{var_delimiter}. [Later, both were used.] @714 Q169. Skew the accents according to the font \\{slant}. [Soon retracted.] @741 # At this point I think nearly all the math routines have been exercised. # Tomorrow they should work! # Eight hours debugging today. * 22 Mar 1978 # (Wednesday, but actually Thursday: I began at midnight because I was proofreading a paper.) # I checked out the font access tables, slowly (i.e., all the |\mathcode| and special-character name entries were catalogued). Q170\>169. Do {\bf not\/} consider slants after all in the math accent routine, since slanted math letters are put differently into fonts. @741 B171. Don't use $q$ for two different things simultaneously in \\{make_math_accent}. @738 F172. Fix bug in \\{compact_list} (I forgot to advance the loop variable). [This procedure became unnecessary in \TeX82.] M173. Avoid conflict between \\{var_delimiter} and \\{mlist_to_hlist}, which want to use \\{temp_head} simultaneously. @713 T174. Fix bad typo in \\{overbar} routine ($b$ for $p$). @705 # Finally \TeX\ got to \\{after_math} after dealing with that hairy formula\thinspace\dots T175. Fix another bad typo: $p$ for $b$ this time. @1199 L176. Insert more parentheses (twice) because of `|lsh|' precedence in |SAIL|. @1199 M177\>36. Use the new hanging-indentation conventions when formatting displayed equations. @1199 Q178. Recompute penalties so that break is allowed after \\{punct_noad}s. @761 F179. Center the large delimiters vertically. @749 Q180. Round all rule sizes (up) before drawing them. @589 Q181. Provide more space over $x$ in $\sqrt x$, and more space atop vincula. @705,737 Q182. Make large delimiters large enough to cover formula height (important for subscripts, superscripts). @762 I183. Insert |/ntn=33| on XGP prompt message so that complex math won't blow the device driver. [See \#84.] P184\>161. Update the comment about the meaning of\/ |\char|, since it can be used in math mode. @208 # Six hours today. * 23 Mar 1978 # 11pm, Maundy Thursday. C185\>104. Make |\tracing| and |\jpar| follow block structure. @283 # It took me two hours to enter yesterday's corrections, because the changes were so numerous. M186. Fix bad call on \\{begin_token_list} when marks are to be scanned. @396 # Now the formula looks like it should, modulo problems in fonts. Q187. Prevent an exponent from going below baseline + xheight/4. @758 B188. Change \\{quad} to \\{math_quad} when finishing a display