[Top][All Lists]

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

[skribilo-users] Footnotes omitted on single-page HTML documents

From: Ludovic Courtès
Subject: [skribilo-users] Footnotes omitted on single-page HTML documents
Date: Tue, 20 Nov 2012 23:23:07 +0100
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)


Klaus Schilling <address@hidden> skribis:

> the footnote problem still persists in 0.9.2.
> If there are several chapters in a document, only the footnotes of the
> last chapter get actually displayed.

Indeed.  Thanks for your report and detailed analysis!

> If there is a chapter containing a section, skribilo exits prematurely
> with an error in
> src/guile/skribilo/engine/html.scm, line 1212. Note that this error
> occurs whether there are actually footnotes in the document ot not. A
> document as simple as 
> (document (chapter (section "")))
> is enough to produce that bug.



> More precisely, if there is a chapter with a section, the argument
> given to `reverse' evaluates to `#f', which is of course not a valid
> argument for `reverse'.


> Unfortunately, I don't quite understand what is going on inside the
> recursion within the `cond' expression. There seem to be several way
> how the recursion may terminate, and I don't see which of them yields
> the obnoxious '#f". The definition of container-env-get looks
> suspicious: 
> (define (container-env-get m key)
>   (let ((c (assq key (slot-ref m 'env))))
>     (and (pair? c) (cadr c))))
> So if (slot-ref subsections 'env) evaluates to an association list
> that holds no key equal to 'footnote-env, or the associated value's
> car is #f, the whole `cond' block returns #f and can't be passed to
> `reverse'. 



> are easier to explain, I guess. The `else' clause in the `cond' block
> ignores the variable `footnotes' completely, and thus any already
> accumulated footnotes are forgotten. Maybe it should read
> (else (append (container-env-get subsections 'footnote-env) footnotes))


appears to fix this:

--8<---------------cut here---------------start------------->8---
$ echo '(document (chapter (footnote [XXX]) (section  (footnote  [FOO]) 
(footnote [BAR]) ".") (section (footnote [BAZ]))))' | ./src/pre-inst-skribilo 
-t html|grep -E '(FOO|BAR|BAZ|XXX)'
<a name="footnote-footnote812"><a 
href="#footnote-site-footnote812"><sup><small>1</small></sup></a></a> XXX
<a name="footnote-footnote813"><a 
href="#footnote-site-footnote813"><sup><small>2</small></sup></a></a> FOO
<a name="footnote-footnote814"><a 
href="#footnote-site-footnote814"><sup><small>3</small></sup></a></a> BAR
<a name="footnote-footnote816"><a 
href="#footnote-site-footnote816"><sup><small>4</small></sup></a></a> BAZ
--8<---------------cut here---------------end--------------->8---

Can you please confirm?

(If you don’t want to use ‘git pull’, you can apply the patch to 0.9.2.)

Thanks again for the thorough investigation!


reply via email to

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