ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* xtables in custom macros
@ 2011-11-03 19:37 "Stefan Müller"
  2011-11-03 19:44 ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: "Stefan Müller" @ 2011-11-03 19:37 UTC (permalink / raw)
  To: ntg-context

Hi list,

I just played a bit with the nice new xtables.  It seems as if "\stopxtable" does not work if used inside a custom macro.  I get a "Runaway argument" error with the current standalone if I uncomment "\Doesnt" in the following example.

\define\Works{\startxtable \startxrow \startxcell works \stopxcell \stopxrow}
\define\Doesnt{\startxtable \startxrow \startxcell does not work \stopxcell \stopxrow \stopxtable}

\starttext
\Works \stopxtable
%\Doesnt
\stoptext

Did I miss something or is this a bug?

Best regards,
Stefan.
-- 


_______
ey, leute, ich hab so lange gebraucht um mir plan a auszudenken, fragt jetzt doch nicht auch 
noch nach plan b!

NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
Jetzt informieren: http://www.gmx.net/de/go/freephone
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: xtables in custom macros
  2011-11-03 19:37 xtables in custom macros "Stefan Müller"
@ 2011-11-03 19:44 ` Wolfgang Schuster
  2011-11-03 22:01   ` "Stefan Müller"
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2011-11-03 19:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 03.11.2011 um 20:37 schrieb Stefan Müller:

> Hi list,
> 
> I just played a bit with the nice new xtables.  It seems as if "\stopxtable" does not work if used inside a custom macro.  I get a "Runaway argument" error with the current standalone if I uncomment "\Doesnt" in the following example.
> 
> \define\Works{\startxtable \startxrow \startxcell works \stopxcell \stopxrow}
> \define\Doesnt{\startxtable \startxrow \startxcell does not work \stopxcell \stopxrow \stopxtable}
> 
> \starttext
> \Works \stopxtable
> %\Doesnt
> \stoptext
> 
> Did I miss something or is this a bug?

The stable environment stores the content in a buffer and you can’t
put the start and stop commands of a buffer in different commands.

Wolfgang
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: xtables in custom macros
  2011-11-03 19:44 ` Wolfgang Schuster
@ 2011-11-03 22:01   ` "Stefan Müller"
  2011-11-04  9:38     ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: "Stefan Müller" @ 2011-11-03 22:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Am 03.11.2011 um 20:37 schrieb Stefan Müller:
> 
> > Hi list,
> > 
> > I just played a bit with the nice new xtables.  It seems as if
> "\stopxtable" does not work if used inside a custom macro.  I get a "Runaway
> argument" error with the current standalone if I uncomment "\Doesnt" in the
> following example.
> > 
> > \define\Works{\startxtable \startxrow \startxcell works \stopxcell
> \stopxrow}
> > \define\Doesnt{\startxtable \startxrow \startxcell does not work
> \stopxcell \stopxrow \stopxtable}
> > 
> > \starttext
> > \Works \stopxtable
> > %\Doesnt
> > \stoptext
> > 
> > Did I miss something or is this a bug?
> 
> The stable environment stores the content in a buffer and you can’t
> put the start and stop commands of a buffer in different commands.
> 
> Wolfgang

I'm not sure if I understood correctly...  I don't want to put the start and stop commands in different commands.  In the example I want to have \startxtable and \stopxtable inside the same command ("\Doesnt"), i.e. I want a self-defined command that produces a complete xtable, not only the xrows.

Stefan
-- 


_______
ey, leute, ich hab so lange gebraucht um mir plan a auszudenken, fragt jetzt doch nicht auch 
noch nach plan b!

Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: xtables in custom macros
  2011-11-03 22:01   ` "Stefan Müller"
@ 2011-11-04  9:38     ` Hans Hagen
  2011-11-04 10:11       ` Thomas A. Schmitz
  2011-11-04 17:18       ` "Stefan Müller"
  0 siblings, 2 replies; 10+ messages in thread
From: Hans Hagen @ 2011-11-04  9:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 3-11-2011 23:01, "Stefan Müller" wrote:
>> \define\Doesnt{\startxtable \startxrow \startxcell does not work
>>  \stopxcell \stopxrow \stopxtable}
>> >  >
>> >  >  \starttext
>> >  >  \Works \stopxtable
>> >  >  %\Doesnt
>> >  >  \stoptext
\def\test
   {\setbuffer[demo]
      \startxtable
        \startxrow
          \startxcell does not work \stopxcell
        \stopxrow
      \stopxtable
    \endbuffer
    \processxtablebuffer[demo]}


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: xtables in custom macros
  2011-11-04  9:38     ` Hans Hagen
@ 2011-11-04 10:11       ` Thomas A. Schmitz
  2011-11-04 12:48         ` Hans Hagen
  2011-11-04 17:18       ` "Stefan Müller"
  1 sibling, 1 reply; 10+ messages in thread
