ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* linebreaks and cell width in xtables
@ 2014-05-04 16:30 Pablo Rodriguez
  2014-05-04 18:27 ` Rik Kabel
  0 siblings, 1 reply; 8+ messages in thread
From: Pablo Rodriguez @ 2014-05-04 16:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

I have the following sample:

\starttext
    \startxtable[option=stretch]
        \startxrow
            \startxcell
                One line

                And another
            \stopxcell
            \startxcell
                This breaks the following cell.
            \stopxcell
        \stopxrow
        \startxrow
            \startxcell
                This cell has multiple lines.
                Vertical spacing is wrong.
            \stopxcell
            \startxcell
                What am I missing?
            \stopxcell
        \stopxrow
    \stopxtable
\stoptext

I don’t know whether this is a bug. My question is the following: how
can I get a new line inside a cell?

I have another question: how can I force that both rows (in this case
two) have the same width?

Many thanks for your help,


Pablo
-- 
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: linebreaks and cell width in xtables
  2014-05-04 16:30 linebreaks and cell width in xtables Pablo Rodriguez
@ 2014-05-04 18:27 ` Rik Kabel
  2014-05-04 19:46   ` Pablo Rodriguez
  0 siblings, 1 reply; 8+ messages in thread
From: Rik Kabel @ 2014-05-04 18:27 UTC (permalink / raw)
  To: ntg-context


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

On 2014-05-04 12:30, Pablo Rodriguez wrote:
> Dear list,
>
> I have the following sample:
>
> \starttext
>      \startxtable[option=stretch]
>          \startxrow
>              \startxcell
>                  One line
>
>                  And another
>              \stopxcell
>              \startxcell
>                  This breaks the following cell.
>              \stopxcell
>          \stopxrow
>          \startxrow
>              \startxcell
>                  This cell has multiple lines.
>                  Vertical spacing is wrong.
>              \stopxcell
>              \startxcell
>                  What am I missing?
>              \stopxcell
>          \stopxrow
>      \stopxtable
> \stoptext
>
> I don’t know whether this is a bug. My question is the following: how
> can I get a new line inside a cell?
>
> I have another question: how can I force that both rows (in this case
> two) have the same width?
>
> Many thanks for your help,
>
>
> Pablo
Any of the following will work here. Which is or are idiomatic I will 
leave for others to say.

    This cell has multiple lines.\\

    This cell has multiple lines.\par

    This cell has multiple lines.\blank[none]


--
Rik Kabel


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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: linebreaks and cell width in xtables
  2014-05-04 18:27 ` Rik Kabel
@ 2014-05-04 19:46   ` Pablo Rodriguez
  2014-05-04 22:19     ` Rik
  2014-05-04 22:20     ` Rik Kabel
  0 siblings, 2 replies; 8+ messages in thread
From: Pablo Rodriguez @ 2014-05-04 19:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 05/04/2014 08:27 PM, Rik Kabel wrote:
> Any of the following will work here. Which is or are idiomatic I will
> leave for others to say.
> 
>     This cell has multiple lines.\\
> 
>     This cell has multiple lines.\par
> 
>     This cell has multiple lines.\blank[none]

Many thanks for your reply, Rik.

I’m afraid none of them works. Here is my sample:

\starttext
    \startxtable[option=stretch]
        \startxrow
            \startxcell
                aaa\blank[none]aaa
            \stopxcell
            \startxcell
                \ConTeXt\ \contextversion
            \stopxcell
        \stopxrow
        \startxrow
            \startxcell
                This cell has multiple lines.
                Vertical spacing is wrong.
            \stopxcell
            \startxcell
                What am I missing?
            \stopxcell
        \stopxrow
    \stopxtable
\stoptext

I’m using latest beta (2014.04.28 23:24) and the issue happens when
there is text before and after the break.


Pablo
-- 
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: linebreaks and cell width in xtables
  2014-05-04 19:46   ` Pablo Rodriguez
@ 2014-05-04 22:19     ` Rik
  2014-05-04 22:20     ` Rik Kabel
  1 sibling, 0 replies; 8+ messages in thread
From: Rik @ 2014-05-04 22:19 UTC (permalink / raw)
  To: ntg-context


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

