ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* align natural tables left and right
@ 2016-12-29 16:31 MF
  2016-12-29 17:24 ` Rik Kabel
  0 siblings, 1 reply; 4+ messages in thread
From: MF @ 2016-12-29 16:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello list,
please take a look at this:

\setupbackgrounds[text][frame=on]

\starttext

Preceding text.

\startplacetable[location={none,fit,force,here,middle}]
\bTABLE
  \bTR
     \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
  \eTR
  \bTR
     \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
  \eTR
\eTABLE
\stopplacetable

Following text.

\page

Preceding text.

\startplacetable[location={none,fit,force,here,left}]
\bTABLE
  \bTR
     \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
  \eTR
  \bTR
     \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
  \eTR
\eTABLE
\stopplacetable

Following text.

\page

Preceding text.

\startplacetable[location={none,fit,force,here,right}]
\bTABLE
  \bTR
     \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
  \eTR
  \bTR
     \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
  \eTR
\eTABLE
\stopplacetable

Following text.

\stoptext

It's the same table repeated on three pages, with some preceding text
and some following text.
Only the "location" option of \startplacetable is modified across
pages: "middle" in page 1, "left" in page 2, "right" in page 3.

When I use location=middle (page 1), the table is centered and the
"Following text" goes after (under) the table. This is what I want to
achieve: the following text should be under the table.

Using location=left or location=right, the "Following text" is not
placed under the table. How can I achieve that?

Thanks in advance,
Massi
___________________________________________________________________________________
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: align natural tables left and right
  2016-12-29 16:31 align natural tables left and right MF
@ 2016-12-29 17:24 ` Rik Kabel
  2016-12-30 19:42   ` MF
  0 siblings, 1 reply; 4+ messages in thread
From: Rik Kabel @ 2016-12-29 17:24 UTC (permalink / raw)
  To: ntg-context


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

On 2016-12-29 11:31, MF wrote:
> Hello list,
> please take a look at this:
>
> \setupbackgrounds[text][frame=on]
>
> \starttext
>
> Preceding text.
>
> \startplacetable[location={none,fit,force,here,middle}]
> \bTABLE
>    \bTR
>       \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
>    \eTR
>    \bTR
>       \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
>    \eTR
> \eTABLE
> \stopplacetable
>
> Following text.
>
> \page
>
> Preceding text.
>
> \startplacetable[location={none,fit,force,here,left}]
> \bTABLE
>    \bTR
>       \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
>    \eTR
>    \bTR
>       \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
>    \eTR
> \eTABLE
> \stopplacetable
>
> Following text.
>
> \page
>
> Preceding text.
>
> \startplacetable[location={none,fit,force,here,right}]
> \bTABLE
>    \bTR
>       \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
>    \eTR
>    \bTR
>       \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
>    \eTR
> \eTABLE
> \stopplacetable
>
> Following text.
>
> \stoptext
>
> It's the same table repeated on three pages, with some preceding text
> and some following text.
> Only the "location" option of \startplacetable is modified across
> pages: "middle" in page 1, "left" in page 2, "right" in page 3.
>
> When I use location=middle (page 1), the table is centered and the
> "Following text" goes after (under) the table. This is what I want to
> achieve: the following text should be under the table.
>
> Using location=left or location=right, the "Following text" is not
> placed under the table. How can I achieve that?
>
> Thanks in advance,
> Massi
Consider your third example, slightly modified:

    \startplacetable[location={none,fit,force,here,right}]
    \bTABLE
       \bTR
          \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
       \eTR
       \bTR
          \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
       \eTR
    \eTABLE
    \stopplacetable

    Following text.

    Following text.

    Following text.

    Following text.

And this example, with a frame around the table:

    \startframed[frame=off,align=right]
    \startplacetable[location={none,fit,force,here}]
    \bTABLE
       \bTR
          \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
       \eTR
       \bTR
          \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
       \eTR
    \eTABLE
    \stopplacetable
    \stopframed

    Following text.

    Following text.

    Following text.

    Following text.


The float location left (right) allows flowing text around the float. 
You do not want that, so do not use it.

-- 
Rik Kabel

[-- Attachment #1.2: Type: text/html, Size: 3111 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: align natural tables left and right
  2016-12-29 17:24 ` Rik Kabel
@ 2016-12-30 19:42   ` MF
  2016-12-30 20:47     ` Rik Kabel
  0 siblings, 1 reply; 4+ messages in thread
From: MF @ 2016-12-30 19:42 UTC (permalink / raw)
  To: ntg-context


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

