ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* "Escaping" tabulate
@ 2005-07-14 13:49 Radhelorn
  2005-07-15  9:12 ` Henning Hraban Ramm
  0 siblings, 1 reply; 15+ messages in thread
From: Radhelorn @ 2005-07-14 13:49 UTC (permalink / raw)


Hello!
I'm expirementing with tabular layouts and have many problems with tabulate. 
For example I want to make tabulate header of description but ConTeXt gives me 
errors about missing } and such. I is possible to make tabulate "one big 
letter" as in LaTeX and manipuate it as a whole? I haven't any luck with 
combinations of vbox/hbox. Maybe there is ConTeXish way to do this?


-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: "Escaping" tabulate
  2005-07-14 13:49 "Escaping" tabulate Radhelorn
@ 2005-07-15  9:12 ` Henning Hraban Ramm
  2005-07-15 10:53   ` Radhelorn
  0 siblings, 1 reply; 15+ messages in thread
From: Henning Hraban Ramm @ 2005-07-15  9:12 UTC (permalink / raw)


Am 2005-07-14 um 15:49 schrieb Radhelorn:

> I'm expirementing with tabular layouts and have many problems with  
> tabulate. For example I want to make tabulate header of description  
> but ConTeXt gives me errors about missing } and such. I is possible  
> to make tabulate "one big letter" as in LaTeX and manipuate it as a  
> whole? I haven't any luck with combinations of vbox/hbox. Maybe  
> there is ConTeXish way to do this?

Try buffers;
try \bgroup ... \egroup instead of {...} in definitions;
try to post a minimal example of what you did, so that we don't have  
to search for our crystal balls in order to help you.



Grüßlis vom Hraban!
---
http://www.fiee.net/texnique/
http://contextgarden.net

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

* Re: "Escaping" tabulate
  2005-07-15  9:12 ` Henning Hraban Ramm
@ 2005-07-15 10:53   ` Radhelorn
  2005-07-15 13:54     ` Hans Hagen
  0 siblings, 1 reply; 15+ messages in thread
From: Radhelorn @ 2005-07-15 10:53 UTC (permalink / raw)


Henning Hraban Ramm wrote:
> Am 2005-07-14 um 15:49 schrieb Radhelorn:
> 
>> I'm expirementing with tabular layouts and have many problems with  
>> tabulate. For example I want to make tabulate header of description  
>> but ConTeXt gives me errors about missing } and such. I is possible  
>> to make tabulate "one big letter" as in LaTeX and manipuate it as a  
>> whole? I haven't any luck with combinations of vbox/hbox. Maybe  there 
>> is ConTeXish way to do this?
> 
> 
> Try buffers;
> try \bgroup ... \egroup instead of {...} in definitions;
> try to post a minimal example of what you did, so that we don't have  to 
> search for our crystal balls in order to help you.
> 

Here is one:

\starttext
\definetyping[test][option=commands]
\starttest
/BTEX\vbox\starttabulate
\NC test \NC test \NR
\NC test \NC test \NR
\stoptabulate/ETEX
\stoptest
\stoptext

Maybe I'm abusing tabular because TeXish \settabs will do for many cases 
but I want to use some of tabular features.

Another problem with this example that /BTEX /ETEX doesn't work when I 
use just \starttyping[option=commands].

