Re: [NTG-context] Extensible arrows in ConTeXT

2017-07-25 Thread Mathias Schickel

> Am 26.07.2017 um 00:47 schrieb Hans Hagen :
> 
> On 7/26/2017 12:01 AM, Mathias Schickel wrote:
>>> Am 22.07.2017 um 22:34 schrieb Alan Braslau >> >:
>>> 
>>> On Fri, 21 Jul 2017 12:31:33 +0200
>>> Mathias Schickel >> > wrote:
>>> 
> $\xrightarrow{}{}$
 
 This throws errors. Any idea why?
 
> $\xrightoverleftarrow{}{33°C}$
 
 This does work. Sadly it is not the arrow I want to have.
>>> 
>>> MWE:
>>> 
>>> \starttext
>>> $A \xrightarrow{}{} B$
>>> \stoptext
>>> 
>>> No problem here.
>> It seems to be a problem with the font I use.  Hans, do you have any idea 
>> why that does not work if I am using Minion Math? I am getting the following 
>> error:
>> attempt to get length of local 'charlist' (a nil value)
>> stack traceback:
>> ...ext/tex/texmf-context/tex/context/base/mkiv/math-act.lua:514: in function 
>> 'horizontalcode'
>> ...ext/tex/texmf-context/tex/context/base/mkiv/math-act.lua:541: in function 
>> <...ext/tex/texmf-context/tex/context/base/mkiv/math-act.lua:540>
>> (...tail calls...)
> you can patch this in that file and remake the format
> 
>elseif kind == e_right then
>local charlist = data[3].horiz_variants
>if charlist then
>local right = charlist[#charlist]
>roffset = abs((right["start"] or 0) - (right["end"] or 0))
>end

Hi Hans,

thank you for your quick answer! I am not sure How I can remake that format. 
Can you tell me the command for that? And can you maybe patch that in the 
distribution, too? (Else I fear that I have to remake that format every time I 
will update the distribution from contextgarden.)

Best
Mathias


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

___
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] Get number of chapter and section

2017-07-25 Thread Henri
On Tue, 2017-07-25 at 23:52 +0200, Gerion Entrup wrote:
> Hi,
> 
> I've another question. Currently I'm experimenting with the header and can 
> retrieve the chapter
> name with \getmarkin[chapter].
> How can I get the current number of the chapter (\getnumber[chapter] does not 
> work) and the
> section?

\getmarking[chapternumber]

> 
> Regards,
> Gerion
> ___
> 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
> ___
___
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] Extensible arrows in ConTeXT

2017-07-25 Thread Hans Hagen

On 7/26/2017 12:01 AM, Mathias Schickel wrote:


Am 22.07.2017 um 22:34 schrieb Alan Braslau >:


On Fri, 21 Jul 2017 12:31:33 +0200
Mathias Schickel > wrote:



$\xrightarrow{}{}$


This throws errors. Any idea why?


$\xrightoverleftarrow{}{33°C}$


This does work. Sadly it is not the arrow I want to have.


MWE:

\starttext
$A \xrightarrow{}{} B$
\stoptext

No problem here.


It seems to be a problem with the font I use.  Hans, do you have any 
idea why that does not work if I am using Minion Math? I am getting the 
following error:


attempt to get length of local 'charlist' (a nil value)
stack traceback:
...ext/tex/texmf-context/tex/context/base/mkiv/math-act.lua:514: in 
function 'horizontalcode'
...ext/tex/texmf-context/tex/context/base/mkiv/math-act.lua:541: in 
function <...ext/tex/texmf-context/tex/context/base/mkiv/math-act.lua:540>

(...tail calls...)

you can patch this in that file and remake the format

elseif kind == e_right then
local charlist = data[3].horiz_variants
if charlist then
local right = charlist[#charlist]
roffset = abs((right["start"] or 0) - (right["end"] or 0))
end



-
  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 in wiki \doifsamestringselse vs \doifsamestringelse

2017-07-25 Thread Jaroslav Hajtmar
Thanx for reply and for fixed too. 
Jaroslav Hajtmar


Dne 24.07.17 23:06, ntg-context za uživatele Henri  napsal(a):

On Mon, 2017-07-24 at 16:54 +, Jaroslav Hajtmar wrote:
> Hello ConTeXist
>  
> I add wiki information. In wiki on page 
http://wiki.contextgarden.net/System_Macros/Branches_and_D
> ecisions is bug (I think) in caption 
\doifsamestringselse,\doifsamestring,\doifnotsamestring.
>  
> Right information is 
\doifsamestringelse,\doifsamestring,\doifnotsamestring (without s in first
> keyword).
> Macro \doifsamestringselse not work.
>  
> Is there anybody, that fix this bug?

It's just a simple typo.  I fixed it for you.  You can also fix things like 
this yourself by making
an account on the wiki and editing the page.

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

___
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

___

___
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] Extensible arrows in ConTeXT

