home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Tex / Tex29 / StTeXsrc.zoo / src / math.h < prev    next >
Text File  |  1988-03-13  |  5KB  |  160 lines

  1.  
  2. /*
  3.  * @(#)math.h 2.6 EPA
  4.  *
  5.  * Copyright 1987,1988 Pat J Monardo
  6.  *
  7.  * Redistribution of this file is permitted through
  8.  * the specifications in the file COPYING.
  9.  *
  10.  * 
  11.  */
  12.  
  13. ptr     new_style();
  14.  
  15. #define STYLE_NODE              (UNSET_NODE + 1)
  16. #define DISPLAY_STYLE           0
  17. #define TEXT_STYLE              2
  18. #define SCRIPT_STYLE            4
  19. #define SCRIPT_SCRIPT_STYLE     6
  20. #define CRAMPED                 1
  21. #define STYLE_NODE_SIZE         3
  22.  
  23. ptr     new_choice();
  24.  
  25. #define CHOICE_NODE             (UNSET_NODE + 2)
  26. #define display_mlist(C)        info(C + 1)
  27. #define text_mlist(C)           link(C + 1)
  28. #define script_mlist(C)         info(C + 2)
  29. #define script_script_mlist(C)  link(C + 2)
  30.  
  31. ptr     new_noad();
  32.  
  33. #define NOAD_SIZE           4
  34. #define nucleus(N)          (N + 1)
  35. #define supscr(N)           (N + 2)
  36. #define subscr(N)           (N + 3)
  37. #define fam                 font
  38. #define math_type           link
  39.  
  40. #define ORD_NOAD            (UNSET_NODE + 3)
  41. #define OP_NOAD             (ORD_NOAD + 1)
  42. #define BIN_NOAD            (ORD_NOAD + 2)
  43. #define REL_NOAD            (ORD_NOAD + 3)
  44. #define OPEN_NOAD           (ORD_NOAD + 4)
  45. #define CLOSE_NOAD          (ORD_NOAD + 5)
  46. #define PUNCT_NOAD          (ORD_NOAD + 6)
  47. #define INNER_NOAD          (ORD_NOAD + 7)
  48.  
  49. #define MATH_CHAR           1
  50. #define SUB_BOX             2
  51. #define SUB_MLIST           3
  52. #define MATH_TEXT_CHAR      4
  53.  
  54. #define LIMITS              1
  55. #define NO_LIMITS           2
  56.  
  57. #define left_delimiter(D)   (D + 4)
  58. #define right_delimiter(D)  (D + 5)
  59.  
  60. #define small_fam(D)        mem[D].qqqq.b0
  61. #define small_char(D)       mem[D].qqqq.b1
  62. #define large_fam(D)        mem[D].qqqq.b2
  63. #define large_char(D)       mem[D].qqqq.b3
  64.  
  65. #define RADICAL_NOAD        (INNER_NOAD + 1)
  66. #define RADICAL_NOAD_SIZE   5
  67. #define FRACTION_NOAD       (RADICAL_NOAD + 1)
  68. #define FRACTION_NOAD_SIZE  6
  69. #define DEFAULT_CODE        010000000000
  70. #define thickness           width
  71. #define numerator           supscr
  72. #define denominator         subscr
  73.  
  74. #define null_delimiter      null_character
  75.  
  76. global  hh  empty_field;
  77.  
  78. #define UNDER_NOAD          (FRACTION_NOAD + 1)
  79. #define OVER_NOAD           (UNDER_NOAD + 1)
  80. #define ACCENT_NOAD         (OVER_NOAD + 1)
  81. #define ACCENT_NOAD_SIZE    5
  82. #define accent_chr(A)       (A + 4)
  83. #define VCENTER_NOAD        (ACCENT_NOAD + 1)
  84. #define LEFT_NOAD           (VCENTER_NOAD + 1)
  85. #define RIGHT_NOAD          (LEFT_NOAD + 1)
  86. #define delimiter           nucleus 
  87.  
  88. #define scripts_allowed(N)  (type(N) >= ORD_NOAD && type(N) < LEFT_NOAD)
  89.  
  90. int     print_fam_and_char();
  91. int     print_delimiter();
  92. int     print_subsidiary_data();
  93. int     print_style();
  94. int     print_size();
  95.  
  96. #define TEXT_SIZE           0
  97. #define SCRIPT_SIZE         16
  98. #define SCRIPT_SCRIPT_SIZE  32
  99.  
  100. int     show_normal_noad();
  101. int     show_fraction_noad();
  102.  
  103. #define mathsy(F, P) \
  104.     font_info[param_base[fam_fnt(2 + F)] + P].sc
  105.  
  106. #define math_x_height(F)    mathsy(F, 5)
  107. #define math_quad(F)        mathsy(F, 6)
  108. #define num1(F)             mathsy(F, 8)
  109. #define num2(F)             mathsy(F, 9)
  110. #define num3(F)             mathsy(F, 10)
  111. #define denom1(F)           mathsy(F, 11)
  112. #define denom2(F)           mathsy(F, 12)
  113. #define sup1(F)             mathsy(F, 13)
  114. #define sup2(F)             mathsy(F, 14)
  115. #define sup3(F)             mathsy(F, 15)
  116. #define sub1(F)             mathsy(F, 16)
  117. #define sub2(F)             mathsy(F, 17)
  118. #define sup_drop(F)         mathsy(F, 18)
  119. #define sub_drop(F)         mathsy(F, 19)
  120. #define delim1(F)           mathsy(F, 20)
  121. #define delim2(F)           mathsy(F, 21)
  122. #define axis_height(F)      mathsy(F, 22)
  123.  
  124. #define TOTAL_MATHSY_PARAMS 22
  125.  
  126. #define mathex(P) \
  127.     font_info[param_base[fam_fnt(3 + cur_size)] + P].sc
  128.  
  129. #define default_rule_thickness  mathex(8)
  130. #define big_op_spacing1         mathex(9)
  131. #define big_op_spacing2         mathex(10)
  132. #define big_op_spacing3         mathex(11)
  133. #define big_op_spacing4         mathex(12)
  134. #define big_op_spacing5         mathex(13)
  135.  
  136. #define TOTAL_MATHEX_PARAMS 13
  137.  
  138. #define cramped_style(S)    2 * ((S)>>1) + CRAMPED
  139. #define sub_style(S)        2 * ((S)>>2) + SCRIPT_STYLE + CRAMPED
  140. #define sup_style(S)        2 * ((S)>>2) + SCRIPT_STYLE + ((S)&1)
  141. #define num_style(S)        S + 2 - 2 * (S / 6)
  142. #define denom_style(S)      2 * ((S)>>1) + CRAMPED + 2 - 2 * (S / 6)
  143.  
  144. #define change_size_and_mu() \
  145.     {if (cur_style < SCRIPT_STYLE) \
  146.         cur_size = TEXT_SIZE; \
  147.     else cur_size = 16 * ((cur_style - TEXT_STYLE) / 2); \
  148.     cur_mu = x_over_n(math_quad(cur_size), 18L);}
  149.  
  150. ptr     fraction_rule();
  151. ptr     overbar();
  152. ptr     var_delimiter();
  153. int     stack_into_box();
  154. scal    height_plus_depth();
  155. ptr     char_box();
  156. ptr     rebox();
  157. ptr     math_glue();
  158. int     math_kern();
  159. int     flush_math();
  160.