ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Multiline cell in spreadsheettable
@ 2021-11-18  9:29 juh via ntg-context
  2021-11-18 11:56 ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: juh via ntg-context @ 2021-11-18  9:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: juh


[-- Attachment #1.1: Type: text/plain, Size: 336 bytes --]

Hi all,

is there a parameter to have multiple lines in a cell in a spreadsheettable?

TIA
juh 
-- 
Autoren-Homepage: ......... http://literatur.hasecke.com
Satiren & Essays: ......... http://www.sudelbuch.de
Privater Blog: ............ http://www.hasecke.eu
Netzliteratur-Projekt: .... http://www.generationenprojekt.de



[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

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

* Re: Multiline cell in spreadsheettable
  2021-11-18  9:29 Multiline cell in spreadsheettable juh via ntg-context
@ 2021-11-18 11:56 ` Hans Hagen via ntg-context
  2021-11-18 16:07   ` juh via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen via ntg-context @ 2021-11-18 11:56 UTC (permalink / raw)
  To: juh, mailing list for ConTeXt users; +Cc: Hans Hagen

On 11/18/2021 10:29 AM, juh via ntg-context wrote:
> Hi all,
> 
> is there a parameter to have multiple lines in a cell in a spreadsheettable?
see end of m-spreadsheet ... they are just natural tables


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Multiline cell in spreadsheettable
  2021-11-18 11:56 ` Hans Hagen via ntg-context
@ 2021-11-18 16:07   ` juh via ntg-context
  2021-11-18 18:08     ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: juh via ntg-context @ 2021-11-18 16:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: juh


[-- Attachment #1.1: Type: text/plain, Size: 2947 bytes --]

Am Thu, Nov 18, 2021 at 12:56:33PM +0100 schrieb Hans Hagen:
> On 11/18/2021 10:29 AM, juh via ntg-context wrote:
> > Hi all,
> > 
> > is there a parameter to have multiple lines in a cell in a spreadsheettable?
> see end of m-spreadsheet ... they are just natural tables

I found this code on the wiki

% mode=mkiv
\setuppapersize[A5]
\bTABLE
\setupTABLE[c][each][alignmentcharacter={number->.},aligncharacter=yes,align=middle]
\bTABLEhead
\bTR
\bTH Same-Width Prefix \eTH \bTH Varying-Width Prefix \eTH
\bTH Same-Width Suffix \eTH \bTH Varying-Width Suffix \eTH
\eTR
\eTABLEhead
\bTABLEbody
\bTR \bTD  \$1.00 \eTD \bTD    \$1.00 \eTD \bTD  1.00\% \eTD \bTD  1.00\%   \eTD \eTR
\bTR \bTD \$10.00 \eTD \bTD \$\$10.00 \eTD \bTD 10.00\% \eTD \bTD 10.00\%\% \eTD \eTR
\bTR \bTD  \$1.0  \eTD \bTD    \$1.0  \eTD \bTD  1.0\%  \eTD \bTD  1.0\%    \eTD \eTR
\bTR \bTD \$10.0  \eTD \bTD \$\$10.0  \eTD \bTD 10.0\%  \eTD \bTD 10.0\%\%  \eTD \eTR
\eTABLEbody
\eTABLE

It sets the text of bTH like p{4cm} in LaTeX in several lines.

But this does not work with my invoice code:

\startspreadsheettable[test][frame=off]
\setupTABLE[c][each][alignmentcharacter={number->.},aligncharacter=yes,align=middle]
\startrow[topframe=off,bottomframe=on]
\startcell[align=flushleft] "Anz" \stopcell
\startcell[align=flushleft, width=9cm] "Beschreibung" \stopcell
\startcell[align=flushleft] "MwSt" \stopcell
\startcell[align=flushright] "Einzeln" \stopcell
\startcell[align=flushright] "Gesamt" \stopcell    
\stoprow

$for(positions)$
\startrow
\startcell[align=center] @ "0.2f h" $it.stunden$ \stopcell
\startcell[align=flushleft] "$it.name$" \stopcell  %<-- this cell should
be like p{4cm}
\startcell[align=flushright] @ "0.2f \percent" $it.mwst$ \stopcell
\startcell[align=flushright] @ "0.2f €" $it.stundensatz$ \stopcell
\startcell[align=flushright] @ "0.2f €" (A[row] * D[row]) \stopcell    
\stoprow
$endfor$

\startrow[topframe=on]
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushleft, style=bold] "Gesamt netto" \stopcell
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushright, style=bold] @ "0.2f €" sum(E) \stopcell
\stoprow

\startrow[topframe=off]
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushleft] "Mehrwertsteuer" \stopcell
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushright] @ "0.2f €" 0.19 * E[row-1] \stopcell
\stoprow

\startrow[topframe=off]
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushleft, style=bold] "Gesamtsumme" \stopcell
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushleft] " " \stopcell    
\startcell[align=flushright, style=bold] @ "0.2f €" E[row-1]+E[row-2] \stopcell
\stoprow
\stopspreadsheettable

The key between $ are variables which get filled by pandoc.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

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

