eqnbox.c 988 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #include "e.h"
  10. void eqnbox(int p1, int p2, int lu)
  11. {
  12. double b, h;
  13. char *sh;
  14. extern char *IRspace;
  15. yyval = p1;
  16. b = max(ebase[p1], ebase[p2]);
  17. eht[yyval] = h = b + max(eht[p1]-ebase[p1],
  18. eht[p2]-ebase[p2]);
  19. ebase[yyval] = b;
  20. dprintf(".\tS%d <- %d %d; b=%g, h=%g\n", yyval, p1, p2, b, h);
  21. sh = pad(class[rclass[p1]][lclass[p2]]);
  22. if (lu) {
  23. printf(".nr %d \\w'\\*(%d%s'\n", p1, p1, sh);
  24. printf(".ds %d \\h'|\\n(09u-\\n(%du'\\*(%d\n", p1, p1, p1);
  25. }
  26. printf(".as %d \"%s\\*(%d\n", yyval, sh, p2);
  27. rfont[p1] = rfont[p2];
  28. rclass[p1] = rclass[p2];
  29. sfree(p2);
  30. }