home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / CMTEX330 / SOURCE / ALIGN.C next >
C/C++ Source or Header  |  1992-02-19  |  16KB  |  734 lines

  1.  
  2. /*
  3.  * %Y%:%M%:%I%:%Q%
  4.  *
  5.  * Copyright 1987,1988,1991,1992 Pat J Monardo
  6.  *
  7.  * Redistribution of this file is permitted through
  8.  * the specifications in the file COPYING.
  9.  *
  10.  *
  11.  */
  12.  
  13. #ifndef lint
  14. static char *sccsid = "%A%";
  15. #endif
  16.  
  17. #include "tex.h"
  18.  
  19. align_stack_t *align_stack;
  20.  
  21. ptr    align_head;
  22.  
  23. ptr    cur_align;
  24. ptr    cur_span;
  25. ptr    cur_loop;
  26. ptr    cur_head;
  27. ptr    cur_tail;
  28.  
  29. ptr    end_span;
  30.  
  31. void
  32. push_alignment ()
  33. {
  34.     align_stack_t *p;
  35.  
  36.     p = (align_stack_t *) new_node(ALIGN_STACK_NODE_SIZE);
  37.     p->align_stack_field = align_stack;
  38.     p->preamble_field = preamble;
  39.     p->cur_align_field = cur_align;
  40.     p->cur_span_field = cur_span;
  41.     p->cur_loop_field = cur_loop;
  42.     p->cur_head_field = cur_head;
  43.     p->cur_tail_field = cur_tail;
  44.     p->align_state_field = align_state;
  45.     align_stack = p;
  46.     cur_head = new_avail();
  47. }
  48.  
  49. void
  50. pop_alignment ()
  51. {
  52.     align_stack_t *p;
  53.  
  54.     free_avail(cur_head);
  55.     p = align_stack;
  56.     align_stack = p->align_stack_field;
  57.     preamble = p->preamble_field;
  58.     cur_align = p->cur_align_field;
  59.     cur_span = p->cur_span_field;
  60.     cur_loop = p->cur_loop_field;
  61.     cur_head = p->cur_head_field;
  62.     cur_tail = p->cur_tail_field;
  63.     align_state = p->align_state_field;
  64.     free_node((ptr)p, ALIGN_STACK_NODE_SIZE);
  65. }
  66.  
  67. void
  68. init_align ()
  69. {
  70.     ptr    p;
  71.     sym    save_cs_ptr;
  72.  
  73. #define MISSING_MAC_PARAM "Missing # inserted in alignment preamble"
  74. #define EXTRA_MAC_PARAM "Only one # is allowed per tab"
  75.  
  76.     save_cs_ptr = cur_cs;
  77.     push_alignment();
  78.     align_state = -1000000;
  79.     if (mode == MMODE && (tail != head || incompleat_noad != null)) {
  80.         print_err("Improper ");
  81.         print_esc("halign");
  82.         print(" inside $$'s");
  83.         help_display_align();
  84.         error();
  85.         flush_math();
  86.     }
  87.     push_nest();
  88.     if (mode == MMODE) {
  89.         mode = -VMODE;
  90.         prev_depth = nest_ptr[-2].aux_field;
  91.     } else if (mode > 0) {
  92.         mode = -mode;
  93.     }
  94.     scan_spec(ALIGN_GROUP, FALSE);
  95.     preamble = null;
  96.     cur_align = align_head;
  97.     cur_loop = null;
  98.     scanner_status = ALIGNING;
  99.     warning_cs = save_cs_ptr;
  100.     align_state = -1000000;
  101.     loop {
  102.         link(cur_align) = new_param_glue(TAB_SKIP_CODE);
  103.         cur_align = link(cur_align);
  104.         if (cur_cmd == CAR_RET) {
  105.             break;
  106.         }
  107.         p = align_toks;
  108.         token_link(p) = null;
  109.         loop {
  110.             get_preamble_token();
  111.             if (cur_cmd == MAC_PARAM) {
  112.                 break;
  113.             }
  114.             if (cur_cmd <= CAR_RET
  115.             && cur_cmd >= TAB_MARK
  116.             && align_state == -1000000) {
  117.                 if (p == align_toks
  118.                 && cur_loop == null
  119.                 && cur_cmd == TAB_MARK) {
  120.                     cur_loop = cur_align;
  121.                 } else {
  122.                     print_err(MISSING_MAC_PARAM);
  123.                     help_preamble_missing();
  124.                     back_error();
  125.                     break;
  126.                 }
  127.             } else if (cur_cmd != SPACER || p != align_toks) {
  128.                 p = token_link(p) = new_token();
  129.                 token(p) = cur_tok;
  130.             }
  131.         }
  132.         link(cur_align) = new_null_box();
  133.         cur_align = link(cur_align);
  134.         end_link(cur_align) = end_span;
  135.         unset_width(cur_align) = NULL_FLAG;
  136.         u_part(cur_align) = token_link(align_toks);
  137.         p = align_toks;
  138.         token_link(p) = null;
  139.         loop {
  140.             get_preamble_token();
  141.             if (cur_cmd <= CAR_RET
  142.             && cur_cmd >= TAB_MARK
  143.             && align_state == -1000000) {
  144.                 break;
  145.             }
  146.             if (cur_cmd == MAC_PARAM) {
  147.                 print_err(EXTRA_MAC_PARAM);
  148.                 help_preamble_many();
  149.                 error();
  150.                 continue;
  151.             }
  152.             p = token_link(p) = new_token();
  153.             token(p) = cur_tok;
  154.         }
  155.         p = token_link(p) = new_token();
  156.         token(p) = END_TEMPLATE_TOKEN;
  157.         v_part(cur_align) = token_link(align_toks);
  158.     }
  159.     scanner_status = NORMAL;
  160.     new_save_level(ALIGN_GROUP);
  161.     if (every_cr != null) {
  162.         begin_token_list(every_cr, EVERY_CR_TEXT);
  163.     }
  164.     align_peek();
  165. }
  166.  
  167. void
  168. get_preamble_token ()
  169. {
  170. restart:
  171.     get_token();
  172.     while (cur_chr == SPAN_CODE && cur_cmd == TAB_MARK) {
  173.         get_token();
  174.         if (cur_cmd > MAX_COMMAND) {
  175.             expand();
  176.             get_token();
  177.         }
  178.     }
  179.     if (cur_cmd == ASSIGN_GLUE && cur_chr == TAB_SKIP_CODE) {
  180.         scan_optional_equals();
  181.         scan_glue(GLUE_VAL);
  182.         if (global_defs > 0) {
  183.             reg_gdefine(skip_reg[TAB_SKIP_CODE], SKIP_REG, cur_val);
  184.         } else {
  185.             reg_define(skip_reg[TAB_SKIP_CODE], SKIP_REG, cur_val);
  186.         }
  187.         goto restart;
  188.     }
  189. }
  190.  
  191. void
  192. align_peek ()
  193. {
  194. restart:
  195.     align_state = 1000000;
  196.     get_nbx_token();
  197.     if (cur_cmd == NO_ALIGN) {
  198.         scan_left_brace();
  199.         new_save_level(NO_ALIGN_GROUP);
  200.         if (mode == -VMODE) {
  201.             normal_paragraph();
  202.         }
  203.     } else if (cur_cmd == RIGHT_BRACE) {
  204.         fin_align();
  205.     } else if (cur_cmd == CAR_RET && cur_chr == CR_CR_CODE) {
  206.         goto restart;
  207.     } else {
  208.         init_row();
  209.         init_col();
  210.     }
  211. }
  212.  
  213. void
  214. init_row ()
  215. {
  216.     push_nest();
  217.     mode = (-HMODE - VMODE) - mode;
  218.     if (mode == -HMODE) {
  219.         space_factor = 0;
  220.     } else {
  221.         prev_depth = 0;
  222.     }
  223.     tail_append(new_glue(glue_ptr(preamble)));
  224.     subtype(tail) = TAB_SKIP_CODE + 1;
  225.     cur_align = link(preamble);
  226.     cur_tail = cur_head;
  227.     init_span(cur_align);
  228. }
  229.  
  230. void
  231. init_span (p)
  232.     ptr    p;
  233. {
  234.     push_nest();
  235.     if (mode == -HMODE) {
  236.         space_factor = 1000;
  237.     } else {
  238.         prev_depth = IGNORE_DEPTH;
  239.         normal_paragraph();
  240.     }
  241.     cur_span = p;
  242. }
  243.  
  244. void
  245. init_col ()
  246. {
  247.     unset_info(cur_align) = cur_cmd;
  248.     if (cur_cmd == OMIT) {
  249.         align_state = 0;
  250.     } else {
  251.         back_input();
  252.         begin_token_list(u_part(cur_align), U_TEMPLATE);
  253.     }
  254. }
  255.  
  256. bool
  257. fin_col ()
  258. {
  259.     int    n;
  260.     int    o;
  261.     ptr    p;
  262.     ptr    q;
  263.     ptr    r;
  264.     ptr    s;
  265.     ptr    u;
  266.     scal    w;
  267.  
  268. #define INTERWOVEN_ALIGNS "(interwoven alignment preambles are not allowed)"
  269.  
  270.     if (cur_align == null) {
  271.         confusion("endv");
  272.     }
  273.     q = link(cur_align);
  274.     if (q == null) {
  275.         confusion("endv");
  276.     }
  277.     if (align_state < 500000) {
  278.         fatal_error(INTERWOVEN_ALIGNS);
  279.     }
  280.     p = link(q);
  281.     if (p == null && unset_info(cur_align) < CR_CODE) {
  282.         if (cur_loop != null) {
  283.             p = link(q) = new_null_box();
  284.             end_link(p) = end_span;
  285.             unset_width(p) = NULL_FLAG;
  286.             cur_loop = link(cur_loop);
  287.             q = align_toks;
  288.             r = u_part(cur_loop);
  289.             while (r != null) {
  290.                 q = token_link(q) = new_token();
  291.                 token(q) = token(r);
  292.                 r = token_link(r);
  293.             }
  294.             token_link(q) = null;
  295.             u_part(p) = token_link(align_toks);
  296.             q = align_toks;
  297.             r = v_part(cur_loop);
  298.             while (r != null) {
  299.                 q = token_link(q) = new_token();
  300.                 token(q) = token(r);
  301.                 r = token_link(r);
  302.             }
  303.             token_link(q) = null;
  304.             v_part(p) = token_link(align_toks);
  305.             cur_loop = link(cur_loop);
  306.             link(p) = new_glue(glue_ptr(cur_loop));
  307.         } else {
  308.             print_err("Extra alignment tab has been changed to ");
  309.             print_esc("cr");
  310.             help_align_apply();
  311.             unset_info(cur_align) = CR_CODE;
  312.             error();
  313.         }
  314.     }
  315.     if (unset_info(cur_align) != SPAN_CODE) {
  316.         unsave();
  317.         new_save_level(ALIGN_GROUP);
  318.         if (mode == -HMODE) {
  319.             adjust_tail = cur_tail;
  320.             u = hpack(link(head), NATURAL);
  321.             w = box_width(u);
  322.             cur_tail = adjust_tail;
  323.             adjust_tail = null;
  324.         } else {
  325.             u = vpackage(link(head), NATURAL, 0);
  326.             w = box_height(u);
  327.         }
  328.         n = MIN_QUARTERWORD;
  329.         if (cur_span != cur_align) {
  330.             q = cur_span;
  331.             do    {
  332.                 incr(n);
  333.                 q = link(link(q));
  334.             } while (q != cur_align);
  335.             if (n > MAX_QUARTERWORD) {
  336.                 confusion("256 spans");
  337.             }
  338.             q = cur_span;
  339.             while (span_count(span_link(q)) < n) {
  340.                 q = span_link(q);
  341.             }
  342.             if (span_count(span_link(q)) > n) {
  343.                 s = new_node(SPAN_NODE_SIZE);
  344.                 span_link(s) = span_link(q);
  345.                 span_link(q) = s;
  346.                 span_count(s) = n;
  347.                 span_width(s) = w;
  348.             } else if (span_width(span_link(q)) < w) {
  349.                 span_width(span_link(q)) = w;
  350.             }
  351.         } else if (w > unset_width(cur_align)) {
  352.             unset_width(cur_align) = w;
  353.         }
  354.         type(u) = UNSET_NODE;
  355.         unset_span_count(u) = n;
  356.         o = get_stretch_order();
  357.         glue_order(u) = o;
  358.         unset_stretch(u) = total_stretch[o];
  359.         o = get_shrink_order();
  360.         glue_sign(u) = o;
  361.         unset_shrink(u) = total_shrink[o];
  362.         pop_nest();
  363.         tail_append(u);
  364.         tail_append(new_glue(glue_ptr(link(cur_align))));
  365.         subtype(tail) = TAB_SKIP_CODE + 1;
  366.         if (unset_info(cur_align) >= CR_CODE) {
  367.             return TRUE;
  368.         }
  369.         init_span(p);
  370.     }
  371.     align_state = 1000000;
  372.     get_nbx_token();
  373.     cur_align = p;
  374.     init_col();
  375.     return FALSE;
  376. }
  377.  
  378. void
  379. fin_row ()
  380. {
  381.     ptr    p;
  382.  
  383.     if (mode == -HMODE) {
  384.         p = hpack(link(head), NATURAL);
  385.         pop_nest();
  386.         append_to_vlist(p);
  387.         if(cur_head != cur_tail) {
  388.             link(tail) = link(cur_head);
  389.             tail = cur_tail;
  390.         }
  391.     } else {
  392.         p = vpack(link(head), NATURAL);
  393.         pop_nest();
  394.         tail = link(tail) = p;
  395.         space_factor = 1000;
  396.     }
  397.     type(p) = UNSET_NODE;
  398.     unset_stretch(p) = 0;
  399.     if (every_cr != null) {
  400.         begin_token_list(every_cr, EVERY_CR_TEXT);
  401.     }
  402.     align_peek();
  403. }
  404.  
  405. void
  406. fin_align ()
  407. {
  408.     int    n;
  409.     scal    o;
  410.     ptr    p;
  411.     ptr    q;
  412.     ptr    r;
  413.     ptr    s;
  414.     scal    t;
  415.     ptr    u;
  416.     ptr    v;
  417.     scal    w;
  418.     int    aux_save;
  419.     scal    rule_save;
  420.  
  421.     if (cur_group != ALIGN_GROUP) {
  422.         confusion("align1");
  423.     }
  424.     unsave();
  425.     if (cur_group != ALIGN_GROUP) {
  426.         confusion("align0");
  427.     }
  428.     unsave();
  429.     if (nest_ptr[-1].mode_field == MMODE) {
  430.         o = display_indent;
  431.     } else {
  432.         o = 0;
  433.     }
  434.     q = link(preamble);
  435.     do {
  436.         flush_list(u_part(q));
  437.         flush_list(v_part(q));
  438.         p = link(link(q));
  439.         if (unset_width(q) == NULL_FLAG) {
  440.             unset_width(q) = 0;
  441.             r = link(q);
  442.             s = glue_ptr(r);
  443.             if (s != zero_glue) {
  444.                 add_glue_ref(zero_glue);
  445.                 delete_glue_ref(s);
  446.                 glue_ptr(r) = zero_glue;
  447.             }
  448.         }
  449.         if (unset_span_list(q) != end_span) {
  450.             t = unset_width(q) + glue_width(glue_ptr(link(q)));
  451.             r = unset_span_list(q);
  452.             s = end_span;
  453.             span_link(s) = p;
  454.             n = MIN_QUARTERWORD + 1;
  455.             do {    
  456.                 span_width(r) -= t;
  457.                 u = span_link(r);
  458.                 while (span_count(r) > n) {
  459.                     s = span_link(s);
  460.                     n = span_count(span_link(s)) + 1;
  461.                 }
  462.                 if (span_count(r) < n) {
  463.                     span_link(r) = span_link(s);
  464.                     span_link(s) = r;
  465.                     decr(span_count(r));
  466.                     s = r;
  467.                 } else {
  468.                     if (span_width(r) >
  469.                         span_width(span_link(s))) {
  470.                         span_width(span_link(s)) =
  471.                             span_width(r);
  472.                     }
  473.                     free_node(r, SPAN_NODE_SIZE);
  474.                 }
  475.                 r = u;
  476.             } while (r != end_span);
  477.         }
  478.         type(q) = UNSET_NODE;
  479.         unset_span_count(q) = MIN_QUARTERWORD;
  480.         box_height(q) = 0;
  481.         box_depth(q) = 0;
  482.         glue_order(q) = NORMAL;
  483.         glue_sign(q) = NORMAL;
  484.         unset_stretch(q) = 0;
  485.         unset_shrink(q) = 0;
  486.         q = p;
  487.     } while (q != null);
  488.     save_ptr -= 2;
  489.     pack_begin_line = -mode_line;
  490.     if (mode == -VMODE) {
  491.         rule_save = overfull_rule;
  492.         overfull_rule = 0;
  493.         p = hpack(preamble, saved(1), saved(0));
  494.         overfull_rule = rule_save;
  495.     } else {
  496.         q = link(preamble);
  497.         do {
  498.             box_height(q) = box_width(q);
  499.             box_width(q) = 0;
  500.             q = link(link(q));
  501.         } while (q != null);
  502.         p = vpackage(preamble, saved(1), saved(0), MAX_DIMEN);
  503.         q = link(preamble);
  504.         do {
  505.             box_width(q) = box_height(q);
  506.             box_height(q) = 0;
  507.             q = link(link(q));
  508.         } while (q != null);
  509.     }
  510.     pack_begin_line = 0;
  511.     for (q = link(head); q != null; q = link(q)) {
  512.         if (type(q) == UNSET_NODE) {
  513.             if (mode == -VMODE) {
  514.                 type(q) = HLIST_NODE;
  515.                 box_width(q) = box_width(p);
  516.             } else {
  517.                 type(q) = VLIST_NODE;
  518.                 box_height(q) = box_height(p);
  519.             }
  520.             glue_order(q) = glue_order(p);
  521.             glue_sign(q) = glue_sign(p);
  522.             glue_set(q) = glue_set(p);
  523.             shift_amount(q) = o;
  524.             r = link(list_ptr(q));
  525.             s = link(list_ptr(p)); 
  526.             do {
  527.                 n = unset_span_count(r); 
  528.                 w = t = unset_width(s);
  529.                 u = hold_head;
  530.                 while (n > MIN_QUARTERWORD) {
  531.                     decr(n);
  532.                     s = link(s);
  533.                     v = glue_ptr(s);
  534.                     link(u) = new_glue(v);
  535.                     u = link(u);
  536.                     subtype(u) = TAB_SKIP_CODE + 1;
  537.                     t += glue_width(v);
  538.                     if (glue_sign(p) == STRETCHING) {
  539.                         if (stretch_order(v) == glue_order(p))
  540.                             t += round(glue_set(p) *
  541.                                 stretch(v));
  542.                     } else if (glue_sign(p) == SHRINKING) {
  543.                         if (shrink_order(v) == glue_order(p))
  544.                             t -= round(glue_set(p) *
  545.                                 shrink(v));
  546.                     }
  547.                     s = link(s);
  548.                     u = link(u) = new_null_box();
  549.                     t += box_width(s);
  550.                     if (mode == -VMODE) {
  551.                         box_width(u) = box_width(s);
  552.                     } else {
  553.                         type(u) = VLIST_NODE;
  554.                         box_height(u) = box_width(s);
  555.                     }
  556.                 }
  557.                 if (mode == -VMODE) {
  558.                     box_height(r) = box_height(q);
  559.                     box_depth(r) = box_depth(q);
  560.                     if (t == box_width(r)) {
  561.                         glue_sign(r) = NORMAL;
  562.                         glue_order(r) = NORMAL;
  563.                         glue_set(r) = 0.0;
  564.                     } else if (t > box_width(r)) {
  565.                         glue_sign(r) = STRETCHING;
  566.                         glue_set(r) = (unset_stretch(r) == 0) ? 0.0 : 
  567.                             (float) (t - glue_width(r)) / unset_stretch(r);
  568.                     } else {
  569.                         glue_order(r) = glue_sign(r);
  570.                         glue_sign(r) = SHRINKING;
  571.                         if (unset_shrink(r) == 0)
  572.                             glue_set(r) = 0.0;
  573.                         else if (glue_order(r) == NORMAL &&
  574.                             box_width(r) - t > unset_shrink(r))
  575.                             glue_set(r) = 1.0;
  576.                         else glue_set(r) = (float) (box_width(r) - t) /
  577.                                             unset_shrink(r);
  578.                     }
  579.                     box_width(r) = w;
  580.                     type(r) = HLIST_NODE;
  581.                 } else {
  582.                     box_width(r) = box_width(q);
  583.                     if (t == box_height(r)) {
  584.                         glue_sign(r) = NORMAL;
  585.                         glue_order(r) = NORMAL;
  586.                         glue_set(r) = 0.0;
  587.                     } else if (t > box_height(r)) {
  588.                         glue_sign(r) = STRETCHING;
  589.                         glue_set(r) = (unset_stretch(r) == 0) ? 0.0 :
  590.                                 (float) (t - box_height(r)) / unset_stretch(r);
  591.                     } else {
  592.                         glue_order(r) = glue_sign(r);
  593.                         glue_sign(r) = SHRINKING;
  594.                         if (unset_shrink(r) == 0)
  595.                             glue_set(r) = 0.0;
  596.                         else if (glue_order(r) == NORMAL &&
  597.                             box_height(r) - t > unset_shrink(r))
  598.                             glue_set(r) = 1.0;
  599.                         else glue_set(r) = (float) (box_height(r) - t) /
  600.                                                     unset_shrink(r);
  601.                     }
  602.                     box_height(r) = w;
  603.                     type(r) = VLIST_NODE;
  604.                 } 
  605.                 shift_amount(r) = 0; 
  606.                 if (u != hold_head) {
  607.                     link(u) = link(r);
  608.                     link(r) = link(hold_head);
  609.                     r = u;
  610.                 }
  611.                 r = link(link(r));
  612.                 s = link(link(s));
  613.             } while (r != null);
  614.         } else if (type(q) == RULE_NODE) {
  615.             if (is_running(rule_width(q))) {
  616.                 rule_width(q) = rule_width(p);
  617.             }
  618.             if (is_running(rule_height(q))) {
  619.                 rule_height(q) = rule_height(p);
  620.             }
  621.             if (is_running(rule_depth(q))) {
  622.                 rule_depth(q) = rule_depth(p);
  623.             }
  624.             if (o != 0) {
  625.                 r = link(q);
  626.                 link(q) = null;
  627.                 q = hpack(q, NATURAL);
  628.                 shift_amount(q) = o;
  629.                 link(q) = r;
  630.                 link(s) = q;
  631.             }
  632.         }
  633.     }
  634.     flush_node_list(p);
  635.     pop_alignment();
  636.     aux_save = aux;
  637.     p = link(head);
  638.     q = tail;
  639.     pop_nest();
  640.     if (mode == MMODE) {
  641.         do_assignments();
  642.         if (cur_cmd != MATH_SHIFT) {
  643.             print_err("Missing $$ inserted");
  644.             help_fin_display_align();
  645.             back_error();
  646.         } else {    
  647.             get_x_token();
  648.             if (cur_cmd != MATH_SHIFT) {
  649.                 print_err("Display math should end with $$");
  650.                 help_fin_display();
  651.                 back_error();
  652.             }
  653.         }
  654.         pop_nest();
  655.         tail_append(new_penalty(pre_display_penalty));
  656.         tail_append(new_param_glue(ABOVE_DISPLAY_SKIP_CODE));
  657.         link(tail) = p;
  658.         if (p != null) {
  659.             tail = q;
  660.         }
  661.         tail_append(new_penalty(post_display_penalty));
  662.         tail_append(new_param_glue(BELOW_DISPLAY_SKIP_CODE));
  663.         prev_depth = aux_save;
  664.         resume_after_display();
  665.     } else {
  666.         aux = aux_save;
  667.         link(tail) = p;
  668.         if (p != null) {
  669.             tail = q;
  670.         }
  671.         if (mode == VMODE) {
  672.             build_page();
  673.         }
  674.     }
  675. }
  676.  
  677. void
  678. _align_init ()
  679. {
  680. }
  681.     
  682. void
  683. _align_init_once ()
  684. {
  685.     align_head = new_avail(); 
  686.     end_span = new_node(SPAN_NODE_SIZE);
  687.     span_count(end_span) = MAX_QUARTERWORD + 1;
  688.     span_link(end_span) = null;
  689. }
  690.  
  691. /*
  692. **    Help text
  693. */
  694.  
  695. help_display_align ()
  696. {
  697.     help3("Displays can use special alignments (like \\eqalignno)",
  698.     "only if nothing but the alignment itself is between $$'s.",
  699.     "So I've deleted the formulas that preceded this alignment.");
  700. }
  701.  
  702. help_fin_display_align ()
  703. {
  704.     help2("Displays can use special alignments (like \\eqalignno)",
  705.     "only if nothing but the alignment itself is between $$'s.");
  706. }
  707.  
  708. help_preamble_missing ()
  709. {
  710.     help3("There should be exactly one # between &'s, when an",
  711.     "\\halign or \\valign is being set up. In this case you had",
  712.     "none, so I've put one in; maybe that will work.");
  713. }
  714.  
  715. help_preamble_many ()
  716. {
  717.     help3("There should be exactly one # between &'s, when an",
  718.     "\\halign or \\valign is being set up. In this case you had",
  719.     "more than one, so I'm ignoring all but the first.");
  720. }
  721.  
  722. help_align_apply ()
  723. {
  724.     help3("You have given more \\span or & marks than there were",
  725.     "in the preamble to the \\halign or \\valign now in progress.",
  726.     "So I'll assume that you meant to type \\cr instead.");
  727. }
  728.  
  729. help_fin_display ()
  730. {
  731.     help2("The `$' that I just saw supposedly matches a previous `$$'.",
  732.     "So I shall assume that you typed `$$' both times.");
  733. }
  734.