aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog26
-rw-r--r--src/guile/skribilo/package/eq.scm15
-rw-r--r--src/guile/skribilo/package/eq/lout.scm20
3 files changed, 56 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index f184248..ad2741a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,32 @@
# arch-tag: automatic-ChangeLog--skribilo@sv.gnu.org--2006/skribilo--devo--1.2
#
+2007-04-10 07:47:58 GMT Ludovic Court`es <ludovic.courtes@laas.fr> patch-89
+
+ Summary:
+ `eq' package: Added support for Lout's new `eq2'.
+ Revision:
+ skribilo--devo--1.2--patch-89
+
+ * 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.
+
+ modified files:
+ ChangeLog src/guile/skribilo/package/eq.scm
+ src/guile/skribilo/package/eq/lout.scm
+
+ new patches:
+ lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-48
+
+
2007-04-10 07:47:03 GMT Ludovic Court`es <ludovic.courtes@laas.fr> patch-88
Summary:
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.
diff --git a/src/guile/skribilo/package/eq/lout.scm b/src/guile/skribilo/package/eq/lout.scm
index d0d9570..bd4ccc7 100644
--- a/src/guile/skribilo/package/eq/lout.scm
+++ b/src/guile/skribilo/package/eq/lout.scm
@@ -45,7 +45,9 @@
;; Append the `eq' include file
(engine-custom-set! lout 'includes
(string-append includes "\n"
- "@SysInclude { eq }\n")))))
+ "@SysInclude { "
+ (if (*use-lout-eq2?*) "eq2" "eq")
+ " }\n")))))
;;;
@@ -131,7 +133,8 @@
(and first?
(is-markup? eq-parent 'eq-display)
(eq? ',sym
- (markup-option eq :align-with))))
+ (markup-option eq :align-with))
+ (direct-equation-child? node)))
(op (car operands))
(eq-op? (equation-markup? op))
(need-paren?
@@ -232,9 +235,12 @@
(let ((body (markup-body node))
(var (markup-option node :var))
(limit (markup-option node :limit)))
- (display "{ lim from { ")
+ (format #t "{ lim ~a { { "
+ (if (*use-lout-eq2?*)
+ "atop @SubScriptStyle"
+ "from"))
(output var engine)
- (display " --> ")
+ (display " } --> ")
(output limit engine)
(display (string-append " } } @VContract { " %left-paren))
(output body engine)
@@ -262,7 +268,11 @@
(let ((from (markup-option node :from))
(to (markup-option node :to))
(body (markup-body node)))
- (display ,(string-append " { big " lout-name
+ (display ,(string-append " { "
+ (if (*use-lout-eq2?*)
+ ""
+ "big ")
+ lout-name
" from { "))
(output from engine)
(display " } to { ")