diff options
-rw-r--r-- | eqn_term.c | 8 | ||||
-rw-r--r-- | regress/eqn/fromto/precedence.out_ascii | 2 | ||||
-rw-r--r-- | regress/eqn/over/precedence.out_ascii | 4 | ||||
-rw-r--r-- | regress/eqn/subsup/precedence.out_ascii | 2 |
4 files changed, 11 insertions, 5 deletions
@@ -90,8 +90,14 @@ eqn_box(struct termp *p, const struct eqn_box *bp) if (bp->font != EQNFONT_NONE) term_fontpush(p, fontmap[(int)bp->font]); - if (bp->text != NULL) + if (bp->text != NULL) { + if (strchr("!\"'),.:;?]}", *bp->text) != NULL) + p->flags |= TERMP_NOSPACE; term_word(p, bp->text); + if (*bp->text != '\0' && strchr("\"'([{", + bp->text[strlen(bp->text) - 1]) != NULL) + p->flags |= TERMP_NOSPACE; + } /* Special box types. */ diff --git a/regress/eqn/fromto/precedence.out_ascii b/regress/eqn/fromto/precedence.out_ascii index b7da7180..15a80120 100644 --- a/regress/eqn/fromto/precedence.out_ascii +++ b/regress/eqn/fromto/precedence.out_ascii @@ -4,6 +4,6 @@ NNAAMMEE ssuubbssuupp--pprreecceeddeennccee - precedence of subscripts and superscripts DDEESSCCRRIIPPTTIIOONN - initial text _X_(_a_)^_c^ ; X_aa^_c ; (_X_1^2)_(_a__c^_e)^(_o__r^_s) final text + initial text _X_(_a_)^_c^; X_aa^_c; (_X_1^2)_(_a__c^_e)^(_o__r^_s) final text OpenBSD July 6, 2017 OpenBSD diff --git a/regress/eqn/over/precedence.out_ascii b/regress/eqn/over/precedence.out_ascii index 1059b742..0dc9e747 100644 --- a/regress/eqn/over/precedence.out_ascii +++ b/regress/eqn/over/precedence.out_ascii @@ -4,7 +4,7 @@ NNAAMMEE oovveerr--pprreecceeddeennccee - precedence of the fraction operator DDEESSCCRRIIPPTTIIOONN - initial text 1 + _x + (_x^2)/2 + (_x^3)/(2 * 3) ; _a^/_c~ ; aa/cc ; - sqrt(_a)/sqrt(_c) final text + initial text 1 + _x + (_x^2)/2 + (_x^3)/(2 * 3); _a^/_c~; aa/cc; sqrt(_a)/sqrt(_c) + final text OpenBSD July 6, 2017 OpenBSD diff --git a/regress/eqn/subsup/precedence.out_ascii b/regress/eqn/subsup/precedence.out_ascii index 65f85d6c..bd4b62c7 100644 --- a/regress/eqn/subsup/precedence.out_ascii +++ b/regress/eqn/subsup/precedence.out_ascii @@ -4,6 +4,6 @@ NNAAMMEE ssuubbssuupp--pprreecceeddeennccee - precedence of subscripts and superscripts DDEESSCCRRIIPPTTIIOONN - initial text (_x^)_(1_)^2- + (_e~)^((_x^)__s<->) ; I_II^_I + I^(II__I) final text + initial text (_x^)_(1_)^2- + (_e~)^((_x^)__s<->); I_II^_I + I^(II__I) final text OpenBSD July 6, 2017 OpenBSD |