Hello everybody.

Some time ago, Wolfgang helped me write an environment to have code above
and typeset output below.
I'll glue you a MWE below.

\mainlanguage [it]

\setupbodyfont [modern]


\defineuserdata

  [example]

  [alternative=example]


\defineuserdataalternative

  [example]

  [renderingsetup=userdata:example]


\startsetups [userdata:example]

  \blank

  \startembeddedxtable
[width=\textwidth,strut=no,offset=1ex,framecolor=black,rulethickness=0.5pt]

    \startxrow [corner=03,align=normal]

      \startxcell

        \typebuffer [userdata] [option=tex]

      \stopxcell

    \stopxrow

    \startxrow [corner=01,align=normal]

      \startxcell

        \getuserdata

      \stopxcell

    \stopxrow

  \stopembeddedxtable

  \blank

\stopsetups


\starttext


\startuserdata [example]

\starttext

  C’era una volta un re\dots

\stoptext

\stopuserdata


\stoptext


Now, the question: Can the code to be improved? How can I modify the code
to have the example typeset to the right of the box? I would like the box
to be 0.5\textwidth wide.

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to