Re: [NTG-context] How do you deal with inappropriate ligatures?

2020-10-13 Thread Hans Hagen

On 10/12/2020 11:09 PM, Denis Maier wrote:

Am 12.10.2020 um 22:35 schrieb Hans Hagen:

On 10/12/2020 4:55 PM, Denis Maier wrote:

Hi,

with LuaLaTeX I used to use the selnolig package to disable 
inappropriate ligatures. With ConTeXt I have just inputted the list 
prepared by Hraban (based on a wordlist originating from selnolig), 
but then ran into a curious bug (?) with disappearing characters (see 
my posts from a couple of days ago). I'm now converting this list to 
the \blockligatures mechanism (instead of using \replaceword), which 
also has better kerning support due to Hans. When done, I'll of 
course share this on the Wiki if there's any need for this.


Now I'm wondering how others deal with inappropriate ligatures. Do 
you just ignore them? Do you block them on an ad-hoc basis, like 
whenever they occur? Do you use scripts to pre-process your files 
before typesetting? Do you just disable ligatures globally?


I tend to think there must be an automatic way to deal with the most 
awkward cases. The problem is that there just so many.


What do you think?

I played a bit with what we have and in a next upload you can do this:

\startexceptions[de]
au{f-}{f}{ff}(f\zwnj f)asse
\stopexceptions

\showglyphs

\starttext

auffasse

then is like:

au\discretionary{f-}{-f}{f\zwnj f}asse

\stoptext
Oh, that looks interesting. So that would essentially be implemented 
like hyphenation exceptions? Any drawbacks? Performance hit with large 
exception lists? Kerning?


probably kerning between the (here) ff but you probably don't want that 
anyway there


performance wise parsing these specs is always delayed till there is a 
word match (and actually every word that fits lrmin criteria is checked 
in the exception wordlist so as soon as one has one or more exceptions 
there is always a bit overhead, but it's nothing compared to the impact 
of some bad styling options)  .. this is not where tex spends most of 
its time (and context spends more than half its time in lua so that is 
the slow down part, not that I hear users complain)


(if needed we can always have some more advanced mechanism, like wiping 
those joiners before kerning happens .. in principle all is doable which 
doesn't mean all has to be done)


Just an experiment. I don't know when there will be an update because 
first WS and I have to test and double check some new stuff as we 
don't want users to suffer too much from a couple of fundamental new 
features.

Is there a patch so the brave can help with testing?

no patch, just wait for an update (luametatex + context lmtx)

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] bug with hz in LMTX?

2020-10-13 Thread Hans Hagen

On 10/12/2020 4:59 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

   \showframe\showgrid
   \setuplayout[width=middle]
   \definefontfamily[mainface][rm][TeX Gyre Pagella]
   [features={default, quality}]
   \setupbodyfont[mainface, 20pt]
   \setupalign[hanging, hz]
   \starttext
   \dorecurse{25}{\input{zapf}\input{cuomo}}
   \stoptext

On page 36 (https://pdf.ousia.tk/wrong-font-expansion.pdf#page=36),
lines 4, 11 and 20 are wrong.

Current LMTX (LuaTeX 2.07 20200920 + ConTeXt MkIV 2020.09.20 23:02) has
the issue, while MkIV (LuaTeX 1.11 7226 + ConTeXt MkIV 2020.01.30 14:13)
has no problem with that.

I think this might be a bug. Could you confirm the issue?

I need to keep count of how frequently i suggest typo also

 \setupalign[verytolerant,stretch]

when one uses hz and/or protrusion. I don't know why folks expect 
expansion and protrusion to give better (or intended) output when the 
other constraints are such that tex either not even ends up in the phase 
where expansion is applied, or when fitting the constraints is only 
possible with excessive and visible expansion. When expansion is max or 
min and there is not enough spacing to stretch and shrink the results 
will not get better. Read: expansion is a last resort in getting things 
right. Also, protrusion actually add to the constraints so that is never 
a way to get a better fit.


Anyway, with tolerant and stretch the test looks ok 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 / 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] font clarification

