The R Project SVN R

Rev

Rev 5458 | Rev 6098 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5458 Rev 5731
Line 300... Line 300...
300
    case xi11:	  /* big_op_spacing3 */
300
    case xi11:	  /* big_op_spacing3 */
301
    case xi12:	  /* big_op_spacing4 */
301
    case xi12:	  /* big_op_spacing4 */
302
    case xi13:	  /* big_op_spacing5 */
302
    case xi13:	  /* big_op_spacing5 */
303
	return 0.15 * XHeight();
303
	return 0.15 * XHeight();
304
    default:/* never happens (enum type) */
304
    default:/* never happens (enum type) */
305
	error("invalid `which' in TeX()!\n"); return 0;/*-Wall*/
305
	error("invalid `which' in TeX()!"); return 0;/*-Wall*/
306
    }
306
    }
307
}
307
}
308
 
308
 
309
/*
309
/*
310
 *  TeX Math Styles
310
 *  TeX Math Styles
Line 347... Line 347...
347
    case STYLE_SS:
347
    case STYLE_SS:
348
    case STYLE_SS1:
348
    case STYLE_SS1:
349
	MathDevice->gp.cex = 0.5 * BaseCex;
349
	MathDevice->gp.cex = 0.5 * BaseCex;
350
	break;
350
	break;
351
    default:
351
    default:
352
	error("invalid math style encountered\n");
352
	error("invalid math style encountered");
353
    }
353
    }
354
    CurrentStyle = newstyle;
354
    CurrentStyle = newstyle;
355
}
355
}
356
 
356
 
357
static void SetPrimeStyle(STYLE style)
357
static void SetPrimeStyle(STYLE style)
Line 1208... Line 1208...
1208
	opBBox = CombineBBoxes(arg1BBox, opBBox);
1208
	opBBox = CombineBBoxes(arg1BBox, opBBox);
1209
	opBBox = CombineBBoxes(opBBox, arg2BBox);
1209
	opBBox = CombineBBoxes(opBBox, arg2BBox);
1210
	return opBBox;
1210
	return opBBox;
1211
    }
1211
    }
1212
    else
1212
    else
1213
	error("invalid mathematical annotation\n");
1213
	error("invalid mathematical annotation");
1214
 
1214
 
1215
    return NullBBox();		/* -Wall */
1215
    return NullBBox();		/* -Wall */
1216
}
1216
}
1217
 
1217
 
1218
static SymTab BinTable[] = {
1218
static SymTab BinTable[] = {
Line 1340... Line 1340...
1340
	bbox = RenderSymbolChar(op, draw);
1340
	bbox = RenderSymbolChar(op, draw);
1341
	bbox = CombineBBoxes(bbox, RenderGap(gap, draw));
1341
	bbox = CombineBBoxes(bbox, RenderGap(gap, draw));
1342
	return CombineBBoxes(bbox, RenderElement(CADR(expr), draw));
1342
	return CombineBBoxes(bbox, RenderElement(CADR(expr), draw));
1343
    }
1343
    }
1344
    else
1344
    else
1345
	error("invalid mathematical annotation\n");
1345
	error("invalid mathematical annotation");
1346
 
1346
 
1347
    return NullBBox();		/* -Wall */
1347
    return NullBBox();		/* -Wall */
1348
 
1348
 
1349
}
1349
}
1350
 
1350
 
Line 1618... Line 1618...
1618
    return NameAtom(expr) && (AccentCode(expr) != 0);
1618
    return NameAtom(expr) && (AccentCode(expr) != 0);
1619
}
1619
}
1620
 
1620
 
1621
static void InvalidAccent(SEXP expr)
1621
static void InvalidAccent(SEXP expr)
1622
{
1622
{
1623
    errorcall(expr, "invalid accent\n");
1623
    errorcall(expr, "invalid accent");
1624
}
1624
}
1625
 
1625
 
1626
static BBOX RenderAccent(SEXP expr, int draw)
1626
static BBOX RenderAccent(SEXP expr, int draw)
1627
{
1627
{
1628
    SEXP body, accent;
1628
    SEXP body, accent;
Line 1827... Line 1827...
1827
	    code = '}';
1827
	    code = '}';
1828
	else if (StringMatch(head, "") || StringMatch(head, "."))
1828
	else if (StringMatch(head, "") || StringMatch(head, "."))
1829
	    code = '.';
1829
	    code = '.';
1830
    }
1830
    }
1831
    if (code == 0)
1831
    if (code == 0)
1832
	errorcall(expr, "invalid group delimiter\n");
