Re: [NTG-context] Problems with Natural Tables

2005-11-09 Thread Hans Hagen

Vit Zyka wrote:


Vit Zyka wrote:
 ...


so please, is the file 'core-ntb-new.tex' somewhere available?



i merged the 'core-ntb-new.tex' code into the main file


Solution of my own question, for who is interesting.

Description:
The next patch enables to define intercolumn gaps in Natural Table 
(bTABLE...eTABLE) environment.



I added your patches, but renamed the keys:

\starttext

% distance mechanism, per column (H)

\start
   \setupTABLE[c][1][distance=2em]
   \setupTABLE[c][2][distance=3em]

   \bTABLE
   \bTR \bTD test \eTD  \bTD test \eTD  \bTD test \eTD \eTR
   \bTR \bTD[nx=2] test \eTD  \bTD test \eTD \eTR
   \bTR \bTD test \eTD  \bTD[nx=2] test \eTD \eTR
   \eTABLE

   \bTABLE[option=stretch]
   \bTR \bTD test \eTD  \bTD test \eTD  \bTD test \eTD \eTR
   \bTR \bTD[nx=2] test \eTD  \bTD test \eTD \eTR
   \bTR \bTD test \eTD  \bTD[nx=2] test \eTD \eTR
   \eTABLE
\stop

% distance mechanism, per table (V)

\framed[offset=none]{%
\setupTABLE[column][2][align=left]
\setupTABLE[column][3][align=right]
\bTABLE[columndistance=2cm,leftmargindistance=.3cm,rightmargindistance=.5cm]
 \bTR
   \bTH[nc=3] Table head\eTH
 \eTR
 \bTR\bTD[nc=2] AB\eTD\bTD C\eTD\eTR
 \bTR\bTD[nc=2,align=left] AB\eTD\bTD C\eTD\eTR
 \bTR\bTD[nc=2,align=middle] AB\eTD\bTD C\eTD\eTR
 \bTR\bTD A\eTD\bTD B\eTD\bTD C\eTD\eTR
 \bTR\bTD Aa\eTD\bTD Bb\eTD\bTD Cccc\eTD\eTR
 \bTR\bTD[nc=3,align=middle] ABC\eTD\eTR
\eTABLE
}

\stoptext

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


Re: [NTG-context] Problems with Natural Tables

2005-11-09 Thread Vit Zyka

Hans Hagen wrote:

Vit Zyka wrote:


Vit Zyka wrote:
 ...


so please, is the file 'core-ntb-new.tex' somewhere available?




i merged the 'core-ntb-new.tex' code into the main file


Solution of my own question, for who is interesting.

Description:
The next patch enables to define intercolumn gaps in Natural Table 
(bTABLE...eTABLE) environment.




I added your patches, but renamed the keys:


Thanks, renaming makes sence.
vit
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Problems with Natural Tables

2005-11-06 Thread Vit Zyka

Vit Zyka wrote:
 ...

so please, is the file 'core-ntb-new.tex' somewhere available?


Solution of my own question, for who is interesting.

Description:
The next patch enables to define intercolumn gaps in Natural Table 
(bTABLE...eTABLE) environment.


Features:
- one can distinguish the amounts of first (colsepfirst), inner 
(colsepbetween), and last (colseplast) gaps.

- patch operates for both 'fit' or 'stretch' table options.
- gaps has no 'background' you have to use external one.

Example:
http://typokvitek.com/tmp/nattab-colskip.pdf

Usage:
\bTABLE[colsepbetween=2cm,colsepfirst=.3cm,colseplast=.5cm]
  \bTR
\bTD A\eTD\bTD B\eTD\bTD C\eTD
  \eTR
\eTABLE

Enjoy it,
vit