From: Thomas A. Schmitz @ 2011-11-04 10:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11/4/11 10:38 AM, Hans Hagen wrote:
> \def\test
>    {\setbuffer[demo]
>       \startxtable
>         \startxrow
>           \startxcell does not work \stopxcell
>         \stopxrow
>       \stopxtable
>     \endbuffer
>     \processxtablebuffer[demo]}


Hans,

is the solution to my xml problem along these lines as well? Example:

\startbuffer[test]
<a>
  <table>
   <tablerow>
    <tablecell>
     One
    </tablecell>
    <tablecell>
     Two
    </tablecell>
   </tablerow>
   <tablerow>
    <tablecell>
     Three
    </tablecell>
    <tablecell>
     Four
    </tablecell>
   </tablerow>
  </table>
</a>
\stopbuffer

\startxmlsetups xml:testsetups
     \xmlsetsetup{main}{a|table|tablerow|tablecell}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:a
     \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:table
     \startxtable
       \xmlflush{#1}
     \stopxtable
\stopxmlsetups

\startxmlsetups xml:tablerow
     \startxrow
       \xmlflush{#1}
     \stopxrow
\stopxmlsetups

\startxmlsetups xml:tablecell
     \startxcell \xmlflush{#1} \stopxcell
\stopxmlsetups

\starttext
\xmlprocessbuffer{main}{test}{}
\stoptext

Would like to find a way to use the new mechanism with xml.

All best

Thomas
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: xtables in custom macros
  2011-11-04 10:11       ` Thomas A. Schmitz
@ 2011-11-04 12:48         ` Hans Hagen
  2011-11-04 21:44           ` Thomas A. Schmitz
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2011-11-04 12:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Thomas A. Schmitz

On 4-11-2011 11:11, Thomas A. Schmitz wrote:
> On 11/4/11 10:38 AM, Hans Hagen wrote:
>> \def\test
>> {\setbuffer[demo]
>> \startxtable
>> \startxrow
>> \startxcell does not work \stopxcell
>> \stopxrow
>> \stopxtable
>> \endbuffer
>> \processxtablebuffer[demo]}
>
>
> Hans,
>
> is the solution to my xml problem along these lines as well? Example:
>
> \startbuffer[test]
> <a>
> <table>
> <tablerow>
> <tablecell>
> One
> </tablecell>
> <tablecell>
> Two
> </tablecell>
> </tablerow>
> <tablerow>
> <tablecell>
> Three
> </tablecell>
> <tablecell>
> Four
> </tablecell>
> </tablerow>
> </table>
> </a>
> \stopbuffer
>
> \startxmlsetups xml:testsetups
> \xmlsetsetup{main}{a|table|tablerow|tablecell}{xml:*}
> \stopxmlsetups
>
> \xmlregistersetup{xml:testsetups}
>
> \startxmlsetups xml:a
> \xmlflush{#1}
> \stopxmlsetups
>
> \startxmlsetups xml:table
> \startxtable
> \xmlflush{#1}
> \stopxtable
> \stopxmlsetups
>
> \startxmlsetups xml:tablerow
> \startxrow
> \xmlflush{#1}
> \stopxrow
> \stopxmlsetups
>
> \startxmlsetups xml:tablecell
> \startxcell \xmlflush{#1} \stopxcell
> \stopxmlsetups
>
> \starttext
> \xmlprocessbuffer{main}{test}{}
> \stoptext
>
> Would like to find a way to use the new mechanism with xml.

In the next beta .. still somewhat experimental as we need to deal with 
all kind of situations, like \asciimode in regular tex.

\startbuffer[test]
<table>
     <tablerow>
         <tablecell>
             One
         </tablecell>
         <tablecell>
             Two
         </tablecell>
     </tablerow>
     <tablerow>
         <tablecell>
             <b>Three</b>
         </tablecell>
         <tablecell>
             Four
         </tablecell>
     </tablerow>
</table>
\stopbuffer

\startxmlsetups xml:testsetups
     \xmlsetsetup{main}{b|table|tablerow|tablecell}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:b
     \bold{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:table
     \startembeddedxtable
         \xmlflush{#1}
     \stopembeddedxtable
\stopxmlsetups

\startxmlsetups xml:tablerow
     \startxrow
         \xmlflush{#1}
     \stopxrow
\stopxmlsetups

\startxmlsetups xml:tablecell
     \startxcell
         \xmlflush{#1}
     \stopxcell
\stopxmlsetups

\starttext
     \xmlprocessbuffer{main}{test}{}
\stoptext

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: xtables in custom macros
  2011-11-04  9:38     ` Hans Hagen
  2011-11-04 10:11       ` Thomas A. Schmitz
@ 2011-11-04 17:18       ` "Stefan Müller"
  2011-11-04 17:47         ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: "Stefan Müller" @ 2011-11-04 17:18 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

> On 3-11-2011 23:01, "Stefan Müller" wrote:
> >> \define\Doesnt{\startxtable \startxrow \startxcell does not work
> >>  \stopxcell \stopxrow \stopxtable}
> >> >  >
> >> >  >  \starttext
> >> >  >  \Works \stopxtable
> >> >  >  %\Doesnt
> >> >  >  \stoptext
> \def\test
>    {\setbuffer[demo]
>       \startxtable
>         \startxrow
>           \startxcell does not work \stopxcell
>         \stopxrow
>       \stopxtable
>     \endbuffer
>     \processxtablebuffer[demo]}

Nice! Thank you very much!

Stefan
-- 


_______
ey, leute, ich hab so lange gebraucht um mir plan a auszudenken, fragt jetzt doch nicht auch 
noch nach plan b!

Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: xtables in custom macros
  2011-11-04 17:18       ` "Stefan Müller"
@ 2011-11-04 17:47         ` Hans Hagen
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2011-11-04 17:47 UTC (permalink / raw)
  To: Stefan Müller; +Cc: ntg-context

On 4-11-2011 18:18, "Stefan Müller" wrote:
>> On 3-11-2011 23:01, "Stefan Müller" wrote:
>>>> \define\Doesnt{\startxtable \startxrow \startxcell does not work
>>>>   \stopxcell \stopxrow \stopxtable}
>>>>>   >
>>>>>   >   \starttext
>>>>>   >   \Works \stopxtable
>>>>>   >   %\Doesnt
>>>>>   >   \stoptext
>> \def\test
>>     {\setbuffer[demo]
>>        \startxtable
>>          \startxrow
>>            \startxcell does not work \stopxcell
>>          \stopxrow
>>        \stopxtable
>>      \endbuffer
>>      \processxtablebuffer[demo]}
>
> Nice! Thank you very much!

the manual shows a more convenient way (embeddedxtable)

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: xtables in custom macros
  2011-11-04 12:48         ` Hans Hagen
@ 2011-11-04 21:44           ` Thomas A. Schmitz
  2011-11-06  9:43             ` Thomas A. Schmitz
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas A. Schmitz @ 2011-11-04 21:44 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

On 11/04/2011 01:48 PM, Hans Hagen wrote:

> \startxmlsetups xml:table
> \startembeddedxtable
> \xmlflush{#1}
> \stopembeddedxtable
> \stopxmlsetups

Hans,

thanks a lot, I'll play with it tomorrow (was on the road today, from 
Florence back home...).

All best

Thomas
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: xtables in custom macros
  2011-11-04 21:44           ` Thomas A. Schmitz
@ 2011-11-06  9:43             ` Thomas A. Schmitz
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas A. Schmitz @ 2011-11-06  9:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen

On 11/04/2011 10:44 PM, Thomas A. Schmitz wrote:
> Hans,
>
> thanks a lot, I'll play with it tomorrow (was on the road today, from
> Florence back home...).
>
> All best
>
> Thomas

Yes, this works wonderfully! And thanks for mentioning the xml example 
in the manual!

All best

Thomas
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-11-06  9:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-03 19:37 xtables in custom macros "Stefan Müller"
2011-11-03 19:44 ` Wolfgang Schuster
2011-11-03 22:01   ` "Stefan Müller"
2011-11-04  9:38     ` Hans Hagen
2011-11-04 10:11       ` Thomas A. Schmitz
2011-11-04 12:48         ` Hans Hagen
2011-11-04 21:44           ` Thomas A. Schmitz
2011-11-06  9:43             ` Thomas A. Schmitz
2011-11-04 17:18       ` "Stefan Müller"
2011-11-04 17:47         ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).