1832
	errorcall(expr, "invalid group delimiter");
1833
    return code;
1833
    return code;
1834
}
1834
}
1835
 
1835
 
1836
static BBOX RenderDelimiter(int delim, int draw)
1836
static BBOX RenderDelimiter(int delim, int draw)
1837
{
1837
{
Line 1852... Line 1852...
1852
{
1852
{
1853
    double cexSaved = MathDevice->gp.cex;
1853
    double cexSaved = MathDevice->gp.cex;
1854
    BBOX bbox;
1854
    BBOX bbox;
1855
    int code;
1855
    int code;
1856
    if (length(expr) != 4)
1856
    if (length(expr) != 4)
1857
	errorcall(expr, "invalid group specification\n");
1857
	errorcall(expr, "invalid group specification");
1858
    bbox = NullBBox();
1858
    bbox = NullBBox();
1859
    code = DelimCode(expr, CADR(expr));
1859
    code = DelimCode(expr, CADR(expr));
1860
    MathDevice->gp.cex = DelimSymbolMag * MathDevice->gp.cex;
1860
    MathDevice->gp.cex = DelimSymbolMag * MathDevice->gp.cex;
1861
    if (code == 2) {
1861
    if (code == 2) {
1862
	bbox = RenderSymbolChar('|', draw);
1862
	bbox = RenderSymbolChar('|', draw);
Line 1921... Line 1921...
1921
	break;
1921
	break;
1922
    case '}':
1922
    case '}':
1923
	top = 252; ext = 239; bot = 254; mid = 253;
1923
	top = 252; ext = 239; bot = 254; mid = 253;
1924
	break;
1924
	break;
1925
    default:
1925
    default:
1926
	error("group is incomplete\n");
1926
	error("group is incomplete");
1927
	return ansBBox;/*never reached*/
1927
	return ansBBox;/*never reached*/
1928
    }
1928
    }
1929
    topBBox = GlyphBBox(top);
1929
    topBBox = GlyphBBox(top);
1930
    extBBox = GlyphBBox(ext);
1930
    extBBox = GlyphBBox(ext);
1931
    botBBox = GlyphBBox(bot);
1931
    botBBox = GlyphBBox(bot);
Line 1994... Line 1994...
1994
    BBOX bbox;
1994
    BBOX bbox;
1995
    double axisHeight = TeX(sigma22);
1995
    double axisHeight = TeX(sigma22);
1996
    double extra = 0.2 * xHeight();
1996
    double extra = 0.2 * xHeight();
1997
    int delim1, delim2;
1997
    int delim1, delim2;
1998
    if (length(expr) != 4)
1998
    if (length(expr) != 4)
1999
	errorcall(expr, "invalid group specification\n");
1999
	errorcall(expr, "invalid group specification");
2000
    bbox = NullBBox();
2000
    bbox = NullBBox();
2001
    delim1 = DelimCode(expr, CADR(expr));
2001
    delim1 = DelimCode(expr, CADR(expr));
2002
    delim2 = DelimCode(expr, CADDDR(expr));
2002
    delim2 = DelimCode(expr, CADDDR(expr));
2003
    bbox = RenderElement(CADDR(expr), 0);
2003
    bbox = RenderElement(CADDR(expr), 0);
2004
    dist = max(bboxHeight(bbox) - axisHeight, bboxDepth(bbox) + axisHeight);
2004
    dist = max(bboxHeight(bbox) - axisHeight, bboxDepth(bbox) + axisHeight);
Line 2472... Line 2472...
2472
	bbox = CombineBBoxes(bbox, RenderGap(gap, draw));
2472
	bbox = CombineBBoxes(bbox, RenderGap(gap, draw));
2473
	bbox = CombineBBoxes(bbox, RenderSymbolChar(op, draw));
2473
	bbox = CombineBBoxes(bbox, RenderSymbolChar(op, draw));
2474
	bbox = CombineBBoxes(bbox, RenderGap(gap, draw));
2474
	bbox = CombineBBoxes(bbox, RenderGap(gap, draw));
2475
	return CombineBBoxes(bbox, RenderElement(CADDR(expr), draw));
2475
	return CombineBBoxes(bbox, RenderElement(CADDR(expr), draw));
2476
    }
2476
    }
2477
    else error("invalid mathematical annotation\n");
2477
    else error("invalid mathematical annotation");
2478
 
2478
 
2479
    return NullBBox();		/* -Wall */
2479
    return NullBBox();		/* -Wall */
2480
}
2480
}
2481
 
2481
 
2482
 
2482