summaryrefslogtreecommitdiff
path: root/src/guile/skribilo/package/eq
diff options
context:
space:
mode:
Diffstat (limited to 'src/guile/skribilo/package/eq')
-rw-r--r--src/guile/skribilo/package/eq/lout.scm24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/guile/skribilo/package/eq/lout.scm b/src/guile/skribilo/package/eq/lout.scm
index cc4b3bf..c8ea50a 100644
--- a/src/guile/skribilo/package/eq/lout.scm
+++ b/src/guile/skribilo/package/eq/lout.scm
@@ -56,7 +56,7 @@
:after "\n@EndAlignedDisplays\n")
(markup-writer 'eq (find-engine 'lout)
- :options '(:inline? :align-with :div-style)
+ :options '(:inline? :align-with :div-style :mul-style)
:before (lambda (node engine)
(let* ((parent (ast-parent node))
(displayed? (is-markup? parent 'eq-display)))
@@ -87,6 +87,16 @@
(else
(error "unsupported div style" style))))
+(define (mul-style->lout style)
+ (case style
+ ((space) "")
+ ((cross) "times")
+ ((asterisk) "*")
+ ((dot) "cdot")
+ (else
+ (error "unsupported mul style" style))))
+
+
(define-macro (simple-lout-markup-writer sym . args)
(let* ((lout-name (if (null? args)
(symbol->string sym)
@@ -151,8 +161,18 @@
(simple-lout-markup-writer +)
-(simple-lout-markup-writer * "times")
(simple-lout-markup-writer - "-")
+
+(simple-lout-markup-writer *
+ (lambda (n e)
+ ;; Obey either the per-node `:mul-style' or the
+ ;; top-level one.
+ (or (markup-option n :mul-style)
+ (let* ((eq (ast-parent n))
+ (mul-style
+ (markup-option eq :mul-style)))
+ (mul-style->lout mul-style)))))
+
(simple-lout-markup-writer /
(lambda (n e)
;; Obey either the per-node `:div-style' or the