[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[skribilo-users] eq-display

From: Roger Mason
Subject: [skribilo-users] eq-display
Date: Sat, 28 Jan 2017 12:36:40 -0330
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix)


I'm working on having the ConTeXt engine output equations in its native
form (i.e. TeX like).  I'm having trouble getting eq-display to work and
discovered that it does not work with lout either.  Here is the command
I issue:

/opt/skribilo-git/bin/skribilo -t lout -o lout/skribilo-input-1.lout

Here is the error:

orphan node: #<<unresolved> (#<procedure 29762070 at 
../../../skribilo-git/src/guile/skribilo/package/eq.scm:263:44 (n e env)>) 

Call stack:
In ice-9/boot-9.scm:
 171: 19 [with-throw-handler srfi-34 ...]
In ../../../skribilo-git/src/guile/skribilo.scm:
 425: 18 [skribilo "-t" "lout" ...]
In ice-9/boot-9.scm:
 867: 17 [call-with-input-file "skribilo-input-1.skb" ...]
In ice-9/r4rs.scm:
 172: 16 [with-input-from-port #<variable 297676a8 value: #<input: file 
/dev/pts/4>> ...]
In ../../../skribilo-git/src/guile/skribilo.scm:
 150: 15 [doskribe #<module (#{ g1863}#) 29577000>]
In ../../../skribilo-git/src/guile/skribilo/evaluator.scm:
 111: 14 [evaluate-document # # # ...]
In ../../../skribilo-git/src/guile/skribilo/resolve.scm:
  76: 13 [resolve! # # ()]
 181: 12 [#<procedure 299e7e60 at 
../../../skribilo-git/src/guile/skribilo/resolve.scm:181:0 (node engine env0)> 
# ...]
 174: 11 [#<procedure 295dae50 at 
../../../skribilo-git/src/guile/skribilo/resolve.scm:141:0 (node engine env0)> 
# ...]
  99: 10 [#<procedure 295d5150 at 
../../../skribilo-git/src/guile/skribilo/resolve.scm:93:0 (ast engine env)> # 
 174: 9 [#<procedure 295dae50 at 
../../../skribilo-git/src/guile/skribilo/resolve.scm:141:0 (node engine env0)> 
# ...]
  99: 8 [#<procedure 295d5150 at 
../../../skribilo-git/src/guile/skribilo/resolve.scm:93:0 (ast engine env)> # 
 166: 7 [#<procedure 295dae50 at 
../../../skribilo-git/src/guile/skribilo/resolve.scm:141:0 (node engine env0)> 
# ...]
In ice-9/boot-9.scm:
 768: 6 [for-each #<procedure 299ef468 at 
../../../skribilo-git/src/guile/skribilo/resolve.scm:166:27 (o)> ...]
In ../../../skribilo-git/src/guile/skribilo/resolve.scm:
 168: 5 [#<procedure 299ef468 at 
../../../skribilo-git/src/guile/skribilo/resolve.scm:166:27 (o)> #]
 203: 4 [#<procedure 295dad00 at 
../../../skribilo-git/src/guile/skribilo/resolve.scm:195:0 (node engine env)> # 
In ice-9/boot-9.scm:
 102: 3 [#<procedure 287ee080 at ice-9/boot-9.scm:97:6 (thrown-k . args)> 
srfi-34 #]
In ../../../skribilo-git/src/guile/skribilo/condition.scm:
 153: 2 [abort 1]
 136: 1 [show-stack-trace]
In unknown file:
   ?: 0 [make-stack #t]

Here is the offending code in eq.scm:

(define-markup (eq :rest opts :key (ident #f) (class "eq")
                                   (inline? 'auto) (align-with #f)
                                   (renderer #f) (div-style 'over)
                                   (mul-style 'space)
                                   (number #t))
  (new container
       (markup 'eq)
       (ident (or ident (symbol->string (gensym "eq"))))
       (class class)
       (loc   &invocation-location)
       (options `((:div-style ,div-style) (:align-with ,align-with)
                  (:mul-style ,mul-style) (:inline? ,inline?)
                  (:number ,(cond ((not number)     #f)
                                  ((string? number) number)
                                   (new unresolved
error==>                                      (proc (lambda (n e env)
                                              (let* ((p? (assq 'parent env))
                                                     (p  (and (pair? p?)
                                                              (cadr p?))))
                                                (and (is-markup? p 'eq)
                                                     (not (inline-equation? p))
                                                     (resolve-counter n env
                  ,@(the-options opts
                                 :ident :class :inline?
                                 :div-style :mul-style :align-with
       (body (let loop ((body (the-body opts))
                        (result '()))
               (if (null? body)
                   (loop (cdr body)
                         (if (markup? (car body))
                             (car body)  ;; the `eq:*' markups were used
                                         ;; directly
                             (eq-evaluate (car body))) ;; a quoted list was
                                                       ;; passed

Here is my input document:

(use-modules (skribilo package eq))

        (document :title [Equations in Skribilo]

(p [This paragraph contains this equation: ,(eq :inline? #t '(/ alpha
beta)).  This is actually an ,(emph [inline]) equation, meaning that it
occurs within a paragraph.  Typesetting has to be adjusted


   (p [This is an equation display block, within which equations can be
aligned with one another.])

   (eq :ident "eq-limit-b-over-l"
       ;:renderer (and %have-lout? 'lout)
       :align-with '=
       '(= (limit (/ lambda beta) 0
                   (apply IPL n k))

            ;; non-simplified
            (/ (expt (+ alpha beta) k)
               (* beta
                  (sum :from (= x 0)
                       :to   (- k 1)
                       (* (combinations k x)
                          (expt beta (- k 1 x))
                          (expt alpha x)))))))

   [This equation can be simplified as follows:]

   (eq :ident "eq-limit-b-over-l-simplified"
       ;:renderer (and %have-lout? 'lout)
       :align-with '=
       '(= ;; simplified
            (/ (expt (+ alpha beta) k)
               (- (expt (+ alpha beta) k)
                  (expt alpha k)))

            (limit (/ lambda beta) 0
                   (apply IPL n k))))))

I have no idea how to debug this.  Any help will be much appreciated.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]