2017-07-25 Thread Mathias Schickel

> Am 22.07.2017 um 22:34 schrieb Alan Braslau :
> 
> On Fri, 21 Jul 2017 12:31:33 +0200
> Mathias Schickel  wrote:
> 
>>> $\xrightarrow{}{}$
>> 
>> This throws errors. Any idea why?
>> 
>>> $\xrightoverleftarrow{}{33°C}$
>> 
>> This does work. Sadly it is not the arrow I want to have.
> 
> MWE:
> 
> \starttext
> $A \xrightarrow{}{} B$
> \stoptext
> 
> No problem here.

It seems to be a problem with the font I use.  Hans, do you have any idea why 
that does not work if I am using Minion Math? I am getting the following error:

attempt to get length of local 'charlist' (a nil value)
stack traceback:
...ext/tex/texmf-context/tex/context/base/mkiv/math-act.lua:514: in 
function 'horizontalcode'
...ext/tex/texmf-context/tex/context/base/mkiv/math-act.lua:541: in 
function <...ext/tex/texmf-context/tex/context/base/mkiv/math-act.lua:540>
(...tail calls...)

Mathias

> 
> Alan

___
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] Get number of chapter and section

2017-07-25 Thread Gerion Entrup
Hi,

I've another question. Currently I'm experimenting with the header and can 
retrieve the chapter name with \getmarkin[chapter].
How can I get the current number of the chapter (\getnumber[chapter] does not 
work) and the section?

Regards,
Gerion
___
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] Metafun: setting pen size in properties

2017-07-25 Thread Aditya Mahajan

On Mon, 24 Jul 2017, Alan Braslau wrote:


On Mon, 24 Jul 2017 10:26:25 +0200
Hans Hagen  wrote:


On 7/24/2017 1:40 AM, Aditya Mahajan wrote:

Hi,

Is it possible to set pen width using properties(...)? The
following does not work (the color is set, but not the pen width):

\starttext
\startMPcode
property p[] ;
p[1] := properties(withcolor red  withpen pencircle scaled 1bp);
p[2] := properties(withcolor blue withpen pencircle scaled 10bp);

draw fullcircle scaled 1cm withproperties p[1];
draw fullcircle scaled 2cm withproperties p[2];
\stopMPcode
\stoptext


def withproperties expr p =
 if colormodel p = 3 :
 withcolor greypart p
 elseif colormodel p = 5 :
 withcolor (redpart p,greenpart p,bluepart p)
 elseif colormodel p = 7 :
 withcolor (cyanpart p,magentapart p,yellowpart p,blackpart p)
 fi
 withpen penpart p


  if dashpart p <> nullpicture :
dashed dashpart p
  fi


 withprescript prescriptpart p
 withpostscript postscriptpart p
enddef ;


Thanks!

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

Re: [NTG-context] Unable to switch math fonts

2017-07-25 Thread Sebastian L.

Thanks for your response Hans.

On 25/07/2017 00:12, Hans Hagen wrote:

On 7/24/2017 11:41 PM, Sebastian L. wrote:
Yes it helps, thanks; it explains why there was so little response to 
this. ;)
After some search I found regular style pictures of it. I was sure, 
that it was italic as standard, because that's what "modern" 
suggests: compability for current regulations (i.e. regular 
constants, italic variables) as well as an attractive style overall. 
But since Neo Euler seems to have no italic style, it is of no use 
for academic purposes, like in my case.


originally "euler" is a math companion font to "concrete" and it's not 
trivial to make en euler with all text styles (maybe some day the tex 
gyre project will give it a try) .. btw, the same is true for sans 
fonts: at some point one runs out of distinctive features


btw, it also fits with pagella (see type-imp-euler)


I don't want to argue with you Hans, as I know that you have better 
things to do. But for clarification: for a non-power TeX / CTX user this 
is information, that one usually doesn't get, as it makes deep interest 
in fonts creation necessary. On the other hand I don't expect you to be 
the one who teaches users about fonts, relationships or even the motives 
behind their creation. Thanks for your explanation though.


The story, to add to the subject of the mail, in case somebody 
searches the archive for this, is that I wasn't able to find out is 
how to change the math font only, as i like the standard font with 
\setupbodyfont[sans] as global setup but not the style of 
(non-modern) Euler.

I tried

\definefontfamily [mainface] [mm] [Xits Math]


most users who mess with fonts either use the selectfont mechanism or 
peek into the type-imp files to see how to set up a combination


I see. Well I just used search on the CTX wiki to find information about 
selectfont, but neither selectfont nor \selectfont gives me any result. 
If it's something TeX related, then I have to say that I didn't start to 
use CTX to get into TeX before. Anyways this is where it starts. This 
time it's type-imp, other topics will make it necessary to search other 
source files and then it starts over... This is something for you, the 
other coders or users who want to tweak CTX or its components, but a 
standard user will never do this, as he usually doesn't know where to 
look for info.



