Hi,
for an involved image placement (full page image starting each chapter,
several stacked elements), I’d like an environment that accepts
key-value arguments, like
\startMyFigure[page=left,title={My caption}]
\externalfigure[dummy]…
\stopMyFigure
I don’t think that a real float makes sense, even if the interface looks
similar, since it’s always a full page in a fixed place, I need no
numbering and can place the caption myself.
Does it make sense to use \definestartstop?
How would I “plugin“ the argument handling?
Or should I better define start and stop separately?
\def\startMyFigure[#1]{
% e.g. use utilities.parsers.settings_to_hash(#1)
}
\def\stopMyFigure{}
Probably I’ll need to catch the content (\externalfigure, might become
more) and use it in a \setlayer – so perhaps something like
\definebuffer[MyFigure]
\define\stopMyFigure{%
\setlayer[page]{\getMyFigure}}}
}
?
But then I don’t know how to handle the arguments.
Probably it makes most sense to do it in Lua, like
\startluacode
interfaces.implement {
name = "startMyFigure",
public = true,
arguments = {"hash",},
actions = function(h, a)
-- …
end, }
\stopluacode
But I didn’t find how to do environments.
Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage : https://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___________________________________________________________________________________