Re: [NTG-context] Coding for new Unicode characters

2019-12-28 Thread Richard Mahoney | Indica et Buddhica
Just to say that I seem to have resolved this (& properly I hope).

I read these two pages:

https://www.contextgarden.net/Faking_characters

https://source.contextgarden.net/tex/context/base/mkiv/enco-ini.mkiv?search=textcedilla

and have included the following with my setups:

% Additional Characters
\definecharacter llowmacron {\buildtextmacron l}
\definecharacter Llowmacron {\buildtextmacron L}
\definecharacter nlowmacron {\buildtextmacron n}
\definecharacter Nlowmacron {\buildtextmacron N}
\definecharacter rlowmacron {\buildtextmacron r}
\definecharacter Rlowmacron {\buildtextmacron R}

\define\lLM{\llowmacron}
\define\LLM{\Llowmacron}
\define\nLM{\nlowmacron}
\define\NLM{\Nlowmacron}
\define\rLM{\rlowmacron}
\define\RLM{\Rlowmacron}


This seems to do it, although if there is a better way please feel
free to say.


Best, Richard



-- 
Richard Mahoney | Indica et Buddhica
 
Littledene  Bay Road  Oxford  NZ 
T: +6433121699  M: +64210640216 
r.maho...@indica-et-buddhica.org 

https://indica-et-buddhica.org/ 

-Original Message-
From: Richard Mahoney | Indica et Buddhica <
r.maho...@indica-et-buddhica.org>
Reply-To: mailing list for ConTeXt users 
To: mailing list for ConTeXt users 
Subject: [NTG-context] Coding for new Unicode characters
Date: Sun, 29 Dec 2019 12:52:18 +1300
Mailer: Evolution 3.32.4 
Organization: Indica et Buddhica

I am using Latin Modern Roman to typeset some proceedings and need the
following characters in regular, italic, and small caps:

Character: ṉ U+1E49
Name: LATIN SMALL LETTER N WITH LINE BELOW

Character: Ṉ U+1E48
Name: LATIN CAPITAL LETTER N WITH LINE BELOW


Character: ḻ U+1E3B
Name: LATIN SMALL LETTER L WITH LINE BELOW

Character: Ḻ U+1E3A
Name: LATIN CAPITAL LETTER L WITH LINE BELOW


Character: ṟ U+1E5F
Name: LATIN SMALL LETTER R WITH LINE BELOW

Character: Ṟ U+1E5E
Name: LATIN CAPITAL LETTER R WITH LINE BELOW


These characters are available in Computer Modern Unicode (although
not, it seems, in small caps). Still, I would prefer to still with LM.

I'm wondering if there is a way in Context to set up these characters
on the fly, say with something along the lines of "newunicodechar"?

\newunicodechar{}{}

\newunicodechar{ā}{\accent"0304 a}

newunicodechar -- Definitions of the meaning of Unicode characters
https://ctan.org/pkg/newunicodechar?lang=en



Best, Richard



___
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] Coding for new Unicode characters

2019-12-28 Thread Richard Mahoney | Indica et Buddhica
I am using Latin Modern Roman to typeset some proceedings and need the
following characters in regular, italic, and small caps:

Character: ṉ U+1E49
Name: LATIN SMALL LETTER N WITH LINE BELOW

Character: Ṉ U+1E48
Name: LATIN CAPITAL LETTER N WITH LINE BELOW


Character: ḻ U+1E3B
Name: LATIN SMALL LETTER L WITH LINE BELOW

Character: Ḻ U+1E3A
Name: LATIN CAPITAL LETTER L WITH LINE BELOW


Character: ṟ U+1E5F
Name: LATIN SMALL LETTER R WITH LINE BELOW

Character: Ṟ U+1E5E
Name: LATIN CAPITAL LETTER R WITH LINE BELOW


These characters are available in Computer Modern Unicode (although
not, it seems, in small caps). Still, I would prefer to still with LM.

I'm wondering if there is a way in Context to set up these characters
on the fly, say with something along the lines of "newunicodechar"?

\newunicodechar{}{}