On 2014-05-04 15:46, Pablo Rodriguez wrote:
> On 05/04/2014 08:27 PM, Rik Kabel wrote:
>> Any of the following will work here. Which is or are idiomatic I will
>> leave for others to say.
>>
>>      This cell has multiple lines.\\
>>
>>      This cell has multiple lines.\par
>>
>>      This cell has multiple lines.\blank[none]
> Many thanks for your reply, Rik.
>
> I’m afraid none of them works. Here is my sample:
>
> \starttext
>      \startxtable[option=stretch]
>          \startxrow
>              \startxcell
>                  aaa\blank[none]aaa
>              \stopxcell
>              \startxcell
>                  \ConTeXt\ \contextversion
>              \stopxcell
>          \stopxrow
>          \startxrow
>              \startxcell
>                  This cell has multiple lines.
>                  Vertical spacing is wrong.
>              \stopxcell
>              \startxcell
>                  What am I missing?
>              \stopxcell
>          \stopxrow
>      \stopxtable
> \stoptext
>
> I’m using latest beta (2014.04.28 23:24) and the issue happens when
> there is text before and after the break.
>
>
> Pablo
Pablo,

With your example, I get



which shows a problem in row 2. When I add \\ to the first line of text 
in row 2 column 1, as shown here

    \starttext
         \startxtable[option=stretch]
             \startxrow
                 \startxcell
                     aaa\blank[none]aaa
                 \stopxcell
                 \startxcell
                     \ConTeXt\ \contextversion
                 \stopxcell
             \stopxrow
             \startxrow
                 \startxcell
                     This cell has multiple lines.\\
                     Vertical spacing is wrong.
                 \stopxcell
                 \startxcell
                     What am I missing?
                 \stopxcell
             \stopxrow
         \stopxtable
    \stoptext


I get


which perhaps has some faults in the vertical spacing, but is much 
better than the original. The spacing can be improved by specifying 
[align=lohi] for that cell.

I get the same result with the other two methods I suggested. Is there a 
reason that you cannot use one of these methods in row 2 as you do in row 1?

Perhaps we would all benefit from an obeylines alignment option?

-- 
Rik Kabel

