X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/dd58bb87ae1e6e8e50fb78516797ec7709c92b7a..b769f1d977b9f49dff721c8ce00998f6e5c4cb38:/eqn_term.c diff --git a/eqn_term.c b/eqn_term.c index 1b702841..3e27233b 100644 --- a/eqn_term.c +++ b/eqn_term.c @@ -1,4 +1,4 @@ -/* $Id: eqn_term.c,v 1.16 2017/08/23 20:49:15 schwarze Exp $ */ +/* $Id: eqn_term.c,v 1.19 2018/12/13 05:23:38 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2017 Ingo Schwarze @@ -25,7 +25,7 @@ #include #include -#include "mandoc.h" +#include "eqn.h" #include "out.h" #include "term.h" @@ -96,15 +96,17 @@ eqn_box(struct termp *p, const struct eqn_box *bp) p->flags |= TERMP_NOSPACE; term_word(p, bp->text); if ((cp = strchr(bp->text, '\0')) > bp->text && - ((cp[-1] == '-' && bp->prev == NULL) || - strchr("\"'([{", cp[-1]) != NULL)) + (strchr("\"'([{", cp[-1]) != NULL || + (bp->prev == NULL && (cp[-1] == '-' || + (cp >= bp->text + 5 && + strcmp(cp - 5, "\\[mi]") == 0))))) p->flags |= TERMP_NOSPACE; } /* Special box types. */ if (bp->pos == EQNPOS_SQRT) { - term_word(p, "sqrt"); + term_word(p, "\\(sr"); if (bp->first != NULL) { p->flags |= TERMP_NOSPACE; eqn_box(p, bp->first);