>     On 2016-12-29 11:31, MF wrote:
> 
>     
>     
> >       Hello list,
> > please take a look at this:
> > 
> > \setupbackgrounds[text][frame=on]
> > 
> > \starttext
> > 
> > Preceding text.
> > 
> > \startplacetable[location={none,fit,force,here,middle}]
> > \bTABLE
> >   \bTR
> >      \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
> >   \eTR
> >   \bTR
> >      \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
> >   \eTR
> > \eTABLE
> > \stopplacetable
> > 
> > Following text.
> > 
> > \page
> > 
> > Preceding text.
> > 
> > \startplacetable[location={none,fit,force,here,left}]
> > \bTABLE
> >   \bTR
> >      \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
> >   \eTR
> >   \bTR
> >      \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
> >   \eTR
> > \eTABLE
> > \stopplacetable
> > 
> > Following text.
> > 
> > \page
> > 
> > Preceding text.
> > 
> > \startplacetable[location={none,fit,force,here,right}]
> > \bTABLE
> >   \bTR
> >      \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
> >   \eTR
> >   \bTR
> >      \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
> >   \eTR
> > \eTABLE
> > \stopplacetable
> > 
> > Following text.
> > 
> > \stoptext
> > 
> > It's the same table repeated on three pages, with some preceding
> > text
> > and some following text.
> > Only the "location" option of \startplacetable is modified across
> > pages: "middle" in page 1, "left" in page 2, "right" in page 3.
> > 
> > When I use location=middle (page 1), the table is centered and the
> > "Following text" goes after (under) the table. This is what I want
> > to
> > achieve: the following text should be under the table.
> > 
> > Using location=left or location=right, the "Following text" is not
> > placed under the table. How can I achieve that?
> > 
> > Thanks in advance,
> > Massi
> > 
> >     
> 
>     Consider your third example, slightly modified:
> 
>     
>       \startplacetable[location={none,fit,force,here,right}]
> \bTABLE
>   \bTR
>      \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
>   \eTR
>   \bTR
>      \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
>   \eTR
> \eTABLE
> \stopplacetable
> 
> Following text.
> 
> Following text.
> 
> Following text.
> 
> Following text.
> 
>     
>     And this example, with a frame around the table:
> 
>     \startframed[frame=off,align=right]
> 
>       \startplacetable[location={none,fit,force,here}]
> 
>       \bTABLE
> 
>         \bTR
> 
>            \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
> 
>         \eTR
> 
>         \bTR
> 
>            \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
> 
>         \eTR
> 
>       \eTABLE
> 
>       \stopplacetable
> 
>       \stopframed
> 
>       
> 
>       Following text.
> 
>       
> 
>       Following text.
> 
>       
> 
>       Following text.
> 
>       
> 
>       Following text.
> 
>     
>     
> 
>     The float location left (right) allows flowing text around the
>     float. You do not want that, so do not use it. 
> 
>     
> 
>     -- 
> 
>     Rik Kabel

Thank you Rik,
you solved my problem.
I've realized that \startplacetable is not necessary:

\starttext
\startframed[frame=off,             align=flushleft, % table aligned to
the left             width=broad,     % the frame takes all the text
width             offset=overlay,  % no space around the
table             ]
\bTABLE  \bTR     \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD  \eTR 
\bTR     \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD  \eTR\eTABLE\stopframed
Following text.
Following text.
Following text.
Following text.
\stoptext
Best greetings,
Massi

[-- Attachment #1.2: Type: text/html, Size: 4827 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: align natural tables left and right
  2016-12-30 19:42   ` MF
@ 2016-12-30 20:47     ` Rik Kabel
  0 siblings, 0 replies; 4+ messages in thread
From: Rik Kabel @ 2016-12-30 20:47 UTC (permalink / raw)
  To: ntg-context

On 2016-12-30 14:42, MF wrote:
> I've realized that \startplacetable is not necessary:
>
> \starttext
> \startframed[frame=off,
>               align=flushleft, % table aligned to the left
>               width=broad,     % the frame takes all the text width
>               offset=overlay,  % no space around the table
>               ]
> \bTABLE
>    \bTR
>       \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
>    \eTR
>    \bTR
>       \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
>    \eTR
> \eTABLE
> \stopframed
> Following text.
> Following text.
> Following text.
> Following text.
> \stoptext
>
Massi,

Whether or not you need \startplacefloat (where the float can be a 
figure, graphic, intermezzo, or table, or a user-defined item) depends 
on the requirements of the document. Floats are typically separate 
entities that do not appear in the linear flow of the text, but instead 
appear in a convenient place close to where they are referenced by the 
text. In addition to providing suggestions to the placement algorithm 
for positioning the float and handling caption formatting, the 
\startplacefloat mechanism manages the generation of reference 
information. If your tables are always set inline and do not need to be 
referenced within the text or in lists of floats (via \placelist), then 
you do not need \startplacefloat.

-- 
Rik
___________________________________________________________________________________
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:[~2016-12-30 20:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-29 16:31 align natural tables left and right MF
2016-12-29 17:24 ` Rik Kabel
2016-12-30 19:42   ` MF
2016-12-30 20:47     ` Rik Kabel

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