[NTG-context] Re: Why the way key-value argument is called affected the document's output?

2024-01-08 Thread Hans Hagen

On 1/8/2024 11:05 PM, 1114...@gmail.com wrote:

Hi,

I was cleaning and formatting my context file and then when I compiled it, the 
output I got introduced extra vertical spacings at the section headings that 
weren't there in the previous compilations. I had to spend enormous amount of 
time trying to fix it so to emulate my previous outputs. Turns out the problem 
was how I called one of the key-value argument in the document.

I really wanna know the reason why it did influenced the output?

Provided below is the minimal source code (and it is producing different 
outputs, meaning the vertical spacings are not same, on my device running the 
version released in the September and also tested with the latest release.)


"""
%% differences in outputs, for how "grid=yes" is called.

%% Type 1.
%\setuplayout[grid=yes]


Here you set the grid variable to "yes".


%% Type 2.
%\setuplayout[
%grid=yes
%]


Here you set the grid variable to "yes " so a trailing space.


\setuphead[section][grid=low] %% needed to observe the output difference
\starttext

\title{Alpha}
\subsection{Beta}
\input{knuth}

\stoptext

So this is ok:

\setupfoo
 [a=A,
  b=B]

\setupfoo
 [a=A,
  b=B,
 ]

I'm not aware of funmdamental changes in the parse, apart from that in 
many setup commands one can now do this:


\setupfoo
  [A=\this[works],
   B=\that[doestoo]]

as nested brackets are handled.

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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Why the way key-value argument is called affected the document's output?

2024-01-08 Thread 111414w
Hi,

I was cleaning and formatting my context file and then when I compiled it, the 
output I got introduced extra vertical spacings at the section headings that 
weren't there in the previous compilations. I had to spend enormous amount of 
time trying to fix it so to emulate my previous outputs. Turns out the problem 
was how I called one of the key-value argument in the document.

I really wanna know the reason why it did influenced the output?

Provided below is the minimal source code (and it is producing different 
outputs, meaning the vertical spacings are not same, on my device running the 
version released in the September and also tested with the latest release.)


"""
%% differences in outputs, for how "grid=yes" is called.

%% Type 1.
%\setuplayout[grid=yes]

%% Type 2.
%\setuplayout[
%grid=yes
%]

\setuphead[section][grid=low] %% needed to observe the output difference
\starttext

\title{Alpha}
\subsection{Beta}
\input{knuth}