2020-10-13 Thread Hans Hagen

On 10/13/2020 12:41 AM, jbf wrote:

Can someone clarify a font issue for me please.

I have the following setup:

\definefontfamily[mainface][rm][TeX Gyre Pagella]
\definefontfamily [mainface] [ss] [Arial][tf=file:arial:ttf]
\definefontfamily [mainface] [mm] [TeX Gyre Pagella Math]
\setupbodyfont[mainface,11.5pt]

When I look at what this produces, I see that my body text is in fact 
texgyrepagellamath-regular. If I run mtxrun --script font --list --file 
-pattern=*pag*, I see, among others, the following:


texgyrepagellamath   ...    texgyrepagellamathregular 
texgyrepagella-math.otf   conflict: regular
texgyrepagella   ...    texgyrepagellaregular 
texgyrepagella-regular.otf   conflict: regular


So three questions:

1. Does Tex Gyre Pagella Math contain everything I need for my body font 
(ignore Arial - I use that for drop caps and a few other things and it 
works as it should)?


no, it's a math font with a math table and math feature sonly

2. If so, do I still need the first line in my setup, namely the [rm] 
line? Would not the [mm] be enough?


no, you need a text font with basic symbols and text features only

so, the setup you use is ok

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] Some interaction questions

2020-10-13 Thread Denis Maier

Hi,

I have a few more question regarding interaction/PDF bookmarks and PDF 
links:


- How can you ignore Commands in bookmarks? Like when instead of "The 
concept of {\em bookmarks}", I'd prefer to just have "The concept of 
bookmarks". I know I can just use something like

\startchapter[title=The concept of {\em bookmarks},
    bookmark=The concept of bookmarks]
But is there an setting for that?

- When clicking on a link, the focus switches to the target page. Is it 
possible to go to the line of the target? (Would be nice for switching 
between notes and text. Otherwise linking between notes and note markers 
would be quite pointless.)


Best,
Denis
___
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] Some interaction questions

2020-10-13 Thread Pablo Rodriguez
On 10/13/20 11:40 AM, Denis Maier wrote:
> Hi,
>
> I have a few more question regarding interaction/PDF bookmarks and PDF
> links:
>
> - How can you ignore Commands in bookmarks? Like when instead of "The
> concept of {\em bookmarks}", I'd prefer to just have "The concept of
> bookmarks". I know I can just use something like
> \startchapter[title=The concept of {\em bookmarks},
>      bookmark=The concept of bookmarks]
> But is there an setting for that?

Hi Denis,

I think this is what you want:

  \enabledirectives[references.bookmarks.preroll]

> - When clicking on a link, the focus switches to the target page. Is it
> possible to go to the line of the target? (Would be nice for switching
> between notes and text. Otherwise linking between notes and note markers
> would be quite pointless.)

"focus=standard" in \setupinteraction.

With a minimal sample:

  \setupinteraction[state=start, focus=standard]
  \enabledirectives[references.bookmarks.preroll]
  \placebookmarks[chapter]
  \starttext
  \completecontent
  \chapter{The concept of {\em bookmarks}}
  \stoptext

I hope it helps,

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] bug with hz in LMTX?

2020-10-13 Thread Pablo Rodriguez
On 10/13/20 1:36 PM, Hans Hagen wrote:
> On 10/12/2020 4:59 PM, Pablo Rodriguez wrote:
>> [...]
>> On page 36 (https://pdf.ousia.tk/wrong-font-expansion.pdf#page=36),
>> lines 4, 11 and 20 are wrong.
>>
>> Current LMTX (LuaTeX 2.07 20200920 + ConTeXt MkIV 2020.09.20 23:02) has
>> the issue, while MkIV (LuaTeX 1.11 7226 + ConTeXt MkIV 2020.01.30 14:13)
>> has no problem with that.
>>
>> I think this might be a bug. Could you confirm the issue?
> I need to keep count of how frequently i suggest typo also
>
>   \setupalign[verytolerant,stretch]
>
> when one uses hz and/or protrusion. I don't know why folks expect
> expansion and protrusion to give better (or intended) output when the
> other constraints are such that tex either not even ends up in the phase
> where expansion is applied, or when fitting the constraints is only
> possible with excessive and visible expansion. When expansion is max or
> min and there is not enough spacing to stretch and shrink the results
> will not get better. Read: expansion is a last resort in getting things
> right. Also, protrusion actually add to the constraints so that is never
> a way to get a better fit.

Many thanks for your reply, Hans.

If both expansion and protrusion add problems to line breaking, I’m
disabling both features in my documents.

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] bug with hz in LMTX?