but this changes the whole typeface; not what I want.
So the trick is to define the standard font for the rest of the font 
variations. The standard font can be found out with \showbodyfont. At 
least that's what it suggests. But it gives you "modern-design" as 
font. When you use this within \definefontfamily then it gives you 
nothing, because the real id of the standard font is "modern". So to 
change the math font only and keep the main font standard, you have 
to use this command group (just in case somebody looks for it):


\definefontfamily [mainface] [rm] [Modern] % = serif
\definefontfamily [mainface] [ss] [Modern] % = sans
\definefontfamily [mainface] [tt] [Modern] % = mono (teletype)
\definefontfamily [mainface] [mm] [Xits Math] [rscale=1.03] % = math

But as this seems to be so trivial, that few people care, I really 
have to wonder why people who test CTX criticise the lack of 
documentation. We (especially who haven't been through LaTeX or even 
TeX) seem to be a minority.


In what sense?


In the sense that we (or let's even say just me) don't know where to 
look for information. I mean how many software do you have, where you go 
through its source files to understand how it does basic tasks? For me 
it's only CTX and as a consequence thereof Textadept, but for me that's 
already /too much/. So IMHO this must not be the future... Except for 
those who can't stop loving open source software that is usually made 
for a specific topic in the first place.




Anyway, there is quite some documentation (also about fonts) available 
(and the context distribution documentation section has examples).


There you are right. There is so much documentation that it's 
overwhelming. For instance documentation on fonts goes over several wiki 
pages. Suffice it to say you have to know what you are looking for, and 
not where. And the more you start searching, the more wiki pages you 
have to go through. A better approach might be to merge several pages 
that belong to a single chapter to one single wiki page. But that's just 
my opinion. Another example: I have found different links to manuals 
like Hoekwater's or Hagen's (on the wiki). But on several pages you get 
links to several versions of the manual, for instance I found one link 
to Hoekwater's 2003 version and to 2011 or 2013 version (I don't 
remember the exact dates as I deleted them both). Some time later I read 
that there is an online manual somewhere in the download area, that has 
to be built first. But there seems to be no manual for Windows users how 
to do this. I.e. one has to get some basic 

[NTG-context] letters in context mkiv

2017-07-25 Thread r . ermers
Dear Contex’ers,I use Context for many things. One of them is letters.I have used the letter module of mkii with an xml database (see example), but now I would like to step forward to mkiv.I have found out how to process the xml data from an xml file (now in the buffer). The recipient’s address neatly shows up in the designed place. (See pdf). So far, everything seems OK. Yet when I add text, only the text appears, and all address data from the xml file disappear.You can try it out by uncommenting the %\input knuth or %tekst lines.I have tried various options, but for now I have no idea how to proceed further.Context Version: 2017.07.17 00:20Lua 5.2.4, This is LuaTeX, Version 1.05.0.Your help is much appreciated!Kind regards,Robert

brieven2mkiv.pdf
Description: Adobe PDF document
\usemodule[letter]\setuplanguage[nl][date={year, –, mm, –, dd}] % ISO 8601 date\setupletteroptions[language=netherlands,bodyfont={rm,10pt},whitespace=1.5ex]\startbuffer[participants]      Hendriks    Karel    mr.    K.    Arnhem          Mr. K. Hendriks      Grotestraat 5      1234 BB Arnhem        1234bb5        Janssen    Piet    P.    mr.    Nijmegen         Mr. P. Janssen     Kortestraat 8     1234 AA Nijmegen        1234aa8  \stopbuffer\startxmlsetups xml:setups\xmlsetsetup{#1}{document|contacts|contact|prefix|initials|address|city|text|kix|p}{xml:*}%\xmlsetsetup{\xmldocument}{text:p}{xml:paragraph}\stopxmlsetups\xmlregistersetup{xml:setups}\startxmlsetups xml:contacts\xmlflush{#1}\stopxmlsetups\startxmlsetups xml:contact\setupletter[toaddress={\xmlall{#1}{/address/p}\par\xmltext{#1}{/kix}}]\defineletterelement[layer][address][example]%    {\correspondenceparameter{toname}\\\correspondenceparameter{toaddress}\par}%toname is not used in setupletter because toaddress contains all data.%kix is used for adding a barcode to the address.\setupletterlayer[address][alternative=example,y=6cm,x=12cm,color=red,style=\tfa\sans]\startletter  [opening={Dear \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},},   closing={Kind regards,},   subject={subject: your life in \xmltext{#1}{/city}},   signature={X}]\stopletter\stopxmlsetups\startxmlsetups xml:address\xmlflush{#1}\stopxmlsetups\startxmlsetups xml:p\xmlflushtext{#1}\par\stopxmlsetups\starttext%\input knuth%tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst\xmlprocessbuffer{main}{participants}{}\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
___