|
|
@ -241,7 +241,7 @@ void supsubscript_render(struct TeX_Node const * node, int x, int y, |
|
|
|
} |
|
|
|
|
|
|
|
//--- |
|
|
|
// Summation symbols. |
|
|
|
// Summation symbol. |
|
|
|
// * args: 0 (ignored) |
|
|
|
// * flow: default |
|
|
|
// |
|
|
@ -268,6 +268,55 @@ void sum_render(__attribute__((unused)) struct TeX_Node const * node, int x, |
|
|
|
TeX_pixel(x + 8, y + 7, color); |
|
|
|
} |
|
|
|
|
|
|
|
//--- |
|
|
|
// Product symbol. |
|
|
|
// * args: 0 (ignored) |
|
|
|
// * flow: default |
|
|
|
// |
|
|
|
// Just like summation symbols, uses display mode by default. |
|
|
|
//--- |
|
|
|
|
|
|
|
void prod_size(struct TeX_Node *node) |
|
|
|
{ |
|
|
|
node->width = 9; |
|
|
|
node->height = 9; |
|
|
|
node->line = 4; |
|
|
|
} |
|
|
|
|
|
|
|
void prod_render(__attribute__((unused)) struct TeX_Node const * node, int x, |
|
|
|
int y, int color) |
|
|
|
{ |
|
|
|
TeX_line(x, y, x + 8, y, color); |
|
|
|
TeX_line(x + 1, y, x + 1, y + 8, color); |
|
|
|
TeX_line(x + 0, y + 8, x + 2, y + 8, color); |
|
|
|
TeX_line(x + 7, y, x + 7, y + 8, color); |
|
|
|
TeX_line(x + 6, y + 8, x + 8, y + 8, color); |
|
|
|
} |
|
|
|
|
|
|
|
//--- |
|
|
|
// Integral symbol |
|
|
|
// * args: 0 (ignored) |
|
|
|
// * flow: default |
|
|
|
//--- |
|
|
|
|
|
|
|
void int_size(struct TeX_Node *node) |
|
|
|
{ |
|
|
|
node->width = 5; |
|
|
|
node->height = 19; |
|
|
|
node->line = 9; |
|
|
|
} |
|
|
|
|
|
|
|
void int_render(struct TeX_Node const * node, int x, int y, int color) |
|
|
|
{ |
|
|
|
int h = node->height; |
|
|
|
|
|
|
|
TeX_pixel(x + 3, y, color); |
|
|
|
TeX_pixel(x + 4, y + 1, color); |
|
|
|
TeX_line(x + 2, y + 1, x + 2, y + h - 2, color); |
|
|
|
TeX_pixel(x, y + h - 2, color); |
|
|
|
TeX_pixel(x + 1, y + h - 1, color); |
|
|
|
} |
|
|
|
|
|
|
|
//--- |
|
|
|
// The class table and lookup functions |
|
|
|
//--- |
|
|
@ -276,19 +325,25 @@ struct TeX_Class TeX_table[] = { |
|
|
|
/* Text is omitted from the table and has ID 0 */ |
|
|
|
|
|
|
|
/* Fractions */ |
|
|
|
{ "frac", frac_size, frac_render }, |
|
|
|
{ "frac", frac_size, frac_render }, |
|
|
|
|
|
|
|
/* Size-aware opening and closing elements */ |
|
|
|
{ "left", leftright_size, leftright_render }, |
|
|
|
{ "right", leftright_size, leftright_render }, |
|
|
|
|
|
|
|
/* Superscripts and subscripts */ |
|
|
|
{ "\\sup", supsubscript_size, supsubscript_render }, |
|
|
|
{ "\\sub", supsubscript_size, supsubscript_render }, |
|
|
|
/* Sum symbol */ |
|
|
|
{ "sum", sum_size, sum_render }, |
|
|
|
|
|
|
|
/* Large operator symbols */ |
|
|
|
{ "sum", sum_size, sum_render }, |
|
|
|
{ "prod", prod_size, prod_render }, |
|
|
|
|
|
|
|
/* Integral */ |
|
|
|
{ "int", NULL, NULL }, |
|
|
|
{ "int", int_size, int_render }, |
|
|
|
|
|
|
|
/* NULL terminator */ |
|
|
|
{ NULL, NULL, NULL }, |
|
|
|
{ NULL }, |
|
|
|
}; |
|
|
|
|
|
|
|
/* class_find() - Find a class using a command name */ |
|
|
|