ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How can I make "natural table" be exactly as wide as the textwidth?
@ 2020-12-06  7:02 T. Kurt Bond
  2020-12-06  7:19 ` Aditya Mahajan
  0 siblings, 1 reply; 5+ messages in thread
From: T. Kurt Bond @ 2020-12-06  7:02 UTC (permalink / raw)
  To: context mailing list


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

Setting maxwidth and textwidth on the \bTABLE doesn't seem to do anything.

-- 
T. Kurt Bond, tkurtbond@gmail.com, https://tkurtbond.github.io

[-- Attachment #1.2: Type: text/html, Size: 463 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] 5+ messages in thread

* Re: How can I make "natural table" be exactly as wide as the textwidth?
  2020-12-06  7:02 How can I make "natural table" be exactly as wide as the textwidth? T. Kurt Bond
@ 2020-12-06  7:19 ` Aditya Mahajan
  2020-12-06  8:24   ` T. Kurt Bond
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2020-12-06  7:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 6 Dec 2020, T. Kurt Bond wrote:

> Setting maxwidth and textwidth on the \bTABLE doesn't seem to do anything.

Use: 

\bTABLE[width=broad]

\eTABLE

Aditya
___________________________________________________________________________________
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] 5+ messages in thread

* Re: How can I make "natural table" be exactly as wide as the textwidth?
  2020-12-06  7:19 ` Aditya Mahajan
@ 2020-12-06  8:24   ` T. Kurt Bond
  2020-12-07  4:18     ` Aditya Mahajan
  0 siblings, 1 reply; 5+ messages in thread
From: T. Kurt Bond @ 2020-12-06  8:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

That did the trick!  It did distribute the new width oddly, with adding
more width to the the first and second columns, while the third column,
which had the most text to wrap, was not as wide as it could have been.  I
had to set widths for the first and second columns, and had to experiment
to get them right.

Thanks for the help!

On Sun, Dec 6, 2020 at 2:20 AM Aditya Mahajan <adityam@umich.edu> wrote:

> On Sun, 6 Dec 2020, T. Kurt Bond wrote:
>
> > Setting maxwidth and textwidth on the \bTABLE doesn't seem to do
> anything.
>
> Use:
>
> \bTABLE[width=broad]
>
> \eTABLE
>
> Aditya
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>


-- 
T. Kurt Bond, tkurtbond@gmail.com, https://tkurtbond.github.io