* Re: Multiline cell in spreadsheettable
  2021-11-18 16:07   ` juh via ntg-context
@ 2021-11-18 18:08     ` Hans Hagen via ntg-context
  2021-11-19  7:48       ` juh via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen via ntg-context @ 2021-11-18 18:08 UTC (permalink / raw)
  To: juh, mailing list for ConTeXt users; +Cc: Hans Hagen

On 11/18/2021 5:07 PM, juh via ntg-context wrote:
> Am Thu, Nov 18, 2021 at 12:56:33PM +0100 schrieb Hans Hagen:
>> On 11/18/2021 10:29 AM, juh via ntg-context wrote:
>>> Hi all,
>>>
>>> is there a parameter to have multiple lines in a cell in a spreadsheettable?
>> see end of m-spreadsheet ... they are just natural tables
> 
> I found this code on the wiki
> 
> % mode=mkiv
> \setuppapersize[A5]
> \bTABLE
> \setupTABLE[c][each][alignmentcharacter={number->.},aligncharacter=yes,align=middle]
> \bTABLEhead
> \bTR
> \bTH Same-Width Prefix \eTH \bTH Varying-Width Prefix \eTH
> \bTH Same-Width Suffix \eTH \bTH Varying-Width Suffix \eTH
> \eTR
> \eTABLEhead
> \bTABLEbody
> \bTR \bTD  \$1.00 \eTD \bTD    \$1.00 \eTD \bTD  1.00\% \eTD \bTD  1.00\%   \eTD \eTR
> \bTR \bTD \$10.00 \eTD \bTD \$\$10.00 \eTD \bTD 10.00\% \eTD \bTD 10.00\%\% \eTD \eTR
> \bTR \bTD  \$1.0  \eTD \bTD    \$1.0  \eTD \bTD  1.0\%  \eTD \bTD  1.0\%    \eTD \eTR
> \bTR \bTD \$10.0  \eTD \bTD \$\$10.0  \eTD \bTD 10.0\%  \eTD \bTD 10.0\%\%  \eTD \eTR
> \eTABLEbody
> \eTABLE
> 
> It sets the text of bTH like p{4cm} in LaTeX in several lines.
maybe something

\setupTABLE[c][1][width=4cm]
\setupTABLE[c][3][width=4cm]

or otherwise more cells with a span (nx=...)


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Multiline cell in spreadsheettable
  2021-11-18 18:08     ` Hans Hagen via ntg-context
@ 2021-11-19  7:48       ` juh via ntg-context
  2021-11-19  8:19         ` Henning Hraban Ramm via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: juh via ntg-context @ 2021-11-19  7:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: juh


[-- Attachment #1.1: Type: text/plain, Size: 929 bytes --]

Am Thu, Nov 18, 2021 at 07:08:12PM +0100 schrieb Hans Hagen:
> maybe something
> 
> \setupTABLE[c][1][width=4cm]
> \setupTABLE[c][3][width=4cm]

I discovered that

\startcell[align=flushleft,width=4cm] A very long line that breaks \stopcell

does the same trick.

While the parameter width is mentioned in spreadsheet-mkiv.pdf there is
no hint that it gives you line breaking cells.  

And in https://wiki.contextgarden.net/Command/setupTABLE the parameter
width is not mentioned at all.

Maybe I knew this but forgot it. And when I searched the wiki I could
not find a hint to this.

I would like to improve the wiki, any hint where a hint to this would
fit?

TIA
juh
-- 
Autoren-Homepage: ......... http://literatur.hasecke.com
Satiren & Essays: ......... http://www.sudelbuch.de
Privater Blog: ............ http://www.hasecke.eu
Netzliteratur-Projekt: .... http://www.generationenprojekt.de



[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

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

* Re: Multiline cell in spreadsheettable
  2021-11-19  7:48       ` juh via ntg-context
@ 2021-11-19  8:19         ` Henning Hraban Ramm via ntg-context
  2021-11-19 10:25           ` juh via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2021-11-19  8:19 UTC (permalink / raw)
  To: ntg-context; +Cc: Henning Hraban Ramm

Am 19.11.21 um 08:48 schrieb juh via ntg-context:

> And in https://wiki.contextgarden.net/Command/setupTABLE the parameter
> width is not mentioned at all.

Because it inherits from \setupframed where all these parameters are 
declared.

> I would like to improve the wiki, any hint where a hint to this would
> fit?

Maybe in https://wiki.contextgarden.net/TABLE
That page needs some better structure...

Hraban
___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Multiline cell in spreadsheettable
  2021-11-19  8:19         ` Henning Hraban Ramm via ntg-context
@ 2021-11-19 10:25           ` juh via ntg-context
  0 siblings, 0 replies; 7+ messages in thread
From: juh via ntg-context @ 2021-11-19 10:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: juh


[-- Attachment #1.1: Type: text/plain, Size: 510 bytes --]

Am Fri, Nov 19, 2021 at 09:19:08AM +0100 schrieb Henning Hraban Ramm via ntg-context:
> Maybe in https://wiki.contextgarden.net/TABLE
> That page needs some better structure...

Thats probably correct.

I inserted a paragraph without improving the structure. 

juh

-- 
Autoren-Homepage: ......... http://literatur.hasecke.com
Satiren & Essays: ......... http://www.sudelbuch.de
Privater Blog: ............ http://www.hasecke.eu
Netzliteratur-Projekt: .... http://www.generationenprojekt.de



[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

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

end of thread, other threads:[~2021-11-19 10:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18  9:29 Multiline cell in spreadsheettable juh via ntg-context
2021-11-18 11:56 ` Hans Hagen via ntg-context
2021-11-18 16:07   ` juh via ntg-context
2021-11-18 18:08     ` Hans Hagen via ntg-context
2021-11-19  7:48       ` juh via ntg-context
2021-11-19  8:19         ` Henning Hraban Ramm via ntg-context
2021-11-19 10:25           ` juh via ntg-context

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).