aboutsummaryrefslogtreecommitdiff
path: root/src/guile/skribilo/package/eq.scm
diff options
context:
space:
mode:
authorLudovic Court`es2007-04-05 14:52:28 +0000
committerLudovic Court`es2007-04-05 14:52:28 +0000
commit5fba14feecc5b268ac93433d493cd704eae19539 (patch)
treeb353fe1ffa0ab1d5421d8872293f4b3d54328f94 /src/guile/skribilo/package/eq.scm
parent21899db7e3bfe30a0c60f2dfef244ecd4037f07b (diff)
downloadskribilo-5fba14feecc5b268ac93433d493cd704eae19539.tar.gz
skribilo-5fba14feecc5b268ac93433d493cd704eae19539.tar.lz
skribilo-5fba14feecc5b268ac93433d493cd704eae19539.zip
`eq' package: Added support for Lout's new `eq2'.
* src/guile/skribilo/package/eq.scm (*use-lout-eq2?*): New. (direct-equation-child?): New. * src/guile/skribilo/package/eq/lout.scm (Initialization): Use `eq2' if asked to. (simple-lout-markup-writer): Use `direct-equation-child?' to decide on whether the issue the `^' character. This is to avoid issuing too many `^', which could result in broken layout. (eq:limit): Adapated. (range-lout-markup-writer): Likewise. git-archimport-id: lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-48
Diffstat (limited to 'src/guile/skribilo/package/eq.scm')
-rw-r--r--src/guile/skribilo/package/eq.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/guile/skribilo/package/eq.scm b/src/guile/skribilo/package/eq.scm
index 8b4d325..90db17b 100644
--- a/src/guile/skribilo/package/eq.scm
+++ b/src/guile/skribilo/package/eq.scm
@@ -60,6 +60,11 @@
;; native engine.
(make-parameter #f))
+(define-public *use-lout-eq2?*
+ ;; Whether the use the new Lout `eq2' package instead of `eq'.
+ (make-parameter #f))
+
+
(define %operators
'(/ * + - = != ~= < > <= >= sqrt expt sum product script
in notin apply limit combinations set))
@@ -130,6 +135,16 @@ a symbol representing the mathematical operator denoted by @var{m} (e.g.,
((#t) #t)
(else #f)))))
+(define-public (direct-equation-child? m)
+ "Return @code{#t} if @var{m} is a direct child of an @code{eq} markup."
+ (let ((parent (ast-parent m)))
+ (and (is-markup? parent 'eq)
+ (let ((body (markup-body parent)))
+ (or (eq? body m)
+ (and (list? body)
+ (memq m body)))))))
+
+
;;;
;;; Operator precedence.