Hello,

I'm trying to hook commands.stoptext()...

Here's a minimal example: why only the first image appears?

----
\startluacode
  local cmd_p
  local tab = {}

  f = function(a)
    if not cmd_p then
      cmd_p = commands.stoptext

      commands.stoptext = function(...)
        context("Hook")

        for _, v in ipairs(tab) do
          context.startTEXpage()
            context.externalfigure{v}
          context.stopTEXpage()
        end

        cmd_p(...)
      end
    end

    table.insert(tab, a)
  end
\stopluacode

\starttext
  A
  \ctxlua{f("cow")}
  \ctxlua{f("hacker")}
\stoptext
----

When I modify the code:

----
...
        for _, v in ipairs(tab) do
          --context.startTEXpage()
            context.externalfigure{v}
          --context.stopTEXpage()
        end
...
----

all figures are shown OK.

Where's the problem?

TIA.

Best regards,

Lukas


--
Ing. Lukáš Procházka [mailto:[email protected]]
Pontex s. r. o.      [mailto:[email protected]] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

Attachment: t.pdf
Description: Adobe PDF document

Attachment: t.mkiv
Description: Binary data

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to