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

2014-06-27 Thread Brian Landy

On Jun 26, 2014, at 5:24 PM, Hans Hagen pra...@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 pra...@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   \eTD \eTR
  \bTR \bTD  x\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


signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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
___

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

2014-06-25 Thread Brian Landy
On Jun 25, 2014, at 6:53 PM, Hans Hagen pra...@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 included a sample and some output below (good.pdf is from 2013.06.10, bad.pdf 
is 2014.06.22)

Regards,
Brian

\starttext

%\enabletrackers[typesetters.characteralign]

\bgroup
\setupTABLE[1,2][3,4,5,6,7,8][aligncharacter=yes,alignmentcharacter={-}]
\bTABLE[align={flushleft}]
\bTABLE
  \bTR \bTD   \eTD \bTD  \eTD\bTD  \eTD \eTR
  \bTR \bTD  x \eTD \bTD  x\eTD\bTD x \eTD \eTR
  \bTR \bTD  1D \eTD \bTD  5D\eTD\bTD xxx \eTD \eTR
  \bTR \bTD  1-2\eTD \bTD  1-2\eTD\bTD xxx \eTD \eTR
  \bTR \bTD  1-2+   \eTD \bTD  1-2\eTD\bTD xxx \eTD \eTR
  \bTR \bTD  1-2\eTD \bTD  1-2\eTD\bTD xxx \eTD \eTR
  \bTR \bTD 11-2\eTD \bTD 11-2\eTD\bTD xxx \eTD \eTR
  \bTR \bTD 11-22+ \eTD \bTD 11-22+ \eTD\bTD xxx \eTD \eTR
\eTABLE
\egroup

\bgroup
\setupTABLE[1,2][3,4,5,6,7,8][aligncharacter=yes,alignmentcharacter={-}]
\bTABLE[align={middle}]
  \bTR \bTD   \eTD \bTD  \eTD\bTD  \eTD \eTR
  \bTR \bTD  x \eTD \bTD  x\eTD\bTD x \eTD \eTR
  \bTR \bTD  1D \eTD \bTD  5D\eTD\bTD xxx \eTD \eTR
  \bTR \bTD  1-2\eTD \bTD  1-2\eTD\bTD xxx \eTD \eTR
  \bTR \bTD  1-2+   \eTD \bTD  1-2\eTD\bTD xxx \eTD \eTR
  \bTR \bTD  1-2\eTD \bTD  1-2\eTD\bTD xxx \eTD \eTR
  \bTR \bTD 11-2\eTD \bTD 11-2\eTD\bTD xxx \eTD \eTR
  \bTR \bTD 11-22+ \eTD \bTD 11-22+ \eTD\bTD xxx \eTD \eTR
\eTABLE
\egroup

\bgroup
\setupTABLE[1,2][3,4,5,6,7,8][aligncharacter=yes,alignmentcharacter={-}]
\bTABLE[align={flushright}]
  \bTR \bTD   \eTD \bTD  \eTD\bTD  \eTD \eTR
  \bTR \bTD  x \eTD \bTD  x\eTD\bTD x \eTD \eTR
  \bTR \bTD  1D \eTD \bTD  5D\eTD\bTD xxx \eTD \eTR
  \bTR \bTD  1-2\eTD \bTD  1-2\eTD\bTD xxx \eTD \eTR
  \bTR \bTD  1-2+   \eTD \bTD  1-2\eTD\bTD xxx \eTD \eTR
  \bTR \bTD  1-2\eTD \bTD  1-2\eTD\bTD xxx \eTD \eTR
  \bTR \bTD 11-2\eTD \bTD 11-2\eTD\bTD xxx \eTD \eTR
  \bTR \bTD 11-22+ \eTD \bTD 11-22+ \eTD\bTD xxx \eTD \eTR
\eTABLE
\egroup

\stoptext




good.pdf
Description: Adobe PDF document


bad.pdf
Description: Adobe PDF document



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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
___

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

2014-06-16 Thread Brian Landy
Hi, I was testing the latest beta (2014.06.15) and noticed I am getting 
incorrect output using natural tables with alignment characters.  I produced a 
small example that demonstrates the problem, and attached output created with 
the version I'm testing (bad.pdf) and my prior version (good.pdf, ConTeXt 
2013.06.10).  You can see in the bad file that ConTeXt doesn't properly align 
on the - and it introduces spurious spaces.

Best regards,
Brian



test.tex
Description: Binary data


good.pdf
Description: Adobe PDF document


bad.pdf
Description: Adobe PDF document



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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
___

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

2014-06-16 Thread Brian Landy
Almost all of the tables I generate via code, not by hand, so I found it more 
convenient to include a trailing % because I occasionally did run across an 
instance where it mattered, and wasn't (and am not) sufficiently skilled at 
TeX/ConTeXt to know how to predict those occurrences.

It's somewhat similar for always wrapping the contents in {}, I thought I had 
run into some cases in the past where it was necessary, so just include them 
always rather than manually add them with the content when they are required.  
Are there negative consequences (performance, memory usage, ...) to writing it 
as I did?  Or is the difference just cosmetic?

Best regards,
Brian

On Jun 16, 2014, at 6:57 PM, Hans Hagen pra...@wxs.nl wrote:

 so instead of
 
 \bTD[]{Bond}\eTD%
 
 use this:
 
 \bTD Bond \eTD
 
 
 -
  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
 ___



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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
___

[NTG-context] problem with switchtobodyfont

2012-06-05 Thread Brian Landy
Hi, I decided to give the latest minimals a test (I had been using 2012.01.16, 
updated to 2012.06.05 today), and noticed that switchtobodyfont no longer seems 
to work properly.  Here is a small example:

\starttypescript [cleartype]
\definetypeface [\typescriptone] [rm] [serif] [constantia][default]
\definetypeface [\typescriptone] [ss] [sans]  [calibri]   [default]
\stoptypescript


\usetypescript[cleartype]%
\starttext
{\switchtobodyfont[cleartype,serif,24pt]should be serif\par}
{\switchtobodyfont[cleartype,sans,24pt]should be sans\par}
\stoptext

The problem appears to be applying in a font size the first time the font is 
loaded.  For example, adding this line works:

% typescript
\starttext
{\switchtobodyfont[cleartype,serif]\switchtobodyfont[24pt]} % new line
{\switchtobodyfont[cleartype,serif,24pt]should be serif\par}
{\switchtobodyfont[cleartype,sans,24pt]should be sans\par}
\stoptext

The point sizes have to match for this to work.

It also works to add in \setupbodyfont[cleartype]; however, this isn’t helpful 
if there are multiple typescripts to use in the same document.

I didn’t notice any mention of this in the list (apologies if I overlooked it) 
so assume this is a bug?

Thanks!
Brian  
___
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
___


[NTG-context] xtable formatting issues

2012-01-18 Thread Brian Landy
Hi, I’ve been experimenting a bit with converting some natural tables into 
xtables and ran across two issues.

The first has to do with nested xtables and settings.  In particular, if you 
attempt to set a cell’s width on the internal table using \setupxtable the 
option is lost.  In the below example testtable1 doesn’t format properly when 
nested; testtable2 does.  I also included some font and color examples to show 
they cascade more as I’d expect (the outer table’s settings are used unless 
overridden by the inner table).

The second thing I noticed is that attempting to set the font via 
foregroundstyle only works when done vie \setupxtable.  Attempting to assign 
this directly to the cell causes compile errors (the commented table in the 
example).  Maybe I should be setting the font some other way?  (this is how I 
always did it with natural tables).

Finally, does xtable have something like the aligncharacter mechanism in 
natural tables?

Thanks,
Brian


\starttext

\setupxtable[wd1][background=color,backgroundcolor=yellow,width=1.0in]
\setupxtable[wd2][background=color,backgroundcolor=green,width=2.0in]
\setupxtable[fnit][foregroundstyle={\switchtobodyfont[modern,ss]\it}]
\setupxtable[fnbf][foregroundstyle={\switchtobodyfont[modern,ss]\bf}]

\startbuffer[testtable1]
\startxtable
\startxrow \startxcell[fnbf] bold \stopxcell \startxcell[wd1] 1in? \stopxcell 
\stopxrow
\stopxtable
\stopbuffer

\startbuffer[testtable2]
\startxtable
\startxrow \startxcell[fnbf] bold \stopxcell 
\startxcell[background=color,backgroundcolor=yellow,width=1.0in] 1in?  
\stopxcell \stopxrow
\stopxtable \stopbuffer

\getbuffer[testtable1]
\getbuffer[testtable2]

\startxtable
\startxrow \startxcell[fnit] \getbuffer[testtable1] \stopxcell \startxcell[wd2] 
\getbuffer[testtable1] \stopxcell \stopxrow
\startxrow \startxcell[fnit] \getbuffer[testtable2] \stopxcell \startxcell[wd2] 
\getbuffer[testtable2] \stopxcell \stopxrow
\stopxtable

% below fails, foregroundstyle set in this fashion must be done through 
\setuptable
%\startxtable
%\startxrow \startxcell[foregroundstyle={\switchtobodyfont[modern,rm]\it}] 
italic \stopxcell \stopxrow
%\stopxtable

\stoptext


___
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
___


Re: [NTG-context] two problems with natural tables

2012-01-17 Thread Brian Landy
Hi, sorry to dredge up such an old thread, but I recently updated from a Feb 
2010 vintage minimals to current (first to 1/12/2012, then to today 1/17).  I 
ran into problems splitting a table within a splitfloat.  I search the list 
archives and came up with this example, which is failing for me.

\starttext
\placetable[split]{Test}
{\bTABLE[split=yes]
\dorecurse{60}{
\bTR \bTD hello \eTD \eTR
}
\eTABLE}
\stoptext

I get this error:

! Undefined control sequence.

system   tex  error on line 7 in file test.tex: Undefined control 
sequence ...

1 \starttext
2 \placetable[split]{Test}
3 {\bTABLE[split=yes]
4 \dorecurse{60}{
5 \bTR \bTD hello \eTD \eTR
6 }
7   \eTABLE}
8 \stoptext
9 

argument \c!suffixstopper 

\floatcaptionparameter ...\currentfloatcaption :#1
  \endcsname \??floatcaption...
argument ...mber )}\thecurrentfloatnumbersuffix 
  \dostoptagged \dostarttagg...
\flushbothlabelclass #1#2#3-#1#3
 #2
\namedtaggedlabeltexts ...\dostarttagged {#1}{#2}}
  \dostoptagged \endgroup 
\thecurrentfloatnumber ...rrentfloatnumbersuffix }
  \fi \fi \fi 
...
l.7 \eTABLE
   }


Any ideas?

Thanks,
Brian

On Apr 20, 2011, at 3:30 AM, Florian Wobbe wrote:

 
 On Apr 18, 2011, at 21:14 , Hans Hagen wrote:
 
 On 18-4-2011 7:16, Wolfgang Schuster wrote:
 \def\floatcaptionattribute
  {\iflocation \ifnofloatnumber \else \ifnofloatcaption \else 
 \ifinsidesplitfloat \else
 attr \destinationattribute \currentfloatattribute
   \fi \fi \fi \fi}
 
 ok, patched
 
 Wolfgang, Hans, as usual thanks for the support and the quick fix!
 Florian
 
 ___
 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
 ___
 

___
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
___