Re: [NTG-context] Character alignment in math mode

2014-06-25 Thread Wolfgang Schuster

Am 25.06.2014 um 02:49 schrieb Maggyero maggy...@gmail.com:

  You can access the current font alternative with the \fontalternative 
  command
 
 Thanks Wolfgang, that was exactly the command I was looking for!
 
 A last question: how can one get italic greek in TEXT MODE? The following 
 code displays upright greek.
 
 \starttext
 \mathgreekitalic \alpha
 \stoptext

The command \mathgreekitalic can only be used in math mode, when you want a 
italic alpha
in text mode you need a font which has greek characters (e.g. Gentium).

\definetypeface [mainface] [rm] [serif] [gentium] [default]
\definetypeface [mainface] [mm] [math]  [xits][default]

\setupbodyfont[mainface]

\starttext
α {\it α} \quad \m{\alpha \mathgreekupright \alpha \mathgreekitalic \alpha}
\stoptext

Wolfgang

___
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] letter-module: the first letter is lost

2014-06-25 Thread Wolfgang Schuster

Am 25.06.2014 um 02:42 schrieb Peter Münster pmli...@free.fr:

 Hi,
 
 With latest context, the T is lost:
 
 \usemodule[letter]
 \starttext
 \startletter
 This is a letter.
 \stopletter
 \startletter
 TThis is a workaround.
 \stopletter
 \stoptext

I put a new version online with fixes this, you can avoid the disappearing of 
the first letter by adding a empty line after \startletter.

Wolfgang
___
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] Character alignment in math mode

2014-06-25 Thread Hans Hagen

On 6/25/2014 12:29 AM, Wolfgang Schuster wrote:


Am 24.06.2014 um 21:46 schrieb Maggyero maggy...@gmail.com:


why  use math here?


It was to avoid oldstyle figures that I use by default. But finally it's better 
to use oldstyle figures even in tables.


You can enable lining (and tabular) figures in the table when you don’t want 
oldstyle figures.


Another question about fonts. Is there a way to define a conditional 
mathcommand based on the current alternative style? For instance, in the 
following example I would like to keep the bold effect but with adaptation to 
the local alternative style (in text mode, when the local alternative style is 
\tf I would like the mathcommand to be \bf, when it is \it I would like \bi, 
when it is \bf I would like \bf and when it is \bi I would like still \bi):


You can access the current font alternative with the \fontalternative command 
(below is a old example I wrote a few months ago).

\def\Test
   {\processaction
  [\fontalternative]
 [ tf=Upright,
it=Italic,
sl=Slanted,
bf=Bold,
bi=Bolditalic,
bs=Boldslanted,
   unknown=Unknown fontalternative]}

\starttext
“\Test” {\it “\Test”} {\bs “\Test”} {\sc “\Test”}
\stoptext


\let\Test\fontstylesuffix

a bit different output

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


Re: [NTG-context] Problem in natural tables with nc= and alignmentcharacter

2014-06-25 Thread Hans Hagen

On 6/24/2014 9:53 PM, Rik Kabel wrote:

On 2014-06-24 08:03, Hans Hagen wrote:

On 6/23/2014 10:50 PM, Peter Münster wrote:

On Mon, Jun 23 2014, Peter Münster wrote:


No solution, just a smaller MWE:


Yet smaller, but I don't know, if it's still the same problem:

\starttext
\bTABLE
\bTR \bTD A x \eTD \bTD[nc=2] A \eTD \eTR
\eTABLE
\stoptext


after lots of experiments (adapting the width guesser) i decided to
stick to a simple check and warning; the first column will be ok but
the second one to wide (btw, one solution was to set maxwidth to a
large value)

catching all possible errors in coding a table is undoable (plus
unpredictable)

(xtables work ok btw)

Hans


Hans,

While xtable works fine for Peter's reduced MWE, it does not handle the
problem first presented, which includes an alignment character for
columns of mark-separated numbers. By my understanding of how xtable
works, I suspect that it will not be able to handle this requirement.

In this case I can get by with explicitly setting column widths as
needed to prevent the error. I have been using the following code to get
the width of what appears to be the widest element in a column:

%% This gets the width of simple things; from Hans on the mailing
%%   list http://www.ntg.nl/pipermail/ntg-context/2007/024390.html
%%   example usage: \SetWidthOf{\ColContent}\to\ColContentWidth\relax
%%   or: \SetWidthOf{Column Content}\to\ContentWidth\relax
\def\SetWidthOf#1\to#2%
  {\bgroup
   \setbox\scratchbox\hbox{#1}%
   \expanded{\egroup\def\noexpand#2{\the\wd\scratchbox}}}

Is TABLE with explicit column widths the best solution for now on tables
that require number alignment, or do you recommend another table mechanism?


you can avoid the nc triggering width distribution with

\setupTABLE[maxwidth=100cm]

(in the case of unpredictable nc the available width is distributed and 
the  doesn't break)


Hans


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


[NTG-context] Character alignment in math mode

2014-06-25 Thread Maggyero
 \let\Test\fontstylesuffix
 a bit different output

Thank you Hans.

 The command \mathgreekitalic can only be used in math mode, when you want
a italic alpha in text mode you need a font which has greek characters
(e.g. Gentium).

Okay Wolfgang, I thought Latin Modern also had greek characters, but
apparently not. So in math mode which font is used by default if it is not
Latin Modern greek?
___
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] database module: the first letter is lost

2014-06-25 Thread Michael Green
This appears to be the same as the problem Peter Münster found with the letter 
module

\usemodule[database]

\defineseparatedlist[MyTable]
[separator=tab,
before=\bTABLE,after=\eTABLE,
first=\bTR,last=\eTR,
left=\bTD,right=\eTD]

\starttext

The first letter of “Cell” is lost.

\startseparatedlist[MyTable]
Cell 1  Cell 2
\stopseparatedlist

With an extra return, “Cell” is intact.

\startseparatedlist[MyTable]

Cell 1  Cell 2
\stopseparatedlist


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


[NTG-context] issues with list items

2014-06-25 Thread Pablo Rodriguez
Dear list,

I have the following sample (compiled
http://www.ousia.tk/list-items.pdf#page=1):

\showframe\showgrid
\setupbodyfont[pagella,15pt]
\starttext
\chapter{Chapter title}
\section{Section title}
\dorecurse{11}{\dorecurse{10}{Sentence. }\par}

\startitemize
\dorecurse{2}{\item This is an item.}

\item This is an item\footnote{This is a footnote.}.
\stopitemize

\dorecurse{50}{These are other sentences. }
\stoptext

The footnote moves the whole list to the second page. If I remove the
footnote and not the item, the whole list fits in the first page
(http://www.ousia.tk/list-items.pdf#page=3).

Sorry, but as far as I can understand, I’m afraid this is a bug.

ConTeXt is handling list items themselves with widows and orphan rules.
Not the lines they contain, but the items themselves.

I understand that ConTeXt avoids widow and orphan lines within list
items. But it makes no sense (at least, to me) to avoid widow and orphan
list items.

Could someone confirm the bug or explain me what I’m missing?

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
___


Re: [NTG-context] database module: the first letter is lost

2014-06-25 Thread Hans Hagen

On 6/25/2014 7:21 PM, Michael Green wrote:

This appears to be the same as the problem Peter Münster found with the letter 
module

\usemodule[database]

\defineseparatedlist[MyTable]
[separator=tab,
before=\bTABLE,after=\eTABLE,
first=\bTR,last=\eTR,
left=\bTD,right=\eTD]

\starttext

The first letter of “Cell” is lost.

\startseparatedlist[MyTable]
Cell 1  Cell 2
\stopseparatedlist

With an extra return, “Cell” is intact.

\startseparatedlist[MyTable]

Cell 1  Cell 2
\stopseparatedlist


\stoptext


in buff-ini.mkiv change this:

\def\buff_start_indeed#1#2#3#4%
  {\normalexpanded{\buff_pickup{#2}{#3}{#4}{}{\buff_stop{#4}}\plusone}}

probably needs some checking

Hans

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


[NTG-context] First letter lost possible cause: \grabbfferdata

2014-06-25 Thread Rik Kabel
Recently there have been reports of the first letter of a line of text 
being lost in the database and letter modules.


I tracked down what appears to be the same problem and developed a 
work-around.


The problem appears to be with the \grabbufferdata command. Something 
has changed in the way it works, and it now swallows the first token of 
the buffer that it grabs. It may also show up with other commands, but 
this is the only one I have found in my projects.


If you have code with this command, a workaround is to insert 
\ignorespaces after it. I have no idea why this helps. If you do not 
have the code (if it is in somebody else's module), then using a blank 
line or dummy argument or \relax after the command that calls the code 
with \grabbufferdata may help.


The following code shows the issues and these workarounds.

   % macros=mkvi

   \starttexdefinition unexpanded startNoIgnore
  \begingroup
  \dostartNoIgnore
   \stoptexdefinition
   \starttexdefinition dostartNoIgnore
  \grabbufferdata[Test][startNoIgnore][stopTest]
   \stoptexdefinition

   \starttexdefinition unexpanded startWithIgnore
  \begingroup
  \dostartWithIgnore
   \stoptexdefinition
   \starttexdefinition dostartWithIgnore
  \grabbufferdata[Test][startWithIgnore][stopTest]
  \ignorespaces
   \stoptexdefinition

   \starttexdefinition stopTest
  \getbufferdata[Test]
  \endgroup
   \stoptexdefinition

   \define\TestText
 {\qquad If you can read this the first token was not swallowed.}

   \starttext

   \subject{Test without \tex{ignorespaces}}

   First, the problem:

   \startNoIgnore\TestText\stopTest

   And the same with \type{{}}

   \startWithIgnore{}\TestText\stopTest

   Workaround with \tex{relax}

   \startNoIgnore\relax\TestText\stopTest

   Workaround with blank line

   \startNoIgnore

   \TestText\stopTest

   \subject{Test with \tex{ignorespaces}}

   This now works:

   \startWithIgnore\TestText\stopTest

   And the same with \type{{}}

   \startWithIgnore{}\TestText\stopTest

   And the same with \tex{relax}

   \startWithIgnore\relax\TestText\stopTest

   And the same with a blank line after the opening

   \startWithIgnore

   \TestText\stopTest
   \stoptext




--
Rik Kabel
___
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] First letter lost possible cause: \grabbfferdata

2014-06-25 Thread Rik Kabel

On 2014-06-25 15:51, Rik Kabel wrote:
Recently there have been reports of the first letter of a line of text 
being lost in the database and letter modules.


I tracked down what appears to be the same problem and developed a 
work-around.


The problem appears to be with the \grabbufferdata command. Something 
has changed in the way it works, and it now swallows the first token 
of the buffer that it grabs. It may also show up with other commands, 
but this is the only one I have found in my projects.


And as soon as I post, I see that Hans has found the problem in the 
buffering  code.


--
Rik Kabel
___
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] First letter lost possible cause: \grabbfferdata

2014-06-25 Thread Hans Hagen

On 6/25/2014 10:03 PM, Rik Kabel wrote:

On 2014-06-25 15:51, Rik Kabel wrote:

Recently there have been reports of the first letter of a line of text
being lost in the database and letter modules.

I tracked down what appears to be the same problem and developed a
work-around.

The problem appears to be with the \grabbufferdata command. Something
has changed in the way it works, and it now swallows the first token
of the buffer that it grabs. It may also show up with other commands,
but this is the only one I have found in my projects.


And as soon as I post, I see that Hans has found the problem in the
buffering  code.


but you're going to test it -)


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


Re: [NTG-context] Orphans/Widows in the Index

2014-06-25 Thread Jan Tosovsky
On 2014-06-23 Jan Tosovsky wrote:
 On 2014-04-23 Jan Tosovsky wrote:
 
  in my auto-generated two column index (registry) there are
  several cases of widows - it is the last item of the given
  letter which overflows to next column/page:
 
  --- (start page) ---
  Usti 29 (! alone !)
 
  V
  Vamberk 18
  ...
  ...
 
 
  There are also few cases of orphans, but this is not so strange:
  ...
  ...
  Josef 29
 
  K
  Karel 69 (! alone !)
   (end page) -
 
 
 I think both cases could be eliminated by establishing a new constraint
 to the 'key letter':
 (1) There must be 0 or at least 3 lines at the beginning of the
 page/column before the Key letter.
 (2) There must be at least 2 lines after the Key letter.
 
 Can this be somehow set in my source file?
 

I've found the corresponding code in strc-reg.mkiv:

\setvalue{\??registerindicator a}#1%
  {\registerparameter\c!before
   % bugged, why does leftskip gets set:
\vskip\lineheight\goodbreak\vskip-\lineheight
   \begingroup
   \useregisterstyleandcolor\c!style\c!color   
   \dontleavehmode
   \strut
   \iflocation
 \dosetdirectpagereference{\currentregister:\v!section:#1}%
   \fi
   \registerparameter\c!command{#1}%
   \endgroup
   \blank[\v!samepage]%
   \registerparameter\c!after
   \par
   \nobreak}

That (2) case can be fixed by a small change:
\testcolumn[3]\registerparameter\c!command{#1}%

But when tested on this MWE, you can see a drawback - the first letter (p)
starts always on the second line (not on the first one):

\setupregister[balance=yes]
\starttext
\index{primary+secondary+tertiary}
\index[primary long]{\dorecurse{5}{primary long }}
\index[primary longer]{\dorecurse{5}{primary longer }}
\input{tufte}
\completeindex
\stoptext

Can this issue somehow be eliminated? Tested on the last beta (with my
patch).

That (1) case is still open. I have no idea how to accomplish something like
this using (Con)TeX(t) syntax :-(

Thanks, Jan


___
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] First letter lost possible cause: \grabbfferdata

2014-06-25 Thread Rik

On 2014-06-25 16:07, Hans Hagen wrote:

On 6/25/2014 10:03 PM, Rik Kabel wrote:

On 2014-06-25 15:51, Rik Kabel wrote:

Recently there have been reports of the first letter of a line of text
being lost in the database and letter modules.

I tracked down what appears to be the same problem and developed a
work-around.

The problem appears to be with the \grabbufferdata command. Something
has changed in the way it works, and it now swallows the first token
of the buffer that it grabs. It may also show up with other commands,
but this is the only one I have found in my projects.


And as soon as I post, I see that Hans has found the problem in the
buffering  code.


but you're going to test it -)
Indeed I have, but my tests mean little beyond what I can eyeball to see 
if it still looks okay. I might say that the issue is resolved for my 
small environment but I do not know what side-effects may result from 
the change. I have no library of edge cases, no integrated build 
environment, and only a single platform.


That said, however, the issue disappears for my projects when I remake 
ConTeXt (and ConTeXtjit) with your patch.


And clearly, the \ignorespaces that I used in my workaround was just a 
convenient no-op. I could have used {} or \relax to the same effect.


--
Rik Kabel

___
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] database module: the first letter is lost

2014-06-25 Thread Wolfgang Schuster

Am 25.06.2014 um 21:44 schrieb Hans Hagen pra...@wxs.nl:

 On 6/25/2014 7:21 PM, Michael Green wrote:
 This appears to be the same as the problem Peter Münster found with the 
 letter module
 
 \usemodule[database]
 
 \defineseparatedlist[MyTable]
  [separator=tab,
  before=\bTABLE,after=\eTABLE,
  first=\bTR,last=\eTR,
  left=\bTD,right=\eTD]
 
 \starttext
 
 The first letter of “Cell” is lost.
 
 \startseparatedlist[MyTable]
 Cell 1   Cell 2
 \stopseparatedlist
 
 With an extra return, “Cell” is intact.
 
 \startseparatedlist[MyTable]
 
 Cell 1   Cell 2
 \stopseparatedlist
 
 
 \stoptext
 
 in buff-ini.mkiv change this:
 
 \def\buff_start_indeed#1#2#3#4%
  {\normalexpanded{\buff_pickup{#2}{#3}{#4}{}{\buff_stop{#4}}\plusone}}
 
 probably needs some checking

Adding \obeylines to \grabbufferdatadirect would also work

\unexpanded\def\grabbufferdatadirect % name start stop
  {\begingroup % (6)
+  \obeylines
   \buff_start_indeed\empty}

but I’m interested what’s the purpose of the fifth argument for 
\buff_start_indeed.

Wolfgang___
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] Character alignment in math mode

2014-06-25 Thread Brian R. Landy



On Wed, 25 Jun 2014, Wolfgang Schuster wrote:



Am 24.06.2014 um 21:46 schrieb Maggyero maggy...@gmail.com:


why  use math here?


It was to avoid oldstyle figures that I use by default. But finally 
it's better to use oldstyle figures even in tables.


You can enable lining (and tabular) figures in the table when you 
don’t want oldstyle figures.


Out of curiosity, how do you do that (i.e., revert back to lining, and 
tabular, figures in a table, or even in running text)?


For example, if I do this:

\starttext
\bf 12345\par
\tf 12345\par
\stoptext

the first line is bold but the second is not.  But if I do the same with 
\os:


\starttext
\os 12345\par
\tf 12345\par
\stoptext

both lines use old style numbers.  Is there a way to switch the current 
font back to lining figures without reloading the font with 
\switchtobodyfont or something similar?


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
___


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

2014-06-25 Thread Brian R. Landy



On Tue, 17 Jun 2014, Hans Hagen wrote:


anyhow, i made it work a bit better with tables (extra pass needed)

\starttext

\enabletrackers[typesetters.characteralign]

\bgroup
\setupTABLE[column][1][aligncharacter=yes,alignmentcharacter={,}]
\bTABLE
   \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,224 \eTD \bTD 11,22 \eTD \bTD xxx \eTD \eTR
\eTABLE
\egroup

\bgroup
\setupTABLE[column][1][aligncharacter=yes,alignmentcharacter={-}]
\setupTABLE[column][2][aligncharacter=yes,alignmentcharacter={\endash}]
\bTABLE
   \bTR \bTD  1-2\eTD \bTD  1\endash2\eTD\bTD xxx \eTD \eTR
   \bTR \bTD  1-2\eTD \bTD  1\endash2\eTD\bTD xxx \eTD \eTR
   \bTR \bTD  1-2\eTD \bTD  1\endash2\eTD\bTD xxx \eTD \eTR
   \bTR \bTD 11-2\eTD \bTD 11\endash2\eTD\bTD xxx \eTD \eTR
   \bTR \bTD 11-22 + \eTD \bTD 11\endash22 + \eTD\bTD xxx \eTD \eTR
\eTABLE
\egroup

\stoptext

the next beta can handle this


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.



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
___


Re: [NTG-context] Character alignment in math mode

2014-06-25 Thread Wolfgang Schuster

Am 25.06.2014 um 23:20 schrieb Brian R. Landy br...@landy.cx:

 
 
 On Wed, 25 Jun 2014, Wolfgang Schuster wrote:
 
 
 Am 24.06.2014 um 21:46 schrieb Maggyero maggy...@gmail.com:
 
 why  use math here?
 
 It was to avoid oldstyle figures that I use by default. But finally it's 
 better to use oldstyle figures even in tables.
 
 You can enable lining (and tabular) figures in the table when you don’t want 
 oldstyle figures.
 
 Out of curiosity, how do you do that (i.e., revert back to lining, and 
 tabular, figures in a table, or even in running text)?
 
 For example, if I do this:
 
\starttext
\bf 12345\par
\tf 12345\par
\stoptext
 
 the first line is bold but the second is not.  But if I do the same with \os:
 
\starttext
\os 12345\par
\tf 12345\par
\stoptext
 
 both lines use old style numbers.  Is there a way to switch the current font 
 back to lining figures without reloading the font with \switchtobodyfont or 
 something similar?


The \os command enables oldstyle figures in your font and the setting isn’t 
reset when you switch to a different font alternative.

\definefontfeature[f:lnum][lnum=yes]
\definefontfeature[f:onum][onum=yes]
\definefontfeature[f:tnum][tnum=yes,pnum=no]
\definefontfeature[f:pnum][pnum=yes,tnum=no]

\setupbodyfont[antykwa-poltawskiego]

\starttext

\starttabulate
\NC onum\NC \feature[+][f:onum]   1234567890 \NC\NR
\NC onum + tnum \NC \feature[+][f:onum]\feature[+][f:tnum]1234567890 \NC\NR
\NC onum + pnum \NC \feature[+][f:onum]\feature[+][f:pnum]1234567890 \NC\NR
\TB
\NC lnum\NC \feature[+][f:lnum]   1234567890 \NC\NR
\NC lnum + tnum \NC \feature[+][f:lnum]\feature[+][f:tnum]1234567890 \NC\NR
\NC lnum + pnum \NC \feature[+][f:lnum]\feature[+][f:pnum]1234567890 \NC\NR
\stoptabulate

\stoptext

Wolfgang
___
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 Hans Hagen

On 6/25/2014 11:26 PM, Brian R. Landy wrote:



On Tue, 17 Jun 2014, Hans Hagen wrote:


anyhow, i made it work a bit better with tables (extra pass needed)

\starttext

\enabletrackers[typesetters.characteralign]

\bgroup
\setupTABLE[column][1][aligncharacter=yes,alignmentcharacter={,}]
\bTABLE
   \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,224 \eTD \bTD 11,22 \eTD \bTD xxx \eTD \eTR
\eTABLE
\egroup

\bgroup
\setupTABLE[column][1][aligncharacter=yes,alignmentcharacter={-}]
\setupTABLE[column][2][aligncharacter=yes,alignmentcharacter={\endash}]
\bTABLE
   \bTR \bTD  1-2\eTD \bTD  1\endash2\eTD\bTD xxx \eTD \eTR
   \bTR \bTD  1-2\eTD \bTD  1\endash2\eTD\bTD xxx \eTD \eTR
   \bTR \bTD  1-2\eTD \bTD  1\endash2\eTD\bTD xxx \eTD \eTR
   \bTR \bTD 11-2\eTD \bTD 11\endash2\eTD\bTD xxx \eTD \eTR
   \bTR \bTD 11-22 + \eTD \bTD 11\endash22 + \eTD\bTD xxx \eTD \eTR
\eTABLE
\egroup

\stoptext

the next beta can handle this


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

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


Re: [NTG-context] database module: the first letter is lost

2014-06-25 Thread Hans Hagen

On 6/25/2014 11:13 PM, Wolfgang Schuster wrote:


Am 25.06.2014 um 21:44 schrieb Hans Hagen pra...@wxs.nl
mailto:pra...@wxs.nl:


On 6/25/2014 7:21 PM, Michael Green wrote:

This appears to be the same as the problem Peter Münster found with
the letter module

\usemodule[database]

\defineseparatedlist[MyTable]
[separator=tab,
before=\bTABLE,after=\eTABLE,
first=\bTR,last=\eTR,
left=\bTD,right=\eTD]

\starttext

The first letter of “Cell” is lost.

\startseparatedlist[MyTable]
Cell 1Cell 2
\stopseparatedlist

With an extra return, “Cell” is intact.

\startseparatedlist[MyTable]

Cell 1Cell 2
\stopseparatedlist


\stoptext


in buff-ini.mkiv change this:

\def\buff_start_indeed#1#2#3#4%
 {\normalexpanded{\buff_pickup{#2}{#3}{#4}{}{\buff_stop{#4}}\plusone}}

probably needs some checking


Adding \obeylines to \grabbufferdatadirect would also work

\unexpanded\def\grabbufferdatadirect % name start stop
   {\begingroup % (6)
+  \obeylines
\buff_start_indeed\empty}

but I’m interested what’s the purpose of the fifth argument for
\buff_start_indeed.


that was wrong; the pickup macro has a fifth argument (\plusone here) 
but goes unnoticed when you add \obeylines in which case the first 
'obeyedline' ended up in #5


(i probably messed up when adding some feature but i would have to need 
to look at older code to see how/when)


does it make sense?

Hans

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


Re: [NTG-context] database module: the first letter is lost

2014-06-25 Thread Aditya Mahajan

On Thu, 26 Jun 2014, Hans Hagen wrote:


but I’m interested what’s the purpose of the fifth argument for
\buff_start_indeed.


that was wrong; the pickup macro has a fifth argument (\plusone here) but 
goes unnoticed when you add \obeylines in which case the first 'obeyedline' 
ended up in #5


(i probably messed up when adding some feature but i would have to need to 
look at older code to see how/when)


http://git.contextgarden.net/context/context/blame/master/tex/context/base/buff-ini.mkiv

Aditya___
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] database module: the first letter is lost

2014-06-25 Thread Rik Kabel

On 2014-06-25 19:04, Hans Hagen wrote:

On 6/25/2014 11:13 PM, Wolfgang Schuster wrote:


Am 25.06.2014 um 21:44 schrieb Hans Hagen pra...@wxs.nl
mailto:pra...@wxs.nl:


On 6/25/2014 7:21 PM, Michael Green wrote:

This appears to be the same as the problem Peter Münster found with
the letter module

\usemodule[database]

\defineseparatedlist[MyTable]
[separator=tab,
before=\bTABLE,after=\eTABLE,
first=\bTR,last=\eTR,
left=\bTD,right=\eTD]

\starttext

The first letter of “Cell” is lost.

\startseparatedlist[MyTable]
Cell 1Cell 2
\stopseparatedlist

With an extra return, “Cell” is intact.

\startseparatedlist[MyTable]

Cell 1Cell 2
\stopseparatedlist


\stoptext


in buff-ini.mkiv change this:

\def\buff_start_indeed#1#2#3#4%
 {\normalexpanded{\buff_pickup{#2}{#3}{#4}{}{\buff_stop{#4}}\plusone}}

probably needs some checking


Adding \obeylines to \grabbufferdatadirect would also work

\unexpanded\def\grabbufferdatadirect % name start stop
   {\begingroup % (6)
+  \obeylines
\buff_start_indeed\empty}

but I’m interested what’s the purpose of the fifth argument for
\buff_start_indeed.


that was wrong; the pickup macro has a fifth argument (\plusone here) 
but goes unnoticed when you add \obeylines in which case the first 
'obeyedline' ended up in #5


(i probably messed up when adding some feature but i would have to 
need to look at older code to see how/when)


does it make sense?

Hans


Adding \obeylines as Wolfgang indicated did not resolve the issue with 
my test case (shortened below), while removing #5 as Hans suggested does 
resolve it.


   % macros=mkvi
   \starttexdefinition unexpanded startTest
  \begingroup
  \dostartTest
   \stoptexdefinition
   \starttexdefinition dostartTest
  \grabbufferdata[Test][startTest][stopTest]
   \stoptexdefinition
   \starttexdefinition stopTest
  \getbufferdata[Test]
  \endgroup
   \stoptexdefinition
   \define\TestText
 {If you can read this the first token was not swallowed.}
   \starttext
   If another line does not follow this, there is a failure.

   \startTest\TestText\stopTest
   \stoptext

As I wrote before, I do not have a way to more extensively test the 
other effects of the change.


--
Rik Kabel
___
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] database module: the first letter is lost

2014-06-25 Thread Aditya Mahajan

On Wed, 25 Jun 2014, Rik Kabel wrote:

As I wrote before, I do not have a way to more extensively test the other 
effects of the change.


Since this affects grabbuffer, it will also affect the filter module. I 
have an extensive set of tests for the filter module 
(https://github.com/adityam/filter) that can be run by


   rake test_filter_mkiv

However, the tests are not automatic (you have to visually inspect the PDF 
to see if everything is fine), require pandoc, and are rather simplistic. 
They are meant to check that nothing is broken with the filter module, not 
to check \grabbuffer. Nonetheless, it may be a good source of example.


I am afraid that I don't have the time to test this right now.

Aditya
___
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] database module: the first letter is lost

2014-06-25 Thread Wolfgang Schuster

Am 26.06.2014 um 01:19 schrieb Rik Kabel cont...@rik.users.panix.com:

 Adding \obeylines as Wolfgang indicated did not resolve the issue with my 
 test case (shortened below), while removing #5 as Hans suggested does resolve 
 it.

There is a difference between

  \startFOO
  …
  \stopFOO

and

  \startFOO … \stopFOO

because context gobbles only content in the same line as \startFOO when you add 
\obeylines and in the first case there is nothing which can be removed.

Wolfgang

___
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] database module: the first letter is lost

2014-06-25 Thread Rik Kabel

On 2014-06-25 19:34, Wolfgang Schuster wrote:

Am 26.06.2014 um 01:19 schrieb Rik Kabel cont...@rik.users.panix.com:


Adding \obeylines as Wolfgang indicated did not resolve the issue with my test 
case (shortened below), while removing #5 as Hans suggested does resolve it.

There is a difference between

   \startFOO
   …
   \stopFOO

and

   \startFOO … \stopFOO

because context gobbles only content in the same line as \startFOO when you add 
\obeylines and in the first case there is nothing which can be removed.

Wolfgang

Thank you, Wolfgang, for the explanation.

When I use

   \startTest
   \TestText
   \stopTest

or

   \startTest
   \TestText\stopTest

it does indeed work with the obeylines fix. It fails on the one-line 
version and also on


   \startTest\TestText
   \stopTest

I have no problem using the multi-line versions. I only reduced it to a 
single line in preparing the MWE. I have, however, seen such one-line 
incantations in other examples on the list and possibly in the wiki. I 
do not recall who wrote them.


I will now leave this to the developers to handle as they see best.

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