2020-10-13 Thread Hans Hagen

On 10/13/2020 4:47 PM, Pablo Rodriguez wrote:

On 10/13/20 1:36 PM, Hans Hagen wrote:

On 10/12/2020 4:59 PM, Pablo Rodriguez wrote:

[...]
On page 36 (https://pdf.ousia.tk/wrong-font-expansion.pdf#page=36),
lines 4, 11 and 20 are wrong.

Current LMTX (LuaTeX 2.07 20200920 + ConTeXt MkIV 2020.09.20 23:02) has
the issue, while MkIV (LuaTeX 1.11 7226 + ConTeXt MkIV 2020.01.30 14:13)
has no problem with that.

I think this might be a bug. Could you confirm the issue?

I need to keep count of how frequently i suggest typo also

   \setupalign[verytolerant,stretch]

when one uses hz and/or protrusion. I don't know why folks expect
expansion and protrusion to give better (or intended) output when the
other constraints are such that tex either not even ends up in the phase
where expansion is applied, or when fitting the constraints is only
possible with excessive and visible expansion. When expansion is max or
min and there is not enough spacing to stretch and shrink the results
will not get better. Read: expansion is a last resort in getting things
right. Also, protrusion actually add to the constraints so that is never
a way to get a better fit.


Many thanks for your reply, Hans.

If both expansion and protrusion add problems to line breaking, I’m
disabling both features in my documents.


they should work ok, if you help them to work well which happens by 
being more permissible (tolerant,stretch) .. the main drawbacks are loss 
of performance and much larger pdf files


Hans

(i admit that i never use these features because on the average the 
result doesn't look better, unless maybe when one does a (really) high 
resolution print which means: offset)


-
  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] need help comparing strings

2020-10-13 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \starttext
  \def\numbersfname
{\cldcontext{string.match([[\env{fname}]], "\letterpercent d+")}}
  \ctxlua{ c = context.getvariable("environment", "fname") or "a" }
  \ctxlua{ d = [[\env{fname}]] }

  tex: \numbersfname\\
  \doifelse{}
  {123}{yes}{no}\\
  c: \cldcontext{c}\\
  \doifelse{\cldcontext{c:match("\letterpercent d+")}}
  {123}{yes}{no}\\
  d: \cldcontext{d}\\
  \doifelse{\cldcontext{d:match("\letterpercent d+")}}
  {123}{yes}{no}
  \stoptext

For compilation, I run the command:

  context --purgeall --arguments=fname={abc123} test-file.tex

These things are failing:

1. I don’t know how to get \numbersfname equal to "123". I don’t know
what I’m doing wrong.

2. Is there no Lua version of \getvariable{...}{...}?

3. I’m trying this on a Linux box, but on Windows I would say that Lua
variable "d" is empty.

I need to get the number from \env{fname} and I don’t know what I’m
missing. \doif is the way to test whether it’s right.

Could anyone explain me what I’m missing here?

Many thanks,

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] need help comparing strings

2020-10-13 Thread Aditya Mahajan
On Tue, 13 Oct 2020, Pablo Rodriguez wrote:

