[NTG-context] Re: unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua

2024-04-10 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: Pablo Rodriguez via ntg-context 
> Gesendet: Mittwoch, 10. April 2024 19:35
> An: ntg-context@ntg.nl
> Cc: Pablo Rodriguez 
> Betreff: [NTG-context] Re: unknown script 'mtx-context.lua' or 'mtx-mtx-
> context.lua
> 
> On 4/10/24 13:59, Denis Maier via ntg-context wrote:
> > Hi,
> > I wanted to test my earlier example (float placement) also with MKIV,
> > but context ---luatex … give me this error message :
> > unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua How can I
> > make it work?
> 
> Hi Denis,
> 
> as far as I know, this is required first:
> 
>   context --luatex --generate

Thanks, Pablo. 
I've tried it, but it doesn't seem to work...

I'm getting this:

resolvers   | resolving |
resolvers   | resolving | warning: no lua configuration files found
resolvers   | resolving | no texmf paths are defined (using TEXMF)
resolvers   | resolving |
mtxrun  | the resolver databases are not present or outdated

And again:

mtxrun  | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'

Any ideas?

Best,
Denis

___
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: \luaescapestring in proper Lua

2024-04-10 Thread Hans Hagen via ntg-context

On 4/10/2024 7:49 PM, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following sample:

   \starttext
   \startluacode
   function document.print_the_thing(str)
 context(str)
   end
   \stopluacode

   \unexpanded\def\PrintTheThing#1{%
 \ctxlua{document.print_the_thing([[\luaescapestring{#1}]])}}

   \PrintTheThing{a \em b {c}}
   \stoptext

I wonder whether there is a proper way in the Lua code to avoid
[[\luaescapestring{}]] in \ctxlua.

BTW, [[\luaescapestring{}]] in \ctxlua works better for me, since in my
real world document, I’m using str:match() to check whether the string
ends with interrogation or exclamation marks ("%?!$").

\starttext
  \startluacode
  function document.print_the_thing()
context(tokens.scanners.string())
  end
  \stopluacode

  \protected\def\PrintTheThing{\ctxlua{document.print_the_thing()}}

  \PrintTheThing{a \em b {\bf c} d}
\stoptext

bonus:

  test!\removepunctuation ?

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] \luaescapestring in proper Lua

2024-04-10 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \starttext
  \startluacode
  function document.print_the_thing(str)
context(str)
  end
  \stopluacode

  \unexpanded\def\PrintTheThing#1{%
\ctxlua{document.print_the_thing([[\luaescapestring{#1}]])}}

  \PrintTheThing{a \em b {c}}
  \stoptext

I wonder whether there is a proper way in the Lua code to avoid
[[\luaescapestring{}]] in \ctxlua.

BTW, [[\luaescapestring{}]] in \ctxlua works better for me, since in my
real world document, I’m using str:match() to check whether the string
ends with interrogation or exclamation marks ("%?!$").

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: unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua

2024-04-10 Thread Pablo Rodriguez via ntg-context
On 4/10/24 13:59, Denis Maier via ntg-context wrote:
> Hi,
> I wanted to test my earlier example (float placement) also with MKIV, but
> context ---luatex …
> give me this error message :
> unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua
> How can I make it work?

Hi Denis,

as far as I know, this is required first:

  context --luatex --generate

BTW, although LuaTeX 1.18 has been released, my Linux64 ConTeXt contains
version 1.17.x.

In fact, the LuaTeX binary was removed in an update some weeks (or
months) ago. I had to copy it from a backup from a previous version.

I hope it helps,

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: Figure reference failing

2024-04-10 Thread Henning Hraban Ramm

Am 10.04.24 um 14:21 schrieb Hans Hagen:

It fails for me as well, when "mode=columns" is used.

compare with and without mode columns:

\starttext

     \enablemode[columns]

     As we see \doifelsemode {columns} {in \in {table} [demo-1]} {below} 
we can have

     more than one cell in a row.

     \startplacetable[mode=columns,reference=demo-1]
     \externalfigure[cow][width=\textwidth]
     \stopplacetable

     \samplefile{tufte}

\stoptext

so basically we have an "at the spot" placement or a float


Is "mode" in floats something new? How is it related to “general” modes?

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: Figure reference failing

2024-04-10 Thread Willi Egger
Hm, I see.

This question appeared while using the tug-boat-style. Taking the example at 
the end of the style I adapted my article accordingly. However I missed the 
point to enable the mode “columns”…

Thanks for the explanation!
Willi

> On 10 Apr 2024, at 14:21, Hans Hagen  wrote:
> 
> On 4/10/2024 1:30 PM, Taco Hoekwater wrote:
>>> On 10 Apr 2024, at 13:04, Willi Egger  wrote:
>>> 
>>> Hello,
>>> 
>>> It seems, that the referencing mechanism is failing. I detected this with 
>>> the January version and the current version: 2024.04.01 08:59.
>>> 
>>> Could some one confirm this?
>> It fails for me as well, when "mode=columns" is used.
> compare with and without mode columns:
> 
> \starttext
> 
>\enablemode[columns]
> 
>As we see \doifelsemode {columns} {in \in {table} [demo-1]} {below} we can 
> have
>more than one cell in a row.
> 
>\startplacetable[mode=columns,reference=demo-1]
>\externalfigure[cow][width=\textwidth]
>\stopplacetable
> 
>\samplefile{tufte}
> 
> \stoptext
> 
> so basically we have an "at the spot" placement or a float
> 
> 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
> ___

___
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: Figure reference failing

2024-04-10 Thread Hans Hagen

On 4/10/2024 1:30 PM, Taco Hoekwater wrote:




On 10 Apr 2024, at 13:04, Willi Egger  wrote:

Hello,

It seems, that the referencing mechanism is failing. I detected this with the 
January version and the current version: 2024.04.01 08:59.

Could some one confirm this?


It fails for me as well, when "mode=columns" is used.

compare with and without mode columns:

\starttext

\enablemode[columns]

As we see \doifelsemode {columns} {in \in {table} [demo-1]} {below} 
we can have

more than one cell in a row.

\startplacetable[mode=columns,reference=demo-1]
\externalfigure[cow][width=\textwidth]
\stopplacetable

\samplefile{tufte}

\stoptext

so basically we have an "at the spot" placement or a float

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] unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua

2024-04-10 Thread Denis Maier via ntg-context
Hi,

 

I wanted to test my earlier example (float placement) also with MKIV, but

context ---luatex .

give me this error message :

unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua

 

How can I make it work?

 

Best,

Denis

___
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] Weird (?) float placement for specific widths of image

2024-04-10 Thread Denis Maier via ntg-context
Hi, 

 

another graphics/floats question: consider the following example

 

%

 

\setupexternalfigures

[location={local,global,default}]

 

\starttext

 

\placefigure{A Cow}{\externalfigure[cow][

height=.5\textheight,

]}

 

\placefigure{A Cow}{\externalfigure[cow][

height=.3\textheight,

%height=.4\textheight,

]}

 

 

\placefigure{A Cow}{\externalfigure[cow][

width=3cm,

%width=2cm,

]}

 

\placefigure{A Cow}{\externalfigure[cow][width=2cm]}

 

\placefigure{A Cow}{\externalfigure[cow][width=2cm]}

 

\stoptext%

 

On the first page, the images appear stacked above each other while on the
second page they appear next to each other.

 

It took me some time to reproduce this behaviour, and I can't claim to
understand what is happening. But it seems to be related to the specific
widths of the images. When I change them to other values the behaviour
disappears. Is this a bug? Anything I can do about this?

 

Best

Denis

___
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: Figure reference failing

2024-04-10 Thread Taco Hoekwater



> On 10 Apr 2024, at 13:04, Willi Egger  wrote:
> 
> Hello,
> 
> It seems, that the referencing mechanism is failing. I detected this with the 
> January version and the current version: 2024.04.01 08:59.
> 
> Could some one confirm this?

It fails for me as well, when "mode=columns" is used.

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 / 
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] Figure reference failing

2024-04-10 Thread Willi Egger
Hello,

It seems, that the referencing mechanism is failing. I detected this with the 
January version and the current version: 2024.04.01 08:59.

Could some one confirm this?

Kind regards
Willi

test.pdf
Description: Adobe PDF document


test.tex
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] minwidth not working ?

2024-04-10 Thread denis.maier
Hi,
Shouldn't minwidth set a default minimal width for external figures? But this 
here does not work

==
\setupexternalfigures
  [
  maxwidth=\textwidth,
  minwidth=\textwidth,
  location={local,global,default},
  ]

\starttext

\externalfigure[cow.pdf]

\externalfigure[cow.pdf][width=\textwidth]

\stoptext
==

Am I missing something here?

Best,
Denis
___
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
___