[NTG-context] latest beta, problem with natural tables and alignment character

Brian Landy brian at landy.cx
Fri Jun 27 20:04:39 CEST 2014


On Jun 26, 2014, at 5:24 PM, Hans Hagen <pragma at wxs.nl> wrote:

> On 6/26/2014 10:48 PM, Hans Hagen wrote:
>> On 6/26/2014 5:06 AM, Brian Landy wrote:
>>> On Jun 25, 2014, at 6:53 PM, Hans Hagen <pragma at wxs.nl> wrote:
>>> 
>>>> On 6/25/2014 11:26 PM, Brian R. Landy wrote:
>>>>> 
>>>>> When you say "next beta" do you mean a subsequent minimals release
>>>>> (i.e., this fix should be the 2014.06.22 release)?  Or do you mean a
>>>>> new
>>>>> beta that you announce more formally on the list?  I'm not sure what I
>>>>> should look for before I test again, so I don't end up testing a
>>>>> version
>>>>> without the fix.
>>>> 
>>>> netx beta == next upload == already done
>>>> 
>>> 
>>> Great, thanks.  I wanted to make sure before mentioning I'm still
>>> seeing problems.  When you have a combination number/character
>>> sequence (i.e., 1D or 11-22+) and specify an alignment
>>> (flushleft/middle/flushright) spaces get inserted between the final
>>> digit and the first trailing character.  So "1D" might print as "1 D",
>>> "11-22+" prints as "11-22 +", etc.  This happens using "." or "," for
>>> alignment, it's not exclusive to aligning on a hyphen.
>> 
>> i now have two methods, number and text and {-} triggers text
>> 
>> you can force a method with text-> and number->
>> 
>> no upload yet
> 
> I'll also add \nocharacteralign so that one can disable this mechanism in a table cell.

This is all great, thank's so much for handling this so quickly!  I like the idea of keeping the old behavior as an alternative.

And now that I see what your new mode is attempting to accomplish, I think it will prove very useful.  It looks like you want to parse out the number from any preceding and following text, align the number on the alignment character, and pad out any text that precedes a number (like a currency symbol) to align on the left rather than be flush with the number.  I just wanted to point out that this only works if identical preceding and/or trailing text exists in every cell.

For example, this table doesn't align using flushleft, middle, or flushright (it will if you force text->{.}, but of course the parens won't align vertically):

\starttext
\bgroup<
\setupTABLE[1,2][3,4,5,6][aligncharacter=yes,alignmentcharacter={.}]
\bTABLE[align={flushright}]
  \bTR \bTD  xxxxxxxx \eTD \eTR
  \bTR \bTD  xxxxx    \eTD \eTR
  \bTR \bTD  1.2      \eTD \eTR
  \bTR \bTD  (1.2)    \eTD \eTR
  \bTR \bTD 11.22     \eTD \eTR
  \bTR \bTD (11.22)   \eTD \eTR
\eTABLE
\egroup
\stoptext

Without having looked through the code, I wonder if in number mode you could first run the existing logic, and then finish off using the existing text logic to pad the outside (i.e., to the left of the left-hand text and to the right of the right-hand text)?

Anyway, for my purposes restoring the old mode as an option is perfect, I just wanted to mention this in case this wasn't the behavior you intended.
Thanks again!

Best regards,
Brian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20140627/3a899acd/attachment.pgp>


More information about the ntg-context mailing list