Patch:
---
% suppressing spurious space from setupTABLE
\let\DosetupTABLE=\setupTABLE
\def\setupTABLE[#1][#2][#3]{\DosetupTABLE[#1][#2][#3]\ignorespaces}

% new bTABLE options dimen: colsepbetween, colsepfirst, colseplast
\def\nexttblcol
  {\doglobal\increment\colTBL\hskip\tbltblcolsepbetween\hbox{}} % VZ

\def\begintblrow
  {\noalign
 {\doglobal\increment\rowTBL
  \doglobal\newcounter\colTBL}%
   \nexttblcol
   \hskip\tbltblcolsepfirst\hskip-\tbltblcolsepbetween} % VZ

\unprotected\def\endtblrow
  {\hskip-\tbltblcolsepbetween\hskip\tbltblcolseplast\hbox{}% VZ
   \crcr
   \noalign
 {\nointerlineskip
  \allowbreak
  \bgroup % protect local vars
\@@tblsplitafter
  \egroup
  \bgroup % protect local vars
\increment\rowTBL\relax
\ifnum\rowTBL\noftblhdnxlines\relax
  \ifnum\rowTBL\maximumrow\relax

\doifsomething\tbltblspaceinbetween{\blank[\tbltblspaceinbetween]}%
  \fi
\fi
  \egroup}}

\unprotected\def\endTBL
  {\appendtoks
 \endtbl
   \to\tbltoks
   \setbox\scratchbox\hbox
 {\localframed
[\@@tbl\@@tbl]
[\c!frame=\v!off,\c!background=,\c!align=\v!no]
{\strut}}%
   \edef\minimalcellheight{\the\ht\scratchbox}%
   \dorecurse\maximumcol
 {\settblaut\recurselevel\!!zeropoint % \zeropoint etc
  % new
  \let\xcol\recurselevel
  \dorecurse\maximumrow
{\settblwd \recurselevel\xcol\!!zeropoint
 \settblht \recurselevel\xcol\!!zeropoint}%
  % till here
  \settblwid\recurselevel\!!zeropoint}%
   \dorecurse\maximumrow
 {\settblhei\recurselevel\maxdimen}%
   \chardef\TBLpass\plusone
   \let\handleTBLcell\dohandleTBLcellA
   \def\makeTBL##1##2%
 {\gettbltxt{##1}{##2}}%
   \def\inTBLcell##1##2%
 {\ExpandBothAfter\doifinsetelse\localwidth{\v!fit,\v!broad} % user set
{}
{\scratchdimen\gettblaut\colTBL\relax
 \ifdim\localwidth\scratchdimen
   \settblaut\colTBL\localwidth
 \fi}}%
   \setbox0\vbox{\trialtypesettingtrue \the\tbltoks}%
   \ifautoTBLspread
 % experimental, stretch non fixed cells to \hsize
 \checktblwidthsone   % trial run
 \checktblwidthstwo   % real run
 \stretchtblwidths
 \let\handleTBLcell\dohandleTBLcellB
 \setbox\scratchbox\vbox{\trialtypesettingtrue \the\tbltoks}%
   \else\ifdim\wd0\hsize
 \ifautoTBLhsize
   \checktblwidthsone % trial run
   \checktblwidthstwo % real run
   \let\handleTBLcell\dohandleTBLcellB
   \setbox\scratchbox\vbox{\trialtypesettingtrue \the\tbltoks}%
 \fi
   \else\ifautoTBLrowspan\ifnum\maximumrowspan1 % max ?
 % added jan 2002 because nx=* did no longer work
 \checktblwidthsone % trial run
 \checktblwidthstwo % real run
 %
 \let\handleTBLcell\dohandleTBLcellC
 \setbox\scratchbox\vbox{\trialtypesettingtrue \the\tbltoks}%
   \fi\fi\fi\fi
   \let\handleTBLcell\dohandleTBLcellD
   \chardef\TBLpass\plustwo
   \def\makeTBL##1##2% meer in cellD
 {\dimen2\zeropoint
  \globalpushmacro\colTBL
  \dorecurse{\gettblcol{##1}{##2}}
{\advance\dimen2 \gettblwid\colTBL
 \advance\dimen2 \tbltblcolsepbetween % VZ
 \increment\colTBL}%
  \advance\dimen2 -\tbltblcolsepbetween % VZ
  \edef\widthTBL{\the\dimen2}%
  \globalpopmacro\colTBL
  \setbox\scratchbox\hbox{\gettbltxt{##1}{##2}}%
  \settblht{##1}{##2}{\the\ht\scratchbox}%
  \settblwd{##1}{##2}{\the\wd\scratchbox}%
  \ifdim\ht\scratchbox\gettblhei{##1}\relax
\settblhei{##1}{\the\ht\scratchbox}%
  \fi}%
   \setbox\scratchbox\vbox{\trialtypesettingtrue \the\tbltoks}%
   \checktblheightsone
   \checktblheightstwo
   \let\handleTBLcell\dohandleTBLcellE
   \chardef\TBLpass\plusthree
   \def\makeTBL##1##2%
 {% height
  \globalpushmacro\rowTBL
  \scratchdimen\zeropoint
  \def\rowTBL{##1}%
  \ifnum\gettblcol{##1}{##2}=\maximumcol\relax
% case: nc=maxcolumns
  \else
\dorecurse{\gettblrow{##1}{##2}}
  {\advance\scratchdimen \gettblhei\rowTBL
   \increment\rowTBL}%
\ifdim\scratchdimen\gettblht{##1}{##2}\relax
  \scratchdimen\gettblht{##1}{##2}\relax
\fi
  \fi
  \edef\heightTBL{\the\scratchdimen}%
  

[Fwd: Re: [NTG-context] Problems with Natural Tables]

2005-10-25 Thread Vit Zyka

Hello Hans,

(I guess you are the only person who can specify your previous answer),
so please, is the file 'core-ntb-new.tex' somewhere available?

Actually what I want. I have plenty of natural tables. If I want to make 
closer interline space between table lines the only way I know is to 
make smaller value of offset param. But after that, columns are too 
close together (framed object as a core of natural table does not 
distinguish between vertical and horizontal offsets). So bellow mentioned

  \setupTABLE[c][1][distance=2em]
would be nice solution.

So ones more, is the new code available?

Thank you in advance for the answer.
Vit

Hans Hagen wrote:

Adam Duck wrote:


Eckhart Guthöhrlein [EMAIL PROTECTED] writes:

 


Am Sonntag, den 14.08.2005, 17:17 +0200 schrieb Adam Duck:

  


- how do I set the spacing between a vertical line (between two
 columns) and the text inside that columns?  I already used
 framedoffest=-3pt, but the output is unacceptable.



Spacing is a weak point of natural tables. Afaik, there is no good way
to tune spacing. I would try using dummy colums like
\bTD[width=1em]\eTD.
  


OK, That sounds reasonable.  I'll try that.  On the other hand this
means many \bTDsomething\eTD ... but one can write a macro for that,
I think.
 


a next release will support:
\input core-ntb-new.tex

\starttext

\showframe

\setupTABLE[c][1][distance=2em]
\setupTABLE[c][2][distance=3em]


I was looking for core-ntb-new.tex or 'distance' in current beta
core-ntb.tex but have not been successful. Please, where I can find it?

Thanks
Vit


\bTABLE
\bTR \bTD test \eTD  \bTD test \eTD  \bTD test \eTD \eTR
\bTR \bTD[nx=2] test \eTD  \bTD test \eTD \eTR
\bTR \bTD test \eTD  \bTD[nx=2] test \eTD \eTR
\eTABLE


\bTABLE[option=stretch]
\bTR \bTD test \eTD  \bTD test \eTD  \bTD test \eTD \eTR
\bTR \bTD[nx=2] test \eTD  \bTD test \eTD \eTR
\bTR \bTD test \eTD  \bTD[nx=2] test \eTD \eTR
\eTABLE

\stoptext


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


Re: [NTG-context] Problems with Natural Tables

2005-10-22 Thread Vit Zyka

Hans Hagen wrote:

Adam Duck wrote:


Eckhart Guthöhrlein [EMAIL PROTECTED] writes:

 


Am Sonntag, den 14.08.2005, 17:17 +0200 schrieb Adam Duck:

  


- how do I set the spacing between a vertical line (between two
 columns) and the text inside that columns?  I already used
 framedoffest=-3pt, but the output is unacceptable.



Spacing is a weak point of natural tables. Afaik, there is no good way
to tune spacing. I would try using dummy colums like
\bTD[width=1em]\eTD.
  


OK, That sounds reasonable.  I'll try that.  On the other hand this
means many \bTDsomething\eTD ... but one can write a macro for that,
I think.
 


a next release will support:
\input core-ntb-new.tex

\starttext

\showframe

\setupTABLE[c][1][distance=2em]
\setupTABLE[c][2][distance=3em]


I was looking for core-ntb-new.tex or 'distance' in current beta 
core-ntb.tex but have not been successful. Please, where I can find it?


Thanks
Vit


\bTABLE
\bTR \bTD test \eTD  \bTD test \eTD  \bTD test \eTD \eTR
\bTR \bTD[nx=2] test \eTD  \bTD test \eTD \eTR
\bTR \bTD test \eTD  \bTD[nx=2] test \eTD \eTR
\eTABLE


\bTABLE[option=stretch]
\bTR \bTD test \eTD  \bTD test \eTD  \bTD test \eTD \eTR
\bTR \bTD[nx=2] test \eTD  \bTD test \eTD \eTR
\bTR \bTD test \eTD  \bTD[nx=2] test \eTD \eTR
\eTABLE

\stoptext


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


Re: [NTG-context] Problems with Natural Tables

2005-08-15 Thread Hans Hagen

Adam Duck wrote:


Eckhart Guthöhrlein [EMAIL PROTECTED] writes:

 


Am Sonntag, den 14.08.2005, 17:17 +0200 schrieb Adam Duck:

   


- how do I set the spacing between a vertical line (between two
 columns) and the text inside that columns?  I already used
 framedoffest=-3pt, but the output is unacceptable.
 


Spacing is a weak point of natural tables. Afaik, there is no good way
to tune spacing. I would try using dummy colums like
\bTD[width=1em]\eTD.
   


OK, That sounds reasonable.  I'll try that.  On the other hand this
means many \bTDsomething\eTD ... but one can write a macro for that,
I think.
 

a next release will support: 


\input core-ntb-new.tex

\starttext

\showframe

\setupTABLE[c][1][distance=2em]
\setupTABLE[c][2][distance=3em]

\bTABLE
\bTR \bTD test \eTD  \bTD test \eTD  \bTD test \eTD \eTR
\bTR \bTD[nx=2] test \eTD  \bTD test \eTD \eTR
\bTR \bTD test \eTD  \bTD[nx=2] test \eTD \eTR
\eTABLE


\bTABLE[option=stretch]
\bTR \bTD test \eTD  \bTD test \eTD  \bTD test \eTD \eTR
\bTR \bTD[nx=2] test \eTD  \bTD test \eTD \eTR
\bTR \bTD test \eTD  \bTD[nx=2] test \eTD \eTR
\eTABLE

\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
-

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


Re: [NTG-context] Problems with Natural Tables

2005-08-15 Thread Adam Duck
Hans Hagen [EMAIL PROTECTED] writes:

 25 lines deleted by Adam Duck 
 a next release will support:
This is mighty cool!  I don't want to be impolite, but when will this
be?  The deadline for my girlfriend's thesis is approaching fast ...

 6 lines deleted by Adam Duck 

 \setupTABLE[c][1][distance=2em]
 \setupTABLE[c][2][distance=3em]
Will this be both: the distance to the left and the right frame?

 28 lines deleted by Adam Duck 

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


Re: [NTG-context] Problems with Natural Tables

2005-08-15 Thread Hans Hagen

Adam Duck wrote:


Hans Hagen [EMAIL PROTECTED] writes:

 25 lines deleted by Adam Duck 
 


a next release will support:
   


This is mighty cool!  I don't want to be impolite, but when will this
be?  The deadline for my girlfriend's thesis is approaching fast ...
 


soon, for the moment just \input the file i sent you


 6 lines deleted by Adam Duck 

 


\setupTABLE[c][1][distance=2em]
\setupTABLE[c][2][distance=3em]
   


Will this be both: the distance to the left and the right frame?
 

you set distances after the column (so, [c][1] means after column 1 with the last column ignored; 

doing left/right take a bit more code and time so maybe some day 




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
-

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


Re: [NTG-context] Problems with Natural Tables

2005-08-15 Thread Adam Duck
Adam Duck [EMAIL PROTECTED] writes:

 Hans Hagen [EMAIL PROTECTED] writes:

  25 lines deleted by Adam Duck 
 a next release will support:
 This is mighty cool!  I don't want to be impolite, but when will this
 be?  The deadline for my girlfriend's thesis is approaching fast ...

Sorry about this mail.  And thank you for the very fast response and
coding.

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


Re: [NTG-context] Problems with Natural Tables

2005-08-15 Thread Vit Zyka

Hans Hagen wrote:

Adam Duck wrote:


Hans Hagen [EMAIL PROTECTED] writes:

 25 lines deleted by Adam Duck 
 


a next release will support:
  


This is mighty cool!  I don't want to be impolite, but when will this
be?  The deadline for my girlfriend's thesis is approaching fast ...
 


soon, for the moment just \input the file i sent you


That is needed improvement of natural tables, thanks Hans.

---

- In my vz-new.tex is another simple improvement of nat tables. Perhaps 
it can be also incorporated:


--
\long\def\parseTH[#1]#2\eTH
  {\parseTD[#1,\c!color=\tbltblheadcolor,\c!style=\tbltblheadstyle,
   \c!align=\tbltblheadalign,\c!aligncharacter=\v!no]#2\eTD}
--
See additional
  \c!align=\tbltblheadalign

- and what about nc=max? = Span as much as columns as there are to the 
end of line.


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


Re: [NTG-context] Problems with Natural Tables

2005-08-14 Thread Hans Hagen

Adam Duck wrote:


Hello ConTeXters,

my girlfriend writes her dimploma thesis now and I talked her into
using ConTeXt, but now I'm not sure anymore that this was the right
thing to do.  So, the problems are numerous and some of them are:

- how do I set the spacing between a vertical line (between two
 columns) and the text inside that columns?  I already used
 framedoffest=-3pt, but the output is unacceptable.
- how do I center the whole table?  This one is really crucial: my GF
 also accepts hacks ;).
- why doesn't \splitfloat{\placetable...} work with Natural Tables?
 (They won't get splitted at all, but with tables and linetables it
 works...)
- how do I refer to tables then?

I have chosen Natural Tables because they were the only one that
splitted correctly (tables and linetables let out 2/3 of a page).  So,
that's all for now.
 

we need small examples showing/solving the problems 

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
-

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


Re: [NTG-context] Problems with Natural Tables

2005-08-14 Thread Vit Zyka

Eckhart Guthöhrlein wrote:

Am Sonntag, den 14.08.2005, 17:17 +0200 schrieb Adam Duck:


- how do I set the spacing between a vertical line (between two
 columns) and the text inside that columns?  I already used
 framedoffest=-3pt, but the output is unacceptable.



Spacing is a weak point of natural tables. Afaik, there is no good way
to tune spacing. I would try using dummy colums like
\bTD[width=1em]\eTD.


Yes, I was also thinking about that. Perhaps adding lefttext= and 
righttext= params to \framed (since table cell is framed) solves some 
problem.


Imagine:
  \setupTABLE[column][1,2][align=right,lefttext=\hskip.5em]
or
  \setupTABLE[column][3][align=left,righttext=\hskip5pt$\bullet$]
...
\bTABLE

\eTABLE

vit

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


Re: [NTG-context] Problems with Natural Tables

2005-08-14 Thread Hans Hagen

Vit Zyka wrote:


Eckhart Guthöhrlein wrote:


Am Sonntag, den 14.08.2005, 17:17 +0200 schrieb Adam Duck:


- how do I set the spacing between a vertical line (between two
 columns) and the text inside that columns?  I already used
 framedoffest=-3pt, but the output is unacceptable.




Spacing is a weak point of natural tables. Afaik, there is no good way
to tune spacing. I would try using dummy colums like
\bTD[width=1em]\eTD.



Yes, I was also thinking about that. Perhaps adding lefttext= and 
righttext= params to \framed (since table cell is framed) solves some 
problem.


Imagine:
  \setupTABLE[column][1,2][align=right,lefttext=\hskip.5em]
or
  \setupTABLE[column][3][align=left,righttext=\hskip5pt$\bullet$]
...
\bTABLE

\eTABLE


probably a distance parameter then (unrelated to framed); it's slightly more complex than you think because we need to take spans into account (so it shows up in prerolls etc) but it's doable 

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
-

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