version 1.7, 2014/10/12 14:49:39 |
version 1.9, 2017/02/12 14:19:01 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
Line 68 eqn_box(struct termp *p, const struct eqn_box *bp) |
|
Line 68 eqn_box(struct termp *p, const struct eqn_box *bp) |
|
|
|
if (bp->pos == EQNPOS_SQRT) { |
if (bp->pos == EQNPOS_SQRT) { |
term_word(p, "sqrt"); |
term_word(p, "sqrt"); |
p->flags |= TERMP_NOSPACE; |
if (bp->first != NULL) { |
eqn_box(p, bp->first); |
p->flags |= TERMP_NOSPACE; |
|
eqn_box(p, bp->first); |
|
} |
} else if (bp->type == EQN_SUBEXPR) { |
} else if (bp->type == EQN_SUBEXPR) { |
child = bp->first; |
child = bp->first; |
eqn_box(p, child); |
eqn_box(p, child); |
Line 79 eqn_box(struct termp *p, const struct eqn_box *bp) |
|
Line 81 eqn_box(struct termp *p, const struct eqn_box *bp) |
|
bp->pos == EQNPOS_TO) ? "^" : "_"); |
bp->pos == EQNPOS_TO) ? "^" : "_"); |
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
child = child->next; |
child = child->next; |
eqn_box(p, child); |
if (child != NULL) { |
if (bp->pos == EQNPOS_FROMTO || |
|
bp->pos == EQNPOS_SUBSUP) { |
|
p->flags |= TERMP_NOSPACE; |
|
term_word(p, "^"); |
|
p->flags |= TERMP_NOSPACE; |
|
child = child->next; |
|
eqn_box(p, child); |
eqn_box(p, child); |
|
if (bp->pos == EQNPOS_FROMTO || |
|
bp->pos == EQNPOS_SUBSUP) { |
|
p->flags |= TERMP_NOSPACE; |
|
term_word(p, "^"); |
|
p->flags |= TERMP_NOSPACE; |
|
child = child->next; |
|
if (child != NULL) |
|
eqn_box(p, child); |
|
} |
} |
} |
} else { |
} else { |
child = bp->first; |
child = bp->first; |
if (bp->type == EQN_MATRIX && child->type == EQN_LIST) |
if (bp->type == EQN_MATRIX && |
|
child != NULL && child->type == EQN_LIST) |
child = child->first; |
child = child->first; |
while (child != NULL) { |
while (child != NULL) { |
eqn_box(p, |
eqn_box(p, |