ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* A bug in character alignment?
@ 2006-07-31 19:34 Nicolas Grilly
  2006-08-01  6:34 ` Peter Münster
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Grilly @ 2006-07-31 19:34 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1250 bytes --]

Hello,

I use ConTeXt natural tables to produce reports, and I use character
alignment to align numbers in these tables.

For example:
\setupTABLE[column][each][align={middle,lohi}, aligncharacter=yes,
alignmentcharacter={.}]

But I have a little issue with character alignment. I have several
tables following each other. First and second tables are well aligned.
But following tables have some columns mis-aligned. You can see the
result in the attached file report_with_bug.pdf (look at column 4 of
tables 3, 4, 5 and 6).

If I comment table 2, then the problem disappears. You can see the
result in the attached file report_without_bug.pdf. If I uncomment
table 2, but move it to end of file, then the problem disappears too.

It seems there is some side effect in code managing character
alignment: perhaps a global variable is not reset each time a new
table starts?

The attached file character_alignment_bug.tex contains the code
producing the first example, where the bug is visible.

I looked through core-ntb.tex and supp-ali.tex but was unable to
understand where is the problem. We have lot of tables like this in
our production, and some are horribles because of this character
alignment issue...

Thanks for your help!

Nicolas Grilly

[-- Attachment #2: report_with_bug.pdf --]
[-- Type: application/pdf, Size: 67104 bytes --]

[-- Attachment #3: report_without_bug.pdf --]
[-- Type: application/pdf, Size: 67124 bytes --]

[-- Attachment #4: character_alignment_bug.tex --]
[-- Type: application/x-tex, Size: 19435 bytes --]

[-- Attachment #5: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: A bug in character alignment?
  2006-07-31 19:34 A bug in character alignment? Nicolas Grilly
@ 2006-08-01  6:34 ` Peter Münster
  2006-08-01 15:07   ` Nicolas Grilly
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Münster @ 2006-08-01  6:34 UTC (permalink / raw)


On Mon, 31 Jul 2006, Nicolas Grilly wrote:

> But I have a little issue with character alignment. I have several
> tables following each other. First and second tables are well aligned.
> But following tables have some columns mis-aligned. You can see the
> result in the attached file report_with_bug.pdf (look at column 4 of
> tables 3, 4, 5 and 6).

Sorry, I can't see it. The column are right-aligned, which is normal, since
there is no alignment-character.
The only "bug" I see, is the missing accent:
"Evolution" should be "Évolution"

> \setupTABLE[column][each][align={middle,lohi}, aligncharacter=yes,
>   alignmentcharacter={;}]
                       ^^^
Could you explain this?

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

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

* Re: A bug in character alignment?
  2006-08-01  6:34 ` Peter Münster
@ 2006-08-01 15:07   ` Nicolas Grilly
  2006-08-01 16:29     ` Nicolas Grilly
  2006-08-02  8:47     ` Peter Münster
  0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Grilly @ 2006-08-01 15:07 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 2079 bytes --]

Peter Münster wrote:
>
> Nicolas Grilly wrote:
> > But I have a little issue with character alignment. I have several
> > tables following each other. First and second tables are well aligned.
> > But following tables have some columns mis-aligned. You can see the
> > result in the attached file report_with_bug.pdf (look at column 4 of
> > tables 3, 4, 5 and 6).
>
> Sorry, I can't see it. The column are right-aligned, which is normal, since
> there is no alignment-character.

No, it is not normal. ConTeXt Wiki says "if there's no
alignmentcharacter in the cell, the content will be aligned in the
following way depending on the value of \characteralignmentmode".

By default, characteralignmentmode=4. Therefore, according to the
wiki, cell content should be aligned on the last character of each
cell.

Details are here: http://wiki.contextgarden.net/TABLE#Using_character_alignment

> > \setupTABLE[column][each][align={middle,lohi}, aligncharacter=yes,
> >   alignmentcharacter={;}]
>                        ^^^
> Could you explain this?

I want to align my numbers on the last character, whatever it is. I
don't want to align my numbers on a comma or a dot. I use
alignmentcharacter={;} just because there is no semi-colon in my
tables. This way, ConTeXt defaults to characteralignementmode=4.

But, to get my issue easier to understand, I change my example and use
alignmentcharacter={,} and, guess what, the "bug" is still here:
- look at the attached PDF (for example look at table 1 where every
columns are well aligned; then look at table 3, 4 and 5 where fourth
column is incorrect) ;
- look at the attached .tex file used to produce the PDF.

I continue to think there is some side effect in code maning character
alignement, probably a global variable not reset or something else.

> The only "bug" I see, is the missing accent:
> "Evolution" should be "Évolution"

You're right: the accent is missing, and it's a typographical error. I
guess you live in France to see such a thing!

Thank you very much for your help.

--
Nicolas Grilly
www.garden-paris.com

[-- Attachment #2: character_alignment_bug.pdf --]
[-- Type: application/pdf, Size: 67082 bytes --]

[-- Attachment #3: character_alignment_bug.tex --]
[-- Type: application/x-tex, Size: 19383 bytes --]

[-- Attachment #4: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: A bug in character alignment?
  2006-08-01 15:07   ` Nicolas Grilly