> Dear list,
> 
> I have the following sample:
> 
>   \starttext
>   \def\numbersfname
> {\cldcontext{string.match([[\env{fname}]], "\letterpercent d+")}}
>   \ctxlua{ c = context.getvariable("environment", "fname") or "a" }
>   \ctxlua{ d = [[\env{fname}]] }
> 
>   tex: \numbersfname\\
>   \doifelse{}
>   {123}{yes}{no}\\
>   c: \cldcontext{c}\\
>   \doifelse{\cldcontext{c:match("\letterpercent d+")}}
>   {123}{yes}{no}\\
>   d: \cldcontext{d}\\
>   \doifelse{\cldcontext{d:match("\letterpercent d+")}}
>   {123}{yes}{no}
>   \stoptext
> 
> For compilation, I run the command:
> 
>   context --purgeall --arguments=fname={abc123} test-file.tex
> 
> These things are failing:
> 
> 1. I don’t know how to get \numbersfname equal to "123". I don’t know
> what I’m doing wrong.
> 
> 2. Is there no Lua version of \getvariable{...}{...}?
> 
> 3. I’m trying this on a Linux box, but on Windows I would say that Lua
> variable "d" is empty.
> 
> I need to get the number from \env{fname} and I don’t know what I’m
> missing. \doif is the way to test whether it’s right.
> 
> Could anyone explain me what I’m missing here?

I find it simpler to write macros where there is  clean communicating between 
tex and lua. For example:

\startluacode
  userdata = userdata or {}
  function userdata.numbersfname(name)
  return string.match(name, "%d+")
  end
\stopluacode

