From cda698a046f56a969998852dedaefa3f94d62e05 Mon Sep 17 00:00:00 2001 From: Ludovic Court`es Date: Fri, 24 Aug 2007 08:29:35 +0000 Subject: eq/lout: Use "strut @Font" within parenthesized expressions. * src/guile/skribilo/package/eq/lout.scm (%left-paren): Use "strut @Font" for the expression that follows. (%right-paren): Updated accordingly. (combinations): Use "nostrut @Font". git-archimport-id: lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-90 --- src/guile/skribilo/package/eq/lout.scm | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/guile/skribilo/package/eq/lout.scm b/src/guile/skribilo/package/eq/lout.scm index ce478f7..4742c31 100644 --- a/src/guile/skribilo/package/eq/lout.scm +++ b/src/guile/skribilo/package/eq/lout.scm @@ -83,10 +83,19 @@ :after " } }") -;; Scaled parenthesis. We could use `pmatrix' here but it precludes -;; line-breaking within equations. -(define %left-paren "{ Base @Font @VScale \"(\" }") -(define %right-paren "{ Base @Font @VScale \")\" }") +;; Scaled parenthesis. +;; +;; * We could use `pmatrix' here but it precludes line-breaking within +;; equations, so we use our own variant. +;; +;; * The use of `strut @Font' aims to produce balanced parentheses, +;; regardless of the ascender/descender of the numerator/denominator, so +;; that, e.g., "(a/b)" has parentheses similar to "(b/a)". +;; +(define %left-paren + "{ { Base \"nostrut\" } @Font @VScale \"(\" } \"strut\" @Font { ") +(define %right-paren + " }{ { Base \"nostrut\" } @Font @VScale \")\" }") (define (div-style->lout style) (case style @@ -258,7 +267,11 @@ :action (lambda (node engine) (let ((of (markup-option node :of)) (among (markup-option node :among))) - (display " ` { matrix atleft { lpar } atright { rpar } { ") + ;; Note: The `matrix' is enclosed in `nostrut' so that its + ;; brackets are not affected. It also looks better to enclose + ;; the matrix contents in `nostrut'. + (display " ` { \"nostrut\" @Font ") + (display "matrix atleft { lpar } atright { rpar } { ") (display "row col { ") (output of engine) (display " } row col { ") -- cgit v1.2.3