[NTG-context] dealing with footnotes and ol in XML

Pablo Rodriguez oinos at gmx.es
Fri Jan 9 13:24:25 CET 2015


On 01/09/2015 12:29 PM, Hans Hagen wrote:
> [...]
> I'll add this:
> 
> \startluacode
>      local gsub = string.gsub
>      function xml.expressions.idstring(str)
>          return type(str) == "string" and gsub(str,"^#","") or ""
>      end
> \stopluacode
> 
> \startxmlsetups xml:footnote:ref
>  
> \xmlfilter{main}{div[@class='footnotes']/ol/li[@id=idstring('\xmlatt{#1}{href}')]/command(xml:footnote:set)}
> \stopxmlsetups
> 
> As this id stuff happens more often.

Many thanks for your reply and the code, Hans.

I have an issue with multiparagraph footnotes. Here is the sample in
ConTeXt code:

\setuppapersize[A7]
\setupbodyfont[15pt]
\starttext
\dorecurse{2}{A footnote\footnote
{\dorecurse{2}{Footnote paragraph.\par}}}
\dorecurse{3}{B footnote\footnote
{Footnote paragraph.\par Footnote paragraph.}}
\stoptext

Footnotes that end with \par have wrong space with next footnote.

I don’t know whether this is intended. How could I avoid that in XML?

Many thanks for your help again,


Pablo
-- 
http://www.ousia.tk


More information about the ntg-context mailing list