Re: [NTG-context] total with of TABLE ?

2005-04-22 Thread luigi.scarso
Duncan Hothersall wrote:
If you want your TABLE to find natural column widths to fit the content,
use [option=stretch] on the \bTABLE command. (NB it doesn't work as an
option to \setupTABLE, only on the actual \bTABLE.)
Then, assuming you don't need splitting over pages, you can set your
TABLE inside a vbox to define its width. (If you do need splitting, try
putting the TABLE into a textbackground - with no background color set
unless you want it - and set the width and/or margins of that?)
Hope that helps.
 

Many thanks !
(I start from \ifautoTBLspread inside core-ntb but after 30secs it comes 
your answer..)

luigi
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] total with of TABLE ?

2005-04-22 Thread Duncan Hothersall
Luigi wrote:

> \SetTableToWidth{10cm} \starttable[|c|c|c|]...\stoptable set width to
> 10 cm, but if I  don't care about cell I can have an overfull box.
> 
> So the problem seem to be "Can I set the total width of a TABLE using
> a macros like \setupTABLE[tablewidth=10cm] ?"
> 
> To solve this problem, I usually set every cell width using 
> \setupTABLE[x][n][width=..];
> 
> 
> But with \setupTABLE[tablewidth=...] I will  avoid to specify every
> single cell width, and the TABLE will find the right dimensions.
> 
> I will look into core-ntb.tex.
> 
> luigi

If you want your TABLE to find natural column widths to fit the content,
use [option=stretch] on the \bTABLE command. (NB it doesn't work as an
option to \setupTABLE, only on the actual \bTABLE.)

Then, assuming you don't need splitting over pages, you can set your
TABLE inside a vbox to define its width. (If you do need splitting, try
putting the TABLE into a textbackground - with no background color set
unless you want it - and set the width and/or margins of that?)

Hope that helps.

Duncan
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] total with of TABLE ?

2005-04-22 Thread luigi.scarso
Hans Hagen wrote:
Hi,
I'm fighting deadlines right now, but later i'll try to get a look at 
the current table thread (maybe someone can summarize the problem)

Hans
\SetTableToWidth{10cm}
\starttable[|c|c|c|]...\stoptable
set width to 10 cm, but if I  don't care about cell I can have an 
overfull box.

So the problem seem to be
"Can I set the total width of a TABLE using a macros like 
\setupTABLE[tablewidth=10cm] ?"

To solve this problem, I usually set every cell width using
\setupTABLE[x][n][width=..];
But with \setupTABLE[tablewidth=...]
I will  avoid to specify every single cell width,
and the TABLE will find the right dimensions.
I will look into core-ntb.tex.
luigi


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] total with of TABLE ?

2005-04-22 Thread luigi.scarso
Peter Münster wrote:
Do you know, if this is possible with TABLE:
\starttext
\SetTableToWidth{10cm}
\starttable[|c|c|c|]
\HL
\VL xxx \VL xxx \VL x \VL\AR
\HL
\stoptable
\stoptext
Cheers, Peter
 

Hmm, I change a little your code to better understand it
\starttext
\SetTableToWidth{10cm}
\setbox100=\vbox{\starttable[|c|c|c|]
\HL
\VL xxx  xxx \VL xxx xxx \VL x x \VL\AR
\HL
\stoptable}
\starttyping
\SetTableToWidth{10cm}
\setbox100=\vbox{%
\starttable[|c|c|c|]
\HL
\VL xxx  xxx \VL xxx xxx \VL x x \VL\AR
\HL
\stoptable}
\stoptyping
\type{\wd100=}{\tt \PtToCm{\wd100}}\par
\type{\ruledvbox{\unvbox100}:}\par
\ruledvbox{\unvbox100}
\stoptext
and I see on log
Overfull \hbox (11.63779pt too wide) in paragraph at lines 14--14
[][]\*12pf* \VL[] []xxx[] [][] []xxx[] 
[]\VL[] []xx
x[] []xxx[] []\VL[] []x[] []x[] []\VL\AR

If I fix table width, I must care about cell content to avoid overfull hbox;
so fix table width is useless, because I have already calculate by 
fixing cell content.

I will look into natural table to see something similar to \SetTableToWidth

luigi
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] total with of TABLE ?

2005-04-21 Thread Peter Münster
On Thu, 21 Apr 2005, luigi.scarso wrote:

> luigi.scarso wrote:
> 
> > (x=0.25 in your example, because you have 4 columns:
> > so you have
> > \setupTABLE[x][width=0.25\textwidth]
> > )
> 
> Of course this setup a TABLE with four columns of equal width and total 
> width =\textwidth;
> For different width :
> \setupTABLE[x][1][width=0.2\textwidth]
> \setupTABLE[x][2][width=0.25\textwidth]
> \setupTABLE[x][3][width=0.25\textwidth]
> \setupTABLE[x][4][width=0.3\textwidth]

Do you know, if this is possible with TABLE:

\starttext
\SetTableToWidth{10cm}
\starttable[|c|c|c|]
\HL
\VL xxx \VL xxx \VL x \VL\AR
\HL
\stoptable
\stoptext

Cheers, Peter

-- 
http://pmrb.free.fr/contact/
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] total with of TABLE ?

2005-04-21 Thread luigi.scarso
luigi.scarso wrote:
(x=0.25 in your example, because you have 4 columns:
so you have
\setupTABLE[x][width=0.25\textwidth]
)
Of course this setup a TABLE with four columns of equal width and total 
width =\textwidth;
For different width :
\setupTABLE[x][1][width=0.2\textwidth]
\setupTABLE[x][2][width=0.25\textwidth]
\setupTABLE[x][3][width=0.25\textwidth]
\setupTABLE[x][4][width=0.3\textwidth]

luigi
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] total with of TABLE ?

2005-04-21 Thread luigi.scarso
Steffen Wolfrum wrote:
Hi,
a quite basic question, nevertheless I couldn'T find an answer:
How do I determine the total with of a TABLE?
I though it should be ...
\setupTABLE[width=\textwidth]
\bTABLE
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\eTABLE
... but this means that all column's INDIVIDUAL width=\textwidth !
But what about the TOTAL width - regardless of the individual column's 
width?

With \setbox:
\setbox100=\vbox{%
\setupTABLE[...]
\bTABLE...\eTABLE%
}
ht=\the\ht100  ,  dp=\the\dp100 ,  wd= \the\wd100 
and you can determine the dimensions of your table.

But I think you need to setup x dimension, so
\setupTABLE[x][width=x\textwidth]
where x = 1/number_of_columns
(x=0.25 in your example, because you have 4 columns:
so you have
\setupTABLE[x][width=0.25\textwidth]
)
luigi
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] total with of TABLE ?

2005-04-21 Thread Steffen Wolfrum
Hi,
a quite basic question, nevertheless I couldn'T find an answer:
How do I determine the total with of a TABLE?
I though it should be ...
\setupTABLE[width=\textwidth]
\bTABLE
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR
\eTABLE
... but this means that all column's INDIVIDUAL width=\textwidth !
But what about the TOTAL width - regardless of the individual column's width?
Steffen
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context