From f4d68f72d57d31743a3db3a4aa741e76b1034b9d Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Fri, 25 Jun 2021 01:38:16 +0430 Subject: [PATCH] box: handle zero ury in subscript correction --- box.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/box.c b/box.c index 549912c..cc3bf72 100644 --- a/box.c +++ b/box.c @@ -297,7 +297,10 @@ void box_sub(struct box *box, struct box *sub, struct box *sup) /* writing the subscript */ if (sub) { /* subscript correction */ - printf(".nr %s (%s+%s)*(%s-%s)/%s\n", nregname(sub_cor), + printf(".nr %s (%s-%s)\n", nregname(sub_cor), + nreg(box_wd), nreg(box_wdnoic)); + printf(".if %s>0 .nr %s (%s+%s)*(%s-%s)/%s\n", + nreg(box_ht), nregname(sub_cor), nreg(box_ht), nreg(sub_fall), nreg(box_wd), nreg(box_wdnoic), nreg(box_ht)); printf(".nr %s -%s\n", nregname(sub_wd), nreg(sub_cor)); -- 2.11.4.GIT