On Tue, 12 Mar 2013, Philipp Gesang wrote: > ········· > >> On Tue, 12 Mar 2013, Philipp Gesang wrote: >> >> A better way to handle this is to provide macros \startRSTcontainer >> ... \stopRSTcontainer and translate the above to > > I considered adding a generator \defineRSTcontainer with the > usual interface (e.g. [command=\framed,frame=on]). This won’t > work because the output is supposed to be a self-contained > document. The goal is for the output to consist of ordinary > Context macros only so it can be imported without loading further > code. (I’m undecided regarding the requirement of the “\RST...” > prefix, though.) Personally, I think that it is reasonable to expect the users to import a module. > Honestly, I have no idea. Depending on the style sheet a div can > be a float or aligned or have a shaded background. The current > approach leaves the implementation to the user. Another option is to change the generated output to \start[xyzzy] .... \stop When the environment xyzzy exists, this is (supposed to be, see below) equivalent to \startxyzzy .... \stopxyzzy otherwise, this is equivalent to \bgroup .... \egroup This way, you maintain your goal of having output that runs out of the box, but at the same time generate readable code. It can then be left upto the user to define the xyzzy environment (Of course, this method does not support passing arguments to environment, but then neither does your proposed solution). @Hans, there is a bug in core-sys.mkiv: There is a missing \expandafter, and currentstartstop should be changed to m_syst_start_stop. \def\syst_start_yes[#1]% {\edef\m_syst_start_stop{#1}% \ifx\m_syst_start_stop\empty \let\syst_stop_indeed\donothing \else\ifcsname\e!start\m_syst_start_stop\endcsname \expandafter\let\expandafter\syst_stop_indeed\csname\e!stop\m_syst_start_stop\endcsname \csname\e!start\m_syst_start_stop\expandafter\expandafter\expandafter\endcsname \else \let\syst_stop_indeed\donothing \fi\fi} Aditya