@ 2006-08-01 16:29     ` Nicolas Grilly
  2006-08-02  8:47     ` Peter Münster
  1 sibling, 0 replies; 8+ messages in thread
From: Nicolas Grilly @ 2006-08-01 16:29 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 539 bytes --]

I've built another example clearly showing the issue with character
alignment in natural tables.

Compare table 1 and table 4 in the attached PDF : the source code for
these tables is exactly the same, but they are not rendered
identically in the PDF (table 1 content is correctly aligned, contrary
to table 4). It's not normal the same table is not rendered the same
way.

When I remove tables 2 and 3, table 1 and 4 are rendered identically
(no more alignment problem).

Does someone know how to fix that?

Thanks a lot,

Nicolas Grilly

[-- Attachment #2: character_alignment_bug.pdf --]
[-- Type: application/pdf, Size: 60952 bytes --]

[-- Attachment #3: character_alignment_bug.tex --]
[-- Type: application/x-tex, Size: 11302 bytes --]

[-- Attachment #4: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: A bug in character alignment?
  2006-08-01 15:07   ` Nicolas Grilly
  2006-08-01 16:29     ` Nicolas Grilly
@ 2006-08-02  8:47     ` Peter Münster
  2006-08-02 11:35       ` Taco Hoekwater
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Münster @ 2006-08-02  8:47 UTC (permalink / raw)


On Tue, 1 Aug 2006, Nicolas Grilly wrote:

> > Sorry, I can't see it. The column are right-aligned, which is normal, since
> > there is no alignment-character.
> 
> No, it is not normal. ConTeXt Wiki says "if there's no
> alignmentcharacter in the cell, the content will be aligned in the
> following way depending on the value of \characteralignmentmode".
> 
> By default, characteralignmentmode=4. Therefore, according to the
> wiki, cell content should be aligned on the last character of each
> cell.

Ok, by "right-aligned" I wanted to say: aligned at the right-most
character.

Now I see your problem: the values are still aligned at the right-most
character, but the whole column is pushed a bit to the right.

> > The only "bug" I see, is the missing accent:
> > "Evolution" should be "Évolution"
> 
> You're right: the accent is missing, and it's a typographical error. I
> guess you live in France to see such a thing!

Rather an orthographic error...


The best thing to do in such cases, is to build a minimal example file,
that shows the problem. This has several advantages:

- you don't need to post heavy pdf and tex files
- sometimes, while building such a file, you discover, that you've made a
  mistake, and that ConTeXt is right
- if there is a ConTeXt bug, the minimal example will make it clear, how to
  reproduce it and what really triggers it

Since I have some time, I provide such an example:

\starttext
\setupTABLE[aligncharacter=yes,alignmentcharacter=;]
\bTABLE\bTR\bTD a\eTD\bTD\hbox to 1cm{b}\eTD\eTR\eTABLE

% change "2" to "1", to see "d" moving 1cm to the right:
\bTABLE\bTR\dorecurse2{\bTD x\eTD}\eTR\eTABLE

\bTABLE\bTR\bTD c\eTD\bTD d\eTD\eTR\eTABLE
\stoptext

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

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

* Re: A bug in character alignment?
  2006-08-02  8:47     ` Peter Münster
@ 2006-08-02 11:35       ` Taco Hoekwater
  2006-08-03 10:19         ` Nicolas Grilly
  0 siblings, 1 reply; 8+ messages in thread
From: Taco Hoekwater @ 2006-08-02 11:35 UTC (permalink / raw)


Peter Münster wrote:
> On Tue, 1 Aug 2006, Nicolas Grilly wrote:
> 
> 
>>>Sorry, I can't see it. The column are right-aligned, which is normal, since
>>>there is no alignment-character.
>>
>>No, it is not normal. ConTeXt Wiki says "if there's no
>>alignmentcharacter in the cell, the content will be aligned in the
>>following way depending on the value of \characteralignmentmode".
>>
>>By default, characteralignmentmode=4. Therefore, according to the
>>wiki, cell content should be aligned on the last character of each
>>cell.
> 
> 
> Ok, by "right-aligned" I wanted to say: aligned at the right-most
> character.
> 
> Now I see your problem: the values are still aligned at the right-most
> character, but the whole column is pushed a bit to the right.

It was definately a bug. We found it and it will be fixed in the next
ConTeXt release.

Taco

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

* Re: A bug in character alignment?
  2006-08-02 11:35       ` Taco Hoekwater
@ 2006-08-03 10:19         ` Nicolas Grilly
  2006-08-03 10:33           ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Grilly @ 2006-08-03 10:19 UTC (permalink / raw)


Peter: Thanks for your help in clarifying my example.

Taco: Thanks for fixing this bug! When will the next release be delivered?

On 8/2/06, Taco Hoekwater <taco@elvenkind.com> wrote:
> Peter Münster wrote:
> > On Tue, 1 Aug 2006, Nicolas Grilly wrote:
> >
> >
> >>>Sorry, I can't see it. The column are right-aligned, which is normal, since
> >>>there is no alignment-character.
> >>
> >>No, it is not normal. ConTeXt Wiki says "if there's no
> >>alignmentcharacter in the cell, the content will be aligned in the
> >>following way depending on the value of \characteralignmentmode".
> >>
> >>By default, characteralignmentmode=4. Therefore, according to the
> >>wiki, cell content should be aligned on the last character of each
> >>cell.
> >
> >
> > Ok, by "right-aligned" I wanted to say: aligned at the right-most
> > character.
> >
> > Now I see your problem: the values are still aligned at the right-most
> > character, but the whole column is pushed a bit to the right.
>
> It was definately a bug. We found it and it will be fixed in the next
> ConTeXt release.
>
> Taco
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>


-- 
Garden - Conseil en Marketing & Datamining
Nicolas Grilly
Tel +33 1 45 72 48 78
Mob +33 6 03 00 25 34
www.garden-paris.com
_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: A bug in character alignment?
  2006-08-03 10:19         ` Nicolas Grilly
@ 2006-08-03 10:33           ` Hans Hagen
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2006-08-03 10:33 UTC (permalink / raw)


Nicolas Grilly wrote:
> Peter: Thanks for your help in clarifying my example.
>
> Taco: Thanks for fixing this bug! When will the next release be delivered?
>   
you can download a beta (or do ctxtools --update) 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

end of thread, other threads:[~2006-08-03 10:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-31 19:34 A bug in character alignment? Nicolas Grilly
2006-08-01  6:34 ` Peter Münster
2006-08-01 15:07   ` Nicolas Grilly
2006-08-01 16:29     ` Nicolas Grilly
2006-08-02  8:47     ` Peter Münster
2006-08-02 11:35       ` Taco Hoekwater
2006-08-03 10:19         ` Nicolas Grilly
2006-08-03 10:33           ` Hans Hagen

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