Re: [NTG-context] defining bug not setting up blank spaces

2017-02-14 Thread Hans Hagen

On 2/14/2017 7:17 PM, Pablo Rodriguez wrote:

On 02/14/2017 06:41 PM, Hans Hagen wrote:

[...]
I don’t understand why \setupblank[ab][big] doesn’t work (with a
previous \defineblank[ab]).

I mean, for most elements \setupelement is possible after \defineelement.

What is different with \setupblank?


Well, you cannot

\definecolor[red][r=1]

\setupcolor[red][r=.5]

either. Adapting a blank this way would also be inefficient because then
we need to keep carry around more state info and all these relatively
basic core macro are tuned for efficiency


Many thanks for your reply, Hans.

Is there anything wrong in defining the same blank again?


not that know of


I need to add special blanks in templates. In some documents, those
blanks will be bigger than in other ones. Is there anything wrong in
redefining in the second documents the blanks I previously defined in
the template?

Many thanks for your help,

Pablo




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] defining bug not setting up blank spaces

2017-02-14 Thread Pablo Rodriguez
On 02/14/2017 06:41 PM, Hans Hagen wrote:
>> [...]
>> I don’t understand why \setupblank[ab][big] doesn’t work (with a
>> previous \defineblank[ab]).
>>
>> I mean, for most elements \setupelement is possible after \defineelement.
>>
>> What is different with \setupblank?
> 
> Well, you cannot
> 
> \definecolor[red][r=1]
> 
> \setupcolor[red][r=.5]
> 
> either. Adapting a blank this way would also be inefficient because then 
> we need to keep carry around more state info and all these relatively 
> basic core macro are tuned for efficiency

Many thanks for your reply, Hans.

Is there anything wrong in defining the same blank again?

I need to add special blanks in templates. In some documents, those
blanks will be bigger than in other ones. Is there anything wrong in
redefining in the second documents the blanks I previously defined in
the template?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] defining bug not setting up blank spaces

2017-02-14 Thread Hans Hagen

On 2/14/2017 5:27 PM, Pablo Rodriguez wrote:

On 02/14/2017 01:13 PM, Hans Hagen wrote:

On 2/13/2017 9:16 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

\defineblank[ab][none]
\starttext
\defineblank[ab][big]
a
\blank[ab]
b
\stoptext

Am I missing something or is there a reason to force the new definition
(instead of the setup) of already defined blank spaces?

I mean, if this isn’t a bug, I don’t see the gain in this behavior.


?


Hans,

I don’t understand why \setupblank[ab][big] doesn’t work (with a
previous \defineblank[ab]).

I mean, for most elements \setupelement is possible after \defineelement.

What is different with \setupblank?


Well, you cannot

\definecolor[red][r=1]

\setupcolor[red][r=.5]

either. Adapting a blank this way would also be inefficient because then 
we need to keep carry around more state info and all these relatively 
basic core macro are tuned for efficiency


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] defining bug not setting up blank spaces

2017-02-14 Thread Pablo Rodriguez
On 02/14/2017 01:13 PM, Hans Hagen wrote:
> On 2/13/2017 9:16 PM, Pablo Rodriguez wrote:
>> Dear list,
>>
>> I have the following sample:
>>
>> \defineblank[ab][none]
>> \starttext
>> \defineblank[ab][big]
>> a
>> \blank[ab]
>> b
>> \stoptext
>>
>> Am I missing something or is there a reason to force the new definition
>> (instead of the setup) of already defined blank spaces?
>>
>> I mean, if this isn’t a bug, I don’t see the gain in this behavior.
> 
> ?

Hans,

I don’t understand why \setupblank[ab][big] doesn’t work (with a
previous \defineblank[ab]).

I mean, for most elements \setupelement is possible after \defineelement.

What is different with \setupblank?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Customize a table with Metafun

2017-02-14 Thread Lutz Haseloff
linecap:=butt ;

