ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Text around a table (xtables)
@ 2018-10-10 17:26 Fabrice Couvreur
  2018-10-10 17:46 ` Pablo Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Couvreur @ 2018-10-10 17:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello,
Why is the text wrapping around the board or far too far ?
Thank you.
Fabrice

\definefloat
    [recipe]
    [figure]

  \setupfloat
    [recipe]
    [default={right,none}]

  \starttext
\placerecipe{}{%
  \startxtable[align={middle,lohi},width=1.7
    cm]
    \startxrow[background=color,backgroundcolor=gray]
      \startxcell[width=3.5cm,frame=off,align={middle,right},
                  background=color,backgroundcolor=white]
        Consommation pour la production de 1 UM
        \hfill\startMPcode drawarrow
(0,0)--(0,0.35cm)--(0.35cm,0.35cm)withpen pencircle scaled 1bp; \stopMPcode
      \stopxcell
      \startxcell
        Ind.
      \stopxcell
      \startxcell
        Agri.
      \stopxcell
    \stopxrow
    \startxrow
      \startxcell[background=color,backgroundcolor=gray]
        Ind.
      \stopxcell
      \startxcell
        0,5
      \stopxcell
      \startxcell
        0,2
      \stopxcell
    \stopxrow
    \startxrow
      \startxcell[background=color,backgroundcolor=gray]
        Agri.
      \stopxcell
      \startxcell
        0,2
      \stopxcell
      \startxcell
        0,6
      \stopxcell
    \stopxrow
    \startxrow
      \startxcell[nx=3,frame=off,align={right}]
       Lecture du tableau : pour la production d'un bien équivalent à 1 UM,
l'industrie consomme l'équivalent de 0,5 UM de sa propre production et
l'équivalent de 0,2 UM de la production de l'agriculture.
      \stopxcell
    \stopxrow
  \stopxtable
}
\dorecurse{10}{\input knuth}
\stoptext

[-- Attachment #1.2: Type: text/html, Size: 2686 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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] 4+ messages in thread

* Re: Text around a table (xtables)
  2018-10-10 17:26 Text around a table (xtables) Fabrice Couvreur
@ 2018-10-10 17:46 ` Pablo Rodriguez
  2018-10-10 18:09   ` Fabrice Couvreur
  0 siblings, 1 reply; 4+ messages in thread
From: Pablo Rodriguez @ 2018-10-10 17:46 UTC (permalink / raw)
  To: ntg-context

On 10/10/18 7:26 PM, Fabrice Couvreur wrote:
> Hello,
> Why is the text wrapping around the board or far too far ?

Hi Fabrice,

replace the following command:

    \startxtable[align={middle,lohi}]

It works now. It is rather weird that the total width for the table is
1.7cm and one of its cells is 3.5cm.

I hope it helps,

Pablo


> Thank you.
> Fabrice
> 
> \definefloat
>     [recipe]
>     [figure]
> 
>   \setupfloat
>     [recipe]
>     [default={right,none}]
> 
>   \starttext
> \placerecipe{}{%
>   \startxtable[align={middle,lohi},width=1.7
>     cm]
>     \startxrow[background=color,backgroundcolor=gray]
>       \startxcell[width=3.5cm,frame=off,align={middle,right},
>                   background=color,backgroundcolor=white]
>         Consommation pour la production de 1 UM
>         \hfill\startMPcode drawarrow
> (0,0)--(0,0.35cm)--(0.35cm,0.35cm)withpen pencircle scaled 1bp; \stopMPcode
>       \stopxcell
>       \startxcell
>         Ind.
>       \stopxcell
>       \startxcell
>         Agri.
>       \stopxcell
>     \stopxrow
>     \startxrow
>       \startxcell[background=color,backgroundcolor=gray]
>         Ind.
>       \stopxcell
>       \startxcell
>         0,5
>       \stopxcell
>       \startxcell
>         0,2
>       \stopxcell
>     \stopxrow
>     \startxrow
>       \startxcell[background=color,backgroundcolor=gray]
>         Agri.
>       \stopxcell
>       \startxcell
>         0,2
>       \stopxcell
>       \startxcell
>         0,6
>       \stopxcell
>     \stopxrow
>     \startxrow
>       \startxcell[nx=3,frame=off,align={right}]
>        Lecture du tableau : pour la production d'un bien équivalent à 1
> UM, l'industrie consomme l'équivalent de 0,5 UM de sa propre production
> et l'équivalent de 0,2 UM de la production de l'agriculture.
>       \stopxcell
>     \stopxrow
>   \stopxtable
> }   
> \dorecurse{10}{\input knuth} 
> \stoptext
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
> 


-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 4+ messages in thread

* Re: Text around a table (xtables)
  2018-10-10 17:46 ` Pablo Rodriguez
