diff options
Diffstat (limited to 'eqn.c')
-rw-r--r-- | eqn.c | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -80,11 +80,22 @@ static const struct eqnstr eqnmarks[EQNMARK__MAX] = { }; static const struct eqnstr eqnfonts[EQNFONT__MAX] = { + { "", 0 }, { "roman", 5 }, { "bold", 4 }, { "italic", 6 }, }; +static const struct eqnstr eqnposs[EQNPOS__MAX] = { + { "", 0 }, + { "over", 4 }, + { "sup", 3 }, + { "sub", 3 }, + { "to", 2 }, + { "from", 4 }, + { "above", 5 }, +}; + /* ARGSUSED */ enum rofferr eqn_read(struct eqn_node **epp, int ln, @@ -189,8 +200,7 @@ eqn_box(struct eqn_node *ep, struct eqn_box *last, struct eqn_box **sv) *sv = last; nextc = 1; - font = EQNFONT_NONE; - + font = EQNFONT_NONE; again: if (NULL == (start = eqn_nexttok(ep, &sz))) return(0); @@ -204,6 +214,15 @@ again: goto again; } + for (i = 0; i < (int)EQNFONT__MAX; i++) { + if (eqnposs[i].sz != sz) + continue; + if (strncmp(eqnposs[i].name, start, sz)) + continue; + last->pos = (enum eqn_post)i; + goto again; + } + for (i = 0; i < (int)EQN__MAX; i++) { if (eqnparts[i].str.sz != sz) continue; |