-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: "Escaping" tabulate
  2005-07-15 10:53   ` Radhelorn
@ 2005-07-15 13:54     ` Hans Hagen
  2005-07-15 16:13       ` Radhelorn
  0 siblings, 1 reply; 15+ messages in thread
From: Hans Hagen @ 2005-07-15 13:54 UTC (permalink / raw)


Radhelorn wrote:

> Henning Hraban Ramm wrote:
>
>> Am 2005-07-14 um 15:49 schrieb Radhelorn:
>>
>>> I'm expirementing with tabular layouts and have many problems with  
>>> tabulate. For example I want to make tabulate header of description  
>>> but ConTeXt gives me errors about missing } and such. I is possible  
>>> to make tabulate "one big letter" as in LaTeX and manipuate it as a  
>>> whole? I haven't any luck with combinations of vbox/hbox. Maybe  
>>> there is ConTeXish way to do this?
>>
>>
>>
>> Try buffers;
>> try \bgroup ... \egroup instead of {...} in definitions;
>> try to post a minimal example of what you did, so that we don't have  
>> to search for our crystal balls in order to help you.
>>
>
> Here is one:
>
> \starttext
> \definetyping[test][option=commands]
> \starttest
> /BTEX\vbox\starttabulate
> \NC test \NC test \NR
> \NC test \NC test \NR
> \stoptabulate/ETEX
> \stoptest
> \stoptext
>
> Maybe I'm abusing tabular because TeXish \settabs will do for many 
> cases but I want to use some of tabular features.

what do you want to achieve? why do you need the typing?

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: "Escaping" tabulate
  2005-07-15 13:54     ` Hans Hagen
@ 2005-07-15 16:13       ` Radhelorn
  2005-07-15 16:43         ` Peter Münster
  2005-07-17 19:57         ` Hans Hagen
  0 siblings, 2 replies; 15+ messages in thread
From: Radhelorn @ 2005-07-15 16:13 UTC (permalink / raw)


Hans Hagen wrote:
> Radhelorn wrote:
> 
>> Henning Hraban Ramm wrote:
>>
>>> Am 2005-07-14 um 15:49 schrieb Radhelorn:
>>>
>>>> I'm expirementing with tabular layouts and have many problems with  
>>>> tabulate. For example I want to make tabulate header of description  
>>>> but ConTeXt gives me errors about missing } and such. I is possible  
>>>> to make tabulate "one big letter" as in LaTeX and manipuate it as a  
>>>> whole? I haven't any luck with combinations of vbox/hbox. Maybe  
>>>> there is ConTeXish way to do this?
>>>
>>>
>>>
>>>
>>> Try buffers;
>>> try \bgroup ... \egroup instead of {...} in definitions;
>>> try to post a minimal example of what you did, so that we don't have  
>>> to search for our crystal balls in order to help you.
>>>
>>
>> Here is one:
>>
>> \starttext
>> \definetyping[test][option=commands]
>> \starttest
>> /BTEX\vbox\starttabulate
>> \NC test \NC test \NR
>> \NC test \NC test \NR
>> \stoptabulate/ETEX
>> \stoptest
>> \stoptext
>>
>> Maybe I'm abusing tabular because TeXish \settabs will do for many 
>> cases but I want to use some of tabular features.
> 
> 
> what do you want to achieve? why do you need the typing?
> 

This is just an example where tabular gives errors. Actualy I started 
from tries to align not floating tables (\setuptabular[align=middle] 
\startalignment[middle] doesn't help). I thougt that making tabular 
independent from it's surroundings will be workaround and provide 
possibility to abuse it in some other places.

Sorry, this is bad example.

I've solved aligning problem with \hfill\vbox or \rightaligned, but this 
needs to be done for each table.

Did I miss something important?

-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: "Escaping" tabulate
  2005-07-15 16:13       ` Radhelorn
@ 2005-07-15 16:43         ` Peter Münster
  2005-07-15 17:20           ` Radhelorn
  2005-07-17 19:41           ` Hans Hagen
  2005-07-17 19:57         ` Hans Hagen
  1 sibling, 2 replies; 15+ messages in thread
From: Peter Münster @ 2005-07-15 16:43 UTC (permalink / raw)


On Fri, 15 Jul 2005, Radhelorn wrote:

> I've solved aligning problem with \hfill\vbox or \rightaligned, but this 
> needs to be done for each table.
> 
> Did I miss something important?

Hello,
you can define a macro. For example:

\def\startMyMidAlignedTable{\hbox to \hsize\bgroup\hss\vbox
  \bgroup\starttable}
\def\stopMyMidAlignedTable{\stoptable\egroup\hss\egroup}

\starttext
\input tufte

