skribilo-users
[Top][All Lists]
Advanced

[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)

Hi,

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.

Yes.

[...]

> 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'.

Indeed.

> 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'. 

Correct.

[...]

> 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))

Indeed!

Commit
<http://git.savannah.gnu.org/cgit/skribilo.git/commit/?id=5a6bebf5847259c8fb8259411cd2f125cb1324bc>
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!

Ludo’.



reply via email to

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