A bug in character alignment?
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
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/
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
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
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/
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
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
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
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 -----------------------------------------------------------------
participants (4)
-
Hans Hagen
-
Nicolas Grilly
-
Peter Münster
-
Taco Hoekwater