version 1.9, 2017/02/12 14:19:01 |
version 1.11, 2017/07/06 00:19:54 |
Line 52 eqn_box(struct termp *p, const struct eqn_box *bp) |
|
Line 52 eqn_box(struct termp *p, const struct eqn_box *bp) |
|
{ |
{ |
const struct eqn_box *child; |
const struct eqn_box *child; |
|
|
if (bp->type == EQN_LIST || |
if ((bp->type == EQN_LIST && bp->expectargs > 1) || |
(bp->type == EQN_PILE && (bp->prev || bp->next)) || |
(bp->type == EQN_PILE && (bp->prev || bp->next)) || |
(bp->parent != NULL && bp->parent->pos == EQNPOS_SQRT)) { |
(bp->parent != NULL && bp->parent->pos == EQNPOS_SQRT)) { |
if (bp->parent->type == EQN_SUBEXPR && bp->prev != NULL) |
if (bp->parent->type == EQN_SUBEXPR && bp->prev != NULL) |
Line 96 eqn_box(struct termp *p, const struct eqn_box *bp) |
|
Line 96 eqn_box(struct termp *p, const struct eqn_box *bp) |
|
} else { |
} else { |
child = bp->first; |
child = bp->first; |
if (bp->type == EQN_MATRIX && |
if (bp->type == EQN_MATRIX && |
child != NULL && child->type == EQN_LIST) |
child != NULL && |
|
child->type == EQN_LIST && |
|
child->expectargs > 1) |
child = child->first; |
child = child->first; |
while (child != NULL) { |
while (child != NULL) { |
eqn_box(p, |
eqn_box(p, |
bp->type == EQN_PILE && |
bp->type == EQN_PILE && |
child->type == EQN_LIST && |
child->type == EQN_LIST && |
|
child->expectargs > 1 && |
child->args == 1 ? |
child->args == 1 ? |
child->first : child); |
child->first : child); |
child = child->next; |
child = child->next; |
Line 110 eqn_box(struct termp *p, const struct eqn_box *bp) |
|
Line 113 eqn_box(struct termp *p, const struct eqn_box *bp) |
|
|
|
if (bp->font != EQNFONT_NONE) |
if (bp->font != EQNFONT_NONE) |
term_fontpop(p); |
term_fontpop(p); |
if (bp->type == EQN_LIST || |
|
(bp->type == EQN_PILE && (bp->prev || bp->next)) || |
|
(bp->parent != NULL && bp->parent->pos == EQNPOS_SQRT)) { |
|
p->flags |= TERMP_NOSPACE; |
|
term_word(p, bp->right != NULL ? bp->right : ")"); |
|
if (bp->parent->type == EQN_SUBEXPR && bp->next != NULL) |
|
p->flags |= TERMP_NOSPACE; |
|
} |
|
|
|
if (bp->top != NULL) { |
if (bp->top != NULL) { |
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
term_word(p, bp->top); |
term_word(p, bp->top); |
Line 126 eqn_box(struct termp *p, const struct eqn_box *bp) |
|
Line 120 eqn_box(struct termp *p, const struct eqn_box *bp) |
|
if (bp->bottom != NULL) { |
if (bp->bottom != NULL) { |
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
term_word(p, "_"); |
term_word(p, "_"); |
|
} |
|
if ((bp->type == EQN_LIST && bp->expectargs > 1) || |
|
(bp->type == EQN_PILE && (bp->prev || bp->next)) || |
|
(bp->parent != NULL && bp->parent->pos == EQNPOS_SQRT)) { |
|
p->flags |= TERMP_NOSPACE; |
|
term_word(p, bp->right != NULL ? bp->right : ")"); |
|
if (bp->parent->type == EQN_SUBEXPR && bp->next != NULL) |
|
p->flags |= TERMP_NOSPACE; |
} |
} |
} |
} |