From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/109863 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "T. Kurt Bond" Newsgroups: gmane.comp.tex.context Subject: Re: How can I make "natural table" be exactly as wide as the textwidth? Date: Tue, 8 Dec 2020 04:33:12 -0500 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7528347618823413444==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6557"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Dec 08 10:33:49 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmZNT-0001aM-P7 for gctc-ntg-context-518@m.gmane-mx.org; Tue, 08 Dec 2020 10:33:47 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4D2501AACA2; Tue, 8 Dec 2020 10:33:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dprQ2G2ajTdN; Tue, 8 Dec 2020 10:33:26 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4A7D21AACA8; Tue, 8 Dec 2020 10:33:26 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 792581AACA0 for ; Tue, 8 Dec 2020 10:33:25 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TzbwO-uP_ybK for ; Tue, 8 Dec 2020 10:33:24 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.49; helo=mail-io1-f49.google.com; envelope-from=tkurtbond@gmail.com; receiver= Original-Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 3549F1AAC32 for ; Tue, 8 Dec 2020 10:33:24 +0100 (CET) Original-Received: by mail-io1-f49.google.com with SMTP id o8so16303523ioh.0 for ; Tue, 08 Dec 2020 01:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=o8C8g+1+29/cxm/k3fINhIRFDxWFOacEQy/Kxo4cXcw=; b=lccYVDyRjutgfHA0fU63tFoSaCHQggsjAU12YizdoEF+J4pyljJdVlErsxq61D2ZmX NRGNX0GJFNcdxMW+9g3hD7E0ww0EioTGzCD8cMqWqihc55BZyO7U1MEguBuzbxxbhdFW Gg9qQB5cGU19YSNFpBYsCgRCo8LakmLlQsYeIOfv6fBGCmGES+NsCq+rySeavqc9y4kv hnZnsGPJIOKKQ5Wp8eZIMF6KN6vSE69TWwuXAfvnkB4iOTMb5HsfN+cyBgt0OM2S8QxT V5wzce/YlupLUUYFgF8O4reFtsAzdOa6AgdD5UX8EO/FUJ0jFOJUu+xvZOdMmqrrMSce PAsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=o8C8g+1+29/cxm/k3fINhIRFDxWFOacEQy/Kxo4cXcw=; b=Vyaen0bBPvISIsE1fi7dFVL7VtVl6BW3r3P8rBvA9Za+05rDYNDsNe543G1/UhA3hh 7Nbi90iONVa5doAN9QWr1bphkOjV4//MhBsiUEtFjJ/cCqjcoADFmze405lA2hobUx0U IeFh//kqxUmJBs/fD6iUos25LRR/ADyo6dEYqYoNKwK2uCRL2lck/lTBLnDurYjGh6jz ajGw+1Z1nPVo8pKhU2qCtZBwi+skuFK5gnSPz9PS5Y3rUdzXos3EJyeBKLNm6cxYAc37 KvKJglRO61GMqdqN9jPXeEcEvPzobx06sGZ2yefNLCKV7HCyoLIa1yexfSzWakIG9DPK Q56A== X-Gm-Message-State: AOAM532c92fd2xG9jCUdmOglU4SaaFXlFsIvo14wPe4UNKgv6tePb2Qr 1TGucY4B/51yiptVUL3zwSPPHr6kSlRRXrV0ZE76JCIV1tQXXw== X-Google-Smtp-Source: ABdhPJxkbqAuRx6zp+oExB9f/lwBHbAyTWYukkrSWT+gKPS8LNL9JKps3peC0UQFd8HeN2EgbJH+AABB5/Gc3qF5ZCQ= X-Received: by 2002:a5d:9f0b:: with SMTP id q11mr21113359iot.157.1607420002784; Tue, 08 Dec 2020 01:33:22 -0800 (PST) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:109863 Archived-At: --===============7528347618823413444== Content-Type: multipart/alternative; boundary="0000000000004559ff05b5f0a282" --0000000000004559ff05b5f0a282 Content-Type: text/plain; charset="UTF-8" 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 wrote: > On Sun, 6 Dec 2020, T. Kurt Bond wrote: > > On Sun, Dec 6, 2020 at 2:20 AM Aditya Mahajan 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 --0000000000004559ff05b5f0a282 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Here's a MWE that produces the oddly distributed colum= ns:

\setupl= ayout[backspace=3D0.5in,width= =3D4.5in,topspace=3D0.5in,top= =3D0in,topdistance=3D0in,
= =C2=A0 header=3D0in,headerdistance=3D0in,bottom=3D0.25in,bottomdistance=3D0.125in,
=C2= =A0 footer=3D0.25in,footerdistance=3D0.25in,height=3D7.75in]
\setuppagenumbering[location=3D{footer,middle}]
\setupwhitespace[quarterline]
\setupbodyfont[pagella,9pt]
\= definepapersize[digest][width= =3D5.5in,height=3D8.5in]
\s= etuppapersize[digest]
\starttext
\startplacetable[location=3Dforce,title=3D{Stun Levels}]
\definecolor[back-3][r=3D.8,g=3D= .8,b=3D.8]
\setupTABLE[background=3Dcolor,frame=3Doff,framecolor=3Dwhite]
\setupTABLE[row][odd][
backgroundc= olor=3Dback-3]
\setupTABLE[row][1][topframe=3Don,bottomframe=3Don,framecolor=3Dblack,rulethickness=3D0.75pt]
\setupTABLE[row][4][
bottomframe=3D= on,framecolor=3Dblack,rulethickness=3D0.75pt]
\bTABLE[width=3Dbroad]
\bTR\bTD {\bf Damage >\\Soak by:}\ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0\eTD\bTD {\bf Stun\\Level}\eTD\bTD {\bf Stun\\Effects} = =C2=A0 =C2=A0 =C2=A0 \eTD\eTR
\bTR\bTD 0 or less\eTD\bTD Unharmed =C2=A0 =C2=A0 =C2=A0 =C2=A0 \eTD\bTD= None. =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 \eTD\eTR
\bTR\bTD 1 to 8 =C2=A0 \eTD\bTD Stunned =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0\eTD\bTD -1D on all actions for 2D rounds. =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \eTD\eTR
\bTR\bTD 9+ =C2=A0 =C2=A0 =C2=A0 \eTD\bTD Severely\\Stunne= d\eTD\bTD The character is knocked unconscious for 2D minutes.\eTD\eTR
<= /span>\eTABLE
\stopplacetable<= br>
\stoptext<= /div>

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

I added t= he following two lines before the \bTABLE:

\setupTABLE[column][1][width=3D6em]
\setupTABLE[column][2][width=3D6em]


Thinking about it a little more, the first result makes sen= se: there is probably no way for ConTeXt to figure out that the third colum= n 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 widt= h for the columns with an x, distributing them equally across the columns w= ith x specifiers. =C2=A0(I often use groff for quick-and-dirty documents, o= r where ConTeXt is not installed; I use ConTeXt for documents that are more= complex, or ones that need their appearance customized.) =C2=A0This is par= ticularly useful when one column has paragraph length text contents, and th= e other columns don't.

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

On Sun, Dec 6, 2020= at 11:20 PM Aditya Mahajan <aditya= m@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 se= em to do
> > anything.
> >
> > Use:
> >
> > \bTABLE[width=3Dbroad]
> >
> > \eTABLE

> That did the trick!=C2=A0 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= .=C2=A0 I
> had to set widths for the first and second columns, and had to experim= ent
> 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 t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________


--
--0000000000004559ff05b5f0a282-- --===============7528347618823413444== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============7528347618823413444==--