\startMyMidAlignedTable[|l|l|]
\HL
\NC this \NC is    \NC\AR
\NC a    \NC table \NC\AR
\HL
\stopMyMidAlignedTable

\input knuth
\stoptext

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

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

* Re: "Escaping" tabulate
  2005-07-15 16:43         ` Peter Münster
@ 2005-07-15 17:20           ` Radhelorn
  2005-07-17 18:35             ` Christopher Creutzig
  2005-07-17 18:55             ` Christopher Creutzig
  2005-07-17 19:41           ` Hans Hagen
  1 sibling, 2 replies; 15+ messages in thread
From: Radhelorn @ 2005-07-15 17:20 UTC (permalink / raw)


Peter Münster wrote:
> On Fri, 15 Jul 2005, Radhelorn wrote:
> 
> 
>>I've solved aligning problem with \hfill\vbox or \rightaligned, but this 
>>needs to be done for each table.
>>
>>Did I miss something important?
> 
> 
> Hello,
> you can define a macro. For example:
> 
> \def\startMyMidAlignedTable{\hbox to \hsize\bgroup\hss\vbox
>   \bgroup\starttable}
> \def\stopMyMidAlignedTable{\stoptable\egroup\hss\egroup}
> 

Oh, thanks. Can you describe in a few words distinction between {} and 
\bgroup\egroup? I know that \bgroup\egroup are "implicit characters" and 
useful in macro definitions but what this really means?

-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: "Escaping" tabulate
  2005-07-15 17:20           ` Radhelorn
@ 2005-07-17 18:35             ` Christopher Creutzig
  2005-07-17 19:21               ` Radhelorn
  2005-07-17 18:55             ` Christopher Creutzig
  1 sibling, 1 reply; 15+ messages in thread
From: Christopher Creutzig @ 2005-07-17 18:35 UTC (permalink / raw)


Radhelorn wrote:

> Oh, thanks. Can you describe in a few words distinction between {} and 
> \bgroup\egroup? I know that \bgroup\egroup are "implicit characters" and 
> useful in macro definitions but what this really means?

  You can have

\def\startfoo{\bgroup}
\def\stopfoo{\egroup}

but you cannot get the same effect with

\def\startfoo{{}
\def\stopfoo{}}

because TeX has no way of knowing that the first definition was supposed 
to have ended.

  I believe in ConTeXt you'd usually(?) use \start and \stop instead of 
\bgroup and \egroup, though.  What do the experts say about this?


Christopher

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

* Re: "Escaping" tabulate
  2005-07-15 17:20           ` Radhelorn
  2005-07-17 18:35             ` Christopher Creutzig
@ 2005-07-17 18:55             ` Christopher Creutzig
  1 sibling, 0 replies; 15+ messages in thread
From: Christopher Creutzig @ 2005-07-17 18:55 UTC (permalink / raw)



