summaryrefslogtreecommitdiff
path: root/src/guile/skribilo/package/eq/lout.scm
diff options
context:
space:
mode:
Diffstat (limited to 'src/guile/skribilo/package/eq/lout.scm')
-rw-r--r--src/guile/skribilo/package/eq/lout.scm27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/guile/skribilo/package/eq/lout.scm b/src/guile/skribilo/package/eq/lout.scm
index 9b27a7e..577f6da 100644
--- a/src/guile/skribilo/package/eq/lout.scm
+++ b/src/guile/skribilo/package/eq/lout.scm
@@ -57,20 +57,25 @@
:after "\n@EndAlignedDisplays\n")
(markup-writer 'eq (find-engine 'lout)
- :options '(:inline? :align-with :div-style :mul-style)
+ :options '(:inline? :align-with :div-style :mul-style :number)
:before (lambda (node engine)
(let* ((parent (ast-parent node))
- (displayed? (is-markup? parent 'eq-display)))
- (format #t "~a{ "
- (if (and displayed? (not (*embedded-renderer*)))
- "\n@IAD " ""))))
+ (displayed? (is-markup? parent 'eq-display))
+ (number (equation-number-string node)))
+ ;; Note: The `@BypassNumber' option appeared in Lout 3.36.
+ (if (and displayed? (not (*embedded-renderer*)))
+ (display (if (string? number)
+ (string-append "@CAND @BypassNumber { \""
+ number "\" } ")
+ "@CAD ")))
+ (display "{ ")))
:action (lambda (node engine)
- (display (if (inline-equation? node)
- "@OneRow @OneCol @E { "
- "@Eq { "))
- (let ((eq (markup-body node)))
- ;;(fprint (current-error-port) "eq=" eq)
- (output eq engine)))
+ (display (if (inline-equation? node)
+ "@OneRow @OneCol @E { "
+ "@Eq { "))
+ (let ((eq (markup-body node)))
+ ;;(fprint (current-error-port) "eq=" eq)
+ (output eq engine)))
:after " } }")