Am 14. Februar 2017 16:53:04 MEZ schrieb Fabrice Couvreur 
:
>Hello,
>In the code below, the red vertical line extends beyond the edges of
>the
>cell.
>Thank you
>Fabrice
>
>\startuniqueMPgraphic{Vertical}
>
>  linecap:=squared ;
>  path p ; p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
>  drawoptions (withpen pencircle withcolor \MPcolor{red}) ;
>  draw .5[llcorner p, lrcorner p]--.5[ulcorner p, urcorner p] ;
>  setbounds currentpicture to p ;
>
>\stopuniqueMPgraphic
>
>\defineoverlay[Vertical][\uniqueMPgraphic{Vertical}]
>
>\startsetups[table:initialize]
>
>\setupTABLE[start]
>   [align={middle,lohi},offset=0.5ex,width=1.5cm,
>foregroundstyle={\switchtobodyfont[10pt]}]
>\setupTABLE[1][2][background=Vertical]
>
>\stopsetups
>
>\starttext
>\startlinecorrection[blank]
>  \startmidaligned
>\bTABLE[setups=table:initialize]
>\bTR
>\bTD \math{\red 0 {\rm (A)}} \eTD
>\bTD \math{+\infty}  \eTD
>\eTR
>\bTR
>\bTD \eTD
>\bTD  \math{+\infty} \eTD
>\eTR
>\eTABLE
>  \stopmidaligned
>\stoplinecorrection
>\stoptext

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Vertical spacing in enumerations

2017-02-14 Thread Fabrice Couvreur
In the code below, the vertical spacing of the second level should be like
that of the first level
Thank you
Fabrice

\definecolor[MyBlue][c=0.06 , m=0.03, y=0.00, k=0.00]

\defineframed
  [algorithmframe]
  [width=\textwidth,
   align=normal,
   strut=no,
   offset=1ex,
   foregroundstyle={\switchtobodyfont[7pt]},
   background=color,
   location=middle,
   backgroundcolor=MyBlue,
   framecolor=darkblue,
   corner=round]

\definelines
  [algorithm]
  [space=on,
   before={\startframed[algorithmframe]},
   after=\stopframed]

\starttext
\startalgorithm
\startitemize[1,joinedup,nowhite]
\item On commence par le sommet A : il est à une distance \math{d({\rm A})}
égale à \math{0} du sommet A.
\item Pour tous les sommets S adjacents à A et non marqués :
\startitemize[2,joinedup,nowhite]
  \item on calcule la somme \math{s} du poids de l'arête A-S et de la
distance \math{d({\rm A})} ;
  \item si \math{s < d({\rm S})}, on remplace la distance \math{d({\rm S})}
par \math{s} et on retient que cette distance \quotation{provient} du
sommet A.
  \stopitemize
\item On marque définitivement le sommet A.
\stopitemize
\stopalgorithm
\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Customize a table with Metafun

2017-02-14 Thread Fabrice Couvreur
Hello,
In the code below, the red vertical line extends beyond the edges of the
cell.
Thank you
Fabrice

\startuniqueMPgraphic{Vertical}

  linecap:=squared ;
  path p ; p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
  drawoptions (withpen pencircle withcolor \MPcolor{red}) ;
  draw .5[llcorner p, lrcorner p]--.5[ulcorner p, urcorner p] ;
  setbounds currentpicture to p ;

\stopuniqueMPgraphic

\defineoverlay[Vertical][\uniqueMPgraphic{Vertical}]

\startsetups[table:initialize]

\setupTABLE[start]
   [align={middle,lohi},offset=0.5ex,width=1.5cm,
foregroundstyle={\switchtobodyfont[10pt]}]
\setupTABLE[1][2][background=Vertical]

\stopsetups

\starttext
\startlinecorrection[blank]
  \startmidaligned
\bTABLE[setups=table:initialize]
\bTR
\bTD \math{\red 0 {\rm (A)}} \eTD
\bTD \math{+\infty}  \eTD
\eTR
\bTR
\bTD \eTD
\bTD  \math{+\infty} \eTD
\eTR
\eTABLE
  \stopmidaligned
\stoplinecorrection
\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Problem with Russian letters in itemize

2017-02-14 Thread Ulrike Fischer
Am Tue, 14 Feb 2017 11:31:01 +0800 schrieb Vladimir Lomov:

> So I conclude that either I'm doing something wrong (in wrong way) or
> something still missing in context regarging usage of other alphabets
> letters as \items.

There are hundreds and thousands scripts and languages in the world.
So I'm certain that quite a lot is still missing in context and
think you shouldn't wonder too much. 

Simply sent an example of what you have done and ask that it gets
added to the core if you think it would be usefull. 


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] frac opentype feature broken by \setbreakpoints[compound]

2017-02-14 Thread Hans Hagen

On 2/13/2017 4:47 PM, MF wrote:

Hello list,
I found an interference between the "frac" opentype feature and
\setbreakpoints[compound], which make the former fail when you have a
numerator more than 2 digit wide.