\newunicodechar{ā}{\accent"0304 a}

newunicodechar -- Definitions of the meaning of Unicode characters
https://ctan.org/pkg/newunicodechar?lang=en



Best, Richard



-- 
Richard Mahoney | Indica et Buddhica
 
Littledene  Bay Road  Oxford  NZ 
T: +6433121699  M: +64210640216 
r.maho...@indica-et-buddhica.org 

https://indica-et-buddhica.org/ 
___
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] background color of text in contour(former: ntg-context Digest, Vol 186, Issue 61)

2019-12-28 Thread Jeong Dal
Dear Hans,

Thank you for the fix.
Background color is OK now.

A new problem in the caption:
Since width of the figure is narrower than the width of the line 
"x = [0,12.555]; y = [-6,6];”,
“y  =“ is written over 12.555. 

Is there any option to suppress the caption x, y since there are numbers of x 
and y in the figure already?

Thank you.

Best regards,

Dalyoung
___
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] How to use in Metafun, a function defined in Lua

2019-12-28 Thread Hans Hagen

On 12/28/2019 4:22 PM, Otared Kavian wrote:

Hi all,

I would like to use a math function defined in lua in Metafun in order to draw 
its graph, together with the graphs of some other functions.
As a simple example consider the following:

%%% begin lua-metafun-example.tex
\startluacode
function document.myfunction(n,x)
local S
S = math.sin(n*x)
return S
end
\stopluacode

\starttext

Here \type{document.myfunction(n,x)} is $\sin(nx)$. For instance when $n = 2$ 
and $x = 355/113$ we have:

\type{document.myfunction(2,355/113)} 
$=\cldcontext{document.myfunction(2,355/113)} \sim 0$.

\startplacefigure[title={Nothing works\dots}]
\startMPcode{GridAxis}
numeric gu ; gu = 5mm ; % gu = graph unit
draw image (
draw function (1,"x","document.myfunction(2,x)", % <-- this does not 
work
%   draw function (1,"x","sin(2*x)", % <-- this works
-355/113,355/113,.01)
scaled gu
withpen pencircle scaled .075pt
withcolor darkred ;
) xsized .7TextWidth ;
\stopMPcode
\stopplacefigure

\stoptext
%%% end lua-metafun-example.tex

Here one sees that the function « document.myfunction » is well defined in Lua 
and is known in ConTeXt, but I cannot use it in a Metapost code: how can one do 
that?

you confuse lua and mp functions

\startluacode
function MP.myfunction(n,x)
return math.sin(n*x)
end
\stopluacode

\starttext

\startMPcode
numeric gu ; gu = 5mm ;
vardef myfunction(expr n, x) = MP.myfunction(n,x) enddef ;
draw image (
draw function (1,"x","myfunction(2,x)",-355/113,355/113,.01)
scaled gu
withpen pencircle scaled .075pt
withcolor darkred ;
) xsized .7TextWidth ;
\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
___


[NTG-context] How to use in Metafun, a function defined in Lua

2019-12-28 Thread Otared Kavian
Hi all,

I would like to use a math function defined in lua in Metafun in order to draw 
its graph, together with the graphs of some other functions.
As a simple example consider the following:

%%% begin lua-metafun-example.tex
\startluacode 
function document.myfunction(n,x)
local S
S = math.sin(n*x)
return S
end
\stopluacode

\starttext

Here \type{document.myfunction(n,x)} is $\sin(nx)$. For instance when $n = 2$ 
and $x = 355/113$ we have:

\type{document.myfunction(2,355/113)} 
$=\cldcontext{document.myfunction(2,355/113)} \sim 0$.

\startplacefigure[title={Nothing works\dots}]
\startMPcode{GridAxis}
numeric gu ; gu = 5mm ; % gu = graph unit
draw image (
draw function (1,"x","document.myfunction(2,x)", % <-- this does not 
work
%   draw function (1,"x","sin(2*x)", % <-- this works
-355/113,355/113,.01)
scaled gu 
withpen pencircle scaled .075pt
withcolor darkred ;
) xsized .7TextWidth ;
\stopMPcode
\stopplacefigure

\stoptext
%%% end lua-metafun-example.tex

Here one sees that the function « document.myfunction » is well defined in Lua 
and is known in ConTeXt, but I cannot use it in a Metapost code: how can one do 
that?

Thanks in advance for any help.
Best regards: Otared
___
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
___