xref: /titanic_52/usr/src/cmd/eqn/eqnbox.c (revision 554ff184129088135ad2643c1c9832174a17be88)
1 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
2 /*	  All Rights Reserved  	*/
3 
4 
5 /*
6  * Copyright (c) 1980 Regents of the University of California.
7  * All rights reserved. The Berkeley software License Agreement
8  * specifies the terms and conditions for redistribution.
9  */
10 
11 /*
12  * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
13  * All Rights Reserved.
14  */
15 
16 #ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.1	*/
17 
18 # include "e.h"
19 
20 eqnbox(p1, p2, lu) {
21 	int b, h;
22 	char *sh;
23 
24 	yyval = p1;
25 	b = max(ebase[p1], ebase[p2]);
26 	eht[yyval] = h = b + max(eht[p1]-ebase[p1],
27 		eht[p2]-ebase[p2]);
28 	ebase[yyval] = b;
29 	if(dbg)printf(".\te:eb: S%d <- S%d S%d; b=%d, h=%d\n",
30 		yyval, p1, p2, b, h);
31 	if (rfont[p1] == ITAL && lfont[p2] == ROM)
32 		sh = "\\|";
33 	else
34 		sh = "";
35 	if (lu) {
36 		printf(".nr %d \\w'\\s%d\\*(%d%s'\n", p1, ps, p1, sh);
37 		printf(".ds %d \\h'|\\n(97u-\\n(%du'\\*(%d\n", p1, p1, p1);
38 	}
39 	printf(".as %d \"%s\\*(%d\n", yyval, sh, p2);
40 	rfont[p1] = rfont[p2];
41 	ofree(p2);
42 }
43