@ 2018-10-10 18:09   ` Fabrice Couvreur
  2018-10-10 18:29     ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Couvreur @ 2018-10-10 18:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi Pablo,
Thank you, I thought that indicating width = 1.7cm, the size of the cells
would have been 1.7cm.
Fabrice

Le mer. 10 oct. 2018 à 19:46, Pablo Rodriguez <oinos@gmx.es> a écrit :

> On 10/10/18 7:26 PM, Fabrice Couvreur wrote:
> > Hello,
> > Why is the text wrapping around the board or far too far ?
>
> Hi Fabrice,
>
> replace the following command:
>
>     \startxtable[align={middle,lohi}]
>
> It works now. It is rather weird that the total width for the table is
> 1.7cm and one of its cells is 3.5cm.
>
> I hope it helps,
>
> Pablo
>
>
> > Thank you.
> > Fabrice
> >
> > \definefloat
> >     [recipe]
> >     [figure]
> >
> >   \setupfloat
> >     [recipe]
> >     [default={right,none}]
> >
> >   \starttext
> > \placerecipe{}{%
> >   \startxtable[align={middle,lohi},width=1.7
> >     cm]
> >     \startxrow[background=color,backgroundcolor=gray]
> >       \startxcell[width=3.5cm,frame=off,align={middle,right},
> >                   background=color,backgroundcolor=white]
> >         Consommation pour la production de 1 UM
> >         \hfill\startMPcode drawarrow
> > (0,0)--(0,0.35cm)--(0.35cm,0.35cm)withpen pencircle scaled 1bp;
> \stopMPcode
> >       \stopxcell
> >       \startxcell
> >         Ind.
> >       \stopxcell
> >       \startxcell
> >         Agri.
> >       \stopxcell
> >     \stopxrow
> >     \startxrow
> >       \startxcell[background=color,backgroundcolor=gray]
> >         Ind.
> >       \stopxcell
> >       \startxcell
> >         0,5
> >       \stopxcell
> >       \startxcell
> >         0,2
> >       \stopxcell
> >     \stopxrow
> >     \startxrow
> >       \startxcell[background=color,backgroundcolor=gray]
> >         Agri.
> >       \stopxcell
> >       \startxcell
> >         0,2
> >       \stopxcell
> >       \startxcell
> >         0,6
> >       \stopxcell
> >     \stopxrow
> >     \startxrow
> >       \startxcell[nx=3,frame=off,align={right}]
> >        Lecture du tableau : pour la production d'un bien équivalent à 1
> > UM, l'industrie consomme l'équivalent de 0,5 UM de sa propre production
> > et l'équivalent de 0,2 UM de la production de l'agriculture.
> >       \stopxcell
> >     \stopxrow
> >   \stopxtable
> > }
> > \dorecurse{10}{\input knuth}
> > \stoptext
> >
> >
> ___________________________________________________________________________________
> > 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
> >
> ___________________________________________________________________________________
> >
>
>
> --
> http://www.ousia.tk
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________

[-- Attachment #1.2: Type: text/html, Size: 5564 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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] 4+ messages in thread

* Re: Text around a table (xtables)
  2018-10-10 18:09   ` Fabrice Couvreur
@ 2018-10-10 18:29     ` Wolfgang Schuster
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2018-10-10 18:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Fabrice Couvreur


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



Fabrice Couvreur schrieb am 10.10.18 um 20:09:
> Hi Pablo,
> Thank you, I thought that indicating width = 1.7cm, the size of the 
> cells would have been 1.7cm.

You’re correct and what Pablo meant is the textwidth option for natural 
tables where you can set a width for the whole table.


The big space below the table in your example is a wrong calculation of 
the cell height for the merged cells. The height is probably wrong 
because ConTeXt uses the width of the first column (and not of all 
merged cells) to determine the height.

\starttext

\startxtable[width=2cm]
     \startxrow
         \startxcell
             Column 1
         \stopxcell
         \startxcell
             Column 2
         \stopxcell
     \stopxrow
     \startxrow
         \startxcell[nx=2]
             Merged column
         \stopxcell
     \stopxrow
\stopxtable

\stoptext


When your goal of the merged cells is to create a caption for the table 
you can use the “nonumber” keyword for placetable to get rid of the 
label and counter of the float.

\starttext

\startplacetable[location={nonumber,right},title={A long title for this 
short table}]
     \startxtable[width=2cm]
         \startxrow
             \startxcell
                 Column 1
             \stopxcell
             \startxcell
                 Column 2
             \stopxcell
         \stopxrow
     \stopxtable
\stopplacetable
\input knuth

\stoptext

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2253 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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] 4+ messages in thread

end of thread, other threads:[~2018-10-10 18:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-10 17:26 Text around a table (xtables) Fabrice Couvreur
2018-10-10 17:46 ` Pablo Rodriguez
2018-10-10 18:09   ` Fabrice Couvreur
2018-10-10 18:29     ` Wolfgang Schuster

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