My other mail didn't come back yet, so to answer the question I raised 
in there: In this context, \start and \stop won't help, since \hbox 
expects something that expands to { to follow.


Christopher

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

* Re: "Escaping" tabulate
  2005-07-17 18:35             ` Christopher Creutzig
@ 2005-07-17 19:21               ` Radhelorn
  2005-07-17 20:00                 ` Brooks Moses
  2005-07-17 21:12                 ` Hans Hagen
  0 siblings, 2 replies; 15+ messages in thread
From: Radhelorn @ 2005-07-17 19:21 UTC (permalink / raw)


Christopher Creutzig wrote:
> Radhelorn wrote:
> 
>> Oh, thanks. Can you describe in a few words distinction between {} and 
>> \bgroup\egroup? I know that \bgroup\egroup are "implicit characters" 
>> and useful in macro definitions but what this really means?
> 
> 
>  You can have
> 
> \def\startfoo{\bgroup}
> \def\stopfoo{\egroup}
> 
> but you cannot get the same effect with
> 
> \def\startfoo{{}
> \def\stopfoo{}}
> 

Thanks. Clear and simple answer.

> 
>  I believe in ConTeXt you'd usually(?) use \start and \stop instead of 
> \bgroup and \egroup, though.  What do the experts say about this?
> 
> 

I've seen \start \stop pairs in some examples, but there are so many of 
them in sources that I can not find their definition.


-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: "Escaping" tabulate
  2005-07-15 16:43         ` Peter Münster
  2005-07-15 17:20           ` Radhelorn
@ 2005-07-17 19:41           ` Hans Hagen
  1 sibling, 0 replies; 15+ messages in thread
From: Hans Hagen @ 2005-07-17 19:41 UTC (permalink / raw)


Peter Münster wrote:

>On Fri, 15 Jul 2005, Radhelorn wrote:
>
>  
>
>>I've solved aligning problem with \hfill\vbox or \rightaligned, but this 
>>needs to be done for each table.
>>
>>Did I miss something important?
>>    
>>
>
>Hello,
>you can define a macro. For example:
>
>\def\startMyMidAlignedTable{\hbox to \hsize\bgroup\hss\vbox
>  \bgroup\starttable}
>\def\stopMyMidAlignedTable{\stoptable\egroup\hss\egroup}
>  
>
ere is actually a \definetabulate (see end of core-mis) 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: "Escaping" tabulate
  2005-07-15 16:13       ` Radhelorn
  2005-07-15 16:43         ` Peter Münster
@ 2005-07-17 19:57         ` Hans Hagen
  1 sibling, 0 replies; 15+ messages in thread
From: Hans Hagen @ 2005-07-17 19:57 UTC (permalink / raw)


Radhelorn wrote:

> Hans Hagen wrote:
>
>> Radhelorn wrote:
>>
>>> Henning Hraban Ramm wrote:
>>>
>>>> Am 2005-07-14 um 15:49 schrieb Radhelorn:
>>>>
>>>>> I'm expirementing with tabular layouts and have many problems 
>>>>> with  tabulate. For example I want to make tabulate header of 
>>>>> description  but ConTeXt gives me errors about missing } and such. 
>>>>> I is possible  to make tabulate "one big letter" as in LaTeX and 
>>>>> manipuate it as a  whole? I haven't any luck with combinations of 
>>>>> vbox/hbox. Maybe  there is ConTeXish way to do this?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Try buffers;
>>>> try \bgroup ... \egroup instead of {...} in definitions;
>>>> try to post a minimal example of what you did, so that we don't 
>>>> have  to search for our crystal balls in order to help you.
>>>>
>>>
>>> Here is one:
>>>
>>> \starttext
>>> \definetyping[test][option=commands]
>>> \starttest
>>> /BTEX\vbox\starttabulate
>>> \NC test \NC test \NR
>>> \NC test \NC test \NR
>>> \stoptabulate/ETEX
>>> \stoptest
>>> \stoptext
>>>
>>> Maybe I'm abusing tabular because TeXish \settabs will do for many 
>>> cases but I want to use some of tabular features.
>>
>>
>>
>> what do you want to achieve? why do you need the typing?
>>
>
> This is just an example where tabular gives errors. Actualy I started 
> from tries to align not floating tables (\setuptabular[align=middle] 
> \startalignment[middle] doesn't help). I thougt that making tabular 
> independent from it's surroundings will be workaround and provide 
> possibility to abuse it in some other places.
>
> Sorry, this is bad example.
>
> I've solved aligning problem with \hfill\vbox or \rightaligned, but 
> this needs to be done for each table.
>
> Did I miss something important?

there is a 'low level' structure for that:

\defineplacement[right][left=\hfill,right=]

\input tufte

\placeright
\starttabulate[|l|l|]
\NC test \NC test \NC \NR
\NC test \NC test \NC \NR
\NC test \NC test \NC \NR
\stoptabulate

\input tufte

\stoptext



-- 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: "Escaping" tabulate
  2005-07-17 19:21               ` Radhelorn
@ 2005-07-17 20:00                 ` Brooks Moses
  2005-07-17 21:08                   ` Hans Hagen
  2005-07-17 21:12                 ` Hans Hagen
  1 sibling, 1 reply; 15+ messages in thread
From: Brooks Moses @ 2005-07-17 20:00 UTC (permalink / raw)


At 12:21 PM 7/17/2005, Radhelorn wrote:
>Christopher Creutzig wrote:
>>  I believe in ConTeXt you'd usually(?) use \start and \stop instead of 
>> \bgroup and \egroup, though.  What do the experts say about this?
>
>I've seen \start \stop pairs in some examples, but there are so many of 
>them in sources that I can not find their definition.

Doing a \show\start in a document finds a definition for \start as 
\docomplexorsimple \complexstart \simplestart; grepping for 
'def\\complexstart' (the \\ being the shell escape for \) finds the 
definition of that in core-sys.tex.

In any case, \start expands (in a somewhat complex way to \bgroup, while 
\start[<something>] appears to expand to \startsomething.  \stop does 
something similar.

Given this, I don't think there's any reason not to use \bgroup and \egroup 
if that's what you mean.

- Brooks

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

* Re: "Escaping" tabulate
  2005-07-17 20:00                 ` Brooks Moses
@ 2005-07-17 21:08                   ` Hans Hagen
  0 siblings, 0 replies; 15+ messages in thread
From: Hans Hagen @ 2005-07-17 21:08 UTC (permalink / raw)


Brooks Moses wrote:

> At 12:21 PM 7/17/2005, Radhelorn wrote:
>
>> Christopher Creutzig wrote:
>>
>>>  I believe in ConTeXt you'd usually(?) use \start and \stop instead 
>>> of \bgroup and \egroup, though.  What do the experts say about this?
>>
>>
>> I've seen \start \stop pairs in some examples, but there are so many 
>> of them in sources that I can not find their definition.
>
>
> Doing a \show\start in a document finds a definition for \start as 
> \docomplexorsimple \complexstart \simplestart; grepping for 
> 'def\\complexstart' (the \\ being the shell escape for \) finds the 
> definition of that in core-sys.tex.

and also e!start

Hans

 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: "Escaping" tabulate
  2005-07-17 19:21               ` Radhelorn
  2005-07-17 20:00                 ` Brooks Moses
@ 2005-07-17 21:12                 ` Hans Hagen
  1 sibling, 0 replies; 15+ messages in thread
From: Hans Hagen @ 2005-07-17 21:12 UTC (permalink / raw)


Radhelorn wrote:

> Christopher Creutzig wrote:
>
>> Radhelorn wrote:
>>
>>> Oh, thanks. Can you describe in a few words distinction between {} 
>>> and \bgroup\egroup? I know that \bgroup\egroup are "implicit 
>>> characters" and useful in macro definitions but what this really means?
>>
>>
>>
>>  You can have
>>
>> \def\startfoo{\bgroup}
>> \def\stopfoo{\egroup}
>>
>> but you cannot get the same effect with
>>
>> \def\startfoo{{}
>> \def\stopfoo{}}
>>
>
> Thanks. Clear and simple answer.

a sunday evening teaser:

\def\startfoo{\iftrue {\else}\fi}
\def\stopfoo {\iffalse{\else}\fi}

Hans 

btw, this is nice stuff for a 'tex basics' corner in the wiki 

Hans 


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

end of thread, other threads:[~2005-07-17 21:12 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-14 13:49 "Escaping" tabulate Radhelorn
2005-07-15  9:12 ` Henning Hraban Ramm
2005-07-15 10:53   ` Radhelorn
2005-07-15 13:54     ` Hans Hagen
2005-07-15 16:13       ` Radhelorn
2005-07-15 16:43         ` Peter Münster
2005-07-15 17:20           ` Radhelorn
2005-07-17 18:35             ` Christopher Creutzig
2005-07-17 19:21               ` Radhelorn
2005-07-17 20:00                 ` Brooks Moses
2005-07-17 21:08                   ` Hans Hagen
2005-07-17 21:12                 ` Hans Hagen
2005-07-17 18:55             ` Christopher Creutzig
2005-07-17 19:41           ` Hans Hagen
2005-07-17 19:57         ` 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).