\define[1]\numbersfname
{\cldcontext{userdata.numbersfname([==[#1]==])}}

\starttext
\numbersfname{abc123}

\numbersfname{\env{fname}}
\stoptext


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

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


Re: [NTG-context] need help comparing strings

2020-10-13 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 13.10.2020 um 17:33:

Dear list,

I have the following sample:

   \starttext
   \def\numbersfname
 {\cldcontext{string.match([[\env{fname}]], "\letterpercent d+")}}
   \ctxlua{ c = context.getvariable("environment", "fname") or "a" }
   \ctxlua{ d = [[\env{fname}]] }

   tex: \numbersfname\\
   \doifelse{}
   {123}{yes}{no}\\
   c: \cldcontext{c}\\
   \doifelse{\cldcontext{c:match("\letterpercent d+")}}
   {123}{yes}{no}\\
   d: \cldcontext{d}\\
   \doifelse{\cldcontext{d:match("\letterpercent d+")}}
   {123}{yes}{no}
   \stoptext

For compilation, I run the command:

   context --purgeall --arguments=fname={abc123} test-file.tex

These things are failing:

1. I don’t know how to get \numbersfname equal to "123". I don’t know
what I’m doing wrong.

2. Is there no Lua version of \getvariable{...}{...}?


There is no need because everything is stored in a Lua table.


 begin example
\starttext

\startluacode

local argumentlist  = document.arguments.arguments
local argumenttable = utilities.parsers.settings_to_hash(argumentlist)

context(argumenttable["fname"])

\stopluacode

\stoptext
 end example


I tested the example with:

    context --arguments="fname=abc123" 


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
___


Re: [NTG-context] need help comparing strings

2020-10-13 Thread Pablo Rodriguez
On 10/13/20 5:54 PM, Aditya Mahajan wrote:
> On Tue, 13 Oct 2020, Pablo Rodriguez wrote:
>> [...]
>> Could anyone explain me what I’m missing here?

Many thanks for your reply, Aditya.

> I find it simpler to write macros where there is clean communicating
> between tex and lua. For example:
> [...]
> \define[1]\numbersfname
> {\cldcontext{userdata.numbersfname([==[#1]==])}}

This is the first time I see that way of wrapping an argument.

In any case, I cannot compare to a number:

  \startluacode
userdata = userdata or {}
function userdata.numbersfname(name)
return string.match(name, "%d+")
end
  \stopluacode

  \define[1]\numbersfname
  {\cldcontext{userdata.numbersfname([==[#1]==])}}

  \starttext
  \numbersfname{abc123}

  \numbersfname{\env{fname}}
  \doifelse{\numbersfname{\env{fname}}}{123}{yes}{no}
  \stoptext

I don’t know why both strings don’t match.

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] need help comparing strings

2020-10-13 Thread Pablo Rodriguez
On 10/13/20 6:14 PM, Wolfgang Schuster wrote:
> Pablo Rodriguez schrieb am 13.10.2020 um 17:33:
>> [...]
>> 2. Is there no Lua version of \getvariable{...}{...}?
>
> There is no need because everything is stored in a Lua table.
> [...]
>   local argumentlist  = document.arguments.arguments
>   local argumenttable = utilities.parsers.settings_to_hash(argumentlist)
>
>   context(argumenttable["fname"])

Many thanks for your reply, Wolfgang.

This is exactly what I need.

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] need help comparing strings

2020-10-13 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 13.10.2020 um 19:06:

On 10/13/20 5:54 PM, Aditya Mahajan wrote:

On Tue, 13 Oct 2020, Pablo Rodriguez wrote:

[...]
Could anyone explain me what I’m missing here?

Many thanks for your reply, Aditya.


I find it simpler to write macros where there is clean communicating
between tex and lua. For example:
[...]
 \define[1]\numbersfname
 {\cldcontext{userdata.numbersfname([==[#1]==])}}

This is the first time I see that way of wrapping an argument.

In any case, I cannot compare to a number:

   \startluacode
 userdata = userdata or {}
 function userdata.numbersfname(name)
 return string.match(name, "%d+")
 end
   \stopluacode

   \define[1]\numbersfname
   {\cldcontext{userdata.numbersfname([==[#1]==])}}


Untested:

\defineexpandable[1]\numbersfname
  {\cldcontext{userdata.numbersfname([==[#1]==])}}

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
___


Re: [NTG-context] need help comparing strings

2020-10-13 Thread Pablo Rodriguez
On 10/13/20 5:33 PM, Pablo Rodriguez wrote:
> [...]
>   \starttext
>   \ctxlua{ d = [[\env{fname}]] }
>
>   d: \cldcontext{d}\\
>   \doifelse{\cldcontext{d:match("\letterpercent d+")}}
>   {123}{yes}{no}
>   \stoptext
> [...]
> 3. I’m trying this on a Linux box, but on Windows I would say that Lua
> variable "d" is empty.

Just for the record, this sample also works in Windows.

The Lua variable isn’t empty and the conditional outputs "yes".

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] need help comparing strings

2020-10-13 Thread Pablo Rodriguez
On 10/13/20 7:14 PM, Wolfgang Schuster wrote:
> Pablo Rodriguez schrieb am 13.10.2020 um 19:06:
>> [...]
>> In any case, I cannot compare to a number:
>>
>>\startluacode
>>  userdata = userdata or {}
>>  function userdata.numbersfname(name)
>>  return string.match(name, "%d+")
>>  end
>>\stopluacode
>>
>>\define[1]\numbersfname
>>{\cldcontext{userdata.numbersfname([==[#1]==])}}
>
> Untested:
>
> \defineexpandable[1]\numbersfname
>    {\cldcontext{userdata.numbersfname([==[#1]==])}}

I’m afraid it doesn’t work.

  \startluacode
userdata = userdata or {}
function userdata.numbersfname(name)
return string.match(name, "%d+")
end
  \stopluacode

  \defineexpandable[1]\numbersfname
{\cldcontext{userdata.numbersfname([==[#1]==])}}

  \starttext
  \numbersfname{abc123}

  \numbersfname{\env{fname}}
  \doifelse{\numbersfname{\env{fname}}}{123}{yes}{no}
  \stoptext

Just curious about what the difference might be.

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] Some interaction questions

2020-10-13 Thread Denis Maier

Thanks. Both suggestions were very helpful.
Best,
Denis

Am 13.10.2020 um 16:14 schrieb Pablo Rodriguez:

On 10/13/20 11:40 AM, Denis Maier wrote:

Hi,

I have a few more question regarding interaction/PDF bookmarks and PDF
links:

- How can you ignore Commands in bookmarks? Like when instead of "The
concept of {\em bookmarks}", I'd prefer to just have "The concept of
bookmarks". I know I can just use something like
\startchapter[title=The concept of {\em bookmarks},
      bookmark=The concept of bookmarks]
But is there an setting for that?

Hi Denis,

I think this is what you want:

   \enabledirectives[references.bookmarks.preroll]


- When clicking on a link, the focus switches to the target page. Is it
possible to go to the line of the target? (Would be nice for switching
between notes and text. Otherwise linking between notes and note markers
would be quite pointless.)

"focus=standard" in \setupinteraction.

With a minimal sample:

   \setupinteraction[state=start, focus=standard]
   \enabledirectives[references.bookmarks.preroll]
   \placebookmarks[chapter]
   \starttext
   \completecontent
   \chapter{The concept of {\em bookmarks}}
   \stoptext

I hope it helps,

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
___


___
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] Some interaction questions

2020-10-13 Thread Pablo Rodriguez
On 10/13/20 10:14 PM, Denis Maier wrote:
> [...]
> So, I just added this to my environment file:
>
> \appendtoks
>    \def\em{\space}
> \to \simplifiedcommands
>
> But, the \em still shows up in the PDF metadata. Is this still the
> recommended way to do this? Or is there an easier way? I guess, even if
> this would remove the \em, that would still leave the braces in place.
> (I'd prefer to remove them as well, but I've no idea how that could work.)

Hi Denis,

\enabledirectives[interaction.identity.preroll] is your friend here.

I think it would be better to update the wiki with these infos.

Many thanks for improving the wiki 😉,

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] Some interaction questions

2020-10-13 Thread Denis Maier

Follow up,
I'm trying to also ignore commands when setting PDF metadata:
The wiki gives these examples:

 \appendtoks
 \def\CONTEXT{ConTeXt}
 \to \simplifiedcommands

And:

 \appendtoks
 \let\quad\space
 \to \simplifiedcommands

So, I just added this to my environment file:

\appendtoks
  \def\em{\space}
\to \simplifiedcommands

But, the \em still shows up in the PDF metadata. Is this still the 
recommended way to do this? Or is there an easier way? I guess, even if 
this would remove the \em, that would still leave the braces in place. 
(I'd prefer to remove them as well, but I've no idea how that could work.)


Best,
Denis

Am 13.10.2020 um 16:14 schrieb Pablo Rodriguez:

On 10/13/20 11:40 AM, Denis Maier wrote:

Hi,

I have a few more question regarding interaction/PDF bookmarks and PDF
links:

- How can you ignore Commands in bookmarks? Like when instead of "The
concept of {\em bookmarks}", I'd prefer to just have "The concept of
bookmarks". I know I can just use something like
\startchapter[title=The concept of {\em bookmarks},
      bookmark=The concept of bookmarks]
But is there an setting for that?

Hi Denis,

I think this is what you want:

   \enabledirectives[references.bookmarks.preroll]


- When clicking on a link, the focus switches to the target page. Is it
possible to go to the line of the target? (Would be nice for switching
between notes and text. Otherwise linking between notes and note markers
would be quite pointless.)

"focus=standard" in \setupinteraction.

With a minimal sample:

   \setupinteraction[state=start, focus=standard]
   \enabledirectives[references.bookmarks.preroll]
   \placebookmarks[chapter]
   \starttext
   \completecontent
   \chapter{The concept of {\em bookmarks}}
   \stoptext

I hope it helps,

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
___


___
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] A Spanish introduction to ConTeXt Mark IV

2020-10-13 Thread Joaquín Ataz López

Good morning to everyone.

Although I guess it will not be of interest to most of the list members, 
I wanted to communicate that I have written an introduction to ConTeXt 
Mark IV in Spanish, which can be downloaded at 
https://webs.um.es/jal/docs/introCTX.pdf. Its title is "An Introduction 
(not too short) to ConTeXt Mark IV".


ConTeXt is a wonderful document composition system, but there is not 
much literature to help you get into it, hence my initiative. The 
problem is that I've only been using ConTeXt for a short time and still 
have many doubts, so it's possible that the introduction may contain 
errors. As it has been written in Spanish I don't think many of you will 
be able to read it, but I would appreciate, of course, any suggestions 
for improvement. The document is, on the other hand, free and anyone who 
wants to include it in any ConTeXt distribution can, of course, do so. 
Also, if anyone wants the source files, I have no problem providing them.


I have not based my introduction on LMTX because I think that for 
beginners a more stable system, like LuaTeX, is preferable.


Finally, I apologize for my bad English level. I read it reasonably 
well, but expressing myself in it is much harder for me.


--
Joaquín Ataz López
Derecho Civil
Universidad de Murcia

___
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] A Spanish introduction to ConTeXt Mark IV

2020-10-13 Thread Joaquín Ataz López
Sorry. By mistake I sent the message as a reply to another one, when in 
fact I was trying to start a new thread with it. I'm sending it again (I 
think I'll do it right now):


-

Good morning to everyone.

Although I guess it will not be of interest to most of the list members, 
I wanted to communicate that I have written an introduction to ConTeXt 
Mark IV in Spanish, which can be downloaded at 
https://webs.um.es/jal/docs/introCTX.pdf. Its title is "An Introduction 
(not too short) to ConTeXt Mark IV".


ConTeXt is a wonderful document composition system, but there is not 
much literature to help you get into it, hence my initiative. The 
problem is that I've only been using ConTeXt for a short time and still 
have many doubts, so it's possible that the introduction may contain 
errors. As it has been written in Spanish I don't think many of you will 
be able to read it, but I would appreciate, of course, any suggestions 
for improvement. The document is, on the other hand, free and anyone who 
wants to include it in any ConTeXt distribution can, of course, do so. 
Also, if anyone wants the source files, I have no problem providing them.


I have not based my introduction on LMTX because I think that for 
beginners a more stable system, like LuaTeX, is preferable.


Finally, I apologize for my bad English level. I read it reasonably 
well, but expressing myself in it is much harder for me.


--
Joaquín Ataz López
Derecho Civil
Universidad de Murcia

___
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] A Spanish introduction to ConTeXt Mark IV

2020-10-13 Thread Jairo A. del Rio
Hi, Joaquín.

I've just found your introduction yesterday and I have to say it is a
pleasure to read it. I can help you with some areas you haven't discussed
too much, e.g. Lua interfaces and Metapost (well, I'm not as skilled as
Aditya or Hans in the latter), as I use it often. I'll send you a message
later so we can communicate in Spanish :)
Thank you a lot for you effort. I hope more Spanish users put a bit of
their expertise on your manual and further documentation for such a great
software as ConTeXt.

Muchas gracias y saludos cordiales,
Jairo :D

El mar., 13 de oct. de 2020 11:27 p. m., Joaquín Ataz López 
escribió:

> Sorry. By mistake I sent the message as a reply to another one, when in
> fact I was trying to start a new thread with it. I'm sending it again (I
> think I'll do it right now):
>
> -
>
> Good morning to everyone.
>
> Although I guess it will not be of interest to most of the list members,
> I wanted to communicate that I have written an introduction to ConTeXt
> Mark IV in Spanish, which can be downloaded at
> https://webs.um.es/jal/docs/introCTX.pdf. Its title is "An Introduction
> (not too short) to ConTeXt Mark IV".
>
> ConTeXt is a wonderful document composition system, but there is not
> much literature to help you get into it, hence my initiative. The
> problem is that I've only been using ConTeXt for a short time and still
> have many doubts, so it's possible that the introduction may contain
> errors. As it has been written in Spanish I don't think many of you will
> be able to read it, but I would appreciate, of course, any suggestions
> for improvement. The document is, on the other hand, free and anyone who
> wants to include it in any ConTeXt distribution can, of course, do so.
> Also, if anyone wants the source files, I have no problem providing them.
>
> I have not based my introduction on LMTX because I think that for
> beginners a more stable system, like LuaTeX, is preferable.
>
> Finally, I apologize for my bad English level. I read it reasonably
> well, but expressing myself in it is much harder for me.
>
> --
> Joaquín Ataz López
> Derecho Civil
> Universidad de Murcia
>
>
> ___
> 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
___