I found it with Adobe Garamond Premier Pro: with
\setbreakpoints[compound], when the fraction had a 3-digit (or more)
numerator, the denominator stayed high as the numerator (like a
superscript).

Here I replaced Garamond Premier Pro with the freely available "Lato"
font, to let you reproduce the problem.
The outcome is different, but still erroneous:
\setbreakpoints[compound] makes ConTeXt ignore the "frac" feature at
all.

Please try this:

\definefontfeature[frac][frac=yes]
\definefontfamily[default][rm][lato][features=frac]
\setupbodyfont[default,rm,11pt]

\setbreakpoints[compound]

\starttext

\addff{frac} 1/3, 1/100, 1/1000, {\setbreakpoints[reset]1633/100},
2345/12.

\stoptext

A workaround is a local \setbreakpoints[reset] limited to the fraction.


i'll add this:

\definefontfeature[f:fractions][frac=yes]

\definealternativestyle [fractions]  [\setfractions\resetbreakpoints] 
[\setfractions\resetbreakpoints]


\unexpanded\def\setfractions{\doaddfeature{f:fractions}}


\addff{frac} 1/3, 1/100, 1/1000, {\resetbreakpoints 1633/100}, 2345/12.

\fractions{1/3, 1/100, 1/1000, 1633/100, 2345/12}.


Keep in mind that often the fractions feature sis incomplete and can 
even give weird side effects when applied to a whole stretch of text so 
limiting the scope is wise anyway


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] defining bug not setting up blank spaces

2017-02-14 Thread Hans Hagen

On 2/13/2017 9:16 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

\defineblank[ab][none]
\starttext
\defineblank[ab][big]
a
\blank[ab]
b
\stoptext

Am I missing something or is there a reason to force the new definition
(instead of the setup) of already defined blank spaces?

I mean, if this isn’t a bug, I don’t see the gain in this behavior.


?


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Bug: \textext inside \*MPinclusions causes error

2017-02-14 Thread Hans Hagen

On 2/13/2017 11:36 PM, Sergey Slyusarev wrote:

It's a single tex run so you can do:
\starttext
\newbox\MyMpBox \setbox\MyMpBox\hbox{foo}
\startMPcode
   draw textext("\copy\MyMpBox") ;
\stopMPcode
\startMPcode
   draw textext("\copy\MyMpBox") rotated 45;
\stopMPcode
\stoptext


This is not much different from:

\starttext

\startMPinclusions

string t;

t := "foo";

\stopMPinclusions

\startMPcode

draw textext(t);

\stopMPcode

\startMPcode

draw textext(t) rotated 45;

\stopMPcode

\stoptext


but the problem was not with passing just text, but with more complex
images that may or may not contain text, without specifically addressing
text after image is defined.


\starttext

\startMPinclusions
vardef my_text_t =
textext("foo")
enddef ;
\stopMPinclusions

\startMPcode
draw textext(my_text_t);
\stopMPcode

\startMPcode
draw textext(my_text_t) rotated 45;
\stopMPcode

\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Problem with Russian letters in itemize

2017-02-14 Thread Hans Hagen

On 2/14/2017 4:31 AM, Vladimir Lomov wrote:

Hello,
** Ulrike Fischer [2017-02-13 14:16:52 +0100]:


Am Mon, 13 Feb 2017 17:24:19 +0800 schrieb Vladimir Lomov:


I'm trying to use Russian (Cyrillic) letters for itemize list but
without luck.


Imho there is no predefined conversion, but you can define your own:

http://wiki.contextgarden.net/User-Defined_Enumerations


Thank you, I saw this page but was confused by other page about
Enumerations (http://wiki.contextgarden.net/Enumerations) that mentions
two special examples: Slovenian and Spain (and some alphabetic thing).

I tried to make custom conversion command and it works, but my point was
that I expected that \items will give Russian letters if I use
'\mainlanguage[ru]'. I tried with 'sl' and 'es' and both give special
letters. Still 'ar', 'gr' and 'kr' don't give me other than Latin
letters in \items as I would expect (examples with 'sl' and 'es' work!).

So I conclude that either I'm doing something wrong (in wrong way) or
something still missing in context regarging usage of other alphabets
letters as \items.


it's a matter of completion .. in core-con.lua we need to add a vector 
for russian in


local counters = allocate { ...

so you can make one and sent it to me ... then we needs an entry in 
core-con.mkiv


just see how slovenian is done

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___