Re: [NTG-context] new lmtx

2020-11-27 Thread Pablo Rodriguez
On 11/27/20 8:26 PM, Hans Hagen wrote:
> Hi,
>
> A new upload ... a few lua files cleaned up (stale code removed and so)
> ... hopefully for the best.

Many thanks for the new upload, Hans.

A new glitch (present in the previous version too) in PDF links:

  \setuppapersize[A9]

  \setupinteraction[state=start]

  \enabledirectives[references.border]

  \unexpanded\def\MyURL#1%

{\bgroup\goto{{\tt\hyphenatedurl{#1}}}[url(#1)]\egroup}

  \starttext

  a\footnote{\dorecurse{2}{longer }\MyURL{a.b/c.de}.

\dorecurse{5}{word }}\stopasciimode

  \stoptext


The link rectangle goes to the end of the line.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] inbetween in \setupnotation

2020-11-27 Thread Pablo Rodriguez
On 11/27/20 8:29 PM, Wolfgang Schuster wrote:
> Pablo Rodriguez schrieb am 27.11.2020 um 19:48:
>> [...]
>>\setupnotation[footnote]
>>  [before={\blackrule[color=red]},
>>   after={\blackrule[color=blue]},
>>   inbetween={\blackrule[color=green]}]
>>\starttext
>>\dorecurse{18}{a\footnote{b} }
>>\stoptext
>>
>> I wonder why the green rule isn’t shown.
>>
>> I mean, I would expect to see it between footnotes.
>>
>> What am I missing or doing wrong?
>
> \setupnotation [footnote] [alternative=top]

Many thanks for your reply, Wolfgang.

I see that my approach is wrong. I need serried for the footnotes as an
alternative. Having the footnote number in a different line makes no
sense in my case.

Which is the best way to set the space between foootnotes that appear on
the same page?

The options after and before place the space after or before the last
and first footnote (which I would like to avoid).

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Install Problems with 64 bit ARM Linux

2020-11-27 Thread Christian Prim
Hi everyone

Is there a reason why the arm binaries for ARM Linux use version 2.29 of
glibc? My actual debian buster installation is still on glibc-2.28. The
x86_64 Linux binaries also use the older 2.28-version which is widely used
among many distros. I would be very happy if I could install a 2.28-version
on my ARM Linux box. Else I have to compile my own glic... or my own
mtxrun...

Many thanks for your clarifications
Christian

PS.: error messages during the install:
.../lmtx/bin/mtxrun: /lib/aarch64-linux-gnu/libm.so.6: version `GLIBC_2.29'
not found (required by .../lmtx/bin/mtxrun)
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] inbetween in \setupnotation

2020-11-27 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 27.11.2020 um 19:48:

Dear list,

I have the following sample:

   \setupnotation[footnote]
 [before={\blackrule[color=red]},
  after={\blackrule[color=blue]},
  inbetween={\blackrule[color=green]}]
   \starttext
   \dorecurse{18}{a\footnote{b} }
   \stoptext

I wonder why the green rule isn’t shown.

I mean, I would expect to see it between footnotes.

What am I missing or doing wrong?


\setupnotation [footnote] [alternative=top]

Wolfgang

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] new lmtx

2020-11-27 Thread Hans Hagen

Hi,

A new upload ... a few lua files cleaned up (stale code removed and so) 
... hopefully for the best.


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] inbetween in \setupnotation

2020-11-27 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \setupnotation[footnote]
[before={\blackrule[color=red]},
 after={\blackrule[color=blue]},
 inbetween={\blackrule[color=green]}]
  \starttext
  \dorecurse{18}{a\footnote{b} }
  \stoptext

I wonder why the green rule isn’t shown.

I mean, I would expect to see it between footnotes.

What am I missing or doing wrong?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting and measuring boxes TeX/Lua

2020-11-27 Thread Hans Hagen

Hi Jano,

It's not clear to me what you want to measure when but here is a weekend 
playground (you're locked down anyway).


\def\MacroJano#1%
  {\writestatus{JANO}{ONE}
   \setbox0=\hbox\bgroup\xmlflush{#1}\egroup}

\startluacode
function document.FunctionJano(id)
context.writestatus("JANO","ZERO")
token.expand_macro("MacroJano",true,id)
context("%p",tex.box[0].width)
context.writestatus("JANO","TWO")
end
\stopluacode

\startbuffer[doc]


one
one two
one two three

\stopbuffer

\startxmlsetups xml:name
\xmlsetsetup{#1}{*}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:name}

\startxmlsetups xml:section
width: \ctxlua{document.FunctionJano("#1")}\par
\stopxmlsetups

\startxmlsetups xml:document
\xmlflush{#1}
\stopxmlsetups

\starttext

\xmlprocessbuffer{xml:name}{doc}{}

\stoptext

A clue: token.expand_macro will kind of 'run a local tex job'.

If this works for you. you know the price you have to pay ... wikify

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Problem with gnuplot-module in lmtx

2020-11-27 Thread Christian Prim
Thanks Hans

the new upload works with the gnuplot-module as it should be!

Christian

Am Mi., 25. Nov. 2020 um 14:25 Uhr schrieb Christian Prim <
christian.p...@gmx.ch>:

> Hi
>
> with the latest version of lmtx (upgraded a minute ago), the
> gnuplot-example from the wiki-page (for lmtx with externalfigure) doesn't
> work. Error is:
>
> tex error   > tex error on line 1 in file
> virtual://buffer.svg-sin-inclusion.1: Undefined control sequence
>
>  \font_basics_predefine #1#2->\font_basics_defined_font_yes
> [#2]\gletcsname #1\expandafter \endcsname \csname
> \v_font_identifier_basic \endcsname
>  \predefinedfont [#1]->\ifcsname \??predefinedfont #1\endcsname
> \lastnamedcs \else \font_basics_predefined {#1}
> \fi
>  \svgnormal ...ame \??svgfamily #1\endcsname \lastnamedcs \else
> #1\fi -#2-#3}\predefinedfont [\s!spec :\p_font *\s!default \space @ 10bp]
> \fi #4\egroup
>
>  \svgstartlayer
> \svgscaled{1}{arial}{normal}{normal}{\svgscaled{1}{arial}{normal}{normal}{\svghashed{1}}}
> \svgstoplayer
>
>  \
>
>  \global \setbox \mptextbox \hbox {\clf_mptexttoks
> }
> ...
>
>  \includegnuplotsvgfile[./sin.svg]
> \resetbuffer[svg-sin-inclusion]
>
> 
>
>
> The control sequence at the end of the top line of your error message was
> never
> \def'ed. You can just continue as I'll forget about whatever was undefined.
>
>
> mtx-context | fatal error: return code: 256
>
> here is the code:
>
> gnuplot.tex:
> \usemodule[gnuplot]
>
> \starttext
> \externalfigure[sin.gp][conversion=svg,width=4cm]
> \stoptext
>
> sin.gp:
> set format xy "$%g$"
>
> set title  'This is a plot of $y=\\sin(x)$'
> set xlabel 'This is the $x$ axis'
> set ylabel 'This is the $y$ axis'
>
> plot [0:6.28] [0:1] sin(x)
>
> The same code works on older lmtx (current version: 2020.09.20 23:02).
> It's not on the same linux-machine, but both have the same gnuplot-version
> installed.
>
> Is this a bug?
>
> Thanks
> Christian
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting and measuring boxes TeX/Lua

2020-11-27 Thread Jano Kula
Hello again, Hans!

On Thu, 26 Nov 2020 at 09:18, Hans Hagen  wrote:

> (this mechanism is already kind of old, there are also other cheats
> possible)
>

Diving into functions and using context.stepwise() worked, until I've got
to: /cldf-stp.lua:48: bad argument #1 to 'resume' (thread expected) and
other errors. It was triar/error approach, not exactly knowing how
context.stepwise() works, and I was some more lua functions and iterations
before needing expansion.

Therefore I've changed the strategy (cannot give up):

   - Create named buffers with formatted content (and store measures)
   before they are needed.
   - When needed, use the reference to the buffer.

Tests looked promising. After \starttext buffers and measures are known
(both TeX & Lua). Also tested in functions, etc.
But inside the first \xmlsetup, they are not expanded anymore, they are
typeset (like \typebuffer).

   - How to have them expanded in \xmlsetup?
   - Is other mechanism better suited for storing typeset blocks than
   buffers (and will survive \xmlsetup)?
   - If none of them is possible, what are the *other **cheats *then?

Thanks,
Jano

MWE attached

% BUFFERS
\startluacode
-- fill buffers
for i=1,1000 do
local content = "framed-" .. i
context.startbuffer( { i } )
context.StartBox()
context.bold(i)context.par()
context.color( { "red" }, content )
context.StopBox()
context.copy(false,0)
context.stopbuffer()
print(">>", i)
end
\stopluacode

\def\StartBox{\setbox0=\hbox\bgroup\framed[width=50mm,
   background=color,
   backgroundcolor=gray,
   frame=off,align={flushleft}]%
   \bgroup%
\vbox\bgroup}
\def\StopBox{\egroup\egroup\egroup}% close vbox, framed, hbox

\def\MeasureBuffer[#1]{\setbox0\hbox{\getbuffer[#1]}%
   ht: \the\ht0\par}


% XML
\startbuffer[doc]


section
section

\stopbuffer

\startxmlsetups xml:name
\xmlsetsetup{\xmldocument}{*}{-}
\xmlsetsetup{\xmldocument}{document}{xml:name:*}
\stopxmlsetups

\xmlregistersetup{xml:name}

\startxmlsetups xml:name:document
\Title{inside xml:name:document}
\Title{TeX}
\MeasureBuffer[333]
\getbuffer[333]
\Title{Lua}
\startluacode
context.MeasureBuffer({"444"})
context.getbuffer({"444"})
\stopluacode
\stopxmlsetups

\def\Title#1{\blank{\bf #1}\par}


\starttext

\Title{TeX}
\MeasureBuffer[111]
\getbuffer[111]

\Title{Lua}
\startluacode
context.MeasureBuffer({"222"})
context.getbuffer({"222"})
\stopluacode

\xmlprocessbuffer{xml:name}{doc}{}

\stoptext


xml-buffers.tex
Description: TeX document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-27 Thread Keith McKay
Thanks Taco!
I understand much better now. I think it's best to leave the units out
until the drawing stage as you suggest.
Thanks again
Keith McKay

On Fri, 27 Nov 2020, 08:30 Taco Hoekwater,  wrote:

>
>
> > On 26 Nov 2020, at 16:09, Keith McKay  wrote:
> >
> > Hi,
> >
> > I have been using xpart and ypart to extract these values from pairs of
> points in a path but I wasn't getting the correct result. I was expecting:
> >
> > pair (2cm, 11cm) to give xpart 2 and ypart 11
>
> As explained by various people, Metapost does not have dimensions. All
> lengths are implicit Postscript big points
> (72/inch). Variables like “cm” just add a multiplication factor to your
> expressions, at no point is a dimension stored inside Metapost.
>
> Your equation:
>
>   a0 = (2cm,11cm)
>
> first expands into
>
>   a0 = (2*28.34645,11*28.34645)
>
> because “cm” is a variable with a value (Its definition in plain.mp is
> "cm = 28.34645”)
>
> Then, the two expressions in the a0 equation are resolved before the
> assignment, so what you actually wrote at the statement level is
>
>   a0 = (56.6929, 311.8096);
>
> At no point is there a “cm”-sized dimension.
>
> ===
>
> Perhaps another option would be for you to do all your work without units,
> e.g.
>
>   a0 = (2,11) % assume scaling will happen later
>
> and then in the end do the drawing on a scaled path:
>
>   draw (pp scaled cm) …
>
> as that may be less confusing? If the precision is an issue, you could
> counter the loss of precision you could use implied millimeters instead of
> centimeters.
>
> Best wishes,
> Taco
>
>
>
>
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mathmatrix and internal lines

2020-11-27 Thread Hans Hagen

On 11/27/2020 10:07 AM, Otared Kavian wrote:

Hi Hans,

Thanks for your insight!
Indeed I'll wikify what you explained, once I have tested it with the next 
upload. Would  \HL and \VL be also available in mkiv ?

Dunno yet ... it's not that hard but I'm in lmtx mode now.

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mathmatrix and internal lines

2020-11-27 Thread Otared Kavian
Hi Hans,

Thanks for your insight!
Indeed I'll wikify what you explained, once I have tested it with the next 
upload. Would  \HL and \VL be also available in mkiv ?

Best regards: Otared

> On 26 Nov 2020, at 23:23, Hans Hagen  wrote:
> 
> On 11/26/2020 8:43 PM, Otared Kavian wrote:
>> Hi Jean-Philippe,
>> A few weeks ago I saw briefly the discussion about Hans' message regarding 
>> \noalign and the the new definitions of \HR and \VR that you are sending. 
>> Indeed your solution works great !
>> Just for the case other people may have the same question about writing 
>> block matrix, I copy below the whole example which can be found later in the 
>> mail archive.
>> (For mkiv, I don't know how to do the same thing…).
> 
> The \noaligned permits a \protected definition. Otherwise one has to do 
> something
> 
> \def\VR{\noalign\bgroup
>   
> that command then does the rule and ends the noalign. Also, that one cannot 
> be \protected (a pitty in case one uses \expanded or so)
> 
> So ... a multistep approach. Plenty of that in mkiv.
> 
>> %%% begin block-matrix.tex
>> % in LMTX defining \HR and \VR to create block matrices:
>> \pushoverloadmode
>> \noaligned\tolerant\protected\def\HR[#1]{\noalign{\hrule #1}}
>> \popoverloadmode
>> \def\VR{\dosingleempty\doVR}
>> \def\doVR[#1]{\NC \hskip-0.5em \vrule #1 \hskip-0.5em \NC}
> 
> given the \HR definition that should be
> 
> \tolerant\protected\def\VR[#1]{\NC ...\NC}
> 
>> \definemathmatrix[mymatrix]
>>  [left={\left(\,},
>>  right={\, \right)}]
>> \starttext   
>> \startformula
>>  \startmymatrix
>>  \NC A \VR  B \NR
>>  \HR
>>  \NC C \VR  D \NR
>>  \stopmymatrix
>> \stopformula
>> \stoptext
> 
> Anyway, a feature like this should be in sync with other table mechanisms, so
> 
> \definemathmatrix
>  [mymatrix]
>  [left={\left\lparent\thinspace},
>   right={\thinspace\right\rparent}]
> 
> \starttext
> 
> \startformula
>   \startmymatrix
>   \NC A \VL  B \NR
>   \HL
>   \NC C \VL  D \NR
>   \stopmymatrix
> \stopformula
> 
> \startformula
>   \startmymatrix
>   \NC A \VL[3,green]  B \NR
>   \HL[10,red]
>   \NC C \VL  D \NR
>   \stopmymatrix
> \stopformula
> 
> \stoptext
> 
> A bit more code needed but the next upload will have it. Of course you have 
> to wikify it.
> 
> Hans
> 
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Testing for LMTX

2020-11-27 Thread Jean-Philippe Rey
Pablo, Jairo,

Thank you very much.

> Le 26 nov. 2020 à 21:01, Pablo Rodriguez  a écrit :
> 
> On 11/26/20 8:06 PM, Jean-Philippe Rey wrote:
>> [...]
>> Do you know a way to distinguish between LMTX and MkIV ?
> 
> Hi Jean-Philippe,
> 
> I guess this is what you are looking for:
> 
>  \starttext
>  \startTEXpage[offset=1em]
>  \startlmtxmode LMTX\stoplmtxmode
>  \startmkivmode MkIV\stopmkivmode
>  \stopTEXpage
>  \stoptext
> 
> Just in case it helps,
> 
> Pablo


-- 
Jean-Philippe Rey
jean-philippe@centralesupelec.fr 

91192 Gif-sur-Yvette Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-27 Thread Taco Hoekwater


> On 26 Nov 2020, at 16:09, Keith McKay  wrote:
> 
> Hi,
> 
> I have been using xpart and ypart to extract these values from pairs of 
> points in a path but I wasn't getting the correct result. I was expecting:
> 
> pair (2cm, 11cm) to give xpart 2 and ypart 11

As explained by various people, Metapost does not have dimensions. All lengths 
are implicit Postscript big points
(72/inch). Variables like “cm” just add a multiplication factor to your 
expressions, at no point is a dimension stored inside Metapost. 

Your equation:

  a0 = (2cm,11cm)

first expands into 
  
  a0 = (2*28.34645,11*28.34645)

because “cm” is a variable with a value (Its definition in plain.mp is "cm = 
28.34645”)

Then, the two expressions in the a0 equation are resolved before the 
assignment, so what you actually wrote at the statement level is

  a0 = (56.6929, 311.8096);

At no point is there a “cm”-sized dimension.

===

Perhaps another option would be for you to do all your work without units, e.g. 

  a0 = (2,11) % assume scaling will happen later

and then in the end do the drawing on a scaled path:

  draw (pp scaled cm) …

as that may be less confusing? If the precision is an issue, you could counter 
the loss of precision you could use implied millimeters instead of centimeters.

Best wishes,
Taco





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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___