mbutterick / pollen-users

please use https://forums.matthewbutterick.com/c/typesetting/ instead
https://forums.matthewbutterick.com/c/typesetting/
52 stars 0 forks source link

How to reset variable between pages #73

Closed pmarinov closed 3 years ago

pmarinov commented 3 years ago

I've updated my Ubuntu and Racket moved from v7.0 to v7.2, using raco pkg I installed Pollen for the new Racket which probably also moved it to a later version

Something has changed because a feature for footnotes that used to work started to behave differently.

In pollen.rkt I have:

(define footnotes null)

(define (footnote . elements)
  (case (current-poly-target)
    ...
    [(html)
      ;; Collect into footnotes
      (set! footnotes (append footnotes (list elements)))
    ...

Before, when it worked, the variable footnotes used to collect only entries from the current page that has been rendered, now it collects entries randomly between pages.

What is the best way to reset the variable between pages?

The project: https://github.com/pmarinov/bash-scripting-guide/blob/master/pollen.rkt

mbutterick commented 3 years ago

See #43 generally, and this message in particular. In short, Pollen now reuses namespaces during batch operations, so tag functions that assume a fresh namespace may need to be adjusted.

pmarinov commented 3 years ago

Thanks for the advise.