[-- Attachment #1.2.1: Type: text/html, Size: 3620 bytes --]

[-- Attachment #1.2.2: fdbgicad.png --]
[-- Type: image/png, Size: 7684 bytes --]

[-- Attachment #1.2.3: jajfgfjj.png --]
[-- Type: image/png, Size: 7832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: linebreaks and cell width in xtables
  2014-05-04 19:46   ` Pablo Rodriguez
  2014-05-04 22:19     ` Rik
@ 2014-05-04 22:20     ` Rik Kabel
  2014-05-05 14:48       ` Pablo Rodriguez
  1 sibling, 1 reply; 8+ messages in thread
From: Rik Kabel @ 2014-05-04 22:20 UTC (permalink / raw)
  To: ntg-context


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

On 2014-05-04 15:46, Pablo Rodriguez wrote:
> On 05/04/2014 08:27 PM, Rik Kabel wrote:
>> Any of the following will work here. Which is or are idiomatic I will
>> leave for others to say.
>>
>>      This cell has multiple lines.\\
>>
>>      This cell has multiple lines.\par
>>
>>      This cell has multiple lines.\blank[none]
> Many thanks for your reply, Rik.
>
> I’m afraid none of them works. Here is my sample:
>
> \starttext
>      \startxtable[option=stretch]
>          \startxrow
>              \startxcell
>                  aaa\blank[none]aaa
>              \stopxcell
>              \startxcell
>                  \ConTeXt\ \contextversion
>              \stopxcell
>          \stopxrow
>          \startxrow
>              \startxcell
>                  This cell has multiple lines.
>                  Vertical spacing is wrong.
>              \stopxcell
>              \startxcell
>                  What am I missing?
>              \stopxcell
>          \stopxrow
>      \stopxtable
> \stoptext
>
> I’m using latest beta (2014.04.28 23:24) and the issue happens when
> there is text before and after the break.
>
>
> Pablo
Pablo,

With your example, I get



which shows a problem in row 2. When I add \\ to the first line of text 
in row 2 column 1, as shown here

    \starttext
         \startxtable[option=stretch]
             \startxrow
                 \startxcell
                     aaa\blank[none]aaa
                 \stopxcell
                 \startxcell
                     \ConTeXt\ \contextversion
                 \stopxcell
             \stopxrow
             \startxrow
                 \startxcell
                     This cell has multiple lines.\\
                     Vertical spacing is wrong.
                 \stopxcell
                 \startxcell
                     What am I missing?
                 \stopxcell
             \stopxrow
         \stopxtable
    \stoptext


I get


which perhaps has some faults in the vertical spacing, but is much 
better than the original. The spacing can be improved by specifying 
[align=lohi] for that cell.

I get the same result with the other two methods I suggested. Is there a 
reason that you cannot use one of these methods in row 2 as you do in row 1?

Perhaps we would all benefit from an obeylines alignment option?

-- 
Rik Kabel (resent from list address, please excuse duplicates)

[-- Attachment #1.2.1: Type: text/html, Size: 3711 bytes --]

[-- Attachment #1.2.2: Type: image/png, Size: 7684 bytes --]

[-- Attachment #1.2.3: Type: image/png, Size: 7832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: linebreaks and cell width in xtables
  2014-05-04 22:20     ` Rik Kabel
@ 2014-05-05 14:48       ` Pablo Rodriguez
  2014-05-05 18:45         ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Pablo Rodriguez @ 2014-05-05 14:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 05/05/2014 12:20 AM, Rik Kabel wrote:
> [...]
> which shows a problem in row 2. When I add \\ to the first line of text
> in row 2 column 1, as shown here
> [...]
> which perhaps has some faults in the vertical spacing, but is much
> better than the original. The spacing can be improved by specifying
> [align=lohi] for that cell.

Many thanks for your reply, Rik.

Now I got what I was doing wrong.

> I get the same result with the other two methods I suggested. Is there a
> reason that you cannot use one of these methods in row 2 as you do in row 1?

Well, that was a minimal sample. I have a document that has many over 50
tables. If that means that I have to add lines in every row that suffers
from this feature, I think I might be doing something wrong.

There is a more basic problem not shown in the samples: cells can
contain paragraphs with multiple lines (such as "\input zapf"). Is the
user supposed to insert line breaks manually in paragraphs containing
multiple lines?

> Perhaps we would all benefit from an obeylines alignment option?

Sorry, but I cannot refrain from asking: isn’t this a bug?

Many thanks for your help,


Pablo
-- 
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: linebreaks and cell width in xtables
  2014-05-05 14:48       ` Pablo Rodriguez
@ 2014-05-05 18:45         ` Hans Hagen
  2014-05-05 19:01           ` Pablo Rodriguez
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2014-05-05 18:45 UTC (permalink / raw)
  To: ntg-context

On 5/5/2014 4:48 PM, Pablo Rodriguez wrote:
> On 05/05/2014 12:20 AM, Rik Kabel wrote:
>> [...]
>> which shows a problem in row 2. When I add \\ to the first line of text
>> in row 2 column 1, as shown here
>> [...]
>> which perhaps has some faults in the vertical spacing, but is much
>> better than the original. The spacing can be improved by specifying
>> [align=lohi] for that cell.
>
> Many thanks for your reply, Rik.
>
> Now I got what I was doing wrong.
>
>> I get the same result with the other two methods I suggested. Is there a
>> reason that you cannot use one of these methods in row 2 as you do in row 1?
>
> Well, that was a minimal sample. I have a document that has many over 50
> tables. If that means that I have to add lines in every row that suffers
> from this feature, I think I might be doing something wrong.
>
> There is a more basic problem not shown in the samples: cells can
> contain paragraphs with multiple lines (such as "\input zapf"). Is the
> user supposed to insert line breaks manually in paragraphs containing
> multiple lines?
>
>> Perhaps we would all benefit from an obeylines alignment option?
>
> Sorry, but I cannot refrain from asking: isn’t this a bug?

more a side effects of trying to find some optimal width automatically 
... i've tried to 'fix' it in the next beta but who knows what else 
shows up

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: linebreaks and cell width in xtables
  2014-05-05 18:45         ` Hans Hagen
@ 2014-05-05 19:01           ` Pablo Rodriguez
  0 siblings, 0 replies; 8+ messages in thread
From: Pablo Rodriguez @ 2014-05-05 19:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 05/05/2014 08:45 PM, Hans Hagen wrote:
> On 5/5/2014 4:48 PM, Pablo Rodriguez wrote:
>> [...]
>> Sorry, but I cannot refrain from asking: isn’t this a bug?
> 
> more a side effects of trying to find some optimal width automatically 
> ... i've tried to 'fix' it in the next beta but who knows what else 
> shows up

Many thanks for your reply and the fix, Hans.


Pablo
-- 
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2014-05-05 19:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-04 16:30 linebreaks and cell width in xtables Pablo Rodriguez
2014-05-04 18:27 ` Rik Kabel
2014-05-04 19:46   ` Pablo Rodriguez
2014-05-04 22:19     ` Rik
2014-05-04 22:20     ` Rik Kabel
2014-05-05 14:48       ` Pablo Rodriguez
2014-05-05 18:45         ` Hans Hagen
2014-05-05 19:01           ` Pablo Rodriguez

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