\stoptext
"""


Best regards,
Ali
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Links

2024-01-08 Thread Henning Hraban Ramm

Am 08.01.24 um 14:10 schrieb Ursula Hermann:

Dear List,

Is this the right way?

I want to use linked bibliography numbers, linked Chapter, section 
subsection, linked margin numbers, in the text.


\setupinteraction[state=start]


This is essential.



\starttext

Der Wert von \m{y = f(x)} ist unabhängig von der Wahl\par von 
\m{x\doubleprime} ist gleichbedeutend mit \m{∃y : ∀x : f(x) = y} \par 
(Beutelspacher [\hyphenatedurl {10},S.54]).


\stoptext


\hyphenatedurl only changes the hyphenation of its content, it doesn’t 
create a link. In your example it makes no sense.


Generally, you need an anchor (link target) to link to, e.g.

\startchapter[title={My chapter},reference=chap:first]
or
\chapter[chap:first]{My chapter}

This works the same for other structure levels. I’m not sure about 
bibliography, but I think you must use the bib entry code.


You can also set anchors manually using \textreference and \pagereference.

Then you can use \in[chap:first], \about[chap:first] or \at[chap:first].

For external links, you use \goto (it’s a bit extensive).

Please look up the syntax reference in the wiki.

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Links

2024-01-08 Thread Ursula Hermann
Dear List,
Is this the right way?
I want to use linked bibliography numbers, linked Chapter, section subsection, 
linked margin numbers, in the text.

\setupinteraction[state=start]
\starttext
Der Wert von \m{y = f(x)} ist unabhängig von der Wahl\par von \m{x\doubleprime} 
ist gleichbedeutend mit \m{∃y : ∀x : f(x) = y} \par (Beutelspacher 
[\hyphenatedurl {10},S.54]).
\stoptext

Many thanks
Uschi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: vim syntax highlighting bug?

2024-01-08 Thread Vincent Hennebert
I was in touch with the maintainer of the context.vim syntax file about 
this. It turns out to be an issue with the lua.vim file that is included 
in the context one. Lua.vim highlights trailing parentheses as errors, 
but that’s done in a way that doesn’t work well when the file is 
included by other syntax files. It somehow steals the syntax context and 
makes Vim stay in Lua mode when it should go back to ConTeXt mode (I’m 
not too savvy of the details).


The maintainer came up with a workaround [1] to force returning to 
ConTeXt mode, although the parenthesis remains highlighted as an error.


That highlight bothers me, so my own workaround is to copy the lua.vim 
file in my own .vim/syntax folder and comment out the ‘syn match 
luaParenError ")"’ line (l.61 in my Vim version).


Maybe playing with the ‘contained’ keyword (in lua.vim) could lead to a 
proper solution, but I’m happy enough with my workaround that I haven’t 
felt the need to investigate this issue any further.


Hope that helps,
Vincent

[1] https://github.com/vim/vim/pull/13778

On 06/01/2024 12:28, Damien Thiriet via ntg-context wrote:

Hello,


Happy New Year!

I got into a bug in my Vim syntax highlighting version.
Highlight stays in lua mode after ctxlua macro is closed.
Here is a MWE, where «this should not be highlitghted as
a comment indeed is.

\starttext

Hello!
\ctxlua{context("does the parser work?")}

-- this should not be highlighted as a comment

\stoptext

Do other Vim users come into this?
Is my syntax file outdated?

I am using this Vim version on OpenBSD 7.3 -stable:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep  6 2023 08:55:14)
Included patches: 1-1876

Best regards,

Damien Thiriet
___
If your question is of interest to others as well, please add an entry 
to the Wiki!


maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl

webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Metapost: draw only subpath; changing thickness of line

2024-01-06 Thread Emanuel Han via ntg-context
Hi Taco,

thanks for your help. This works for me!
On Jan. 5 2024, at 2:13 pm, Taco Hoekwater  wrote:
> Hi,
>
> Here is 'a' way to draw the subpath, at least. I do not have time to come up 
> with a nice “thicker in the middle” solution.
> Best wishes,
> Taco
>
>
> \startMPcode
> numeric u; u=1cm;
> %equiangular spiral
> numeric a, k ;
> a = 2.3; %scaling factor
> k = 8.61722335;
> path S;
> S = right for t=1 upto 360: .. a ** (t/50.2) * dir (-k*t) endfor;
> draw S;
>
> z1 = 8 dir -14;
> path A; A = origin -- z1 scaled 0.7u ;% draw A;
> pair AEndPoint; AEndPoint = point 1 of A;
> pair gong[], times; numeric n; n = 0;
> numeric gongtimes[]; % new
> for i = 1 upto length(A):
> for j = 1 upto length(S):
> times := subpath (i-1,i) of A intersectiontimes subpath (j-1,j) of S;
> if xpart times > -1:
> gong[incr n] = 1[point xpart times of subpath (i-1,i) of A,
> point ypart times of subpath (j-1,j) of S];
> gongtimes[n] = j-1 + ypart times; % new
> fi
> endfor
> endfor
>
> % new
> path H; H = subpath(gongtimes[6],gongtimes[7]) of S;
> lH = length(H);
> for i = 1 upto 100:
> draw (subpath((i-1)/100*lH, i/100* lH) of H) withcolor red withpen (pencircle 
> scaled(abs(abs(i-50)-50)/10)) ;
> endfor;
>
> \stopMPcode
>
> > On 5 Jan 2024, at 09:56, Emanuel Han via ntg-context  
> > wrote:
> >
> > Hi all,
> >
> > I have this MWE. Now I want to draw only the subpath of S between gong6 and 
> > gong7 with a red line which is narrower at the two ends and thicker in the 
> > middle part. How to achieve this?
> >
> > Thanks!
> > Emanuel
> >
> > \setuppapersize[A4,landscape]
> >
> > \starttext
> >
> > \startMPcode
> > numeric u; u=1cm;
> > %equiangular spiral
> > numeric a, k ;
> > a = 2.3; %scaling factor
> > k = 8.61722335;
> > path S;
> > S = right for t=1 upto 360: .. a ** (t/50.2) * dir (-k*t) endfor;
> > draw S;
> >
> > z1 = 8 dir -14;
> > path A; A = origin -- z1 scaled 0.7u ; draw A;
> > pair AEndPoint; AEndPoint = point 1 of A;
> > pair gong[], times; numeric n; n = 0;
> > for i = 1 upto length(A):
> > for j = 1 upto length(S):
> > times := subpath (i-1,i) of A intersectiontimes subpath (j-1,j) of S;
> > if xpart times > -1:
> > gong[incr n] = 1/2[point xpart times of subpath (i-1,i) of A,
> > point ypart times of subpath (j-1,j) of S];
> > fi
> > endfor
> > endfor
> >
> > dotlabel.rt ("$gong6$", gong6);
> > dotlabel.rt ("$gong7$", gong7);
> >
> > %Now I want to draw only the subpath of S between gong6 and gong7 with a 
> > red line which is narrower at the two ends and thicker in the middle part
> >
> > \stopMPcode
> >
> > \stoptext
> > ___
> > If your question is of interest to others as well, please add an entry to 
> > the Wiki!
> >
> > maillist : ntg-context@ntg.nl / 
> > https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> > webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> > archive : https://github.com/contextgarden/context
> > wiki : https://wiki.contextgarden.net
> > ___
>
> —
> Taco Hoekwater E: t...@bittext.nl
> genderfluid (all pronouns)
>

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: multipage metapost output from ConTeXt

2024-01-06 Thread Emanuel Han via ntg-context
Hi Mikael,

with the solution provided by you, I could work on my graphic which grows from 
page to page. So far I have already 28 pages. Now I would like to go back to 
the summed graphic of p1 to p21 and add the coming p29, p30 etc. to only that 
(that means contents of p22 to p28 should not be visible on pages 29 and 
forward).
I don't bother you with my code which is too long. Let's use the mwe provided 
by you (I added it here for convenience), where we have 3 pages. How can I have 
the content of p2 not be added on page 3 and forward?
\startuseMPgraphic{base}
picture p[];
path TheFrame ;
TheFrame := fullsquare scaled 5in ;
z1 = (60,40);
z2 = (40,90);
z3 = (10,70);

p1:=image(
label("Word 1", z1);
);

p2:=image(
label("Mot 2", z2);
);

p3:=image(
label("Parola 3", z3);
);

\stopuseMPgraphic
\starttext
\dorecurse{3}{ % Frame
\startMPpage[pagestate=start]
\includeMPgraphic{base}
currentime := #1 ;
% Just for learning :
draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
draw textext("T="(currentime)) scaled 2 shifted(0,2in)
withcolor magenta ;
for k=1 upto currentime: addto currentpicture also p[k]; endfor
setbounds currentpicture to TheFrame ;

desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
currentpicture := currentpicture xysized (desiredformat ,desiredformat );
\stopMPpage
}

\stoptext
On Dez. 2 2023, at 7:46 pm, Mikael Sundqvist  wrote:
> Hi,
>
> I don't know if \startMPinclusions \stopMPinclusions shall work with
> \startMPpage and \stopMPpage. In this case, one can use a separate
> graphics:
>
> \startuseMPgraphic{base}
> picture p[];
> path TheFrame ;
> TheFrame := fullsquare scaled 5in ;
> z1 = (60,40);
> z2 = (40,90);
> z3 = (10,70);
>
> p1:=image(
> label("Word 1", z1);
> );
>
> p2:=image(
> label("Mot 2", z2);
> );
>
> p3:=image(
> label("Parola 3", z3);
> );
>
> \stopuseMPgraphic
> \starttext
> \dorecurse{3}{ % Frame
> \startMPpage[pagestate=start]
> \includeMPgraphic{base}
> currentime := #1 ;
> % Just for learning :
> draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
> draw textext("T="(currentime)) scaled 2 shifted(0,2in)
> withcolor magenta ;
> for k=1 upto currentime: addto currentpicture also p[k]; endfor
> setbounds currentpicture to TheFrame ;
>
> desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
> currentpicture := currentpicture xysized (desiredformat ,desiredformat );
> \stopMPpage
> }
>
> \stoptext
> /Mikael
> On Sat, Dec 2, 2023 at 6:14 PM Emanuel Han via ntg-context
>  wrote:
> >
> > Hi Mikael,
> >
> > here's a very simple mwe for the label(textext()) issue. On page 1, the 
> > text "Word 1" should be drawn in position z1. On page 2, the same text in 
> > the same position should be visible, and the text "Mot 2" in position p2 
> > should be added. And so on.
> >
> > \startMPinclusions
> >
> > picture p[];
> > path TheFrame ;
> > TheFrame := fullsquare scaled 5in ;
> >
> > z1 = (60,40);
> > z2 = (40,90);
> > z3 = (10,70);
> >
> > p1:=image(
> > label(textext("Word 1"), z1);
> > );
> >
> > p2:=image(
> > label(textext("Mot 2"), z2);
> > );
> >
> > p3:=image(
> > label(textext("Parola 3"), z3);
> > );
> >
> > \stopMPinclusions
> >
> > \starttext
> >
> > \dorecurse{3}{ % Frame
> > \startMPpage[pagestate=start]
> > currentime := #1 ;
> > % Just for learning :
> > draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
> > draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> > magenta ;
> > for k=1 upto currentime: draw p[k]; endfor
> > setbounds currentpicture to TheFrame ;
> >
> > desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
> > currentpicture := currentpicture xysized (desiredformat ,desiredformat );
> >
> > \stopMPpage
> > }
> >
> > \stoptext
> >
> > On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist  wrote:
> >
> > Hi Emanuel,
> >
> > I am not sure I understand your question, and since you use fonts that
> > i do not have, I cannot test your example as is. But, maybe, if you
> > want to redraw a picture, you can do
> >
> > addto currentpicture also p1;
> >
> > where you want it.
> >
> > /Mikael
> >
> > PS For the text thing, I did not get it. Could one have a _very
> > simple_ example showing only that problem and no other problem?
> >
> > On Sat, Dec 2, 2

[NTG-context] Re: vim syntax highlighting bug?

2024-01-06 Thread Christian Prim via ntg-context
Hello

on my installation, it's working:
[image: image.png]
But I'm on an old version on debian:
VIM - Vi IMproved 8.2 (2019 Dec 12 kompiliert am Oct 01 2021 01:51:08)
Inklusive der Patches: 1-2434
Extra Patches: 8.2.3402, 8.2.3403, 8.2.3409, 8.2.3428

Perhaps something has changed in version 9.0...

Hope it helps

Christian

Am Sa., 6. Jan. 2024 um 13:04 Uhr schrieb Damien Thiriet via ntg-context <
ntg-context@ntg.nl>:

> Hello,
>
>
> Happy New Year!
>
> I got into a bug in my Vim syntax highlighting version.
> Highlight stays in lua mode after ctxlua macro is closed.
> Here is a MWE, where «this should not be highlitghted as
> a comment indeed is.
>
> \starttext
>
> Hello!
> \ctxlua{context("does the parser work?")}
>
> -- this should not be highlighted as a comment
>
> \stoptext
>
> Do other Vim users come into this?
> Is my syntax file outdated?
>
> I am using this Vim version on OpenBSD 7.3 -stable:
> VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep  6 2023 08:55:14)
> Included patches: 1-1876
>
> Best regards,
>
> Damien Thiriet
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] vim syntax highlighting bug?

2024-01-06 Thread Damien Thiriet via ntg-context

Hello,


Happy New Year!

I got into a bug in my Vim syntax highlighting version.
Highlight stays in lua mode after ctxlua macro is closed.
Here is a MWE, where «this should not be highlitghted as
a comment indeed is.

\starttext

Hello!
\ctxlua{context("does the parser work?")}

-- this should not be highlighted as a comment

\stoptext

Do other Vim users come into this?
Is my syntax file outdated?

I am using this Vim version on OpenBSD 7.3 -stable:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep  6 2023 08:55:14)
Included patches: 1-1876

Best regards,

Damien Thiriet
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Question to a formular

2024-01-05 Thread Ursula Hermann
Dear Aditya,


Many thanks for your help.


Uschi


Von: Aditya Mahajan 
Gesendet: Freitag, 5. Jänner 2024 15:20:46
An: mailing list for ConTeXt users
Betreff: [NTG-context] Re: Question to a formular

On Fri, 5 Jan 2024, Ursula Hermann wrote:

> Dear list,
>
>
> I have this formular, but no idea , how to write it in Context. This is a 
> formular  with  factorial.
>
>
> 0! := 1
> (n + 1)! := (n + 1) n!
>
> Can someone help me please?

\starttext
\startformula \startalign
  \NC 0! \NC \colonequals 1 \NR
  \NC (n+1)! \NC \colonequals (n+1) n! \NR
\stopalign \stopformula
\stoptext

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Question to a formular

2024-01-05 Thread Aditya Mahajan
On Fri, 5 Jan 2024, Ursula Hermann wrote:

> Dear list,
> 
> 
> I have this formular, but no idea , how to write it in Context. This is a 
> formular  with  factorial.
> 
> 
> 0! := 1
> (n + 1)! := (n + 1) n!
> 
> Can someone help me please?

\starttext
\startformula \startalign
  \NC 0! \NC \colonequals 1 \NR
  \NC (n+1)! \NC \colonequals (n+1) n! \NR
\stopalign \stopformula
\stoptext

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Metapost: draw only subpath; changing thickness of line

2024-01-05 Thread Taco Hoekwater
Hi,

Here is 'a' way to draw the subpath, at least. I do not have time to come up 
with a nice “thicker in the middle” solution.

Best wishes,
Taco


\startMPcode
numeric u; u=1cm;
%equiangular spiral
numeric a, k ;
a = 2.3; %scaling factor
k = 8.61722335;
path S;
S = right for t=1 upto 360: .. a ** (t/50.2) * dir (-k*t) endfor;
draw S;

z1 = 8 dir -14;
path A; A = origin -- z1 scaled 0.7u ;%  draw A;
pair AEndPoint; AEndPoint = point 1 of A;
pair gong[], times; numeric n; n = 0;
numeric gongtimes[]; % new
for i = 1 upto length(A):
 for j = 1 upto length(S):
   times := subpath (i-1,i) of A intersectiontimes subpath (j-1,j) of S;
   if xpart times > -1:
 gong[incr n] = 1[point xpart times of subpath (i-1,i) of A,
 point ypart times of subpath (j-1,j) of S];
 gongtimes[n] = j-1 + ypart times;  % new
  fi
 endfor
endfor

% new
path H; H = subpath(gongtimes[6],gongtimes[7]) of S;
lH = length(H);
for i = 1 upto 100:
draw (subpath((i-1)/100*lH, i/100* lH) of H) withcolor red  withpen 
(pencircle scaled(abs(abs(i-50)-50)/10)) ;
endfor;

\stopMPcode


> On 5 Jan 2024, at 09:56, Emanuel Han via ntg-context  
> wrote:
> 
> Hi all, 
> 
> I have this MWE. Now I want to draw only the subpath of S between gong6 and 
> gong7 with a red line which is narrower at the two ends and thicker in the 
> middle part. How to achieve this?
> 
> Thanks!
> Emanuel
> 
> \setuppapersize[A4,landscape]
> 
> \starttext
> 
> \startMPcode
> numeric u; u=1cm;
> %equiangular spiral
> numeric a, k ; 
> a = 2.3; %scaling factor
> k = 8.61722335; 
> path S; 
> S = right for t=1 upto 360: .. a ** (t/50.2) * dir (-k*t) endfor;
> draw S;
> 
> z1 = 8 dir -14;
> path A; A = origin -- z1 scaled 0.7u ; draw A;
> pair AEndPoint; AEndPoint = point 1 of A;
> pair gong[], times; numeric n; n = 0;
> for i = 1 upto length(A):
>  for j = 1 upto length(S):
>times := subpath (i-1,i) of A intersectiontimes subpath (j-1,j) of S;
>if xpart times > -1:
>  gong[incr n] = 1/2[point xpart times of subpath (i-1,i) of A,
>  point ypart times of subpath (j-1,j) of S];
>   fi 
>  endfor
> endfor
> 
> dotlabel.rt ("$gong6$", gong6);
> dotlabel.rt ("$gong7$", gong7);
> 
> %Now I want to draw only the subpath of S between gong6 and gong7 with a red 
> line which is narrower at the two ends and thicker in the middle part
> 
> \stopMPcode
> 
> \stoptext
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___

— 
Taco Hoekwater  E: t...@bittext.nl
genderfluid (all pronouns)


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Metapost: draw only subpath; changing thickness of line

2024-01-05 Thread Emanuel Han via ntg-context
Hi all,

I have this MWE. Now I want to draw only the subpath of S between gong6 and 
gong7 with a red line which is narrower at the two ends and thicker in the 
middle part. How to achieve this?
Thanks!
Emanuel

\setuppapersize[A4,landscape]
\starttext
\startMPcode
numeric u; u=1cm;
%equiangular spiral
numeric a, k ;
a = 2.3; %scaling factor
k = 8.61722335;
path S;
S = right for t=1 upto 360: .. a ** (t/50.2) * dir (-k*t) endfor;
draw S;

z1 = 8 dir -14;
path A; A = origin -- z1 scaled 0.7u ; draw A;
pair AEndPoint; AEndPoint = point 1 of A;
pair gong[], times; numeric n; n = 0;
for i = 1 upto length(A):
for j = 1 upto length(S):
times := subpath (i-1,i) of A intersectiontimes subpath (j-1,j) of S;
if xpart times > -1:
gong[incr n] = 1/2[point xpart times of subpath (i-1,i) of A,
point ypart times of subpath (j-1,j) of S];
fi
endfor
endfor

dotlabel.rt ("$gong6$", gong6);
dotlabel.rt ("$gong7$", gong7);

%Now I want to draw only the subpath of S between gong6 and gong7 with a red 
line which is narrower at the two ends and thicker in the middle part
\stopMPcode
\stoptext___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Local alternative to \input

2024-01-04 Thread Henning Hraban Ramm

Am 04.01.24 um 18:00 schrieb Jeroen:
I just would like to have a lot of mark-up for combined figures and 
tables etc moved out of the way, similar to this. I am loosing the 
general documetn flow because of all this markup. Would there be a 
construction similar to this:


\starttext

\environment foo
\environment bar

\startenvironment foo
this is a lot of text
\stopenvironment

\startenvironment bar
and this is another piece of text
\stopenvironment

\stoptext


An environment is a separate file.
\environment is like \input with a few more checks, e.g. it loads the 
file only once.


e.g.

-- file "env_foo.tex" --
\startenvironment env_foo
% settings
\stopenvironment
--


-- file document.tex --
\environment env_foo

\starttext
% whatever
\stoptext
--

Instead of the call within your document, you can also call

context --environment=env_foo.tex document

(Usually that makes only sense in XML workflows.)

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Status of Asymptote

2024-01-03 Thread Jeroen
Below is how I have used Asymptote in the past with the Context filter 
module:


download portable ghostsctipt
create dir c:\context\ghostscript and install from 
https://portableapps.com/apps/utilities/ghostscript_portable


download non-portable asymptote
create dir c:\context\asymptote and install from 
http://asymptote.sourceforge.net/


create file c:\context\asy.bat with context
ASYMPTOTE_GS=C:context/ghostscript/bin/gswin64.exe
C:/context/asymptote/asy.exe %*

test with:

\usemodule[filter]

\defineexternalfilter[ASY]
   [filter={/context/asy.bat -tex context -outformat pdf
    -outname \externalfilteroutputfile},
    output=\externalfilterbasefile.pdf,
    cache=yes,
    readcommand=\ReadImage,]

\define[1]\ReadImage{\externalfigure[#1]}

\starttext
   Testing if we can include an asymptote image
   \startplacefigure[location={here}, title={An Asymptote figure}]
 \startASY
   size(10cm);
   import graph;
   real f(real x) {return sin(x);}
   draw(graph(f,-3,3,300),blue);
 \stopASY
   \stopplacefigure
\stoptext


OR alternatively:


\usemodule[filter]

\defineexternalfilter[ASY]
   [filter={/context/asy.bat -tex context -outformat pdf
    -outname \externalfilteroutputfile},
    output=\externalfilterbasefile.pdf,
    cache=yes,
    readcommand=\ReadImage,]

\define[1]\ReadImage{\externalfigure[#1]}

\starttext
   Testing if we can include an asymptote image
   \startplacefigure[location={here}, title={An Asymptote figure}]
 \startASY
   unitsize(1cm);
   draw((-.1,0) -- (2,0), arrow=Arrow(TeXHead));
   draw((0,-.1) -- (0,2), arrow=Arrow(TeXHead));
   draw((0,0) .. (1,1) .. (2,sqrt(2)));
 \stopASY
   \stopplacefigure
\stoptext

Op 31/12/2023 om 00:33 schreef Aditya Mahajan:

On Sun, 31 Dec 2023, Shiv Shankar Dayal wrote:


It would be nice to either support Metapost 3D or Asymptote. Right now I
generate images separately and embed them in PDF using externalfigure command 
which works but I have to maintain all the graphics separately.

It is possible to obtain simple integration for asymptote using the filter 
module:

   https://github.com/adityam/filter

Using that you could define an asymptote environment so that:

\startbuffer[asymptote-preamble]

\stopbuffer

\starttext

\startasymptote
% Asymptote figure
\stopasymptote

\stoptext

saves the content of the asymptote-preamble and the figure in a separate file, 
runs asymptote to generate a PDF figure and includes the figure. The results 
are cached so the asymptote is re-run only if the content of the figure 
environment changes.

A drawback of this approach is that the labels are generated by asymptote. That 
means that the font, colors, and any macros needed for the figures need to be 
redefined at both context and asymptote end.

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Status of Asymptote

2023-12-30 Thread Aditya Mahajan
On Sun, 31 Dec 2023, Shiv Shankar Dayal wrote:

> It would be nice to either support Metapost 3D or Asymptote. Right now I
> generate images separately and embed them in PDF using externalfigure command 
> which works but I have to maintain all the graphics separately.

It is possible to obtain simple integration for asymptote using the filter 
module:

  https://github.com/adityam/filter

Using that you could define an asymptote environment so that:

\startbuffer[asymptote-preamble]

\stopbuffer

\starttext

\startasymptote
% Asymptote figure
\stopasymptote

\stoptext

saves the content of the asymptote-preamble and the figure in a separate file, 
runs asymptote to generate a PDF figure and includes the figure. The results 
are cached so the asymptote is re-run only if the content of the figure 
environment changes. 

A drawback of this approach is that the labels are generated by asymptote. That 
means that the font, colors, and any macros needed for the figures need to be 
redefined at both context and asymptote end. 

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: old style factorial symbol and theorems

2023-12-30 Thread Shiv Shankar Dayal
I tried this for old style factorial, but it appears much below the line in
which it is used. How can I bring it up?

On Wed, Dec 27, 2023 at 6:18 PM Shiv Shankar Dayal <
shivshankar.da...@gmail.com> wrote:

>
>
> A simple alternative to tikz is the usage of \framed.
>>
>> \define[1]\oldfact
>>   {\inmframed[frame=off,strut=no,leftframe=on,bottomframe=on]{#1}}
>>
>> \starttext
>>
>> \m{\oldfact{n}}
>>
>> \stoptext
>>
>> Wolfgang
>>
>> Thanks a lot. It should work nicely.
>
> --
> Respect,
> Shiv Shankar Dayal
>


-- 
Respect,
Shiv Shankar Dayal
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Question about drawing flowchart using chart module

2023-12-27 Thread Jeong Dal via ntg-context
Dear all,

I tried to draw a flow chart using the module[chart].
Following the examples, I draw one.

The problem is that the size of the chart is not changed even though I changed 
the numbers dx,dy, width, height, and maxwidth in the \setupFLOWcharts

Please tell me how to resize the chart.

Thank you.

Dalyoung

%%
\usemodule[chart]

\starttext

\startFLOWchart[bigger]
  \setupFLOWcharts
  [option=test,
   nx=3,
   ny=6,
   dx=\bodyfontsize,
   dy=\bodyfontsize,
   width=6cm,%.5\bodyfontsize,
   height=10cm,%.3\bodyfontsize,
   maxwidth=.5\textwidth
   ]

  \startFLOWcell 
\name{a} \location{2,1} \shape{loop} \text{start}  
\connection[bt]{b}
  \stopFLOWcell
  \startFLOWcell 
\name{b} \location{2,2} \shape{79} \text{input $a,b$} 
\connection[bt]{c} 
  \stopFLOWcell
  \startFLOWcell 
\name{c} \location{2,3} \shape{decision} \text{$a-b > 0$}  
\connection[lt]{d}  \comment[l]{Yes}
\connection[rt]{g}  \comment[r]{No}
  \stopFLOWcell
  \startFLOWcell 
\name{d} \location{1,5} \shape{76} \text{$a$ is bigger \\ than $b$} 
 
\connection[bt]{f}
  \stopFLOWcell
  \startFLOWcell 
\name{e} \location{2,5} \shape{76} \text{$b$ is bigger \\ than $a$} 
 
\connection[bt]{f}
  \stopFLOWcell
  \startFLOWcell 
\name{g} \location{3,4} \shape{decision} \text{$a - b < 0$}  
\connection[lt]{e}\comment[l]{Yes}
\connection[bt]{h}\comment[b]{No}
  \stopFLOWcell
  \startFLOWcell 
\name{h} \location{3,5} \shape{76} \text{$a$ is equal \\ to $b$}  
\connection[bt]{f}
  \stopFLOWcell
  \startFLOWcell 
\name{f} \location{2,6} \shape{loop} \text{stop}  
  \stopFLOWcell
\stopFLOWchart

\placefigure
  [here][fig:bigger]
  {Which is bigger?}
  {\tx\setupFLOWcharts\FLOWchart[bigger]}

\stoptext___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: old style factorial symbol and theorems

2023-12-27 Thread Mikael Sundqvist
Hi!

Not by computer, and I'm sure Hans (or Wolfgang) has already shown a way to
do the old factorial with the actuarian mechanism when I'm back to the
computer...

/Mikael

Den ons 27 dec. 2023 13:49Shiv Shankar Dayal 
skrev:

>
>
> A simple alternative to tikz is the usage of \framed.
>>
>> \define[1]\oldfact
>>   {\inmframed[frame=off,strut=no,leftframe=on,bottomframe=on]{#1}}
>>
>> \starttext
>>
>> \m{\oldfact{n}}
>>
>> \stoptext
>>
>> Wolfgang
>>
>> Thanks a lot. It should work nicely.
>
> --
> Respect,
> Shiv Shankar Dayal
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: old style factorial symbol and theorems

2023-12-27 Thread Shiv Shankar Dayal
A simple alternative to tikz is the usage of \framed.
>
> \define[1]\oldfact
>   {\inmframed[frame=off,strut=no,leftframe=on,bottomframe=on]{#1}}
>
> \starttext
>
> \m{\oldfact{n}}
>
> \stoptext
>
> Wolfgang
>
> Thanks a lot. It should work nicely.

-- 
Respect,
Shiv Shankar Dayal
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: old style factorial symbol and theorems

2023-12-27 Thread Wolfgang Schuster

Shiv Shankar Dayal schrieb am 27.12.2023 um 13:31:


What do you expect here to pass as argument to the oldfact command?

I will pass something like n, 5, 10 etc.


A simple alternative to tikz is the usage of \framed.

\define[1]\oldfact
  {\inmframed[frame=off,strut=no,leftframe=on,bottomframe=on]{#1}}

\starttext

\m{\oldfact{n}}

\stoptext

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: old style factorial symbol and theorems

2023-12-27 Thread Shiv Shankar Dayal
What do you expect here to pass as argument to the oldfact command?
>
I will pass something like n, 5, 10 etc.

>
> This works here:
>
> \defineenumeration
>   [proof]
>   [closesymbol={\mathematics{\square}}]
>
> \starttext
>
> \startproof
> \samplefile{lorem}
> \stopproof
>
> \stoptext
>

Thanks. I will test this again.
-- 
Respect,
Shiv Shankar Dayal
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: old style factorial symbol and theorems

2023-12-27 Thread Wolfgang Schuster

Shiv Shankar Dayal schrieb am 27.12.2023 um 13:19:

I use following in Latex to generate old factorial symbol:

\newcommand{\oldfact}[1]{%
\tikz[baseline]{\node[anchor=base,inner 
sep=0.3ex](mynode){\ensuremath{#1}};\draw(mynode.north 
west)--(mynode.south west)--(mynode.south east);\path[use as bounding 
box]($(mynode.south west)+(-0.3ex,-0.3ex)$)rectangle($(mynode.north 
east)+(0.3ex,0.3ex)$);}

}


What do you expect here to pass as argument to the oldfact command?

But I do not know how to make it work in ConTeXt as I am not very 
familiar with ConTeXt.


If you see https://www.ntg.nl/maps/36/09.pdf page no. 28 then proof is 
defined as


\defineenumeration
[proof]
[ text=Proof,
number=no,
headstyle=italic,
title=no, %this is the default
closesymbol={\mathematics{\square}},
style=normal]

But the closessymbol does not work.

I will create a minimum working example and post it as soon as possible.


This works here:

\defineenumeration
  [proof]
  [closesymbol={\mathematics{\square}}]

\starttext

\startproof
\samplefile{lorem}
\stopproof

\stoptext

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: error: Control sequence expected instead of undefined

2023-12-25 Thread Willi Egger
Hello,

I just copied your example code and run it on version 2023-09-26. It compiled 
just fine. 

Cheers

Willi

> On 25 Dec 2023, at 16:09, Jeong Dal via ntg-context  
> wrote:
> 
> Hi,
> 
> I got an error message as following:
> 
> Control sequence expected instead of undefined
> 
> If I comment out the “\externalfigure[][]” line, then there is no error 
> message.
> 
> I don’t know what is wrong in the sample code.
> Please check the code.
> 
> Thank you for reading.
> 
> Best regards,
> 
> Dalyoung
> 
> %%%*
> \starttext
> \in{figure}[fig:kruskal1] is my point.
> 
> \startplacefigure[location=,reference=fig:kruskal1,title={}]
> \externalfigure[cow][width=.5\makeupwidth]
> \stopplacefigure
> \stoptext
> %
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] error: Control sequence expected instead of undefined

2023-12-25 Thread Jeong Dal via ntg-context
Hi,

I got an error message as following:

Control sequence expected instead of undefined

If I comment out the “\externalfigure[][]” line, then there is no error message.

I don’t know what is wrong in the sample code.
Please check the code.

Thank you for reading.

Best regards,

Dalyoung

%%%*
\starttext
\in{figure}[fig:kruskal1] is my point.

\startplacefigure[location=,reference=fig:kruskal1,title={}]
\externalfigure[cow][width=.5\makeupwidth]
\stopplacefigure
\stoptext
%___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \setupsynonyms textstyle=cap failing

2023-12-24 Thread Wolfgang Schuster

Garulfo schrieb am 23.12.2023 um 12:41:

Hi all,

the following  minimum working example is properly typesetted with 
textstyle=bold,

but it fails with textstyle=cap (ConTeXt version : 2023.09.26 18:19)

A number should have been here; I inserted '0'. (If you can't figure 
out why I
needed to see a number, look up 'weird error' in the index to The 
TeXbook.)

mtx-context | fatal error: return code: 1

It works on https://context-on-web.eu (ConTeXt version : 2022.12.22 22:17)


\definesynonyms    [abbreviation] [abbreviations] [\AbbreviationsFull]
\setupsynonyms [abbreviation] [textstyle=bold]

\starttext

\contextversion
\abbreviation{NTG}{Nederlandstalige TeX Gebruikersgroep}

Test 1 : \NTG .

Test 2 : \AbbreviationsFull{NTG}.

\stoptext

Any clue ?


Hans made changes on the capitals mode and now the following two lines 
have to be added to typo-cap.mkxl on line 52 and 53.


\definecapitals[\v!cap] [\v!capital]
\definecapitals[\v!Cap] [\v!Capital]

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \setupsynonyms textstyle=cap failing

2023-12-23 Thread Bruce Horrocks


> On 23 Dec 2023, at 11:41, Garulfo  wrote:
> 
> Hi all,
> 
> the following  minimum working example is properly typesetted with 
> textstyle=bold,
> but it fails with textstyle=cap (ConTeXt version : 2023.09.26 18:19)
> 
> A number should have been here; I inserted '0'. (If you can't figure out why 
> I 
> needed to see a number, look up 'weird error' in the index to The TeXbook.) 
> mtx-context | fatal error: return code: 1
> 
> It works on https://context-on-web.eu (ConTeXt version : 2022.12.22 22:17)
> 
> 
> \definesynonyms[abbreviation] [abbreviations] [\AbbreviationsFull]
> \setupsynonyms [abbreviation] [textstyle=bold]
> 
> \starttext
> 
> \contextversion
> \abbreviation{NTG}{Nederlandstalige TeX Gebruikersgroep}
> 
> Test 1 : \NTG .
> 
> Test 2 : \AbbreviationsFull{NTG}.
> 
> \stoptext

I'm not sure why textstyle=cap fails but textstyle=sc works. However 
textstyle=\cap (i.e. as a command) works. Also \abbreviation is already defined 
so you don't need to define it again. Thus your MWE becomes:

%\definesynonyms[abbreviation] [abbreviations] [\AbbreviationsFull]
\setupsynonyms [abbreviation] [textstyle=\cap]

\starttext

\contextversion
\abbreviation{NTG}{Nederlandstalige TeX Gebruikersgroep}

Test 1 : \NTG .

Test 2 : \infull{NTG} %\AbbreviationsFull{NTG}.

\stoptext

—
Bruce Horrocks
Hampshire, UK

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] \setupsynonyms textstyle=cap failing

2023-12-23 Thread Garulfo

Hi all,

the following  minimum working example is properly typesetted with 
textstyle=bold,

but it fails with textstyle=cap (ConTeXt version : 2023.09.26 18:19)

A number should have been here; I inserted '0'. (If you can't figure out 
why I

needed to see a number, look up 'weird error' in the index to The TeXbook.)
mtx-context | fatal error: return code: 1

It works on https://context-on-web.eu (ConTeXt version : 2022.12.22 22:17)


\definesynonyms    [abbreviation] [abbreviations] [\AbbreviationsFull]
\setupsynonyms [abbreviation] [textstyle=bold]

\starttext

\contextversion
\abbreviation{NTG}{Nederlandstalige TeX Gebruikersgroep}

Test 1 : \NTG .

Test 2 : \AbbreviationsFull{NTG}.

\stoptext




Any clue ?___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: QR Code

2023-12-21 Thread Ursula Hermann
\Program Files\MiKTeX 2.9\miktex\bin\yap.exe

  TeX-Bin (TeX.exe): OK*
C:\Program Files\MiKTeX 2.9\miktex\bin\tex.exe
  TeX-Bin (LaTeX.exe): OK*
C:\Program Files\MiKTeX 2.9\miktex\bin\latex.exe
  TeX-Bin (PDFTeX.exe): OK*
C:\Program Files\MiKTeX 2.9\miktex\bin\pdftex.exe
  TeX-Bin (PDFLaTeX.exe): OK*
C:\Program Files\MiKTeX 2.9\miktex\bin\pdflatex.exe
  TeX-Bin (BibTeX.exe): OK*
C:\Program Files\MiKTeX 2.9\miktex\bin\bibtex.exe
  TeX-Bin (dvips.exe): OK*
C:\Program Files\MiKTeX 2.9\miktex\bin\dvips.exe
  TeX-Bin (ps2pdf.exe): OK*
C:\Program Files\MiKTeX 2.9\miktex\bin\ps2pdf.exe
  TeX-Bin (dvipdfmx.exe): OK*
C:\Program Files\MiKTeX 2.9\miktex\bin\dvipdfmx.exe
  TeX-Bin (mf.exe): OK*
C:\Program Files\MiKTeX 2.9\miktex\bin\mf.exe
  TeX-Bin (mpost.exe): OK*
C:\Program Files\MiKTeX 2.9\miktex\bin\mpost.exe

  MiKTeX-Bin (TeXify.exe): OK*
C:\Program Files\MiKTeX 2.9\miktex\bin\texify.exe

My question is: Should I put the PATH in WinEdt or in Windows? Or in ConTeXt?


$TEXROOT/tex/texmf-$ARCH/bin/lib/luametatex/zint

Many thanks

Uschi



Von: Henning Hraban Ramm 
Gesendet: Montag, 18. Dezember 2023 20:34:15
An: ntg-context@ntg.nl
Betreff: [NTG-context] Re: QR Code

Am 18.12.23 um 17:05 schrieb Ursula Hermann:
> Dear List
> After compiling
> \usemodule[m-zint]
> \starttext
> \barcode[alternative=isbnx, text=9783865419026, width=4cm] \blank[big] 
> \barcode[alternative=qrcode, text={wie weet waar willem wever woont}, 
> width=3cm] \stoptext
>
> I got , what you see in the pdf.

Are you using MkIV (LuaTeX) or LMTX (LuaMetaTeX)?
What’s your ConTeXt version, and how did you install it? (TeX live,
Linux distribution, LMTX distribution?)

I guess a missing EPS means you load the MkIV version of the module,
probably because "m-zint".

Is there an error message with \loadmodule[zint]?

I can’t help with Windows; since Hans developed it on Windows, it should
work (but don’t ask me how).

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: QR Code

2023-12-19 Thread Ursula Hermann
Dear Hraban, 

Thank your for your mail. 

I have the latest ConTeXt version, and I have Texlive. 

Uschi 
-Ursprüngliche Nachricht-
Von: Henning Hraban Ramm  
Gesendet: Montag, 18. Dezember 2023 20:34
An: ntg-context@ntg.nl
Betreff: [NTG-context] Re: QR Code

Am 18.12.23 um 17:05 schrieb Ursula Hermann:
> Dear List
> After compiling
> \usemodule[m-zint]
> \starttext
> \barcode[alternative=isbnx, text=9783865419026, width=4cm] \blank[big] 
> \barcode[alternative=qrcode, text={wie weet waar willem wever woont}, 
> width=3cm] \stoptext
> 
> I got , what you see in the pdf.

Are you using MkIV (LuaTeX) or LMTX (LuaMetaTeX)?
What’s your ConTeXt version, and how did you install it? (TeX live, Linux 
distribution, LMTX distribution?)

I guess a missing EPS means you load the MkIV version of the module, probably 
because "m-zint".

Is there an error message with \loadmodule[zint]?

I can’t help with Windows; since Hans developed it on Windows, it should work 
(but don’t ask me how).

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) 
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: QR Code

2023-12-18 Thread Michal Vlasák
On Mon Dec 18, 2023 at 9:35 PM CET, Pablo Rodriguez via ntg-context wrote:
> On 12/18/23 20:34, Henning Hraban Ramm wrote:
> > [...]
> > Are you using MkIV (LuaTeX) or LMTX (LuaMetaTeX)?
>
> Many thanks for your reply, Hraban.
>
> I understood my issue with your reply (I known, your answer is intended
> to Uschi).
>
> It is also in the sent file:
>
>  Creator:
>LuaMetaTeX 2.10.11 20230908 + ConTeXt LMTX 2023.09.26 18:19
>  PDF Producer:
>LuaMetaTeX-2.10.11
>
> > I guess a missing EPS means you load the MkIV version of the module,
> > probably because "m-zint".
> >
> > I can’t help with Windows; since Hans developed it on Windows, it should
> > work (but don’t ask me how).
>
> I will try to explain what I understand from this (intended for Uschi).
>
> Given that there are two modules (m-zint and zint), there are two options:
>
> 1. Either you use the LMTX module (\usemodule[zint]) and you need the
> Zint library (as explained in
> https://wiki.contextgarden.net/Barcodes#Zint_module).
>
> 2. Or you use the MkIV module (\usemodule[m-zint]) and you need the Zint
> binary installed and CMD should be able to invoke it (already knowing
> its past).
>
> You may have the Zint binary installed, ConTeXt may be generating the
> required EPS files, but either Inkscape is not installed (or its path is
> unknown to the system), or ConTeXt cannot simply find where the
> converted PDF versions of the zint images are.
>
> If I have the following source in testing-barcodes.tex:
>
>   \usemodule[m-zint]
>   \starttext
>   \startTEXpage[offset=1dk]
>   \barcode[alternative=isbnx, text=9783865419026, width=4cm]
>   \stopTEXpage
>   \stoptext
>
> ConTeXt compiles it generating to extra files (when compared to the pure
> zint module for LMTX only):
>
>   zint-isbnx-fe90eda0e93cf020312eps
>   m_k_i_v_zint-isbnx-fe90eda0e93cf020312_eps_c60ccda70ef.pdf
>
> (Removed some characters in strings so file names fit in a single line.)
>
> The first file is generated by the Zint binary itself. The second one is
> the automatic conversion (through Inkscape) that ConTeXt needs to embed
> EPS (and SVG) files in the final PDF document.
>
> If m_k_i_v_zint-*.pdf files are missing, the problem might be that
> Inkscape isn’t installed (or its path is unknown to the system).
>
> If also zint-*.eps files are missing, you should find where Zint is
> generating them.

I will just add to the excellent answers above, that I very much
recommend LMTX and the LMTX way of using the zint _library_. I published
compiled versions of zint and couple of other libraries to the optional
libraries repository:

https://github.com/contextgarden/luametatex-optional-libraries

https://github.com/contextgarden/luametatex-optional-libraries/releases/tag/v20230902

I tested the steps on the wiki and libzint.dll works without problems:
i.e. install ConTeXt, create a few folders, move the dll and
mtxrun --generate.

My goto document for testing zint, that went without problems (even the
hexagons!):

\starttext
\usemodule[zint]
\barcode[alternative=isbnx, text=9783865419026, width=4cm]
\barcode[alternative=qrcode, text={https://wiki.contextgarden.net}, 
width=3cm]
\barcode[alternative=maxicode, text={test}, width=3cm]
\stoptext

Michal

PS: Coincidentally zint 2.13 has been released just today. Usually every
new zint release requires an update on the ConTeXt side, but older
releases still work well with ConTeXt (e.g. currently ConTeXt supports
2.10, 2.11 and 2.12). The version linked above works.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: QR Code

2023-12-18 Thread Pablo Rodriguez via ntg-context
On 12/18/23 20:34, Henning Hraban Ramm wrote:
> [...]
> Are you using MkIV (LuaTeX) or LMTX (LuaMetaTeX)?

Many thanks for your reply, Hraban.

I understood my issue with your reply (I known, your answer is intended
to Uschi).

It is also in the sent file:

 Creator:
   LuaMetaTeX 2.10.11 20230908 + ConTeXt LMTX 2023.09.26 18:19
 PDF Producer:
   LuaMetaTeX-2.10.11

> I guess a missing EPS means you load the MkIV version of the module,
> probably because "m-zint".
>
> I can’t help with Windows; since Hans developed it on Windows, it should
> work (but don’t ask me how).

I will try to explain what I understand from this (intended for Uschi).

Given that there are two modules (m-zint and zint), there are two options:

1. Either you use the LMTX module (\usemodule[zint]) and you need the
Zint library (as explained in
https://wiki.contextgarden.net/Barcodes#Zint_module).

2. Or you use the MkIV module (\usemodule[m-zint]) and you need the Zint
binary installed and CMD should be able to invoke it (already knowing
its past).

You may have the Zint binary installed, ConTeXt may be generating the
required EPS files, but either Inkscape is not installed (or its path is
unknown to the system), or ConTeXt cannot simply find where the
converted PDF versions of the zint images are.

If I have the following source in testing-barcodes.tex:

  \usemodule[m-zint]
  \starttext
  \startTEXpage[offset=1dk]
  \barcode[alternative=isbnx, text=9783865419026, width=4cm]
  \stopTEXpage
  \stoptext

ConTeXt compiles it generating to extra files (when compared to the pure
zint module for LMTX only):

  zint-isbnx-fe90eda0e93cf020312eps
  m_k_i_v_zint-isbnx-fe90eda0e93cf020312_eps_c60ccda70ef.pdf

(Removed some characters in strings so file names fit in a single line.)

The first file is generated by the Zint binary itself. The second one is
the automatic conversion (through Inkscape) that ConTeXt needs to embed
EPS (and SVG) files in the final PDF document.

If m_k_i_v_zint-*.pdf files are missing, the problem might be that
Inkscape isn’t installed (or its path is unknown to the system).

If also zint-*.eps files are missing, you should find where Zint is
generating them.

Just in case it might help,

Pablo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: QR Code

2023-12-18 Thread Henning Hraban Ramm

Am 18.12.23 um 17:05 schrieb Ursula Hermann:

Dear List
After compiling
\usemodule[m-zint]
\starttext
\barcode[alternative=isbnx, text=9783865419026, width=4cm] \blank[big] 
\barcode[alternative=qrcode, text={wie weet waar willem wever woont}, 
width=3cm] \stoptext

I got , what you see in the pdf.


Are you using MkIV (LuaTeX) or LMTX (LuaMetaTeX)?
What’s your ConTeXt version, and how did you install it? (TeX live, 
Linux distribution, LMTX distribution?)


I guess a missing EPS means you load the MkIV version of the module, 
probably because "m-zint".


Is there an error message with \loadmodule[zint]?

I can’t help with Windows; since Hans developed it on Windows, it should 
work (but don’t ask me how).


Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: QR Code

2023-12-18 Thread vm via ntg-context



On 18/12/2023 17:05, Ursula Hermann wrote:

After compiling
\usemodule[m-zint]
\starttext
\barcode[alternative=isbnx, text=9783865419026, width=4cm] \blank[big]
\barcode[alternative=qrcode, text={wie weet waar willem wever woont},
width=3cm] \stoptext

I got , what you see in the pdf.

context 43.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: QR Code

2023-12-18 Thread Ursula Hermann
Dear List
After compiling 
\usemodule[m-zint]
\starttext
\barcode[alternative=isbnx, text=9783865419026, width=4cm] \blank[big] 
\barcode[alternative=qrcode, text={wie weet waar willem wever woont}, 
width=3cm] \stoptext

I got , what you see in the pdf. 

Many Thanks
Uschi 

-Ursprüngliche Nachricht-
Von: vm via ntg-context  
Gesendet: Montag, 18. Dezember 2023 16:15
An: ntg-context@ntg.nl
Cc: vm 
Betreff: [NTG-context] Re: QR Code



On 18/12/2023 15:13, Ursula Hermann wrote:
>> Dear  List
>>
>> I was interested how it works.
>>
>> So I started this example.
>>
>> \starttext
>>
>> \usemodule[m-zint]
>>
>> \barcode[alternative=isbnx, text=9783865419026, width=4cm]
>>
>> \barcode[alternative=qrcode, text={https://wiki.contextgarden.net},
>> width=3cm]
>>
>> \stoptext
>>
>> Is that the right way?
> just \usemodule[zint]


For what it is worth, the [zint] variant does not work on my linux platform, 
the [m-zint] does work correctly.

\usemodule[m-zint]
\starttext
\barcode[alternative=isbnx, text=9783865419026, width=4cm] \blank[big] 
\barcode[alternative=qrcode, text={wie weet waar willem wever woont}, 
width=3cm] \stoptext


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


Barcode.pdf
Description: Barcode.pdf
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: QR Code

2023-12-18 Thread vm via ntg-context



On 18/12/2023 15:13, Ursula Hermann wrote:

Dear  List

I was interested how it works.

So I started this example.

\starttext

\usemodule[m-zint]

\barcode[alternative=isbnx, text=9783865419026, width=4cm]

\barcode[alternative=qrcode, text={https://wiki.contextgarden.net},
width=3cm]

\stoptext

Is that the right way?

just \usemodule[zint]



For what it is worth, the [zint] variant does not work on my linux 
platform, the [m-zint] does work correctly.


\usemodule[m-zint]
\starttext
\barcode[alternative=isbnx, text=9783865419026, width=4cm]
\blank[big]
\barcode[alternative=qrcode, text={wie weet waar willem wever woont}, 
width=3cm]

\stoptext


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: QR Code

2023-12-18 Thread Ursula Hermann
Dear Henning, 

I have downloaded Zint in Windows. Yes, I saw it, but I'm not sure where to 
write this file. I have WinEdt 11. 

Many thanks 
Uschi 

-Ursprüngliche Nachricht-
Von: Henning Hraban Ramm  
Gesendet: Montag, 18. Dezember 2023 13:26
An: ntg-context@ntg.nl
Betreff: [NTG-context] Re: QR Code

Am 18.12.23 um 13:00 schrieb Ursula Hermann:
> Dear  List
> 
> I was interested how it works.
> 
> So I started this example.
> 
> \starttext
> 
> \usemodule[m-zint]
> 
> \barcode[alternative=isbnx, text=9783865419026, width=4cm]
> 
> \barcode[alternative=qrcode, text={https://wiki.contextgarden.net},
> width=3cm]
> 
> \stoptext
> 
> Is that the right way?

just \usemodule[zint]

This works for me:
\barcode[alternative=isbn, text=9783865419026, width=5cm] 
\barcode[alternative=qr code, text={https://wiki.contextgarden.net},
width=2.5cm]
(Not sure how tolerant the codes are.)

But you must install the zint libraries, as outlined in 
https://wiki.contextgarden.net/Barcodes
I guess you saw this, since you quote the wiki examples.

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) 
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: QR Code

2023-12-18 Thread Ursula Hermann
Dear Hraban, 

Many Thanks for your mail. I am sorry for asking: Where should I write this 
path. After the download in Windows? 

Uschi

-Ursprüngliche Nachricht-
Von: Henning Hraban Ramm  
Gesendet: Montag, 18. Dezember 2023 13:26
An: ntg-context@ntg.nl
Betreff: [NTG-context] Re: QR Code

Am 18.12.23 um 13:00 schrieb Ursula Hermann:
> Dear  List
> 
> I was interested how it works.
> 
> So I started this example.
> 
> \starttext
> 
> \usemodule[m-zint]
> 
> \barcode[alternative=isbnx, text=9783865419026, width=4cm]
> 
> \barcode[alternative=qrcode, text={https://wiki.contextgarden.net},
> width=3cm]
> 
> \stoptext
> 
> Is that the right way?

just \usemodule[zint]

This works for me:
\barcode[alternative=isbn, text=9783865419026, width=5cm] 
\barcode[alternative=qr code, text={https://wiki.contextgarden.net},
width=2.5cm]
(Not sure how tolerant the codes are.)

But you must install the zint libraries, as outlined in 
https://wiki.contextgarden.net/Barcodes
I guess you saw this, since you quote the wiki examples.

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) 
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: QR Code

2023-12-18 Thread Henning Hraban Ramm

Am 18.12.23 um 13:00 schrieb Ursula Hermann:

Dear  List

I was interested how it works.

So I started this example.

\starttext

\usemodule[m-zint]

\barcode[alternative=isbnx, text=9783865419026, width=4cm]

\barcode[alternative=qrcode, text={https://wiki.contextgarden.net}, 
width=3cm]


\stoptext

Is that the right way?


just \usemodule[zint]

This works for me:
\barcode[alternative=isbn, text=9783865419026, width=5cm]
\barcode[alternative=qr code, text={https://wiki.contextgarden.net}, 
width=2.5cm]

(Not sure how tolerant the codes are.)

But you must install the zint libraries, as outlined in
https://wiki.contextgarden.net/Barcodes
I guess you saw this, since you quote the wiki examples.

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] QR Code

2023-12-18 Thread Ursula Hermann
Dear  List

I was interested how it works.
So I started this example.
\starttext
\usemodule[m-zint]
\barcode[alternative=isbnx, text=9783865419026, width=4cm]
\barcode[alternative=qrcode, text={https://wiki.contextgarden.net}, width=3cm]
\stoptext

Is that the right way?

Many thanks
Uschi




Barcode.pdf
Description: Barcode.pdf
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Seeking advice for module that draws globes

2023-12-18 Thread Hans Hagen via ntg-context

On 12/17/2023 11:22 PM, Gavin via ntg-context wrote:

Hello ConTeXters,

I wrote a little ConTeXt module for drawing globes. I would love some advice on 
how to improve it and share it. The code is quite short (about 250 lines). Most 
of the work is done by Lua, which reads the data files and calculates paths. 
These paths are passed to MetaFun, which draws the globe.

about names:

how about

t-luageo.lmt
t-luageo.mpxl

so that one knows what comes with the module (we do the same with s-* 
modules)


and you can add the example to the end of the module

\continueifinputfile{t-luageo.mkxl}

\starttext
exaple code
\stoptext

and then process the module to get the example

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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Problem with the paragraph

2023-12-18 Thread Ursula Hermann
Dear Bruce, 

Thank you for your Mail 
It works  perfect. Thank you .
Uschi Hermann 

-Ursprüngliche Nachricht-
Von: Bruce Horrocks  
Gesendet: Freitag, 15. Dezember 2023 14:00
An: ntg-context mailing list 
Betreff: [NTG-context] Re: Problem with the paragraph



> On 14 Dec 2023, at 09:44, Ursula Hermann  wrote:
> 
> If I change the name of the textbackground with my example, I sent yesterday, 
> there is no color in the paragraph. 
> 

Try the following version of your example which incoporates Hraban's and 
Wolfgang's suggestions.
Also take care over changing style so use \bold{this is bold} or {\bf this is 
bold} but not \bf{this is bold}.

\definepapersize[MyBook][width=19cm,height=24cm]
\setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook 
%\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper 
\setupbodyfont[Times New Roman, 12.2pt] \definemargindata  
[MyInMargin][inright] 
\definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
\defineenumeration
  [theorem]
  [
text=Theorem,
title=yes,
width=fit,
distance=0.2em,
alternative=serried,
  ]
\definetextbackground[GrayBackground][
  location=paragraph,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.5\bodyfontsize,
  rightoffset=.5\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off,]
  \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\\}
  \blackrule[color=black, height=0.10ex, width=13.50cm] \starttext \margintext 
{1.1.1} {\bf Beispiel 3.2.17 (Vertauschung von All- und Existenzquantor).} \par 
Sei M die Menge aller Männer und F die Menge aller Frauen. Die Aussage h(m, f) 
sei ”m ist verliebt in f“. Unter diesen Voraussetzungen machen Sie sich die 
Bedeutung der beiden Aussagen klar.
\par
\startitemize[n]
 \item \m{\forall m ∈ M : ∃f ∈ F : h(m, f)}  \item ∃f ∈ F : ∀m ∈ M : h(m, f).
\stopitemize
% I changed the above to use \startitemize but have a look at \placeformula as 
well

\startGrayBackground
Mitunter ist es aus der Formulierung nur schwer zu erkennen, dass ein 
\m{∃\forall} oder ein \m{\forall\m∃} versteckt ist. Dann ist es besonders 
wichtig, die Formulierung sehr lange zu prüfen und eventuell auch formalisiert 
noch einmal aufzuschreiben.”
\blank
Der Wert von \m{y = f(x)} ist unabhängig von der Wahl\par von \m{x\doubleprime} 
ist gleichbedeutend mit \m{∃y : ∀x : f(x) = y} \par (Beutelspacher [10, S.54]).
\stopGrayBackground
\stoptext

—
Bruce Horrocks
Hampshire, UK

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) 
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: error with definestartstop and startmode

2023-12-18 Thread Aditya Mahajan
On Sun, 17 Dec 2023, Wolfgang Schuster wrote:

> Peter Münster schrieb am 17.12.2023 um 10:09:
> > On Sat, Dec 16 2023, Hans Hagen via ntg-context wrote:
> >
> >> \usemodule[abbreviations-logos]
> >> \defineblock [H] [before=\startcolor[blue],after=\stopcolor]
> >> \keepblocks[H]
> > Thanks for this solution.
> >
> > Is there also something for inline-mode? Example:
> >
> > test \beginH TEST\endH test
> 
> You can create different versions of your environment and let context choose
> one whether the mode is enabled or disabled.
> 
> %\enablemode[H]
> 
> \startmode [H]
>   \definestartstop [H] [color=blue]
> \stopmode
> 
> \startnotmode [H]
>   \define\startH{\ignoreupto\stopH}
> \stopnotmode
> 
> \starttext
> 
> xxx \startH yyy \stopH zzz
> 
> \stoptext

I do something similar:

\definebuffer[H]

\startmode[H]
  \definestartstop[H][color=blue]
\stopmode

Aditya___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: error with definestartstop and startmode

2023-12-17 Thread Wolfgang Schuster

Peter Münster schrieb am 17.12.2023 um 10:09:

On Sat, Dec 16 2023, Hans Hagen via ntg-context wrote:


\usemodule[abbreviations-logos]
\defineblock [H] [before=\startcolor[blue],after=\stopcolor]
\keepblocks[H]

Thanks for this solution.

Is there also something for inline-mode? Example:

test \beginH TEST\endH test


You can create different versions of your environment and let context choose
one whether the mode is enabled or disabled.

%\enablemode[H]

\startmode [H]
  \definestartstop [H] [color=blue]
\stopmode

\startnotmode [H]
  \define\startH{\ignoreupto\stopH}
\stopnotmode

\starttext

xxx \startH yyy \stopH zzz

\stoptext

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: error with definestartstop and startmode

2023-12-16 Thread Hans Hagen via ntg-context

On 12/16/2023 9:17 AM, Peter Münster wrote:

Hi,

I get an "runaway error" with the following example:

--8<---cut here---start->8---
\definestartstop[H][color=blue, before={\startmode[h]}, after={\stopmode}]
\starttext
test
\startH
   TEST
\stopH
\stoptext
--8<---cut here---end--->8---

How could I create such start-stop pair please?

doesn't work because \stopmode is a delimiter when shipped

\usemodule[abbreviations-logos]

\defineblock [H] [before=\startcolor[blue],after=\stopcolor]
\keepblocks[H]

\starttext
test

\beginH
   TEST
\endH

test
\stoptext


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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] error with definestartstop and startmode

2023-12-16 Thread Peter Münster
Hi,

I get an "runaway error" with the following example:

--8<---cut here---start->8---
\definestartstop[H][color=blue, before={\startmode[h]}, after={\stopmode}]
\starttext
test
\startH
  TEST
\stopH
\stoptext
--8<---cut here---end--->8---

How could I create such start-stop pair please?

TIA for any hints,
-- 
   Peter
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Problem with the paragraph

2023-12-15 Thread Bruce Horrocks


> On 14 Dec 2023, at 09:44, Ursula Hermann  wrote:
> 
> If I change the name of the textbackground with my example, I sent yesterday, 
> there is no color in the paragraph. 
> 

Try the following version of your example which incoporates Hraban's and 
Wolfgang's suggestions.
Also take care over changing style so use \bold{this is bold} or {\bf this is 
bold} but not \bf{this is bold}.

\definepapersize[MyBook][width=19cm,height=24cm]
\setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook
%\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper
\setupbodyfont[Times New Roman, 12.2pt]
\definemargindata  [MyInMargin][inright]
\definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
\defineenumeration
  [theorem]
  [
text=Theorem,
title=yes,
width=fit,
distance=0.2em,
alternative=serried,
  ]
\definetextbackground[GrayBackground][
  location=paragraph,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.5\bodyfontsize,
  rightoffset=.5\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off,]
  \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\\}
  \blackrule[color=black, height=0.10ex, width=13.50cm]
\starttext
\margintext {1.1.1}
{\bf Beispiel 3.2.17 (Vertauschung von All- und Existenzquantor).}
\par Sei M die Menge aller Männer und F die Menge aller Frauen. Die
Aussage h(m, f) sei ”m ist verliebt in f“. Unter diesen Voraussetzungen
machen Sie sich die Bedeutung der beiden Aussagen klar.
\par
\startitemize[n]
 \item \m{\forall m ∈ M : ∃f ∈ F : h(m, f)}
 \item ∃f ∈ F : ∀m ∈ M : h(m, f).
\stopitemize
% I changed the above to use \startitemize but have a look at \placeformula as 
well

\startGrayBackground
Mitunter ist es aus der Formulierung nur schwer zu erkennen, dass
ein \m{∃\forall} oder ein \m{\forall\m∃} versteckt ist. Dann ist es besonders 
wichtig, die
Formulierung sehr lange zu prüfen und eventuell auch formalisiert
noch einmal aufzuschreiben.”
\blank
Der Wert von \m{y = f(x)} ist unabhängig von der Wahl\par
von \m{x\doubleprime} ist gleichbedeutend mit \m{∃y : ∀x : f(x) = y} \par
(Beutelspacher [10, S.54]).
\stopGrayBackground
\stoptext

—
Bruce Horrocks
Hampshire, UK

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Problem with the paragraph

2023-12-14 Thread Wolfgang Schuster

Ursula Hermann schrieb am 13.12.2023 um 15:22:


Dear list,

I have this example. I need the whole paragraph in color. But there is 
something wrong.


\definepapersize[MyBook][width=19cm,height=24cm]

\setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook

%\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper



This doesn't work to use Times New Roman as main font, you can use

    \setupbodyfont[termes]

to get a times lookalike.


\setupbodyfont[Times New Roman, 12.2pt]

\definemargindata [MyInMargin][inright]

\definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]

\defineenumeration

[theorem]

  [

text=Theorem,

title=yes,

width=fit,

distance=0.2em,

alternative=serried,

  ]

\definetextbackground[paragraph][

location=paragraph,

background=color,

backgroundcolor=lightgray,

leftoffset=.5\bodyfontsize,

rightoffset=.5\bodyfontsize,

topoffset=.5\bodyfontsize,

bottomoffset=.5\bodyfontsize,

before={\switchtobodyfont[global]},

after={},

frame=off,]

\margintext{\blackrule[color=black, height=0.10ex, 
width=1cm]\\}\blackrule[color=black, height=0.10ex, width=13.50cm]


\starttext

\margintext {1.1.1}



What is the purpose of all these starttext/stoptext blocks?


\starttext

\bf{Beispiel 3.2.17 (Vertauschung von All- und Existenzquantor)}.

\stoptext

\starttext

{\it

\par Sei M die Menge aller Männer und F die Menge aller Frauen. Die 
Aus-\par


sage h(m, f) sei ”m ist verliebt in f“. Unter diesen Voraussetzungen

machen Sie sich die Bedeutung der beiden Aussagen klar.

\stoptext

\par

\starttext



1. Use the itemize environment to create numbered blocks.

2. Learn the correct usage of inline math mode, i.e. \m{...}


1. \m\forall m ∈M : ∃f ∈F : h(m, f).\par

2. ∃f ∈F : ∀m ∈M : h(m, f).\par

\stoptext

\blank

\starttext

\startparagraph

\blank

\tf Mitunter ist es aus der Formulierung nur schwer zu erkennen, dass

ein \m ∃\forall∀oder ein \m \forall∀\m∃versteckt ist. Dann ist es 
besonders wichtig, die


Formulierung sehr lange zu prüfen und eventuell auch formalisiert

noch einmal aufzuschreiben.”\blank

Der Wert von y = f(x) ist unabhängig von der Wahl\par

von x“ ist gleichbedeutend mit ∃y : ∀x : f(x) = y \par

(Beutelspacher [10, S.54]).

\blank

\stopparagraph

\stoptext



Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: LMTX: Command handling, Interface between TeX and Lua

2023-12-14 Thread Gerion Entrup
Am Mittwoch, 13. Dezember 2023, 21:57:35 CET schrieb Bruce Horrocks:
> 
> > On 13 Dec 2023, at 17:13, Gerion Entrup  wrote:
> > 
> > Is there a simple way to define a new command/environment and handle
> > the keyword arguments in Lua? For example defining a frontend command
> > like this:
> 
> I don't have the answer to your other questions but I do have an example for 
> this one.
> It's not mine - I'm fairly sure it came from this list but I can't find who 
> that was any more.
> 
> \startluacode
> userdata = userdata or { }
> 
> function userdata.mycommand(keywords, keyvals, str) 
> keyword_options = utilities.parsers.settings_to_array(keywords)
> named_values = utilities.parsers.settings_to_hash(keyvals)
> 
> context('First option = ' .. keyword_options[1])
> context('\\par')
> context('Color chosen = ' .. named_values['color'])
> context('\\par')
> context('Curly braces = ' .. str)
> context('\\par')
> end
> \stopluacode
> 
> \def\mycommand[#1][#2]#3{\ctxlua{
> userdata.mycommand('#1', '#2', [==[#3]==])}} 
> 
> \starttext
> \mycommand[top, inmargin, now][color=green, roof=gabled]{Anne of Green 
> Gables?}
> \stoptext

Thank you. That helps a lot already!

Gerion


signature.asc
Description: This is a digitally signed message part.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Score sums and references

2023-12-13 Thread Jairo A. del Rio
Cool. It works once \startlines ... \stoplines is removed. Thank you
very much!

Jairo

El mié, 13 dic 2023 a la(s) 3:40 a.m., Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 12/13/2023 4:05 AM, Jairo A. del Rio wrote:
> > Hi, dear list. Is there a proper "ConTeXt way" to do the following?
> >
> > \integerdef\lmao=0
> > \starttext
> > Sum: \in[trick] % 10 from the result below
> >
> > +1\advance\lmao\plusone
> >
> > +2\advance\lmao\plustwo
> >
> > +3\advance\lmao\plusthree
> >
> > +4\advance\lmao\plusfour
> >
> > \normalexpanded{\reference[trick]{\the\lmao}} % 10 printed above
> > \stoptext
> >
> > I want the result of a sum (either via Lua or TeX) to be printed before
> > summands in text, but without the mess of reference options such as
> > interaction, etc. Thank you in advance and sorry for any inconvenience.
>
> \integerdef\DSlmao=0
>
> \starttext
>
> Sum: \datasetvariable{test-1}{1}{whatever}
>
> \startlines
> +1\advance\DSlmao\plusone
> +2\advance\DSlmao\plustwo
> +3\advance\DSlmao\plusthree
> +4\advance\DSlmao\plusfour
> \stoplines
>
> \normalexpanded{\setdataset[test-1][whatever=\the\DSlmao]}
>
> \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 /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: LMTX: Command handling, Interface between TeX and Lua

2023-12-13 Thread Bruce Horrocks

> On 13 Dec 2023, at 17:13, Gerion Entrup  wrote:
> 
> Is there a simple way to define a new command/environment and handle
> the keyword arguments in Lua? For example defining a frontend command
> like this:

I don't have the answer to your other questions but I do have an example for 
this one.
It's not mine - I'm fairly sure it came from this list but I can't find who 
that was any more.

\startluacode
userdata = userdata or { }

function userdata.mycommand(keywords, keyvals, str) 
keyword_options = utilities.parsers.settings_to_array(keywords)
named_values = utilities.parsers.settings_to_hash(keyvals)

context('First option = ' .. keyword_options[1])
context('\\par')
context('Color chosen = ' .. named_values['color'])
context('\\par')
context('Curly braces = ' .. str)
context('\\par')
end
\stopluacode

\def\mycommand[#1][#2]#3{\ctxlua{
userdata.mycommand('#1', '#2', [==[#3]==])}} 

\starttext
\mycommand[top, inmargin, now][color=green, roof=gabled]{Anne of Green Gables?}
\stoptext

—
Bruce Horrocks
Hampshire, UK

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] About framedtext

2023-12-13 Thread Fabrice Couvreur
Hi,
Is this a bug or not ?
The key to coloring the background of the text seems to no longer work.
Thanks
Fabrice

\definecolor[MyColorC][s=0.8784]
  \definecolor[MyColorD][m=0.27,y=1]
  \definecolor[ColorA][0.8(white)]
  \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
  \definecolor[MyColorA][.75(MyColorB,white)]

  \defineframed
  [FrameTitle]
  [frame=off,
   foregroundstyle=\bfx\ss,
   foregroundcolor=white,
   background=color,
   backgroundcolor=MyColorD,
   location=depth]

  \defineframedtext
  [FramedText]
  [offset=0.25em,
   style=\ss,
   toffset=\zeropoint,
   background=color,
   backgroundcolor=MyColorA,
   foregroundstyle={\switchtobodyfont[9pt]},
   align={right, broad},
   frame=off,
   corner=00,
   radius=0.5em,
   width=10cm]

  \definedescription
  [Info]
  [before=,
   after=,
   text=Info,
   title=no,
   width=fit,
   distance=0.5em,
   headcommand=\FrameTitle,
   alternative=serried]

\starttext
   \startFramedText[width=5cm]
\startInfo
 \input{ward}
\stopInfo
\stopFramedText
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Problem with the paragraph

2023-12-13 Thread Ursula Hermann
Dear list,

I have this example. I need the whole paragraph in color. But there is 
something wrong.
\definepapersize[MyBook][width=19cm,height=24cm]
\setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook
%\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper
\setupbodyfont[Times New Roman, 12.2pt]
\definemargindata  [MyInMargin][inright]
\definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
\defineenumeration
  [theorem]
  [
text=Theorem,
title=yes,
width=fit,
distance=0.2em,
alternative=serried,
  ]
\definetextbackground[paragraph][
  location=paragraph,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.5\bodyfontsize,
  rightoffset=.5\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  before={\switchtobodyfont[global]},
  after={},
  frame=off,]
  \margintext{\blackrule[color=black, height=0.10ex, 
width=1cm]\\}\blackrule[color=black, height=0.10ex, width=13.50cm]
\starttext
\margintext {1.1.1}
\starttext
\bf{Beispiel 3.2.17 (Vertauschung von All- und Existenzquantor)}.
\stoptext
\starttext
{\it
\par Sei M die Menge aller Männer und F die Menge aller Frauen. Die Aus-\par
sage h(m, f) sei ”m ist verliebt in f“. Unter diesen Voraussetzungen
machen Sie sich die Bedeutung der beiden Aussagen klar.
\stoptext
\par
\starttext
1. \m\forall m ∈ M : ∃f ∈ F : h(m, f).\par
2. ∃f ∈ F : ∀m ∈ M : h(m, f).\par
\stoptext
\blank
\starttext
\startparagraph
\blank
\tf Mitunter ist es aus der Formulierung nur schwer zu erkennen, dass
ein \m ∃\forall∀ oder ein \m \forall∀\m∃ versteckt ist. Dann ist es besonders 
wichtig, die
Formulierung sehr lange zu prüfen und eventuell auch formalisiert
noch einmal aufzuschreiben.”\blank
Der Wert von y = f(x) ist unabhängig von der Wahl\par
von x“ ist gleichbedeutend mit ∃y : ∀x : f(x) = y \par
(Beutelspacher [10, S.54]).
\blank
\stopparagraph
\stoptext

Many thanks
Uschi



u.pdf
Description: u.pdf
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Score sums and references

2023-12-13 Thread Hans Hagen

On 12/13/2023 4:05 AM, Jairo A. del Rio wrote:

Hi, dear list. Is there a proper "ConTeXt way" to do the following?

\integerdef\lmao=0
\starttext
Sum: \in[trick] % 10 from the result below

+1\advance\lmao\plusone

+2\advance\lmao\plustwo

+3\advance\lmao\plusthree

+4\advance\lmao\plusfour

\normalexpanded{\reference[trick]{\the\lmao}} % 10 printed above
\stoptext

I want the result of a sum (either via Lua or TeX) to be printed before 
summands in text, but without the mess of reference options such as 
interaction, etc. Thank you in advance and sorry for any inconvenience.


\integerdef\DSlmao=0

\starttext

Sum: \datasetvariable{test-1}{1}{whatever}

\startlines
+1\advance\DSlmao\plusone
+2\advance\DSlmao\plustwo
+3\advance\DSlmao\plusthree
+4\advance\DSlmao\plusfour
\stoplines

\normalexpanded{\setdataset[test-1][whatever=\the\DSlmao]}

\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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Score sums and references

2023-12-12 Thread Jairo A. del Rio
Hi, dear list. Is there a proper "ConTeXt way" to do the following?

\integerdef\lmao=0
\starttext
Sum: \in[trick] % 10 from the result below

+1\advance\lmao\plusone

+2\advance\lmao\plustwo

+3\advance\lmao\plusthree

+4\advance\lmao\plusfour

\normalexpanded{\reference[trick]{\the\lmao}} % 10 printed above
\stoptext

I want the result of a sum (either via Lua or TeX) to be printed before
summands in text, but without the mess of reference options such as
interaction, etc. Thank you in advance and sorry for any inconvenience.

Regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Fractions

2023-12-10 Thread Gavin via ntg-context
Hello fraction fascinated friends,

> On Dec 10, 2023, at 5:24 AM, Henning Hraban Ramm  wrote:
> 
> Am 09.12.23 um 23:30 schrieb Mikael Sundqvist:
>> Hi,
>> On Sat, Dec 9, 2023 at 4:39 PM Wolfgang Schuster
>>  wrote:
>>> 
>>> Fabrice Couvreur schrieb am 09.12.2023 um 17:19:
>>> 
>>> Very clear !
>>> In typography for Mathematics books, what choice should we make for the 
>>> best possible result ?
>>> 
>>> A question better answered by Mikael or Aditya!
>> Thank you for your trust, Wolfgang. I am not sure I have something
>> valuable to say in addition to Adityas suggestion \frac{1/3} in inline
>> math. In any case, I attach a passage, with suggestions inspired by
>> Lansburgh's book (iin Swedish). Not sure the file size makes it
>> through to the list, though.
> 
> Thank you!
> 
> I usually only need simple inline fractions like 1/n, 1/2 or 3/8 in text.
> With these and \frac, the spacing below the numerator (depth) is too big, 
> while the denominator sticks too tightly to the fraction bar.
> (Of course I use regular numbers for fractions, not mediaeval.)
> 
> Usually I’d prefer “vulgar fractions”, but \vulgarfraction looks “horrible” 
> in comparison to the few usual fractions contained in fonts (like ½ & ¾).
> 
> I tried to use the OpenType fraction features to no avail.
> 
> So I’m still looking for “the best” solution for simple fractions inline.
> 
> Hraban

I also use fractions frequently, so I’ve tried a few things.

Some fonts have superior and inferior numbers that can be used to make small 
slash fractions. I’ve done this, but my method is not pretty. Hraban suggested 
using font features for this, but I haven’t learned how to do that. Any advice 
is welcome.

Example code below uses the Libertinus font, which has these superior and 
inferior numbers, to produce sample paragraph demonstrating a few options for 
fractions in text.

Gavin


\usetypescriptfile[libertinus]
\setupbodyfont [libertinus,11pt]%
\setupinterlinespace[line=3.1ex]

\define\fracone{\getnamedglyphdirect{libertinus}{onesuperior}} % 1
\define\fracthree{\getnamedglyphdirect{libertinus}{threesuperior}} % 3
\define\fracnine{\getnamedglyphdirect{libertinus}{ninesuperior}} % 9

\define\thirteenths{\textfraction\getnamedglyphdirect{libertinus}{oneinferior}\getnamedglyphdirect{libertinus}{threeinferior}}
 % /13

\define\onethirteenth{\text{\fracone\thirteenths}} % 1/13
\define\threethirteenths{\text{\fracthree\thirteenths}} % 3/13
\define\ninethirteenths{\text{\fracnine\thirteenths}} % 9/13

\starttext
Some small fractions are already available in many fonts, like \onehalf\ and 
\onethird. Others can be built using superior and inferior numbers in some 
fonts. This includes the fractions required to
find the normal and shearing stresses on an oblique plane defined by 
$l=\sqrt{\threethirteenths}$, $m=\sqrt{\onethirteenth}$, and 
$n=\sqrt{\ninethirteenths}$.
Of course, you could just find the normal and shearing stresses on an oblique 
plane defined by $l=\sqrt{3/13}$, $m=\sqrt{1/13}$, and $n=\sqrt{9/13}$.
Vulgar fractions are between these extremes.
Find the normal and shearing stresses on an oblique plane defined by 
$l=\sqrt{\vfrac{3}{13}}$, $m=\sqrt{\vfrac{1}{13}}$, and 
$n=\sqrt{\vfrac{9}{13}}$.
I included more text than strictly necessary in this example to demonstrate the 
effect on line spacing.
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: margin bigger than backspace pushes it outside the edge

2023-12-10 Thread Bruce Horrocks
On 10 Dec 2023, at 10:30, Jigé via ntg-context  wrote:
> 
> I've been struggling with basic page layout.
> 
> The left margin extends outside the left edge of the page.
> Example (from the wiki):

I don't know why it is like this but changing it now would probably break a lot 
of documents that rely on the defaults.

I suspect that most people, me included, simply adjust margin sizes until they 
have a pleasing result. This would only become a problem if margin text is used 
a lot.

The following corrects for the left margin starting off the page for both 
single and doublesided documents. The remainder of the settings will need 
adjusting to suit your specific circumstances.

\setuppapersize[A4][A3]
\setuplayout[location=middle]
\setuppagenumbering[alternative=doublesided]
\setuplayout[backspace=30.8mm]
\starttext
\showlayout[4,pt,cm]
\stoptext

—
Bruce Horrocks
Hampshire, UK

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: margin bigger than backspace pushes it outside the edge

2023-12-10 Thread Jigé via ntg-context
 Thanks Wolfgang.

Is this expected behavior? I'm very much confused with my second example:

\setuppapersize[A5][A4]
%\setuplayout[location=middle]
\setuplayout[location=middle,width=middle]
%\setuplayout[location=middle,width=middle,backspace=2.5cm]
\usemodule[ipsum]
\starttext
\showframe
Hello
\stoptext

With just \setuplayout[location=middle] the left margin gets outside the left 
edge, there's also a gap to the right of the right margin and, to the eye, it 
seems that the sum 
leftmargin+leftmargindistance+textwidth+rightmargindistance+rightmargin doesn 
not match the page width.

With \setuplayout[location=middle,width=middle] all is symmetrical but the two 
margins go outside the edges.

With e.g. \setuplayout[location=middle,width=middle,backspace=2.5cm] I can fit 
everything by manually adjusting the backspace to I'm not sure what the right 
value.

I couldn't adjust the page layout on some more complex document, so I'm going 
back to the most basic layout and trying to make it work on the simplest 
document possible.

JG Le dimanche 10 décembre 2023 à 11:53:07 UTC+1, Wolfgang Schuster 
 a écrit :  
 
 Jigé via ntg-context schrieb am 10.12.2023 um 11:30:
> Hi all,
> I've been struggling with basic page layout.
>
> The left margin extends outside the left edge of the page.
> Example (from the wiki):
>
> \setuppapersize[A4][A4] % this is the default and may be omitted
> \setuplayout[backspace=20mm,

leftmargin=10mm,
leftmargindistance=5mm,

>      width=110mm,
>      topspace=20mm,
>      header=0mm,
>      footer=0mm,
>      height=250mm]
> \starttext
> \showlayout
> \stoptext

Wolfgang

  ___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Fractions (was \placefigure[location=here...] problem)

2023-12-10 Thread Hans Hagen via ntg-context

On 12/9/2023 4:33 PM, Aditya Mahajan wrote:

On Sat, 9 Dec 2023, Wolfgang Schuster wrote:


\starttext

\startlines
\type{\frac{1}{3}}: \m{\frac{1}{3}}
\type{\xfrac{1}{3}}: \m{\xfrac{1}{3}}
\type{\xxfrac{1}{3}}: \m{\xxfrac{1}{3}}
\type{\tfrac{1}{3}}: \m{\tfrac{1}{3}}
\type{\sfrac{1}{3}}: \m{\sfrac{1}{3}}
\type{\frac{1}{3}}: \m{\frac{1}{3}}
\type{\dfrac{1}{3}}: \m{\dfrac{1}{3}}
\type{\cfrac{1}{3}}: \m{\cfrac{1}{3}}
\type{\vfrac{1}{3}}: \m{\vfrac{1}{3}}
\type{\hfrac{1}{3}}: \m{\hfrac{1}{3}}
\stoplines

\stoptext


Or, for inline math, $\sqrt{1/3}$.

radicals are somewhat special to deal with:

- multidimensional delimiter
- vertical spacing inside
- horizontal spacing oustside
- anchoring degrees
- left and right radicals
- more consistent rules (char based)
- size dependent additional spacing (avoid clash)
- normalize size across formula
- lack of granularity in variants sizes

by now we have dealt with all of that (some not in the current release), 
think of additional control in the engine, compensation for insufficient 
opentype math features, companion fonts with more sizes


there will always be suboptimal cases but the average is ok (we put 
radical - character kerning on hold because it is a lot of definitions) 
and we don't want to add hard to fight heuristics


so to inline: in most cases the solution that Adirya suggests will work 
out okay with respect toline spacing


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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: margin bigger than backspace pushes it outside the edge

2023-12-10 Thread Wolfgang Schuster

Jigé via ntg-context schrieb am 10.12.2023 um 11:30:

Hi all,
I've been struggling with basic page layout.

The left margin extends outside the left edge of the page.
Example (from the wiki):

\setuppapersize[A4][A4] % this is the default and may be omitted
\setuplayout[backspace=20mm,


leftmargin=10mm,
leftmargindistance=5mm,


     width=110mm,
     topspace=20mm,
     header=0mm,
     footer=0mm,
     height=250mm]
\starttext
\showlayout
\stoptext


Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] margin bigger than backspace pushes it outside the edge

2023-12-10 Thread Jigé via ntg-context
Hi all,
I've been struggling with basic page layout.

The left margin extends outside the left edge of the page.
Example (from the wiki):

\setuppapersize[A4][A4] % this is the default and may be omitted
\setuplayout[backspace=20mm,
    width=110mm,
    topspace=20mm,
    header=0mm,
    footer=0mm,
    height=250mm]
\starttext
\showlayout
\stoptext

Another example:

\setuppapersize[A5][A4]
\setuplayout[location=middle]
\usemodule[ipsum]
\starttext
\showframe
\ipsum
\stoptext

Thanks,
Jean-Guillaume

mise_en_page-layout.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Problem with \startlinenumbering left and right arguments

2023-12-09 Thread Wolfgang Schuster

Marcus Vinicius Mesquita schrieb am 07.12.2023 um 19:21:

Dear List,

In the MWE below, the left and right arguments are not applied in the
last chapter. How can this be fixed?

\starttext
\startlinenumbering[left={[},right={]}]

\dorecurse{5}{%
\startchapter[title={Knuth}]
\samplefile{knuth}
\stopchapter
}

\stoplinenumbering
\stoptext


When you have a single linenumbering block in your document you can set
the left/right values at the begin of your document with

    \setuplinenumbering[left={[},right={]}]

When you have multiple linenumbering blocks in your document you can
ensure the values stay also on the last page with a forced page break before
the block ends, e.g.

    \page
    \stoplinenumbering

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Aditya Mahajan
On Sat, 9 Dec 2023, Wolfgang Schuster wrote:

> \starttext
> 
> \startlines
> \type{\frac{1}{3}}: \m{\frac{1}{3}}
> \type{\xfrac{1}{3}}: \m{\xfrac{1}{3}}
> \type{\xxfrac{1}{3}}: \m{\xxfrac{1}{3}}
> \type{\tfrac{1}{3}}: \m{\tfrac{1}{3}}
> \type{\sfrac{1}{3}}: \m{\sfrac{1}{3}}
> \type{\frac{1}{3}}: \m{\frac{1}{3}}
> \type{\dfrac{1}{3}}: \m{\dfrac{1}{3}}
> \type{\cfrac{1}{3}}: \m{\cfrac{1}{3}}
> \type{\vfrac{1}{3}}: \m{\vfrac{1}{3}}
> \type{\hfrac{1}{3}}: \m{\hfrac{1}{3}}
> \stoplines
> 
> \stoptext

Or, for inline math, $\sqrt{1/3}$. 

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 09.12.2023 um 16:13:

Hi Wolfgang,
I'm reading this thread and I'm interested because I type a lot of 
text with mathematical formulas.
In fact, I find that \dfrac{} creates unsightly leading space and that 
\frac{} is too small. What is the difference between \frac{} and 
\tfrac{} ?


\frac switches the math style while \tfrac (textstyle), \dfrac 
(displaystyle) and \sfrac (scriptstyle) enforce a certain style.


 begin example
\startbuffer[frac]
\frac{1}{2} + \dfrac{1}{2} - \tfrac{1}{2} + \sfrac{1}{2}
\stopbuffer

\starttext

\startformula
\getbuffer[frac]
\stopformula

\m{\getbuffer[frac]}

\startformula
  \frac
    {\getbuffer[frac]}
    {\getbuffer[frac]}
\stopformula

\m{\frac
  {\getbuffer[frac]}
  {\getbuffer[frac]}}

\stoptext
 end example

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Wolfgang Schuster

anton.chig...@mail.com schrieb am 09.12.2023 um 14:15:

I worked, ;-), thanks.
Let me ask you another thing, how can I avoid messing up the
line spacing by using \sqrt and \frac, the line that follows these has increased
line spacing in the pdf output

code:
Find the normal and shearing stresses on an oblique plane defined by
$l=\sqrt{\frac{3}{13}}$, $m=\sqrt{\frac{1}{13}}$, and $n=\sqrt{\frac{9}{13}}$.


Complete working minimal examples are preferred over code snippets.

To avoid single lines with different spacing you can either increase the 
line spacing for all
lines with \setupinterlinespace or you use a different fraction command 
which uses

smaller numbers or creates inline fractions.

\starttext

\startlines
\type{\frac{1}{3}}: \m{\frac{1}{3}}
\type{\xfrac{1}{3}}: \m{\xfrac{1}{3}}
\type{\xxfrac{1}{3}}: \m{\xxfrac{1}{3}}
\type{\tfrac{1}{3}}: \m{\tfrac{1}{3}}
\type{\sfrac{1}{3}}: \m{\sfrac{1}{3}}
\type{\frac{1}{3}}: \m{\frac{1}{3}}
\type{\dfrac{1}{3}}: \m{\dfrac{1}{3}}
\type{\cfrac{1}{3}}: \m{\cfrac{1}{3}}
\type{\vfrac{1}{3}}: \m{\vfrac{1}{3}}
\type{\hfrac{1}{3}}: \m{\hfrac{1}{3}}
\stoplines

\stoptext

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Problem with \startlinenumbering left and right arguments

2023-12-07 Thread Marcus Vinicius Mesquita
Dear List,

In the MWE below, the left and right arguments are not applied in the
last chapter. How can this be fixed?

\starttext
\startlinenumbering[left={[},right={]}]

\dorecurse{5}{%
\startchapter[title={Knuth}]
\samplefile{knuth}
\stopchapter
}

\stoplinenumbering
\stoptext

Kind regards

Marcus Vinicius

-- 
Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o
corpo nem seus membros, por ser descanso da alma, primavera do
coração, distração do aflito, entretenimento do solitário, e viático
do viajante.

Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik)
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Buffer and \input content as input for \processtokens, etc.

2023-12-06 Thread Hans Hagen

On 12/6/2023 8:26 PM, Jairo A. del Rio wrote:
Hi, list! My question is just like that: how do I pass buffers or \input 
content to \processtokens. What I have done so far:


\tolerant\protected\def\foo#={\ifparameter#1\or\oof{#1}\fi}
\protected\def\oof#1{<#1>}
\startbuffer[ofo]
% Output: Ths  not a  anymore!
Th{i{s {is} not a {question} anymore!
\stopbuffer
\starttext
\processtokens\foo\foo\relax\space{Th{i}s {is} not a {question} anymore!}
% Neither \inlinebuffer nor \rawbuffer work in the example above
\stoptext


I didn't try to decipher this (you probably need expansion someplace),

I've also tried a variant of the mechanism described in OPmac trick 
described here <https://petr.olsak.net/opmac-tricks-e.html#etoks> to 
process content token by token, but it only works with \normalinput. Any 
suggestions or guidance? Thank you in advance.

\starttext

% \doloopovermatch
% {(.-)(\letterpercent b\letterleftbrace\letterrightbrace)(.-)}
% {Th{i}s {is} not a {que{s}tion} anymore!}
% {#1<#2>#3}

\startluacode

interfaces.implement {
name  = "WeirdCommand",
 -- arguments = "string",
arguments = "detokened",
public= true,
actions   = function(s)
s = string.gsub(s,".",{ ["{"] = "<", ["}"] = ">",})
context(s)
end
}

\stopluacode

\WeirdCommand
  {Th{i}s {is} not a {que{s}tion} anymore!}

\stoptext

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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Buffer and \input content as input for \processtokens, etc.

2023-12-06 Thread Jairo A. del Rio
Hi, list! My question is just like that: how do I pass buffers or \input
content to \processtokens. What I have done so far:

\tolerant\protected\def\foo#={\ifparameter#1\or\oof{#1}\fi}
\protected\def\oof#1{<#1>}
\startbuffer[ofo]
% Output: Ths  not a  anymore!
Th{i{s {is} not a {question} anymore!
\stopbuffer
\starttext
\processtokens\foo\foo\relax\space{Th{i}s {is} not a {question} anymore!}
% Neither \inlinebuffer nor \rawbuffer work in the example above
\stoptext

I've also tried a variant of the mechanism described in OPmac trick
described here <https://petr.olsak.net/opmac-tricks-e.html#etoks> to
process content token by token, but it only works with \normalinput. Any
suggestions or guidance? Thank you in advance.

Best regards,
Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] framed: rounded corner oddity

2023-12-05 Thread Henning Hraban Ramm

Hi,

in my ConTeXt book, some examples for \framed with rounded corners look 
odd, as if the MetaPost calculation of rounded corners fails.


I can’t find a minimal example that shows the problem, and I can’t 
imagine which of the settings in my extensive environment would cause it.


Find below the code that works on its own, but causes the results as 
shown in the attachments within my book. There’s nowhere a \setupframed, 
and nothing that should influence MetaPost.


Do you have any clue for what I should look?

Hraban

\starttext

\framed[
  rulethickness=1pt,
  offset=0.5em,
  background=color,
  backgroundcolor=yellow,
  framecorner=13,
  backgroundcorner=07,
  backgroundoffset=0.5em,
]{Das Runde muss ins Eckige}

\blank

\framed[
  frame=on,
  corner=round,
  frameoffset=0.5em,
  framecolor=black,
  background=color,
  backgroundcolor=darkgreen,
  backgroundoffset=1em,
  foregroundcolor=white,
  foregroundstyle={\ss\bf},
]{Komm ins Grüne!}

\stoptext___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \unit{mercury} renders as m (meter) and \unit{millimetermercury} doesn't work as expected

2023-12-05 Thread Wolfgang Schuster

Marco Patzer schrieb am 05.12.2023 um 15:19:

Hi!

I'm struggling with the rendering of a particular liquid metal:

   %% renders as m (meter), not as Hg
   \unit{mercury}

   %% renders as mm·m, not as mmHg
   \unit{millimetermercury}

This is strange, since both “mercury” and “millimetermercury” are
defined in phys-dim.lua. To get mercury recognised as a unit this
can be used:

   \registerunitshortcut [mercury=mercury]

Now \unit{mercury} renders correctly as Hg.

Why is that \registerunitshortcut necessary? Is it even correct to
use it like this? However, even then millimetermercury doesn't
render correctly:

   %% renders as mm·Hg, not as mmHg
   \unit{millimetermercury}

How to get millimetermercury render as mmHg? And “inch mercury”
render as inHg? I can't find “inchmercury” in phys-dim.lua, only
“millimetermercury”, should it be added?

Example:

%% \enabletrackers [physics.units]

%% inch should render as “in”
%% \setupunittext [inch=in]

\starttext
   \unit{mercury}\crlf  %% renders: mm · m

   \unit{12 millimetermercury}\crlf  %% renders: mm · m
   \unit{12 inchmercury}\crlf%% renders: in · m

   %% why is this necessary to get mercury rendered as Hg?
   \registerunitshortcut [mercury=mercury]

   \unit{12 millimetermercury}\crlf  %% renders: mm · Hg
   \unit{12 inch mercury}\crlf   %% renders: in · Hg
\stoptext

Questions:

1) Why is \unit{mercury} not working, although it's listed in
phys-dim.lua?
2) Is the call \registerunitshortcut [mercury=mercury]
necessary/correct?
3) How to make \unit{millimetermercury} render as mmHg and
\unit{inch mercury} render as inHg?


None of your examples work because millimetermercury and mercury are the 
names for the labels

and the units are accessed with hg and mmhg.

\setupunittext[en][millimetermercury=inHg]

\starttext

\unit{mmhg}

\stoptext

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] \unit{mercury} renders as m (meter) and \unit{millimetermercury} doesn't work as expected

2023-12-05 Thread Marco Patzer
Hi!

I'm struggling with the rendering of a particular liquid metal:

  %% renders as m (meter), not as Hg
  \unit{mercury}

  %% renders as mm·m, not as mmHg
  \unit{millimetermercury}

This is strange, since both “mercury” and “millimetermercury” are
defined in phys-dim.lua. To get mercury recognised as a unit this
can be used:

  \registerunitshortcut [mercury=mercury]

Now \unit{mercury} renders correctly as Hg.

Why is that \registerunitshortcut necessary? Is it even correct to
use it like this? However, even then millimetermercury doesn't
render correctly:

  %% renders as mm·Hg, not as mmHg
  \unit{millimetermercury}

How to get millimetermercury render as mmHg? And “inch mercury”
render as inHg? I can't find “inchmercury” in phys-dim.lua, only
“millimetermercury”, should it be added?

Example:

%% \enabletrackers [physics.units]

%% inch should render as “in”
%% \setupunittext [inch=in]

\starttext
  \unit{mercury}\crlf  %% renders: mm · m

  \unit{12 millimetermercury}\crlf  %% renders: mm · m
  \unit{12 inchmercury}\crlf%% renders: in · m

  %% why is this necessary to get mercury rendered as Hg?
  \registerunitshortcut [mercury=mercury]

  \unit{12 millimetermercury}\crlf  %% renders: mm · Hg
  \unit{12 inch mercury}\crlf   %% renders: in · Hg
\stoptext

Questions:

1) Why is \unit{mercury} not working, although it's listed in
   phys-dim.lua?
2) Is the call \registerunitshortcut [mercury=mercury]
   necessary/correct?
3) How to make \unit{millimetermercury} render as mmHg and
   \unit{inch mercury} render as inHg?

Marco
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Colored Paragraph

2023-12-05 Thread Ursula Hermann
Dear List,

i have this example:

\setupbodyfont[modern,10pt]
\definemargindata  [MyInMargin][inright]
\definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1cm]

\defineenumeration
  [theorem]
  [
text=Theorem,
title=yes,
width=fit,
distance=0.5em,
alternative=serried,
  ]
\margintext{\blackrule[color=black, height=0.25ex, 
width=1cm]\\}\blackrule[color=black, height=0.25ex, width=15cm]
\starttext
\margintext {1.1.1}

\startparagraph
It was essential for Hasselt to have a bridge across the Zwarte
Water river. The bishop of Utrecht gave Hasselt his consent in
1486.
\blank
Other cities in the neighbourhood of Hasselt were afraid of the
toll money to be paid when crossing this bridge so they
prevented the construction for many years.
\stopparagraph
\stoptext

The paragraph should have a color in the background. How can I get an colored 
paragraph?

Many thanks
Uschi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: (again) wrong destination types?

2023-12-04 Thread Bruce Horrocks


> On 3 Dec 2023, at 15:26, Pablo Rodriguez via ntg-context  
> wrote:
> 
> On 11/22/23 00:06, Bruce Horrocks wrote:
>> [...]
>> I changed your example to the following:
>> \setupinteraction[state=start, page=name, focus=standard]
>> \starttext
>> \input knuth \par
>> a\footnote{b} \par
>> \dorecurse{7}{\input knuth \par}
>> \stoptext
> 
> Many thanks for your fast reply, Bruce.
> 
> I wanted to reply much sooner, but it was really impossible for me.
> 
>> From your explanation, the first link (body to footnote, your point b)
> has destination to fit the whole page inside the viewer.
> 
> The second link (footnote to body, your point c) has the destination to
> reach a position inside the page (where the destination lies). This is
> what "focus=standard" should achieve.
> 
> In PDF terms (simplified), fit to page destinations are /Fit
> destinations and placed destinations are /XYZ destinations.
> 
> This sample shows what might be the root issue here:
> 
>  \setupinteraction[state=start, page=name, focus=standard]
>  \starttext
>  \completecontent
>  \chapter{Chapter}
>  a\footnote{b}
>  \stoptext
> 
> ConTeXt handles internally links in categories. For some reason unknown
> to me, "page=name" triggers that special operation links contain /Fit
> instead /XYZ destinations.
> 
> This is similar to the wrong link destinations (fit instead of standard)
> from TOC (but not in footnotes [which are right]) when compiled with MkIV:
> 
>  \setupinteraction[state=start, focus=standard]
>  \starttext
>  \completecontent
>  \chapter{Chapter}
>  a\footnote{b}
>  \stoptext
> 
> I hope it is clearer now. Let me know if it is not.
> 
> My issue is that I cannot avoid having "page=name" for links to external
> documents, but this breaks footnotes and other special operation links.

What are you using for links to external documents? If just a single command 
such as \goto then you might be able to get away with defining a wrapper (e.g. 
\myGoto) that does \setupinteraction[state=start,page=name,focus=standard] then 
the \goto command then \setupinteraction[state=start,page=fit,focus=standard] 
afterwards.

(Assuming calling \setupinteraction that many times does not cause problems in 
itself.)

—
Bruce Horrocks
Hampshire, UK

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: externalfigure crashed

2023-12-04 Thread Hans Hagen via ntg-context

On 12/4/2023 5:38 PM, Pablo Rodriguez via ntg-context wrote:

On 11/24/23 18:16, Hans Hagen via ntg-context wrote:

[…]
will do for now ... i can't upload a new installer .. pending the built;
the advantage is that i can do some experiments that would otherwise
break the current version (making compact font mode very close to
normal, pdf signing […]


Sorry, Hans, if I am missing the point.

Does the above mean that ConTeXt will be able to sign PDF documents with
digital certificates?
Well, that's what singing is, right? The problem is actually less in the 
signing than in the certificates themselves.


Basically one can sign (with some certificate) and then validate.


% sign-001.tex

\setupinteraction[state=start]

\definefield[signature][signed]

\defineoverlay[signature][my signature]

\starttext
\startTEXpage[offset=1ts,frame=on,framecolor=darkblue]
sign: \inframed
  [background=signature,framecolor=darkred]
  {\fieldbody[signature][width=3cm,option=hidden]}
\stopTEXpage
\stoptext

after neing processed:

mtxrun --script pdf --sign --certificate=sign-001.pem --password=test 
sign-001 (--library)


and:

mtxrun --script pdf --validate --certificate=sign-001.pem 
--password=test sign-001 (--library)


etc. works here.

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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-04 Thread Fabrice L
Dear Emanuel,

> Le 2 déc. 2023 à 12:08, Emanuel Han via ntg-context  a 
> écrit :
> 
> Hi Mikael,
> 
> here's a very simple mwe for the label(textext()) issue. On page 1, the text 
> "Word 1" should be drawn in position z1. On page 2, the same text in the same 
> position should be visible, and the text "Mot 2" in position p2 should be 
> added. And so on.
> 
> \startMPinclusions
> 
> picture p[];
>  path TheFrame ;
>  TheFrame := fullsquare scaled 5in ;
>  
>  z1 = (60,40);
>  z2 = (40,90); 
>  z3 = (10,70);
> 
> p1:=image(
> label(textext("Word 1"), z1);
> );
> 
> p2:=image(
> label(textext("Mot 2"), z2);
> );
> 
> p3:=image(
> label(textext("Parola 3"), z3);
> );
> 
> \stopMPinclusions
> 
> \starttext
> 
> \dorecurse{3}{ % Frame
> \startMPpage[pagestate=start]  
>  currentime := #1 ;
>  % Just for learning :
>  draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
>  draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> magenta ;
>  for k=1 upto currentime: draw p[k]; endfor
>  setbounds currentpicture to TheFrame ;
> 
>  desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
>  currentpicture := currentpicture xysized (desiredformat ,desiredformat );
>  
> \stopMPpage
> }
> 
> \stoptext
> 
> On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist  wrote:
> Hi Emanuel,
> 
> I am not sure I understand your question, and since you use fonts that
> i do not have, I cannot test your example as is. But, maybe, if you
> want to redraw a picture, you can do
> 
> addto currentpicture also p1;
> 
> where you want it.
> 
> /Mikael
> 
> PS For the text thing, I did not get it. Could one have a _very
> simple_ example showing only that problem and no other problem?
> 
> On Sat, Dec 2, 2023 at 12:58 PM fv leung  wrote:
> >
> > You didn't specify the color of path A in p2 and p4. So it's drawn in black.
> > The other issue, I can't help.
> >
> > Emanuel Han via ntg-context  於 2023年12月2日 週六 下午7:23寫道:
> >>
> >> So is there a way to circumvent these issues? Or an explanation for this 
> >> behavior, so that I can try to find a solution by myself?
> >>
> >> Thanks
> >> Emanuel
> >>
> >> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context 
> >>  wrote:
> >>
> >> Dear Aditya and Fabrice,
> >> thanks for your responses.
> >>
> >> I included some of Fabrice's code into mine for testing purpose, and 
> >> indeed the multipage works now.
> >> What is bizarre is that issues appear now that didn't appear before:
> >>
> >> Path A is drawn with color red on page 1, and in color black on all 
> >> following pages, while it should stay red.
> >> textext(, ) is overwriting  with 
> >> "T="(currentime) which has been used previously in textext() 
> >> before the for k=1 endfor loop. This overwriting happens only for the 
> >> first textext() which occurs inside the for k=1 endfor loop. All other 
> >> textext() inside the for k=1 endfor loop are not drawn at all. If the line 
> >> « draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> >> magenta ; » is commented out, the first textext() inside the for k=1 
> >> endfor loop is not drawn neither. It must be an issue with textext(), 
> >> because when I replace textext() by lmt_outline[], the text is drawn.
> >>
> >> Adjusted mwe:
> >>
> >> \enableregime[utf] % enable unicoded input
> >>
> >> \definefontfamily [RomanFont] [rm] [calluna]
> >>
> >> \definefontfamily [KoreanFont] [rm] [applemyungjo]
> >>
> >> \definefontfamily [JapaneseFont] [rm] [hannotatesc]
> >>
> >> \definefontfeature
> >> [fea]
> >> [mode=node,language=dflt,script=arab,
> >> init=yes,
> >> medi=yes,
> >> fina=yes,
> >> isol=yes,
> >> calt=yes,
> >> rlig=yes,
> >> tlig=yes,
> >> trep=yes,
> >> curs=yes,
> >> kern=yes,
> >> mark=yes
> >> ]
> >>
> >> \starttypescript [serif] [notonaskharabic]
> >> \definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Bold] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Italic] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsy

[NTG-context] Re: Inline math spacing

2023-12-04 Thread Hans Hagen via ntg-context

On 12/4/2023 6:43 AM, Alexandre Christe wrote:

Hi,

Here’s a MWE:

\setupinterlinespace[line=3ex]

\definefontfeature[default][default][lnum=yes,tnum=yes]
\usetypescriptfile[alegreya_libertinus]
\setupbodyfont[alegreya-light,ss,10pt]
\setupmathematics[autopunctuation={all}]

% math definitions
\enablemathautospacing % more global
% \enablemathautofencing % more global
\enablemathautonumbers % more global
% \autofences % more local

\usemodule[ipsum]

\starttext

\ipsum

\stoptext

And I attach the two files to setup the font.

no math ... anyway

\showglyphs

\dorecurse{100}{test \im{\frac{#1}{3}} test }

\setupmathematics[textdistance=.25em plus .1em minus .1em]

\dorecurse{100}{test \im{\frac{#1}{3}} test }

will give more space but it's mostly optical that the math related 
spacing looks doferent from regular spaces.


-
  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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] externalfigure regression?

2023-12-03 Thread Thangalin
Hi,

>From the wiki <https://wiki.contextgarden.net/Command/externalfigure>:

"When the file extension is .auto or method=auto is used, ConTeXt reads the
first few bytes of the file to determine the filetype. Such an
auto-discovery is useful for remote images that do not have a file
extension."

current version: 2023.09.26 18:19

Code:

% SOT
\starttext
  \startplacefigure
\externalfigure[https://placekitten.com/408/287][method=auto]
  \stopplacefigure
\stoptext
% EOT

Expected: Cute kitten photo.
Actual: Error.

Is this a regression? Or has the syntax changed (stale wiki)?

Specifying the type works (I'd've thought it not necessary to specify the
method at all, given both magic headers and HTTP content-type could
determine the type):

% SOT
\starttext
  \startplacefigure
\externalfigure[https://placekitten.com/408/287][method=jpg]
  \stopplacefigure
\stoptext
% EOT

See also:

https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/src/main/java/com/keenwrite/io/MediaTypeSniffer.java#L53

https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/src/main/java/com/keenwrite/io/MediaType.java#L218
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Inline math spacing

2023-12-03 Thread Alexandre Christe
Hi,

Here’s a MWE:

\setupinterlinespace[line=3ex]

\definefontfeature[default][default][lnum=yes,tnum=yes]
\usetypescriptfile[alegreya_libertinus]
\setupbodyfont[alegreya-light,ss,10pt]
\setupmathematics[autopunctuation={all}]

% math definitions
\enablemathautospacing % more global
% \enablemathautofencing % more global
\enablemathautonumbers % more global
% \autofences % more local

\usemodule[ipsum]

\starttext

\ipsum

\stoptext

And I attach the two files to setup the font.

A. Christe
Le 3 déc. 2023 à 22:44 +0100, Hans Hagen , a écrit :
> On 12/3/2023 10:31 PM, Alexandre Christe wrote:
> > Dear list,
> >
> > I’m facing some strange spacing with inline maths. Sometimes the space
> > is ok (like around the first two fractions), but sometimes it is way too
> > little. Do I miss to configure something?
> your spacing is little between words too .. hard to tell without MWE
>
> 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 / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___


libertinus-with-alegreya-math.lfg
Description: Binary data


type-imp-alegreya_libertinus.mkiv
Description: Binary data
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: marginwidths

2023-12-03 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 03.12.2023 um 16:33:

On 11/22/23 18:03, Wolfgang Schuster wrote:

Hans van der Meer via ntg-context schrieb am 22.11.2023 um 15:45:

But changing the width of the section in the middle is not changing.

dr. van der Meer,

your sample works for me if you add width=fit, such as in:

   \setuplayout[width=fit, leftmargin=6cm,rightmargin=10cm]
   \showframe
   \starttext
   \ConTeXt\space\contextversion\blank
   before the \type{\starttext}:\crlf
   \type{\setuplayout[leftmargin=6cm,rightmargin=10cm]}\crlf
   make no difference in displayed frame
   \showlayout
   \stoptext

I wonder whether I might be missing something, since this option is not
mentioned by Wolfgang.


IIRC width=fit is intended for presentation styles because it uses 
margin and edge values

to calculate the text area.

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: marginwidths

2023-12-03 Thread Pablo Rodriguez via ntg-context
On 11/22/23 18:03, Wolfgang Schuster wrote:
> Hans van der Meer via ntg-context schrieb am 22.11.2023 um 15:45:
>> But changing the width of the section in the middle is not changing.

dr. van der Meer,

your sample works for me if you add width=fit, such as in:

  \setuplayout[width=fit, leftmargin=6cm,rightmargin=10cm]
  \showframe
  \starttext
  \ConTeXt\space\contextversion\blank
  before the \type{\starttext}:\crlf
  \type{\setuplayout[leftmargin=6cm,rightmargin=10cm]}\crlf
  make no difference in displayed frame
  \showlayout
  \stoptext

I wonder whether I might be missing something, since this option is not
mentioned by Wolfgang.

Just in case it might help,

Pablo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: (again) wrong destination types?

2023-12-03 Thread Pablo Rodriguez via ntg-context
On 11/22/23 00:06, Bruce Horrocks wrote:
> [...]
> I changed your example to the following:
> \setupinteraction[state=start, page=name, focus=standard]
> \starttext
> \input knuth \par
> a\footnote{b} \par
> \dorecurse{7}{\input knuth \par}
> \stoptext

Many thanks for your fast reply, Bruce.

I wanted to reply much sooner, but it was really impossible for me.

>From your explanation, the first link (body to footnote, your point b)
has destination to fit the whole page inside the viewer.

The second link (footnote to body, your point c) has the destination to
reach a position inside the page (where the destination lies). This is
what "focus=standard" should achieve.

In PDF terms (simplified), fit to page destinations are /Fit
destinations and placed destinations are /XYZ destinations.

This sample shows what might be the root issue here:

  \setupinteraction[state=start, page=name, focus=standard]
  \starttext
  \completecontent
  \chapter{Chapter}
  a\footnote{b}
  \stoptext

ConTeXt handles internally links in categories. For some reason unknown
to me, "page=name" triggers that special operation links contain /Fit
instead /XYZ destinations.

This is similar to the wrong link destinations (fit instead of standard)
from TOC (but not in footnotes [which are right]) when compiled with MkIV:

  \setupinteraction[state=start, focus=standard]
  \starttext
  \completecontent
  \chapter{Chapter}
  a\footnote{b}
  \stoptext

I hope it is clearer now. Let me know if it is not.

My issue is that I cannot avoid having "page=name" for links to external
documents, but this breaks footnotes and other special operation links.

Many thanks for your help,

Pablo

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread Emanuel Han via ntg-context
Thank you Mikael,
this works!
Emanuel

On Dez. 2 2023, at 7:46 pm, Mikael Sundqvist  wrote:
> Hi,
>
> I don't know if \startMPinclusions \stopMPinclusions shall work with
> \startMPpage and \stopMPpage. In this case, one can use a separate
> graphics:
>
> \startuseMPgraphic{base}
> picture p[];
> path TheFrame ;
> TheFrame := fullsquare scaled 5in ;
> z1 = (60,40);
> z2 = (40,90);
> z3 = (10,70);
>
> p1:=image(
> label("Word 1", z1);
> );
>
> p2:=image(
> label("Mot 2", z2);
> );
>
> p3:=image(
> label("Parola 3", z3);
> );
>
> \stopuseMPgraphic
> \starttext
> \dorecurse{3}{ % Frame
> \startMPpage[pagestate=start]
> \includeMPgraphic{base}
> currentime := #1 ;
> % Just for learning :
> draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
> draw textext("T="(currentime)) scaled 2 shifted(0,2in)
> withcolor magenta ;
> for k=1 upto currentime: addto currentpicture also p[k]; endfor
> setbounds currentpicture to TheFrame ;
>
> desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
> currentpicture := currentpicture xysized (desiredformat ,desiredformat );
> \stopMPpage
> }
>
> \stoptext
> /Mikael
> On Sat, Dec 2, 2023 at 6:14 PM Emanuel Han via ntg-context
>  wrote:
> >
> > Hi Mikael,
> >
> > here's a very simple mwe for the label(textext()) issue. On page 1, the 
> > text "Word 1" should be drawn in position z1. On page 2, the same text in 
> > the same position should be visible, and the text "Mot 2" in position p2 
> > should be added. And so on.
> >
> > \startMPinclusions
> >
> > picture p[];
> > path TheFrame ;
> > TheFrame := fullsquare scaled 5in ;
> >
> > z1 = (60,40);
> > z2 = (40,90);
> > z3 = (10,70);
> >
> > p1:=image(
> > label(textext("Word 1"), z1);
> > );
> >
> > p2:=image(
> > label(textext("Mot 2"), z2);
> > );
> >
> > p3:=image(
> > label(textext("Parola 3"), z3);
> > );
> >
> > \stopMPinclusions
> >
> > \starttext
> >
> > \dorecurse{3}{ % Frame
> > \startMPpage[pagestate=start]
> > currentime := #1 ;
> > % Just for learning :
> > draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
> > draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> > magenta ;
> > for k=1 upto currentime: draw p[k]; endfor
> > setbounds currentpicture to TheFrame ;
> >
> > desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
> > currentpicture := currentpicture xysized (desiredformat ,desiredformat );
> >
> > \stopMPpage
> > }
> >
> > \stoptext
> >
> > On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist  wrote:
> >
> > Hi Emanuel,
> >
> > I am not sure I understand your question, and since you use fonts that
> > i do not have, I cannot test your example as is. But, maybe, if you
> > want to redraw a picture, you can do
> >
> > addto currentpicture also p1;
> >
> > where you want it.
> >
> > /Mikael
> >
> > PS For the text thing, I did not get it. Could one have a _very
> > simple_ example showing only that problem and no other problem?
> >
> > On Sat, Dec 2, 2023 at 12:58 PM fv leung  wrote:
> > >
> > > You didn't specify the color of path A in p2 and p4. So it's drawn in 
> > > black.
> > > The other issue, I can't help.
> > >
> > > Emanuel Han via ntg-context  於 2023年12月2日 週六 下午7:23寫道:
> > >>
> > >> So is there a way to circumvent these issues? Or an explanation for this 
> > >> behavior, so that I can try to find a solution by myself?
> > >>
> > >> Thanks
> > >> Emanuel
> > >>
> > >> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context 
> > >>  wrote:
> > >>
> > >> Dear Aditya and Fabrice,
> > >> thanks for your responses.
> > >>
> > >> I included some of Fabrice's code into mine for testing purpose, and 
> > >> indeed the multipage works now.
> > >> What is bizarre is that issues appear now that didn't appear before:
> > >>
> > >> Path A is drawn with color red on page 1, and in color black on all 
> > >> following pages, while it should stay red.
> > >> textext(, ) is overwriting  with 
> > >> "T="(currentime) which has been used previously in textext() 
> > >> b

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread Mikael Sundqvist
Hi,

I don't know if \startMPinclusions \stopMPinclusions shall work with
\startMPpage and \stopMPpage. In this case, one can use a separate
graphics:

\startuseMPgraphic{base}

picture p[];
path TheFrame ;
TheFrame := fullsquare scaled 5in ;
z1 = (60,40);
z2 = (40,90);
z3 = (10,70);

p1:=image(
label("Word 1", z1);
);

p2:=image(
label("Mot 2", z2);
);

p3:=image(
label("Parola 3", z3);
);

\stopuseMPgraphic

\starttext

\dorecurse{3}{ % Frame

\startMPpage[pagestate=start]

\includeMPgraphic{base}

currentime := #1 ;
% Just for learning :
draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
draw textext("T="(currentime)) scaled 2 shifted(0,2in)
withcolor magenta ;
for k=1 upto currentime: addto currentpicture also p[k]; endfor
setbounds currentpicture to TheFrame ;

desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
currentpicture := currentpicture xysized (desiredformat ,desiredformat );
\stopMPpage
}

\stoptext

/Mikael

On Sat, Dec 2, 2023 at 6:14 PM Emanuel Han via ntg-context
 wrote:
>
> Hi Mikael,
>
> here's a very simple mwe for the label(textext()) issue. On page 1, the text 
> "Word 1" should be drawn in position z1. On page 2, the same text in the same 
> position should be visible, and the text "Mot 2" in position p2 should be 
> added. And so on.
>
> \startMPinclusions
>
> picture p[];
>  path TheFrame ;
>  TheFrame := fullsquare scaled 5in ;
>
>  z1 = (60,40);
>  z2 = (40,90);
>  z3 = (10,70);
>
> p1:=image(
> label(textext("Word 1"), z1);
> );
>
> p2:=image(
> label(textext("Mot 2"), z2);
> );
>
> p3:=image(
> label(textext("Parola 3"), z3);
> );
>
> \stopMPinclusions
>
> \starttext
>
> \dorecurse{3}{ % Frame
> \startMPpage[pagestate=start]
>  currentime := #1 ;
>  % Just for learning :
>  draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
>  draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> magenta ;
>  for k=1 upto currentime: draw p[k]; endfor
>  setbounds currentpicture to TheFrame ;
>
>  desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
>  currentpicture := currentpicture xysized (desiredformat ,desiredformat );
>
> \stopMPpage
> }
>
> \stoptext
>
> On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist  wrote:
>
> Hi Emanuel,
>
> I am not sure I understand your question, and since you use fonts that
> i do not have, I cannot test your example as is. But, maybe, if you
> want to redraw a picture, you can do
>
> addto currentpicture also p1;
>
> where you want it.
>
> /Mikael
>
> PS For the text thing, I did not get it. Could one have a _very
> simple_ example showing only that problem and no other problem?
>
> On Sat, Dec 2, 2023 at 12:58 PM fv leung  wrote:
> >
> > You didn't specify the color of path A in p2 and p4. So it's drawn in black.
> > The other issue, I can't help.
> >
> > Emanuel Han via ntg-context  於 2023年12月2日 週六 下午7:23寫道:
> >>
> >> So is there a way to circumvent these issues? Or an explanation for this 
> >> behavior, so that I can try to find a solution by myself?
> >>
> >> Thanks
> >> Emanuel
> >>
> >> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context 
> >>  wrote:
> >>
> >> Dear Aditya and Fabrice,
> >> thanks for your responses.
> >>
> >> I included some of Fabrice's code into mine for testing purpose, and 
> >> indeed the multipage works now.
> >> What is bizarre is that issues appear now that didn't appear before:
> >>
> >> Path A is drawn with color red on page 1, and in color black on all 
> >> following pages, while it should stay red.
> >> textext(, ) is overwriting  with 
> >> "T="(currentime) which has been used previously in textext() 
> >> before the for k=1 endfor loop. This overwriting happens only for the 
> >> first textext() which occurs inside the for k=1 endfor loop. All other 
> >> textext() inside the for k=1 endfor loop are not drawn at all. If the line 
> >> « draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> >> magenta ; » is commented out, the first textext() inside the for k=1 
> >> endfor loop is not drawn neither. It must be an issue with textext(), 
> >> because when I replace textext() by lmt_outline[], the text is drawn.
> >>
> >> Adjusted mwe:
> >>
> >> \enableregime[utf] % enable unicoded input
> >>
> >> \definefontfamily [RomanFont] [rm] [calluna]
> >>
>

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread Emanuel Han via ntg-context
Hi Mikael,

here's a very simple mwe for the label(textext()) issue. On page 1, the text 
"Word 1" should be drawn in position z1. On page 2, the same text in the same 
position should be visible, and the text "Mot 2" in position p2 should be 
added. And so on.
\startMPinclusions
picture p[];
path TheFrame ;
TheFrame := fullsquare scaled 5in ;

z1 = (60,40);
z2 = (40,90);
z3 = (10,70);

p1:=image(
label(textext("Word 1"), z1);
);

p2:=image(
label(textext("Mot 2"), z2);
);

p3:=image(
label(textext("Parola 3"), z3);
);

\stopMPinclusions
\starttext
\dorecurse{3}{ % Frame
\startMPpage[pagestate=start]
currentime := #1 ;
% Just for learning :
draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
magenta ;
for k=1 upto currentime: draw p[k]; endfor
setbounds currentpicture to TheFrame ;

desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
currentpicture := currentpicture xysized (desiredformat ,desiredformat );

\stopMPpage
}

\stoptext
On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist  wrote:
> Hi Emanuel,
>
> I am not sure I understand your question, and since you use fonts that
> i do not have, I cannot test your example as is. But, maybe, if you
> want to redraw a picture, you can do
>
> addto currentpicture also p1;
> where you want it.
> /Mikael
> PS For the text thing, I did not get it. Could one have a _very
> simple_ example showing only that problem and no other problem?
>
> On Sat, Dec 2, 2023 at 12:58 PM fv leung  wrote:
> >
> > You didn't specify the color of path A in p2 and p4. So it's drawn in black.
> > The other issue, I can't help.
> >
> > Emanuel Han via ntg-context  於 2023年12月2日 週六 下午7:23寫道:
> >>
> >> So is there a way to circumvent these issues? Or an explanation for this 
> >> behavior, so that I can try to find a solution by myself?
> >>
> >> Thanks
> >> Emanuel
> >>
> >> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context 
> >>  wrote:
> >>
> >> Dear Aditya and Fabrice,
> >> thanks for your responses.
> >>
> >> I included some of Fabrice's code into mine for testing purpose, and 
> >> indeed the multipage works now.
> >> What is bizarre is that issues appear now that didn't appear before:
> >>
> >> Path A is drawn with color red on page 1, and in color black on all 
> >> following pages, while it should stay red.
> >> textext(, ) is overwriting  with 
> >> "T="(currentime) which has been used previously in textext() 
> >> before the for k=1 endfor loop. This overwriting happens only for the 
> >> first textext() which occurs inside the for k=1 endfor loop. All other 
> >> textext() inside the for k=1 endfor loop are not drawn at all. If the line 
> >> « draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> >> magenta ; » is commented out, the first textext() inside the for k=1 
> >> endfor loop is not drawn neither. It must be an issue with textext(), 
> >> because when I replace textext() by lmt_outline[], the text is drawn.
> >>
> >> Adjusted mwe:
> >>
> >> \enableregime[utf] % enable unicoded input
> >>
> >> \definefontfamily [RomanFont] [rm] [calluna]
> >>
> >> \definefontfamily [KoreanFont] [rm] [applemyungjo]
> >>
> >> \definefontfamily [JapaneseFont] [rm] [hannotatesc]
> >>
> >> \definefontfeature
> >> [fea]
> >> [mode=node,language=dflt,script=arab,
> >> init=yes,
> >> medi=yes,
> >> fina=yes,
> >> isol=yes,
> >> calt=yes,
> >> rlig=yes,
> >> tlig=yes,
> >> trep=yes,
> >> curs=yes,
> >> kern=yes,
> >> mark=yes
> >> ]
> >>
> >> \starttypescript [serif] [notonaskharabic]
> >> \definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Bold] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Italic] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Bold-Italic] [name:notonaskharabic] 
> >> [features=fea]
> >> \stoptypescript
> >>
> >> \starttypescript [serif] [notonaskharabic]
> >> \usetypescript[serif][fallback]
> >> \definefontsynonym [Serif] [notonaskharabic-Light] [features=fea]
> >> \definefontsynonym [SerifItalic] [notonaskharabic-Italic] [features=fea]
&g

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread Mikael Sundqvist
Hi Emanuel,

I am not sure I understand your question, and since you use fonts that
i do not have, I cannot test your example as is. But, maybe, if you
want to redraw a picture, you can do

addto currentpicture also p1;

where you want it.

/Mikael

PS For the text thing, I did not get it. Could one have a _very
simple_ example showing only that problem and no other problem?

On Sat, Dec 2, 2023 at 12:58 PM fv leung  wrote:
>
> You didn't specify the color of path A in p2 and p4. So it's drawn in black.
> The other issue, I can't help.
>
> Emanuel Han via ntg-context  於 2023年12月2日 週六 下午7:23寫道:
>>
>> So is there a way to circumvent these issues? Or an explanation for this 
>> behavior, so that I can try to find a solution by myself?
>>
>> Thanks
>> Emanuel
>>
>> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context 
>>  wrote:
>>
>> Dear Aditya and Fabrice,
>> thanks for your responses.
>>
>> I included some of Fabrice's code into mine for testing purpose, and indeed 
>> the multipage works now.
>> What is bizarre is that issues appear now that didn't appear before:
>>
>> Path A is drawn with color red on page 1, and in color black on all 
>> following pages, while it should stay red.
>> textext(, ) is overwriting  with "T="(currentime) 
>> which has been used previously  in textext() before the for k=1 endfor loop. 
>> This overwriting happens only for the first textext() which occurs inside 
>> the for k=1 endfor loop. All other textext() inside the for k=1 endfor loop 
>> are not drawn at all. If the line  « draw textext("T="(currentime)) 
>> scaled 2 shifted(0,2in) withcolor magenta ; » is commented out, the first 
>> textext() inside the for k=1 endfor loop is not drawn neither. It must be an 
>> issue with textext(), because when I replace textext() by lmt_outline[], the 
>> text is drawn.
>>
>> Adjusted mwe:
>>
>> \enableregime[utf] % enable unicoded input
>>
>> \definefontfamily [RomanFont] [rm] [calluna]
>>
>> \definefontfamily [KoreanFont] [rm] [applemyungjo]
>>
>> \definefontfamily [JapaneseFont] [rm] [hannotatesc]
>>
>> \definefontfeature
>>  [fea]
>>  [mode=node,language=dflt,script=arab,
>>   init=yes,
>>   medi=yes,
>>   fina=yes,
>>   isol=yes,
>>   calt=yes,
>>   rlig=yes,
>>   tlig=yes,
>>   trep=yes,
>>   curs=yes,
>>   kern=yes,
>>   mark=yes
>> ]
>>
>> \starttypescript [serif] [notonaskharabic]
>>  \definefontsynonym [notonaskharabic-Light]   [name:notonaskharabic] 
>>[features=fea]
>>  \definefontsynonym [notonaskharabic-Bold][name:notonaskharabic] 
>>[features=fea]
>>  \definefontsynonym [notonaskharabic-Italic]  [name:notonaskharabic] 
>>[features=fea]
>>  \definefontsynonym [notonaskharabic-Bold-Italic] [name:notonaskharabic] 
>>[features=fea]
>> \stoptypescript
>>
>> \starttypescript [serif] [notonaskharabic]
>>  \usetypescript[serif][fallback]
>>  \definefontsynonym [Serif]   [notonaskharabic-Light]
>>[features=fea]
>>  \definefontsynonym [SerifItalic] [notonaskharabic-Italic]   
>>[features=fea]
>>  \definefontsynonym [SerifBold]   [notonaskharabic-Bold] 
>>[features=fea]
>>  \definefontsynonym [SerifBoldItalic] 
>> [notonaskharabic-Bold-Italic] [features=fea]
>> \stoptypescript
>>
>> \starttypescript [notonaskharabic]
>>   \definetypeface [notonaskharabic] [rm] [serif] [notonaskharabic] [default]
>> \stoptypescript
>>
>> \usetypescript[notonaskharabic]
>>
>> \setupbodyfont [RomanFont]
>>
>> \usecolors[crayola]
>>
>> \startMPinclusions
>>
>> picture p[];
>>  path TheFrame ;
>>  TheFrame := fullsquare scaled 5in ;
>>
>>  z0 = (0,0);
>>  z1 = (60,40);
>>  z2 = (40,90);
>>  z3 = (10,70);
>>  z4 = (30,50);
>>  z5 = (90,70);
>>  z6 = (-10,70);
>>
>> path A; A = z0..z1..z2..z3..z4 ;
>> pair AStartPoint; AStartPoint = point 0 of A;
>> pair AEndPoint; AEndPoint = point 4 of A;
>> path B; B =  z5..z6;
>> pair BStartPoint; BStartPoint = point 0 of B;
>> pair BEndPoint; BEndPoint = point 1 of B;
>> path C; C = AStartPoint..AEndPoint;
>>
>> p1:=image(
>> draw A withcolor red;
>> );
>>
>> p2:=image(draw A; label(lmt_outline [
>> text = "\JapaneseFont 日本語"
>> ], AEndPoint););
>>
>> p3:=image(
>>

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread fv leung
You didn't specify the color of path A in p2 and p4. So it's drawn in black.
The other issue, I can't help.

Emanuel Han via ntg-context  於 2023年12月2日 週六 下午7:23寫道:

> So is there a way to circumvent these issues? Or an explanation for this
> behavior, so that I can try to find a solution by myself?
>
> Thanks
> Emanuel
>
> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context <
> ntg-context@ntg.nl> wrote:
>
> Dear Aditya and Fabrice,
> thanks for your responses.
>
> I included some of Fabrice's code into mine for testing purpose, and
> indeed the multipage works now.
> What is bizarre is that issues appear now that didn't appear before:
>
>- Path A is drawn with color red on page 1, and in color black on all
>following pages, while it should stay red.
>- textext(, ) is overwriting  with
>"T="(currentime) which has been used previously  in textext()
>before the for k=1 endfor loop. This overwriting happens only for the first
>textext() which occurs inside the for k=1 endfor loop. All other textext()
>inside the for k=1 endfor loop are not drawn at all. If the line  « draw
>textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor magenta
>; » is commented out, the first textext() inside the for k=1 endfor loop is
>not drawn neither. It must be an issue with textext(), because when I
>replace textext() by lmt_outline[], the text is drawn.
>
> Adjusted mwe:
>
> \enableregime[utf] % enable unicoded input
>
> \definefontfamily [RomanFont] [rm] [calluna]
>
> \definefontfamily [KoreanFont] [rm] [applemyungjo]
>
> \definefontfamily [JapaneseFont] [rm] [hannotatesc]
>
> \definefontfeature
>  [fea]
>  [mode=node,language=dflt,script=arab,
>   init=yes,
>   medi=yes,
>   fina=yes,
>   isol=yes,
>   calt=yes,
>   rlig=yes,
>   tlig=yes,
>   trep=yes,
>   curs=yes,
>   kern=yes,
>   mark=yes
> ]
>
> \starttypescript [serif] [notonaskharabic]
>  \definefontsynonym [notonaskharabic-Light]
> [name:notonaskharabic][features=fea]
>  \definefontsynonym [notonaskharabic-Bold]
> [name:notonaskharabic][features=fea]
>  \definefontsynonym [notonaskharabic-Italic]
> [name:notonaskharabic][features=fea]
>  \definefontsynonym [notonaskharabic-Bold-Italic]
> [name:notonaskharabic][features=fea]
> \stoptypescript
>
> \starttypescript [serif] [notonaskharabic]
>  \usetypescript[serif][fallback]
>  \definefontsynonym [Serif]
> [notonaskharabic-Light]   [features=fea]
>  \definefontsynonym [SerifItalic]
> [notonaskharabic-Italic]  [features=fea]
>  \definefontsynonym [SerifBold]
> [notonaskharabic-Bold][features=fea]
>  \definefontsynonym [SerifBoldItalic]
> [notonaskharabic-Bold-Italic] [features=fea]
> \stoptypescript
>
> \starttypescript [notonaskharabic]
>   \definetypeface [notonaskharabic] [rm] [serif] [notonaskharabic]
> [default]
> \stoptypescript
>
> \usetypescript[notonaskharabic]
>
> \setupbodyfont [RomanFont]
>
> \usecolors[crayola]
>
> \startMPinclusions
>
> picture p[];
>  path TheFrame ;
>  TheFrame := fullsquare scaled 5in ;
>
>  z0 = (0,0);
>  z1 = (60,40);
>  z2 = (40,90);
>  z3 = (10,70);
>  z4 = (30,50);
>  z5 = (90,70);
>  z6 = (-10,70);
>
> path A; A = z0..z1..z2..z3..z4 ;
> pair AStartPoint; AStartPoint = point 0 of A;
> pair AEndPoint; AEndPoint = point 4 of A;
> path B; B =  z5..z6;
> pair BStartPoint; BStartPoint = point 0 of B;
> pair BEndPoint; BEndPoint = point 1 of B;
> path C; C = AStartPoint..AEndPoint;
>
> p1:=image(
> draw A withcolor red;
> );
>
> p2:=image(draw A; label(lmt_outline [
> text = "\JapaneseFont 日本語"
> ], AEndPoint););
>
> p3:=image(
> label(textext("\notonaskharabic \textdir TRT دانگ") scaled 1.2,
> BStartPoint);
> );
>
> p4:=image(draw A; label(lmt_outline [
> text = "\KoreanFont 한국어"
> ], AStartPoint););
>
> p5:=image(
> label(textext("bāng"), BEndPoint);
> draw C withcolor green;
> );
>
> p6:=image(
> draw B withcolor blue;
> );
> \stopMPinclusions
>
> \starttext
>
> \dorecurse{6}{ % Frame
>  \setupMPpage[background=color, backgroundcolor=SpringGreen]
> \startMPpage[pagestate=start]
>  currentime := #1 ;
>  % Just for learning :
>  draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
>  draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor
> magenta ;
>  for k=1 upto currentime: draw p[k]; endfor
>  setbounds currentpicture to TheFrame ;
>
>  desiredformat := 1080;% In pixels (will be converted by default 

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread Emanuel Han via ntg-context
So is there a way to circumvent these issues? Or an explanation for this 
behavior, so that I can try to find a solution by myself?

Thanks
Emanuel

On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context  
wrote:
> Dear Aditya and Fabrice,
> thanks for your responses.
>
> I included some of Fabrice's code into mine for testing purpose, and indeed 
> the multipage works now.
> What is bizarre is that issues appear now that didn't appear before:
> Path A is drawn with color red on page 1, and in color black on all following 
> pages, while it should stay red.
>
> textext(, ) is overwriting  with "T="(currentime) 
> which has been used previously in textext() before the for k=1 endfor loop. 
> This overwriting happens only for the first textext() which occurs inside the 
> for k=1 endfor loop. All other textext() inside the for k=1 endfor loop are 
> not drawn at all. If the line « draw textext("T="(currentime)) scaled 
> 2 shifted(0,2in) withcolor magenta ; » is commented out, the first textext() 
> inside the for k=1 endfor loop is not drawn neither. It must be an issue with 
> textext(), because when I replace textext() by lmt_outline[], the text is 
> drawn.
>
>
> Adjusted mwe:
>
> \enableregime[utf] % enable unicoded input
> \definefontfamily [RomanFont] [rm] [calluna]
> \definefontfamily [KoreanFont] [rm] [applemyungjo]
> \definefontfamily [JapaneseFont] [rm] [hannotatesc]
> \definefontfeature
> [fea]
> [mode=node,language=dflt,script=arab,
> init=yes,
> medi=yes,
> fina=yes,
> isol=yes,
> calt=yes,
> rlig=yes,
> tlig=yes,
> trep=yes,
> curs=yes,
> kern=yes,
> mark=yes
> ]
>
> \starttypescript [serif] [notonaskharabic]
> \definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] 
> [features=fea]
> \definefontsynonym [notonaskharabic-Bold] [name:notonaskharabic] 
> [features=fea]
> \definefontsynonym [notonaskharabic-Italic] [name:notonaskharabic] 
> [features=fea]
> \definefontsynonym [notonaskharabic-Bold-Italic] [name:notonaskharabic] 
> [features=fea]
> \stoptypescript
>
> \starttypescript [serif] [notonaskharabic]
> \usetypescript[serif][fallback]
> \definefontsynonym [Serif] [notonaskharabic-Light] [features=fea]
> \definefontsynonym [SerifItalic] [notonaskharabic-Italic] [features=fea]
> \definefontsynonym [SerifBold] [notonaskharabic-Bold] [features=fea]
> \definefontsynonym [SerifBoldItalic] [notonaskharabic-Bold-Italic] 
> [features=fea]
> \stoptypescript
>
> \starttypescript [notonaskharabic]
> \definetypeface [notonaskharabic] [rm] [serif] [notonaskharabic] [default]
> \stoptypescript
>
> \usetypescript[notonaskharabic]
> \setupbodyfont [RomanFont]
>
> \usecolors[crayola]
>
> \startMPinclusions
> picture p[];
> path TheFrame ;
> TheFrame := fullsquare scaled 5in ;
>
> z0 = (0,0);
> z1 = (60,40);
> z2 = (40,90);
> z3 = (10,70);
> z4 = (30,50);
> z5 = (90,70);
> z6 = (-10,70);
>
> path A; A = z0..z1..z2..z3..z4 ;
> pair AStartPoint; AStartPoint = point 0 of A;
> pair AEndPoint; AEndPoint = point 4 of A;
> path B; B = z5..z6;
> pair BStartPoint; BStartPoint = point 0 of B;
> pair BEndPoint; BEndPoint = point 1 of B;
> path C; C = AStartPoint..AEndPoint;
>
> p1:=image(
> draw A withcolor red;
> );
>
> p2:=image(draw A; label(lmt_outline [
> text = "\JapaneseFont 日本語"
> ], AEndPoint););
>
> p3:=image(
> label(textext("\notonaskharabic \textdir TRT دانگ") scaled 1.2, BStartPoint);
> );
>
> p4:=image(draw A; label(lmt_outline [
> text = "\KoreanFont 한국어"
> ], AStartPoint););
>
> p5:=image(
> label(textext("bāng"), BEndPoint);
> draw C withcolor green;
> );
>
> p6:=image(
> draw B withcolor blue;
> );
> \stopMPinclusions
>
> \starttext
> \dorecurse{6}{ % Frame
> \setupMPpage[background=color, backgroundcolor=SpringGreen]
> \startMPpage[pagestate=start]
> currentime := #1 ;
> % Just for learning :
> draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
> draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> magenta ;
> for k=1 upto currentime: draw p[k]; endfor
> setbounds currentpicture to TheFrame ;
>
> desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
> currentpicture := currentpicture xysized (desiredformat ,desiredformat );
>
> \stopMPpage
> }
>
> \stoptext
> On Nov. 27 2023, at 11:25 pm, Aditya Mahajan  wrote:
> > On Mon, 27 Nov 2023, Fabrice L wrote:
> >
> > > Hi,
> > >
> > > It is fun fact very easy to do. You just use \startMPpage (…) \stopMPpage 
> > > multiple times. Here is an example which build an anima

[NTG-context] Re: Bold TeX Gyre Pagella Math results in Math error: parameter 'subshiftdown' with id 48 in style 2 is not set

2023-12-01 Thread Marco Patzer
On Fri, 1 Dec 2023 15:09:32 +0100
Wolfgang Schuster  wrote:

> You get the same error with Latin Modern as soon as you use a non 
> predefined font size in combination with bold math.

True, thanks for pointing that out. I wasn't aware and frankly,
that's rather unexpected behaviour.

So to put it all together, this now works for me:

\definefontfamily [mainface] [rm] [TeX Gyre Pagella]
\definefontfamily [mainface] [ss] [TeX Gyre Heros]

\starttypescript [math] [default] [size]
  \definebodyfont [8.5pt] [mm] [default]
\stoptypescript

\definetypeface [mainface] [mm] [math] [pagella]

\setupbodyfont [mainface, 8.5pt]

\starttext
  \math{V_y}
  \bold{\math{V_y}}
\stoptext

Thank you for your replies.

Marco
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Bold TeX Gyre Pagella Math results in Math error: parameter 'subshiftdown' with id 48 in style 2 is not set

2023-12-01 Thread Wolfgang Schuster

Marco Patzer schrieb am 30.11.2023 um 22:23:

On Thu, 30 Nov 2023 20:51:42 +0100
Wolfgang Schuster  wrote:


Use the \definetypeface command to load the math font. Math fonts
always use special
settings or load additional settings which are missing when you use
\definefontfamily.

\definetypeface [mainface] [mm] [math] [pagella]

\definetypeface generates the same error message if the font size is
changed:

\definefontfamily [mainface] [rm] [TeX Gyre Pagella]
\definefontfamily [mainface] [ss] [TeX Gyre Heros]

\definetypeface [mainface] [mm] [math] [pagella]

%% 8pt works
\setupbodyfont [mainface, 8.5pt]

\starttext
   \bold{\math{x_y}}
\stoptext


You get the same error with Latin Modern as soon as you use a non 
predefined font size in combination with bold math.


 begin example
% \starttypescript [math] [default] [size]
%   \definebodyfont [8.5pt] [mm] [default]
% \stoptypescript

\setupbodyfont[8.5pt]

\starttext

\im{x_y}

\mb\im{x_y}

\stoptext
 end example

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Bold TeX Gyre Pagella Math results in Math error: parameter 'subshiftdown' with id 48 in style 2 is not set

2023-11-30 Thread Marco Patzer
On Thu, 30 Nov 2023 20:51:42 +0100
Wolfgang Schuster  wrote:

> Use the \definetypeface command to load the math font. Math fonts
> always use special
> settings or load additional settings which are missing when you use 
> \definefontfamily.
> 
> \definetypeface [mainface] [mm] [math] [pagella]

\definetypeface generates the same error message if the font size is
changed:

\definefontfamily [mainface] [rm] [TeX Gyre Pagella]
\definefontfamily [mainface] [ss] [TeX Gyre Heros]

\definetypeface [mainface] [mm] [math] [pagella]

%% 8pt works
\setupbodyfont [mainface, 8.5pt]

\starttext
  \bold{\math{x_y}}
\stoptext

Marco
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Bold TeX Gyre Pagella Math results in Math error: parameter 'subshiftdown' with id 48 in style 2 is not set

2023-11-30 Thread Marco Patzer
Hi!

I have a strange issue when TeX Gyre Pagella Math is used together
with bold text. MWE:

\definefontfamily [mainface] [rm] [TeX Gyre Pagella]
\definefontfamily [mainface] [ss] [TeX Gyre Heros]

%% comment/remove this line and it works
\definefontfamily [mainface] [mm] [TeX Gyre Pagella Math]

\setupbodyfont [mainface]
\definedescription [foo]

\starttext
  %% works, no issues here
  \math{x_y}

  %% fails if TeX Gyre Pagella Math is used
  \bold{\math{x_y}}
\stoptext

The error is:

tex error   > tex error on line 14 in file /tmp/tex-xDj/xDj.mkvi: Math 
error: parameter 'subshiftdown' with id 48 in style 2 is not set

 \math_m_nop 
#1->\relax \ifmmode #1\else \normalstartimath \begingroup #1\endgroup 
\normalstopimath 
\fi 
 
  \bold{\math{x_y}

What is the issue here?

Marco

LMTX 2023.09.04 19:15
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: multipage metapost output from ConTeXt

2023-11-29 Thread Emanuel Han via ntg-context
Dear Aditya and Fabrice,
thanks for your responses.

I included some of Fabrice's code into mine for testing purpose, and indeed the 
multipage works now.
What is bizarre is that issues appear now that didn't appear before:
Path A is drawn with color red on page 1, and in color black on all following 
pages, while it should stay red.

textext(, ) is overwriting  with "T="(currentime) 
which has been used previously in textext() before the for k=1 endfor loop. 
This overwriting happens only for the first textext() which occurs inside the 
for k=1 endfor loop. All other textext() inside the for k=1 endfor loop are not 
drawn at all. If the line « draw textext("T="(currentime)) scaled 2 
shifted(0,2in) withcolor magenta ; » is commented out, the first textext() 
inside the for k=1 endfor loop is not drawn neither. It must be an issue with 
textext(), because when I replace textext() by lmt_outline[], the text is drawn.

Adjusted mwe:

\enableregime[utf] % enable unicoded input
\definefontfamily [RomanFont] [rm] [calluna]
\definefontfamily [KoreanFont] [rm] [applemyungjo]
\definefontfamily [JapaneseFont] [rm] [hannotatesc]
\definefontfeature
[fea]
[mode=node,language=dflt,script=arab,
init=yes,
medi=yes,
fina=yes,
isol=yes,
calt=yes,
rlig=yes,
tlig=yes,
trep=yes,
curs=yes,
kern=yes,
mark=yes
]

\starttypescript [serif] [notonaskharabic]
\definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] [features=fea]
\definefontsynonym [notonaskharabic-Bold] [name:notonaskharabic] [features=fea]
\definefontsynonym [notonaskharabic-Italic] [name:notonaskharabic] 
[features=fea]
\definefontsynonym [notonaskharabic-Bold-Italic] [name:notonaskharabic] 
[features=fea]
\stoptypescript

\starttypescript [serif] [notonaskharabic]
\usetypescript[serif][fallback]
\definefontsynonym [Serif] [notonaskharabic-Light] [features=fea]
\definefontsynonym [SerifItalic] [notonaskharabic-Italic] [features=fea]
\definefontsynonym [SerifBold] [notonaskharabic-Bold] [features=fea]
\definefontsynonym [SerifBoldItalic] [notonaskharabic-Bold-Italic] 
[features=fea]
\stoptypescript

\starttypescript [notonaskharabic]
\definetypeface [notonaskharabic] [rm] [serif] [notonaskharabic] [default]
\stoptypescript

\usetypescript[notonaskharabic]
\setupbodyfont [RomanFont]

\usecolors[crayola]

\startMPinclusions
picture p[];
path TheFrame ;
TheFrame := fullsquare scaled 5in ;

z0 = (0,0);
z1 = (60,40);
z2 = (40,90);
z3 = (10,70);
z4 = (30,50);
z5 = (90,70);
z6 = (-10,70);

path A; A = z0..z1..z2..z3..z4 ;
pair AStartPoint; AStartPoint = point 0 of A;
pair AEndPoint; AEndPoint = point 4 of A;
path B; B = z5..z6;
pair BStartPoint; BStartPoint = point 0 of B;
pair BEndPoint; BEndPoint = point 1 of B;
path C; C = AStartPoint..AEndPoint;

p1:=image(
draw A withcolor red;
);

p2:=image(draw A; label(lmt_outline [
text = "\JapaneseFont 日本語"
], AEndPoint););

p3:=image(
label(textext("\notonaskharabic \textdir TRT دانگ") scaled 1.2, BStartPoint);
);

p4:=image(draw A; label(lmt_outline [
text = "\KoreanFont 한국어"
], AStartPoint););

p5:=image(
label(textext("bāng"), BEndPoint);
draw C withcolor green;
);

p6:=image(
draw B withcolor blue;
);
\stopMPinclusions

\starttext
\dorecurse{6}{ % Frame
\setupMPpage[background=color, backgroundcolor=SpringGreen]
\startMPpage[pagestate=start]
currentime := #1 ;
% Just for learning :
draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
magenta ;
for k=1 upto currentime: draw p[k]; endfor
setbounds currentpicture to TheFrame ;

desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
currentpicture := currentpicture xysized (desiredformat ,desiredformat );

\stopMPpage
}

\stoptext
On Nov. 27 2023, at 11:25 pm, Aditya Mahajan  wrote:
> On Mon, 27 Nov 2023, Fabrice L wrote:
>
> > Hi,
> >
> > It is fun fact very easy to do. You just use \startMPpage (…) \stopMPpage 
> > multiple times. Here is an example which build an animation of a particle 
> > moving according to a Brownian motion.
>
> A very similar option is to pass a variable to a metapost drawing. This is 
> what I use:
> https://adityam.github.io/context-blog/post/metapost-animation/
> It only works when viewed in acrobat, you can just comment out the animation 
> part and wrap it in \startTEXpage .. \stopTEXpage to get multi-page animation.
> Aditya___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> _

[NTG-context] Re: usage of conversion in \date

2023-11-29 Thread Hans Hagen

On 11/28/2023 6:09 PM, Peter Münster wrote:

Hi,

When printing a date in French, I would like to convert the "1" to
"1\ier", but it does not work as I expect:

--8<---cut here---start->8---
\startluacode
-- from https://wiki.contextgarden.net/Command/defineconversion:
interfaces.implement {
 name  = "FRdate",
 public= true,
 arguments = "string",
 actions   =
 function(s)
 local n = tonumber(s)
 if n == 1 then
 context"1\\ier"
 else
 context(s)
 end
 end
}
\stopluacode
\def\ier{\highordinalstr{er}}
\mainlanguage[fr]
\defineconversion[frd][\FRdate]
\setuplanguage[fr][date={day:frd,\ ,month,\ ,year}]
\starttext
Conversion: \convertnumber{frd}{1}, \convertnumber{frd}{2} (OK)\\
Dates: \date[d=1], \date[d=2] (not OK)
\stoptext
--8<---cut here---end--->8---

How could I get "1\ier\ novembre 2023" please?

\mainlanguage[fr]

\setuplanguage[fr][date={day:++,\ ,month,\ ,year}]

\starttext
Dates: \date[d=1], \date[d=2] (not OK)
\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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] usage of conversion in \date

2023-11-28 Thread Peter Münster
Hi,

When printing a date in French, I would like to convert the "1" to
"1\ier", but it does not work as I expect:

--8<---cut here---start->8---
\startluacode
-- from https://wiki.contextgarden.net/Command/defineconversion:
interfaces.implement {
name  = "FRdate",
public= true,
arguments = "string",
actions   =
function(s)
local n = tonumber(s)
if n == 1 then
context"1\\ier"
else
context(s)
end
end
}
\stopluacode
\def\ier{\highordinalstr{er}}
\mainlanguage[fr]
\defineconversion[frd][\FRdate]
\setuplanguage[fr][date={day:frd,\ ,month,\ ,year}]
\starttext
Conversion: \convertnumber{frd}{1}, \convertnumber{frd}{2} (OK)\\
Dates: \date[d=1], \date[d=2] (not OK)
\stoptext
--8<---cut here---end--->8---

How could I get "1\ier\ novembre 2023" please?

TIA for any help,
-- 
   Peter
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: multipage metapost output from ConTeXt

2023-11-27 Thread Fabrice L
Hi,

It is fun fact very easy to do. You just use \startMPpage (…) \stopMPpage 
multiple times. Here is an example which build an animation of a particle 
moving according to a Brownian motion. 

Fabrice.

% 8< ---

\usecolors[crayola]
\setupMPinstance

\starttext

% We can put in the inclusions the material we will use at each page, to 
declare things only one time.
\startMPinclusions
 % the frame of the video ;
 path TheFrame ;
 TheFrame := fullsquare scaled 5in ;

 randomseed := 53 ;
 path TheBrownianMotion ;
 pair Coordinate[];
 Coordinate[0] := (0,0);
 TheBrownianMotion := Coordinate[0] ;
 variance := 10 ;
\stopMPinclusions

\dorecurse{600}{ % Frame

\setupMPpage[background=color, backgroundcolor=SpringGreen]
\startMPpage[pagestate=start]

 currentime := #1 ;
 % Just for learning :
 draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
 draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
magenta ;

Coordinate[currentime] := Coordinate[currentime-1] + 
%(normaldeviate*variance,normaldeviate*variance) ;
  ((uniformdeviate(1)-0.5)*variance,(uniformdeviate(1)-0.5)*variance) ;
TheBrownianMotion := for p=0 upto (currentime-1) :
  Coordinate[p] .. endfor Coordinate[currentime] ;

draw TheBrownianMotion withpen pencircle scaled .01in withcolor blue ;
draw Coordinate[currentime] withpen pencircle scaled .10in withcolor red ;

setbounds currentpicture to TheFrame ;

desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
currentpicture := currentpicture xysized (desiredformat ,desiredformat );

\stopMPpage

} 

\stoptext
% 8< ---



> Le 27 nov. 2023 à 13:49, Emanuel Han via ntg-context  a 
> écrit :
> 
> How can I achieve multipage metapost output from ConTeXt? The result should 
> be a multipage pdf. It contains just a metapost graphic per page. The graphic 
> has always the same bounding box and evolves from page to page: Some elements 
> to be drawn are added, and some others would ideally also be removed, while 
> keeping elements which has already been drawn on previous pages. I can manage 
> when it is not possible to remove elements (in that case I'll just cover them 
> with a covering element).
> 
> I saw that it is possible to achieve my goal with standalone metapost, as 
> described here: 
> https://tex.stackexchange.com/questions/471662/mptopdf-is-multipage-output-pdf-possible
> But I'll need to achieve this with Metapost inside ConTeXt because I use 
> labels in Metapost which print text in Japanese, Korean , Arabic and Roman 
> script: Thanks to ConTeXt, I can define appropriate fonts for each script. 
> All this works already in my working example.
> 
> The only unsolved problem is to ship out multiple pages.
> 
> For the minimal working example, I didn't remove the font defining part, 
> because having 4 different fonts is a condition of my use case. The graphic 
> on the other hand is some simple dummy nonsense graphic not from my project. 
> The graphic is in the provided example drawn as a summing up of layered 
> drawing steps (6 steps, to be precise), so no removing is implemented here 
> (because I don't know how that would be done). If each of the figures 1 to 6 
> of my mwe can be put alone on a page, I'd be already very happy. Now, they're 
> put on top of each other all on the same single page, also on top of figure 0.
> 
> The desired multipage pdf will be used in presentation mode of a pdf viewer 
> and skipped forward and backward from page to page (that is from drawing step 
> to drawing step).
> 
> mwe:
> 
> \enableregime[utf] % enable unicoded input
> 
> \definefontfamily [RomanFont] [rm] [calluna]
> 
> \definefontfamily [KoreanFont] [rm] [applemyungjo]
> 
> \definefontfamily [JapaneseFont] [rm] [hannotatesc]
> 
> \definefontfeature
>  [fea]
>  [mode=node,language=dflt,script=arab,
>   init=yes,
>   medi=yes,
>   fina=yes,
>   isol=yes,
>   calt=yes,
>   rlig=yes,
>   tlig=yes,
>   trep=yes,
>   curs=yes,
>   kern=yes,
>   mark=yes
> ]
> 
> \starttypescript [serif] [notonaskharabic]
>  \definefontsynonym [notonaskharabic-Light]   [name:notonaskharabic]  
>   [features=fea]
>  \definefontsynonym [notonaskharabic-Bold][name:notonaskharabic]  
>   [features=fea]
>  \definefontsynonym [notonaskharabic-Italic]  [name:notonaskharabic]  
>   [features=fea]
>  \definefontsynonym [notonaskharabic-Bold-Italic] [name:notonaskharabic]  
>   [features=fea]
> \stoptypescript
> 
> \starttypescript [serif] [notonaskharabic]
>  \usetypescript[serif][fallback]
>  \definefontsynonym [Serif]   [notonaskharabic-Light] 
>   [features=fea]
>  \definefontsynonym [SerifItalic]

[NTG-context] multipage metapost output from ConTeXt

2023-11-27 Thread Emanuel Han via ntg-context
How can I achieve multipage metapost output from ConTeXt? The result should be 
a multipage pdf. It contains just a metapost graphic per page. The graphic has 
always the same bounding box and evolves from page to page: Some elements to be 
drawn are added, and some others would ideally also be removed, while keeping 
elements which has already been drawn on previous pages. I can manage when it 
is not possible to remove elements (in that case I'll just cover them with a 
covering element).

I saw that it is possible to achieve my goal with standalone metapost, as 
described here: 
https://tex.stackexchange.com/questions/471662/mptopdf-is-multipage-output-pdf-possible
But I'll need to achieve this with Metapost inside ConTeXt because I use labels 
in Metapost which print text in Japanese, Korean , Arabic and Roman script: 
Thanks to ConTeXt, I can define appropriate fonts for each script. All this 
works already in my working example.
The only unsolved problem is to ship out multiple pages.
For the minimal working example, I didn't remove the font defining part, 
because having 4 different fonts is a condition of my use case. The graphic on 
the other hand is some simple dummy nonsense graphic not from my project. The 
graphic is in the provided example drawn as a summing up of layered drawing 
steps (6 steps, to be precise), so no removing is implemented here (because I 
don't know how that would be done). If each of the figures 1 to 6 of my mwe can 
be put alone on a page, I'd be already very happy. Now, they're put on top of 
each other all on the same single page, also on top of figure 0.
The desired multipage pdf will be used in presentation mode of a pdf viewer and 
skipped forward and backward from page to page (that is from drawing step to 
drawing step).
mwe:
\enableregime[utf] % enable unicoded input
\definefontfamily [RomanFont] [rm] [calluna]
\definefontfamily [KoreanFont] [rm] [applemyungjo]
\definefontfamily [JapaneseFont] [rm] [hannotatesc]
\definefontfeature
[fea]
[mode=node,language=dflt,script=arab,
init=yes,
medi=yes,
fina=yes,
isol=yes,
calt=yes,
rlig=yes,
tlig=yes,
trep=yes,
curs=yes,
kern=yes,
mark=yes
]

\starttypescript [serif] [notonaskharabic]
\definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] [features=fea]
\definefontsynonym [notonaskharabic-Bold] [name:notonaskharabic] [features=fea]
\definefontsynonym [notonaskharabic-Italic] [name:notonaskharabic] 
[features=fea]
\definefontsynonym [notonaskharabic-Bold-Italic] [name:notonaskharabic] 
[features=fea]
\stoptypescript

\starttypescript [serif] [notonaskharabic]
\usetypescript[serif][fallback]
\definefontsynonym [Serif] [notonaskharabic-Light] [features=fea]
\definefontsynonym [SerifItalic] [notonaskharabic-Italic] [features=fea]
\definefontsynonym [SerifBold] [notonaskharabic-Bold] [features=fea]
\definefontsynonym [SerifBoldItalic] [notonaskharabic-Bold-Italic] 
[features=fea]
\stoptypescript

\starttypescript [notonaskharabic]
\definetypeface [notonaskharabic] [rm] [serif] [notonaskharabic] [default]
\stoptypescript

\usetypescript[notonaskharabic]
\setupbodyfont [RomanFont]

\starttext
\startMPcode
picture p[];
path bb; %bounding box

z0 = (0,0);
z1 = (60,40);
z2 = (40,90);
z3 = (10,70);
z4 = (30,50);
z5 = (90,70);
z6 = (-10,70);

path A; A = z0..z1..z2..z3..z4 ;
pair AStartPoint; AStartPoint = point 0 of A;
pair AEndPoint; AEndPoint = point 4 of A;
path B; B = z5..z6;
pair BStartPoint; BStartPoint = point 0 of B;
pair BEndPoint; BEndPoint = point 1 of B;
path C; C = AStartPoint..AEndPoint;

% drawing steps:
p1:=image(
draw A withcolor red;
);

p2:=image(
label(textext("\JapaneseFont 日本語"), AEndPoint);
);

p3:=image(
label(textext("\notonaskharabic \textdir TRT دانگ") scaled 1.2, AStartPoint);
);

p4:=image(
label(textext("\KoreanFont 한국어"), BStartPoint);
);

p5:=image(
label(textext("\RomanFont bāng"), BEndPoint);
draw C withcolor green;
);

p6:=image(
draw B withcolor blue;
);

beginfig(0); %% the whole picture for the common bbox
for k=1 upto 6: draw p[k]; endfor
bb:=bbox(currentpicture);
endfig;

for $=1 upto 6:
beginfig($);
for k=1 upto $: draw p[k]; endfor
setbounds currentpicture to bb;
endfig;
endfor

\stopMPcode
\stoptext

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Converting XHTML captions to ConTeXt captions

2023-11-26 Thread Thangalin
I'd like to capture a caption and apply it to the block-level element that
immediately follows. In the MWE, is there a more "ConTeXt way" to
accomplish the task of adding captions to tables, figures, blockquotes, etc?

% SOT
\startbuffer[demo]

Caption 1 
table 1 with caption
table 2 without caption
Caption 3 
table 3 with caption

\stopbuffer

\startxmlsetups xml:demo
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{a|p|body|table}{xml:*}
  \xmlsetsetup{\xmldocument}{span[@class='caption']}{xml:span}

  \define\CaptionText{}
  \define\AnchorXref{}
\stopxmlsetups

\startxmlsetups xml:span
  \define\CaptionText{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:a
  \define\AnchorXref{\xmlatt{#1}{data-type}-\xmlatt{#1}{name}}
\stopxmlsetups

\startxmlsetups xml:body \xmlflush{#1} \stopxmlsetups
\startxmlsetups xml:p \xmlflush{#1}\par \stopxmlsetups
\startxmlsetups xml:table
  \blank
  \doifelsetext{\CaptionText}{%
\startplacetable[
  title={\ignorespaces\CaptionText{}\removeunwantedspaces.},
  reference={\AnchorXref}
]

\define\CaptionText{}
\define\AnchorXref{}
  }{
\startplacetable
  }

\startembeddedxtable
  \startxtablebody[body]
\startxrow
  \startxcell
\xmlflush{#1}
  \stopxcell
\stopxrow
  \stopxtablebody
\stopembeddedxtable
  \stopplacetable
  \blank
\stopxmlsetups

\xmlregistersetup{xml:demo}

\starttext
  \xmlprocessbuffer{demo}{demo}{}
\stoptext
% EOT
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: mathalignment; alignment of columns

2023-11-24 Thread Mikael Sundqvist
Hi,

try

\startmathalignment[n=2,align={1:left,2:right}]

I think this was changed two or three years ago.

/Mikael

On Fri, Nov 24, 2023 at 11:04 PM wolfgangbackes--- via ntg-context
 wrote:
>
> Something as elementary as "mathenvironment" can't really be faulty, can it? 
> According to my recent tests, a mathalignment environment does not seem to 
> react (any more) to the values of the "align" option.
> The source code hab been rendered correctly a few years ago,
>
> Minimal example 1:
>
> \starttext
> \startformula
> \startmathalignment[n=2,align={left, right}]
> \NC always aligned to the right \NC = u + at, \NR
> \NC d \NC = ut + \frac12 at^2. \NR
> \stopmathalignment
> \stopformula
> \stoptext
>
> Despite "align={left, right}", the first column is aligned to the right and 
> the second to the left. This does not change, no matter which values I assign 
> to "align", for example align={middle, middle}.
>
> The align option is also ignored in the case of other column numbers., for 
> example:
>
> \starttext
> \startformula
> \startmathalignment[n=1,align=left]
> \NC This single column should \NR
> \NC be left-aligned, \NR
> \NC but it is centered. \NR
> \stopmathalignment
> \stopformula
> \stoptext
>
>  What am I missing here? Where is my mistake?
>
> Regards
> Wolfgang
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] mathalignment; alignment of columns

2023-11-24 Thread wolfgangbackes--- via ntg-context
Something as elementary as "mathenvironment" can't really be faulty, can it? 
According to my recent tests, a mathalignment environment does not seem to 
react (any more) to the values of the "align" option.
The source code hab been rendered correctly a few years ago,

Minimal example 1:

\starttext
\startformula
\startmathalignment[n=2,align={left, right}]
\NC always aligned to the right \NC = u + at, \NR
\NC d \NC = ut + \frac12 at^2. \NR
\stopmathalignment
\stopformula 
\stoptext

Despite "align={left, right}", the first column is aligned to the right and the 
second to the left. This does not change, no matter which values I assign to 
"align", for example align={middle, middle}.

The align option is also ignored in the case of other column numbers., for 
example:

\starttext 
\startformula
\startmathalignment[n=1,align=left]
\NC This single column should \NR
\NC be left-aligned, \NR
\NC but it is centered. \NR
\stopmathalignment
\stopformula 
\stoptext

 What am I missing here? Where is my mistake?

Regards
Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Compatibility Issue with TikZ/Spy Library in ConTeXt: Seeking Solutions

2023-11-24 Thread Hans Hagen

On 11/24/2023 11:17 AM, wolfgangbackes--- via ntg-context wrote:

Hello,
I am reaching out to seek assistance regarding a compatibility issue I have 
encountered after installing ConTeXt on a new computer. The problem arises when 
attempting to compile documents that utilize the spy library; the LuaTeX engine 
returns the following error message:

"error (luacall): invalid number
mtx-context | fatal error: return code: 1"

Unfortunately, the error message provides no additional clues. To investigate 
further, I created a minimal example, which you can easily verify at 
https://context-on-web.eu/. The example employs the spy library within a TikZ 
environment. Surprisingly, the same example runs without error on my local 
LaTeX engine, indicating a potential compatibility issue between ConTeXt and 
the spy library.

Here is the minimal example for your reference:

\starttext
\usemodule[tikz]
\usetikzlibrary {spy}
\starttikzpicture[spy using overlays={size=12mm}]
\draw (0,0) -- (1,1) -- (2,-1);
\spy [blue,magnification=5] on (1,1) in node at (3,0);
\stoptikzpicture
\stoptext

I am curious if anyone else has encountered a similar problem with the spy 
library and ConTeXt and, if so, if there is a known solution. Any insights or 
guidance would be greatly appreciated.

Thank you for your time and assistance.
the log probably mentions some call lua issue .. tikz is somewhat hard 
to debug but in the end i figured out that it relates to the way it 
registers function where it assumes that it's the only pqackage in the 
tex universe


put this before you load tikz:

\ifdefined\pdfstrcmp\else

\def\pdfstrcmp{\directlua{
local a = token.scan_string()
local b = token.scan_string()
context((a < b and -1) or (a > b and 1) or 0)
}}

\fi

i'll add more efficient ones to the tikz modules

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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


<    2   3   4   5   6   7   8   9   10   11   >