[-- Attachment #1.2: Type: text/html, Size: 2270 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] 5+ messages in thread

* Re: How can I make "natural table" be exactly as wide as the textwidth?
  2020-12-06  8:24   ` T. Kurt Bond
@ 2020-12-07  4:18     ` Aditya Mahajan
  2020-12-08  9:33       ` T. Kurt Bond
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2020-12-07  4:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 6 Dec 2020, T. Kurt Bond wrote:
> On Sun, Dec 6, 2020 at 2:20 AM Aditya Mahajan <adityam@umich.edu> wrote:
> 
> > On Sun, 6 Dec 2020, T. Kurt Bond wrote:
> >
> > > Setting maxwidth and textwidth on the \bTABLE doesn't seem to do
> > anything.
> >
> > Use:
> >
> > \bTABLE[width=broad]
> >
> > \eTABLE

> That did the trick!  It did distribute the new width oddly, with adding
> more width to the the first and second columns, while the third column,
> which had the most text to wrap, was not as wide as it could have been.  I
> had to set widths for the first and second columns, and had to experiment
> to get them right.

A MWE (Minimal working example) is needed to see what is going on.

Aditya
___________________________________________________________________________________
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] 5+ messages in thread

* Re: How can I make "natural table" be exactly as wide as the textwidth?
  2020-12-07  4:18     ` Aditya Mahajan
@ 2020-12-08  9:33       ` T. Kurt Bond
  0 siblings, 0 replies; 5+ messages in thread
From: T. Kurt Bond @ 2020-12-08  9:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Here's a MWE that produces the oddly distributed columns:

\setuplayout[backspace=0.5in,width=4.5in,topspace=0.5in,
top=0in,topdistance=0in,
  header=0in,headerdistance=0in,bottom=0.25in,bottomdistance=0.125in,
  footer=0.25in,footerdistance=0.25in,height=7.75in]
\setuppagenumbering[location={footer,middle}]
\setupwhitespace[quarterline]
\setupbodyfont[pagella,9pt]
\definepapersize[digest][width=5.5in,height=8.5in]
\setuppapersize[digest]
\starttext
\startplacetable[location=force,title={Stun Levels}]
\definecolor[back-3][r=.8,g=.8,b=.8]
\setupTABLE[background=color,frame=off,framecolor=white]
\setupTABLE[row][odd][backgroundcolor=back-3]
\setupTABLE[row][1][topframe=on,bottomframe=on,framecolor=
black,rulethickness=0.75pt]
\setupTABLE[row][4][bottomframe=on,framecolor=black,rulethickness=0.75pt]
\bTABLE[width=broad]
\bTR\bTD {\bf Damage >\\Soak by:}\          \eTD\bTD {\bf
Stun\\Level}\eTD\bTD {\bf Stun\\Effects}       \eTD\eTR
\bTR\bTD 0 or less\eTD\bTD Unharmed         \eTD\bTD None.
                              \eTD\eTR
\bTR\bTD 1 to 8   \eTD\bTD Stunned          \eTD\bTD -1D on all actions for
2D rounds.                   \eTD\eTR
\bTR\bTD 9+       \eTD\bTD Severely\\Stunned\eTD\bTD The character is
knocked unconscious for 2D minutes.\eTD\eTR
\eTABLE
\stopplacetable
\stoptext


Naively, I expected the third column, which has the longest text, to absorb
more of the width, rather than the three columns getting about the same
width.

I added the following two lines before the \bTABLE:

\setupTABLE[column][1][width=6em]
\setupTABLE[column][2][width=6em]


This caused all the space not used by the first two columns to be used by
the third column.

Thinking about it a little more, the first result makes sense: there is
probably no way for ConTeXt to figure out that the third column should be
wider unless it is given some constraints.

Interestingly, groff's tbl has a Column Specifier, x or X, that, after
computing all the widths of columns without an x specifier, uses the
remaining line width for the columns with an x, distributing them equally
across the columns with x specifiers.  (I often use groff for
quick-and-dirty documents, or where ConTeXt is not installed; I use ConTeXt
for documents that are more complex, or ones that need their appearance
customized.)  This is particularly useful when one column has paragraph
length text contents, and the other columns don't.

I don't suppose there is a bTABLE equivalent?  Or an equivalent in one of
ConTeXt's other table types?

On Sun, Dec 6, 2020 at 11:20 PM Aditya Mahajan <adityam@umich.edu> wrote:

> On Sun, 6 Dec 2020, T. Kurt Bond wrote:
> > On Sun, Dec 6, 2020 at 2:20 AM Aditya Mahajan <adityam@umich.edu> wrote:
> >
> > > On Sun, 6 Dec 2020, T. Kurt Bond wrote:
> > >
> > > > Setting maxwidth and textwidth on the \bTABLE doesn't seem to do
> > > anything.
> > >
> > > Use:
> > >
> > > \bTABLE[width=broad]
> > >
> > > \eTABLE
>
> > That did the trick!  It did distribute the new width oddly, with adding
> > more width to the the first and second columns, while the third column,
> > which had the most text to wrap, was not as wide as it could have been.
> I
> > had to set widths for the first and second columns, and had to experiment
> > to get them right.
>
> A MWE (Minimal working example) is needed to see what is going on.
>
> Aditya
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>


-- 
T. Kurt Bond, tkurtbond@gmail.com, https://tkurtbond.github.io

[-- Attachment #1.2: Type: text/html, Size: 7601 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] 5+ messages in thread

end of thread, other threads:[~2020-12-08  9:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-06  7:02 How can I make "natural table" be exactly as wide as the textwidth? T. Kurt Bond
2020-12-06  7:19 ` Aditya Mahajan
2020-12-06  8:24   ` T. Kurt Bond
2020-12-07  4:18     ` Aditya Mahajan
2020-12-08  9:33       ` T. Kurt Bond

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