Re: [NTG-context] ZapfDingbats Unicode differences MKIV vs LMTX

2020-09-18 Thread Christoph Reller
On Fri, Sep 18, 2020 at 4:17 PM Hans Hagen  wrote:

> On 9/18/2020 11:23 AM, Christoph Reller wrote:
> > Dear List,
> >
> > I have the following MWE:
> >
> > \definefontsynonym[ZapfDingbats][file:ZapfDingbats][features=dingbats]
> > \usemodule [fnt-10]
> > \starttext
> > (1) \getglyphdirect{ZapfDingbats}{61491}\crlf % MKIV log: char 
> > (U+0F033) in font 'ZapfDingbats-4' with id 8: missing
> > (2) \getglyphdirect{ZapfDingbats}{983059} % LMTX log: char 
> > (U+F0013) in font 'ZapfDingbats-4' with id 8: missing
> > \ShowCompleteFont{name:ZapfDingbats}{14pt}{1}
> > \stoptext
> >
> Dingbats are old school t1 without proper names so we can't use
> unicodes. However, there is a goodie that should do that so that in
> principle it should work with unicodes but there is some interference
> going on (i'll look at that)
>
> For nwo access by 'name' or 'index' (these are kind of stable for such
> an old font):
>
>   n:a34  : \getglyph{ZapfDingbats}{\tochar{n:a34}}  \par
>   n:a35  : \getglyph{ZapfDingbats}{\tochar{n:a35}}  \par
>   i:48   : \getglyph{ZapfDingbats}{\tochar{i:48}}   \par
>   i:49   : \getglyph{ZapfDingbats}{\tochar{i:49}}   \par
>   n:a104 : \getglyph{ZapfDingbats}{\tochar{n:a104}} \par
>   n:a105 : \getglyph{ZapfDingbats}{\tochar{n:a105}} \par
>
> Thank you Hans!

Access by glyph index with \tochar{i:19} works well for both MKIV and LMTX.
Access by name with \tochar{n:a39} does not work in LMTX with log
message: char ✓ (U+02713) in font 'ZapfDingbats-4' with id 8: missing. Also
\ShowCompleteFont does not report any glyph names in LMTX.

Cheers,
Christoph
___
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] Allow pagebreaks in footnotes

2020-09-18 Thread denis . maier . lists

Hi

Is there a setting that prevents footnotes from spreading over more than 
one page? I have a document where this seems to be the case, but I don't 
know why. It just looks like ConTeXt tries to keep the complete footnote 
on one page, which leads to ugly white space at the end of almost every 
page. (LaTeX has \interfootnotelinepenalty to customize this, but what 
about ConTeXt?)

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] Best way to store text for later use

2020-09-18 Thread Denis Maier



Am 18.09.2020 um 19:02 schrieb Hans Hagen:

On 9/18/2020 3:36 PM, Denis Maier wrote:


I've tried using buffers, but this here doesn't work:
Why not just fetch it when needed. There is no gain in storing it and 
fetching from the xml tree is fast.


Most likely due to my limited understanding of how these things work. I 
thought storing the text and retrieving it later would be the easiest 
way to get rid of the constraints of linar processing of the XML file. 
The layout itself is determined by setups such as this one:


\startsetups abstract
    \startabstract
        \documentvariable{abstract}
    \stopabstract
\stopsetups

\setuphead [chapter][
    alternative=middle,
    page=yes,
    indentnext=no,
    style=\tfa\setupinterlinespace,
    after={\directsetup{placeauthors}\directsetup{abstract}},
    footer=chapterfooter,
    ]

How could I fetch the xml node from here so I don't need a variable, 
buffer or the like?


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] Error setting up ConTeXt in MacTeX 2020

2020-09-18 Thread Hans Hagen

On 9/18/2020 2:49 PM, Arthur Reutenauer wrote:

On Fri, Sep 18, 2020 at 01:48:16PM +0200, Felix Krause wrote:

   In your case validformatpath is a subdirectory of $TMPDIR, under
/var/folders/.  However, if your Mac is anything like mine, /var is
actually a symbolic link to /private/var, so that dir.current() reports
a path starting with /private and the test fails.


Yes, this is the setup here as well.


   That was rhetorical :-)  /var and /tmp (as well as /etc) have been
symbolic links for at least ten years, probably earlier.


   You can work around that by setting TMPDIR to some other value, that
doesn’t start with /var -- and not /tmp either because that’s also a
symbolic link :-)  It should work with a temporary directory in your
home folder.  Can you try that?


This works. Thanks a lot (also to everyone else involved)!


   Glad to hear that, and you’re welcome, but this should also be fixed
in ConTeXt -- Hans, can you do something about that?  It should be
enough to resolve symbolic links on either sides of the test
dir.current() ~= validformatpath
I need to find a problematic mac ... I remember that Taco did some tests 
recently so I'll ask him.


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] Best way to store text for later use

2020-09-18 Thread Hans Hagen

On 9/18/2020 3:36 PM, Denis Maier wrote:


I've tried using buffers, but this here doesn't work:
Why not just fetch it when needed. There is no gain in storing it and 
fetching from the xml tree is fast.


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 fonts in Lua

2020-09-18 Thread Pablo Rodriguez
On 9/15/20 1:15 PM, Wolfgang Schuster wrote:
> \setuplanguage [es] [patterns={es,gr}]

Just a minor issue, ancient Greek is "agr" (instead of "gr").

That being said, Heraklit is a good match for Palatino (both by Hermann
Zapf). The digitized version is available from
https://greekfontsociety-gfs.gr/_assets/fonts/GFS_Heraklit.zip (direct
link).

So the final sample might read:

  \definefallbackfamily
 [mainface] [rm] [GFS Heraklit]
 [preset=range:greek,force=yes]

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

  \definefontfamily [mainface] [ss] [TeX Gyre Heros] [scale=0.75]

  \setuplanguage [es] [patterns={es,gr}]

  \setupbodyfont [mainface, 15pt]

  \mainlanguage[es]

  \starttext

  \samplefile{cervantes-es}

  \samplefile{aristotle-grc}}

  \stoptext

Just in case 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] Best way to store text for later use

2020-09-18 Thread Hans van der Meer
A possibility is saving the data as text in a Lua-table. If you are not afraid 
to use some Lua, I can send my code for saving files and data for repeated use.

dr. Hans van der Meer


> On 18 Sep 2020, at 15:36, Denis Maier  wrote:
> 
> Hi,
> 
> For typesetting XML I'm wondering how to best store text for later use:
> 
> I've tried using buffers, but this here doesn't work:
> 
> ==
> \startxmlsetups xml:article-meta
> \setupdocument [
> pub-year=\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:year)},
> volume=\xmlfilter{#1}{/volume/command(xml:article-meta:volume)},
> doi=\xmlfilter{#1}{/article-id[@pub-id-type='doi']/command(xml:article-meta:doi)},
> elocation-id=\xmlfilter{#1}{/elocation-id/command(xml:article-meta:elocation-id)},
> title=\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta:title-group:article-title)},
> author={\AuthorList},
> ]
>   \startbuffer[abstract]
>   \xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)}
>   \stopbuffer
>\xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:article-meta:abstract
> \xmlflush{#1}
> \stopxmlsetups
> ===
> 
> This here works:
> 
> ==
> \startxmlsetups xml:article-meta
> \setupdocument [
> pub-year=\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:year)},
> volume=\xmlfilter{#1}{/volume/command(xml:article-meta:volume)},
> doi=\xmlfilter{#1}{/article-id[@pub-id-type='doi']/command(xml:article-meta:doi)},
> elocation-id=\xmlfilter{#1}{/elocation-id/command(xml:article-meta:elocation-id)},
> title=\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta:title-group:article-title)},
> author={\AuthorList},
> abstract=\xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)},
> ]
>\xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:article-meta:abstract
> \xmlflush{#1}
> \stopxmlsetups
> ===
> 
> But has using a variable for the abstract any drawbacks? (The abstract might 
> contain multiple paragraphs.)
> 
> 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
> ___

___
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] ZapfDingbats Unicode differences MKIV vs LMTX

2020-09-18 Thread Hans Hagen

On 9/18/2020 11:23 AM, Christoph Reller wrote:

Dear List,

I have the following MWE:

\definefontsynonym[ZapfDingbats][file:ZapfDingbats][features=dingbats]
\usemodule [fnt-10]
\starttext
(1) \getglyphdirect{ZapfDingbats}{61491}\crlf % MKIV log: char  
(U+0F033) in font 'ZapfDingbats-4' with id 8: missing
(2) \getglyphdirect{ZapfDingbats}{983059}     % LMTX log: char  
(U+F0013) in font 'ZapfDingbats-4' with id 8: missing

\ShowCompleteFont{name:ZapfDingbats}{14pt}{1}
\stoptext

In MKIV, line (1) fails to output the requested glyph, while line (2) 
produces a "check" (✓). In LMTX, line (2) fails and line (1) produces 
the "check" (✓) . The output of "\ShowCompleteFont" reports differing 
Unicodes for the same glyphs. Apparently the Unicodes for ZapfDingbats 
have changed.


I would like to have a "check" (✓) in the output for both MKIV and LMTX. 
Options:
A) Is there a way to address the glyph in ZapfDingbats for both MKIV and 
LMTX uniformly, e.g. by glyph index? (By glyph name does not seem to 
work: MKIV reports glyph names, LMTX does not.)
B) Is there a conditional that I can build into the source to 
distinguish between MKIV and LMTX?
C) Is there a font in the distribution for which I can have a 
"check"-symbol in both MKIV and LMTX?
Dingbats are old school t1 without proper names so we can't use 
unicodes. However, there is a goodie that should do that so that in 
principle it should work with unicodes but there is some interference 
going on (i'll look at that)


For nwo access by 'name' or 'index' (these are kind of stable for such 
an old font):


 n:a34  : \getglyph{ZapfDingbats}{\tochar{n:a34}}  \par
 n:a35  : \getglyph{ZapfDingbats}{\tochar{n:a35}}  \par
 i:48   : \getglyph{ZapfDingbats}{\tochar{i:48}}   \par
 i:49   : \getglyph{ZapfDingbats}{\tochar{i:49}}   \par
 n:a104 : \getglyph{ZapfDingbats}{\tochar{n:a104}} \par
 n:a105 : \getglyph{ZapfDingbats}{\tochar{n:a105}} \par

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] Best way to store text for later use

2020-09-18 Thread Denis Maier

Hi,

For typesetting XML I'm wondering how to best store text for later use:

I've tried using buffers, but this here doesn't work:

==
\startxmlsetups xml:article-meta
    \setupdocument [
pub-year=\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:year)},
volume=\xmlfilter{#1}{/volume/command(xml:article-meta:volume)},
doi=\xmlfilter{#1}{/article-id[@pub-id-type='doi']/command(xml:article-meta:doi)},
elocation-id=\xmlfilter{#1}{/elocation-id/command(xml:article-meta:elocation-id)},
title=\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta:title-group:article-title)},
        author={\AuthorList},
    ]
  \startbuffer[abstract]
  \xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)}
  \stopbuffer
   \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:article-meta:abstract
    \xmlflush{#1}
\stopxmlsetups
===

This here works:

==
\startxmlsetups xml:article-meta
    \setupdocument [
pub-year=\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:year)},
volume=\xmlfilter{#1}{/volume/command(xml:article-meta:volume)},
doi=\xmlfilter{#1}{/article-id[@pub-id-type='doi']/command(xml:article-meta:doi)},
elocation-id=\xmlfilter{#1}{/elocation-id/command(xml:article-meta:elocation-id)},
title=\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta:title-group:article-title)},
        author={\AuthorList},
abstract=\xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)},
    ]
   \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:article-meta:abstract
    \xmlflush{#1}
\stopxmlsetups
===

But has using a variable for the abstract any drawbacks? (The abstract 
might contain multiple paragraphs.)


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] Error setting up ConTeXt in MacTeX 2020

2020-09-18 Thread Arthur Reutenauer
On Fri, Sep 18, 2020 at 01:48:16PM +0200, Felix Krause wrote:
>>   In your case validformatpath is a subdirectory of $TMPDIR, under
>> /var/folders/.  However, if your Mac is anything like mine, /var is
>> actually a symbolic link to /private/var, so that dir.current() reports
>> a path starting with /private and the test fails.
> 
> Yes, this is the setup here as well.

  That was rhetorical :-)  /var and /tmp (as well as /etc) have been
symbolic links for at least ten years, probably earlier.

>>   You can work around that by setting TMPDIR to some other value, that
>> doesn’t start with /var -- and not /tmp either because that’s also a
>> symbolic link :-)  It should work with a temporary directory in your
>> home folder.  Can you try that?
> 
> This works. Thanks a lot (also to everyone else involved)!

  Glad to hear that, and you’re welcome, but this should also be fixed
in ConTeXt -- Hans, can you do something about that?  It should be
enough to resolve symbolic links on either sides of the test
dir.current() ~= validformatpath

Best,

Arthur
___
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] Error setting up ConTeXt in MacTeX 2020

2020-09-18 Thread Felix Krause
On 18 Sep 2020, at 12:50, Arthur Rosendahl wrote:

>   I think I may have found the origin of the error:
>
>   In your case validformatpath is a subdirectory of $TMPDIR, under
> /var/folders/.  However, if your Mac is anything like mine, /var is
> actually a symbolic link to /private/var, so that dir.current() reports
> a path starting with /private and the test fails.

Yes, this is the setup here as well.

>   You can work around that by setting TMPDIR to some other value, that
> doesn’t start with /var -- and not /tmp either because that’s also a
> symbolic link :-)  It should work with a temporary directory in your
> home folder.  Can you try that?

This works. Thanks a lot (also to everyone else involved)!

Regards,
Felix
___
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] Struggling with startuseMPgraphic and string argument!

2020-09-18 Thread Geert Verhaag

On 18-09-2020 09:03, Hans Hagen wrote:

On 9/17/2020 9:41 PM, Geert Verhaag wrote:

Hi ConTeXt users,

That's indeed magic and it works! Hans, thanks for your prompt answer!

But I would like to take this a step further, by introducing a macro 
within the start/stopuseMPgraphic structure like so:


\startuseMPgraphic{name}{s::lbl}
   def mymacro (text lb) =
 pair a ; a := (3cm,3cm) ;label.top("String: " & str lb,a) ;
   enddef ;
   mymacro(\MPvariable{lbl}) ;
\stopuseMPgraphic

and this works too, but what if I introduce another text argument like:

\startuseMPgraphic{name}{s::lbl,s::label}
   def mymacro (text lb,lbx) =
 pair a ; a := (3cm,3cm) ;label.top("String: " & str lb & ", " & 
str lbx,a) ;

   enddef ;
   mymacro(\MPvariable{lbl},\MPvariable{label}) ;
\stopuseMPgraphic

However this doesn't work!  It gives the following error:

! Missing argument to mymacro.

Isn't that weird? But perhaps it has to do with me not understanding 
argument passing properly within METAPOST macros!


Can someone please explain why this 2 argument example doesn't work?

(But maybe this isn't the proper list to ask questions like these. If 
so, I'm sorry for bothering you!)


Regards,
Gerard


On 16-09-2020 16:32, Geert Verhaag wrote:


Hi,

I'm trying to pass a string argument value to an MPgraphic but it 
doesn't seem to work:


Tried the following:

\startuseMPgraphic{name}{lbl}
  pair a ; a := (3cm,3cm) ;label.top("\MPvariable{lbl}",a) ;
\stopuseMPgraphic

\starttext
  \useMPgraphic{name}{lbl=1}
\stoptext

The above works as expected!

But the following doesn't:

\startuseMPgraphic{name}{lbl}
  pair a ; a := (3cm,3cm) ;label.top("\MPvariable{lbl}",a) ;
\stopuseMPgraphic

\starttext
  \useMPgraphic{name}{lbl=abc}
\stoptext

It yields:

 1 \startuseMPgraphic{name}{lbl}
 2   pair a ; a := (3cm,3cm) ;label.top("\MPvariable{lbl}",a) ;
 3 \stopuseMPgraphic
 4
 5 %\startuseMPgraphic{name}fill fullcircle scaled 200pt 
withcolor .625yellow ;\stopuseMPgraphic

 6
 7 \starttext
 8  Example:
 9 >>    \useMPgraphic{name}{lbl=abc}
10 \stoptext
11


a
\m_meta_current_variable a-a
    bc
 ... \hbox {\scratchdimen \m_meta_current_variable
  sp}\ifzeropt \wd 
\b_meta_v...

\secondoftwoarguments #1#2b-#2

\9>>1 #1,2-\meta_prepare_instance_variable {#1}
\syst_helpers_do_process_comm...
\syst_helpers_do_process_comma_list ...rgument #1,
  ]\relax \global 
\advance \...

...
l.9   \useMPgraphic{name}{lbl=abc}

So it seems that only numbers can be passed not character strings! 
Why is that? Is there a possibility to achieve this functionality?

\startuseMPgraphic{name}{s::lbl,s::label}
    def mymacro(expr a, b) =
    label.top("str:(" & a & "," & b & ")",(3cm,3cm)) ;
    enddef ;
    mymacro("\MPvariable{lbl}","\MPvariable{label}")
\stopuseMPgraphic

\starttext
  \useMPgraphic{name}{lbl=abc,label=pqr}
  \useMPgraphic{name}{lbl=def,label=xyz}
\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
-


Hi Hans,

It really is in the details!!!

I was convinced that I did something wrong somewhere, but couldn't 
figure out what.


Thanks very much for your kind help!

Regards,
Gerard
___
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] Error setting up ConTeXt in MacTeX 2020

2020-09-18 Thread Felix Krause
On 18 Sep 2020, at 12:36, Thomas A. Schmitz wrote:
>
>
> What does
>
> mtxrun --expand-var TEXMFCACHE
>
> return?

selfautoparent:texmf-var;/Users/flyx/Library/texlive/2020/texmf-var

Regards,
Felix___
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] Error setting up ConTeXt in MacTeX 2020

2020-09-18 Thread Arthur Rosendahl
  I think I may have found the origin of the error:

On Fri, Sep 18, 2020 at 09:41:23AM +0200, Felix Krause wrote:
> resolvers   | formats | changing to format path 
> '/var/folders/rj/hfjmjx796q102y4v23vh038cgp/T/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luatex'
> resolvers   | formats | unable to change to format path 
> '/var/folders/rj/hfjmjx796q102y4v23vh038cgp/T/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luatex'

  These messages come from the middle of the file luat-fmt.lua (lines
180 and 183, respectively, on my system) when ConTeXt tries to change
the working directory (that’s what “change” means in this context, just
moving to another directory, as in cd or chdir).  The relevant extract
is

report_format("changing to format path %a",validformatpath)
lfs.chdir(validformatpath)
if dir.current() ~= validformatpath then
return fatalerror(startupdir,"unable to change to format path 
%a",validformatpath)
end

  In your case validformatpath is a subdirectory of $TMPDIR, under
/var/folders/.  However, if your Mac is anything like mine, /var is
actually a symbolic link to /private/var, so that dir.current() reports
a path starting with /private and the test fails.

  You can work around that by setting TMPDIR to some other value, that
doesn’t start with /var -- and not /tmp either because that’s also a
symbolic link :-)  It should work with a temporary directory in your
home folder.  Can you try that?

Best,

Arthur
___
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] Error setting up ConTeXt in MacTeX 2020

2020-09-18 Thread Thomas A. Schmitz
On 18. Sep 2020, at 12:00, Felix Krause  wrote:
> 
> The directory name luatex-cache suggests it's used for caching.

That doesn’t help a lot.

> I interpret the output like „something happens during the generation of the 
> format file and therefore the file never gets generated“. I don't know much 
> about the internals.

What does 

mtxrun --expand-var TEXMFCACHE

return?

Thomas

___
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] Error setting up ConTeXt in MacTeX 2020

2020-09-18 Thread Felix Krause

On 18 Sep 2020, at 11:45, Henning Hraban Ramm wrote:

Try to delete the luatex cache (i.e. all of 
/var/folders/rj/hfjmjx796q102y4v23vh038cgp/T/luatex-cache) and try 
again.


Did that, it regenerates the contents of the directory and the error 
keeps coming up.


Regards,
Felix
___
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] Error setting up ConTeXt in MacTeX 2020

2020-09-18 Thread Felix Krause


On 18 Sep 2020, at 11:43, Thomas A. Schmitz wrote:


Then tell us a bit more about your system. What is the output of

which -a context


/Library/TeX/texbin/context

which is an alias of

/Library/TeX/texbin/context@ -> 
../../texmf-dist/scripts/context/stubs/unix/context


and texbin is

/Library/TeX/texbin@ -> Distributions/Programs/texbin
/Library/TeX/Distributions/Programs/texbin@ -> 
../.DefaultTeX/Contents/Programs/texbin
/Library/TeX/Distributions/.DefaultTeX/Contents@ -> 
../TeXLive-2020.texdist/Contents



for example? Is

/var/folders/

the normal path where mactex would expect a format file? I use a Mac, 
but I have vanilla texlive installed; I never quite understood where 
mactex was any better, so I can’t test on my system.


The directory name luatex-cache suggests it's used for caching. I 
interpret the output like „something happens during the generation of 
the format file and therefore the file never gets generated“. I don't 
know much about the internals.


I don't really have any reason for using MacTeX over texlive; I was once 
told that this is the thing I want to use on a Mac when I was a student, 
and have used it ever since.
I could switch over and try texlive if nothing else helps, though I 
think it would be good to pin down the cause of this error and tell the 
MacTeX folks about it.


Regards,
Felix___
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] Error setting up ConTeXt in MacTeX 2020

2020-09-18 Thread Henning Hraban Ramm

> Am 18.09.2020 um 09:41 schrieb Felix Krause :
> 
> Hi all,
> 
> with MacTeX 2020 on a newly installed Mac, I have the problem that ConTeXt 
> doesn't work anymore:
> 
> $ context file.tex
> mtx-context | warning: no format found, forcing remake (commandline 
> driven)
> […] snip lots of lines
> resolvers   | formats | changing to format path 
> '/var/folders/rj/hfjmjx796q102y4v23vh038cgp/T/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luatex'
> resolvers   | formats | unable to change to format path 
> '/var/folders/rj/hfjmjx796q102y4v23vh038cgp/T/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luatex'
> mtx-context | error, no format found with name: cont-en, aborting
> system  | total runtime: 5.315 seconds

Try to delete the luatex cache (i.e. all of 
/var/folders/rj/hfjmjx796q102y4v23vh038cgp/T/luatex-cache) and try again.

HTH
Hraban
___
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] Error setting up ConTeXt in MacTeX 2020

2020-09-18 Thread Thomas A. Schmitz


> On 18. Sep 2020, at 11:35, Felix Krause  wrote:
> 
> Hm. I don't have this directory (not using MacPorts) and my error seems to be 
> quite different (the scripts to be executed seem to be found).
> I dug through the thread but for all I can see, nothing there describes my 
> problem or a solution for solving it.

Then tell us a bit more about your system. What is the output of

which -a context

for example? Is 

/var/folders/

the normal path where mactex would expect a format file? I use a Mac, but I 
have vanilla texlive installed; I never quite understood where mactex was any 
better, so I can’t test on my system.

Thomas
___
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] Error setting up ConTeXt in MacTeX 2020

2020-09-18 Thread Felix Krause

On 18 Sep 2020, at 11:20, Otared Kavian wrote:


Hi Felix,

Some time ago I encountered the same problem and we had a thread on 
this list about this:


https://www.mail-archive.com/ntg-context@ntg.nl/msg95355.html

The problem on my Mac came from the fact that a directory
/opt/local/etc/texmf/
existed (installed by MacPorts, without me knowing it…) where 
ConTeXt tries to find a format, while there is none.
I removed that directory and then I could use ConTeXt from MacTex 
2020.


Hm. I don't have this directory (not using MacPorts) and my error seems 
to be quite different (the scripts to be executed seem to be found).
I dug through the thread but for all I can see, nothing there describes 
my problem or a solution for solving it.


Regards,
Felix
___
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] ZapfDingbats Unicode differences MKIV vs LMTX

2020-09-18 Thread Christoph Reller
Dear List,

I have the following MWE:

\definefontsynonym[ZapfDingbats][file:ZapfDingbats][features=dingbats]
\usemodule [fnt-10]
\starttext
(1) \getglyphdirect{ZapfDingbats}{61491}\crlf % MKIV log: char  (U+0F033)
in font 'ZapfDingbats-4' with id 8: missing
(2) \getglyphdirect{ZapfDingbats}{983059} % LMTX log: char  (U+F0013)
in font 'ZapfDingbats-4' with id 8: missing
\ShowCompleteFont{name:ZapfDingbats}{14pt}{1}
\stoptext

In MKIV, line (1) fails to output the requested glyph, while line (2)
produces a "check" (✓). In LMTX, line (2) fails and line (1) produces the
"check" (✓) . The output of "\ShowCompleteFont" reports differing Unicodes
for the same glyphs. Apparently the Unicodes for ZapfDingbats have changed.

I would like to have a "check" (✓) in the output for both MKIV and LMTX.
Options:
A) Is there a way to address the glyph in ZapfDingbats for both MKIV and
LMTX uniformly, e.g. by glyph index? (By glyph name does not seem to work:
MKIV reports glyph names, LMTX does not.)
B) Is there a conditional that I can build into the source to distinguish
between MKIV and LMTX?
C) Is there a font in the distribution for which I can have a
"check"-symbol in both MKIV and LMTX?

Any help is appreciated!
Cheers,

Christoph
___
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] Error setting up ConTeXt in MacTeX 2020

2020-09-18 Thread Otared Kavian
Hi Felix,

Some time ago I encountered the same problem and we had a thread on this list 
about this:

https://www.mail-archive.com/ntg-context@ntg.nl/msg95355.html

The problem on my Mac came from the fact that a directory
/opt/local/etc/texmf/
existed (installed by MacPorts, without me knowing it…) where ConTeXt tries to 
find a format, while there is none.
I removed that directory and then I could use ConTeXt from MacTex 2020.

Best regards: Otared


> On 18 Sep 2020, at 09:41, Felix Krause  wrote:
> 
> Hi all,
> 
> with MacTeX 2020 on a newly installed Mac, I have the problem that ConTeXt 
> doesn't work anymore:
> 
> $ context file.tex
> mtx-context | warning: no format found, forcing remake (commandline 
> driven)
> […] snip lots of lines
> resolvers   | formats | changing to format path 
> '/var/folders/rj/hfjmjx796q102y4v23vh038cgp/T/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luatex'
> resolvers   | formats | unable to change to format path 
> '/var/folders/rj/hfjmjx796q102y4v23vh038cgp/T/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luatex'
> mtx-context | error, no format found with name: cont-en, aborting
> system  | total runtime: 5.315 seconds
> The ConTeXt docs  say that I 
> should run mtxrun --generate, which seems to run successfully, and context 
> --make, which finishes with the same „unable to change format path“ error (I 
> believe this is what context automatically does when compiling my file, 
> hinted by the „no format found. forcing remake“ message). I tried explicitly 
> running context --make cont-en which yields the same result. The given path 
> does exist on my hard drive.
> 
> I don't even know if the „unable to change format path“ message is actually 
> an error, but I have no other indicator of what goes wrong. The only line 
> that explicitly says „error“ is the one I get when trying to process the file.
> 
> Interestingly, I have another Mac where I upgraded from MacTeX 2019 to MacTeX 
> 2020 and everything works there.
> 
> I made sure that everything is up-to-date with the TeX Live Utility.
> 
> How can I fix this problem?
> 
> Regards,
> Felix
> 
> ___
> 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] Error setting up ConTeXt in MacTeX 2020

2020-09-18 Thread Felix Krause

Hi all,

with MacTeX 2020 on a newly installed Mac, I have the problem that 
ConTeXt doesn't work anymore:


$ context file.tex
mtx-context | warning: no format found, forcing remake 
(commandline driven)

[…] snip lots of lines
resolvers   | formats | changing to format path 
'/var/folders/rj/hfjmjx796q102y4v23vh038cgp/T/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luatex'
resolvers   | formats | unable to change to format path 
'/var/folders/rj/hfjmjx796q102y4v23vh038cgp/T/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luatex'
mtx-context | error, no format found with name: cont-en, 
aborting

system  | total runtime: 5.315 seconds

The [ConTeXt docs][1] say that I should run `mtxrun --generate`, which 
seems to run successfully, and `context --make`, which finishes with the 
same „unable to change format path“ error (I believe this is what 
context automatically does when compiling my file, hinted by the „no 
format found. forcing remake“ message). I tried explicitly running 
`context --make cont-en` which yields the same result. The given path 
does exist on my hard drive.


I don't even know if the „unable to change format path“ message is 
actually an error, but I have no other indicator of what goes wrong. The 
only line that explicitly says „error“ is the one I get when trying 
to process the file.


Interestingly, I have another Mac where I upgraded from MacTeX 2019 to 
MacTeX 2020 and everything works there.


I made sure that everything is up-to-date with the TeX Live Utility.

How can I fix this problem?

Regards,
Felix


 [1]: https://wiki.contextgarden.net/Running_Mark_IV___
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] Struggling with startuseMPgraphic and string argument!

2020-09-18 Thread Hans Hagen

On 9/17/2020 9:41 PM, Geert Verhaag wrote:

Hi ConTeXt users,

That's indeed magic and it works! Hans, thanks for your prompt answer!

But I would like to take this a step further, by introducing a macro 
within the start/stopuseMPgraphic structure like so:


\startuseMPgraphic{name}{s::lbl}
   def mymacro (text lb) =
     pair a ; a := (3cm,3cm) ;label.top("String: " & str lb,a) ;
   enddef ;
   mymacro(\MPvariable{lbl}) ;
\stopuseMPgraphic

and this works too, but what if I introduce another text argument like:

\startuseMPgraphic{name}{s::lbl,s::label}
   def mymacro (text lb,lbx) =
     pair a ; a := (3cm,3cm) ;label.top("String: " & str lb & ", " & str 
lbx,a) ;

   enddef ;
   mymacro(\MPvariable{lbl},\MPvariable{label}) ;
\stopuseMPgraphic

However this doesn't work!  It gives the following error:

! Missing argument to mymacro.

Isn't that weird? But perhaps it has to do with me not understanding 
argument passing properly within METAPOST macros!


Can someone please explain why this 2 argument example doesn't work?

(But maybe this isn't the proper list to ask questions like these. If 
so, I'm sorry for bothering you!)


Regards,
Gerard


On 16-09-2020 16:32, Geert Verhaag wrote:


Hi,

I'm trying to pass a string argument value to an MPgraphic but it 
doesn't seem to work:


Tried the following:

\startuseMPgraphic{name}{lbl}
  pair a ; a := (3cm,3cm) ;label.top("\MPvariable{lbl}",a) ;
\stopuseMPgraphic

\starttext
  \useMPgraphic{name}{lbl=1}
\stoptext

The above works as expected!

But the following doesn't:

\startuseMPgraphic{name}{lbl}
  pair a ; a := (3cm,3cm) ;label.top("\MPvariable{lbl}",a) ;
\stopuseMPgraphic

\starttext
  \useMPgraphic{name}{lbl=abc}
\stoptext

It yields:

 1 \startuseMPgraphic{name}{lbl}
 2   pair a ; a := (3cm,3cm) ;label.top("\MPvariable{lbl}",a) ;
 3 \stopuseMPgraphic
 4
 5 %\startuseMPgraphic{name}fill fullcircle scaled 200pt withcolor 
.625yellow ;\stopuseMPgraphic

 6
 7 \starttext
 8  Example:
 9 >>    \useMPgraphic{name}{lbl=abc}
10 \stoptext
11


a
\m_meta_current_variable a-a
    bc
 ... \hbox {\scratchdimen \m_meta_current_variable
  sp}\ifzeropt \wd 
\b_meta_v...

\secondoftwoarguments #1#2b-#2

\9>>1 #1,2-\meta_prepare_instance_variable {#1}
\syst_helpers_do_process_comm...
\syst_helpers_do_process_comma_list ...rgument #1,
  ]\relax \global 
\advance \...

...
l.9   \useMPgraphic{name}{lbl=abc}

So it seems that only numbers can be passed not character strings! Why 
is that? Is there a possibility to achieve this functionality?

\startuseMPgraphic{name}{s::lbl,s::label}
def mymacro(expr a, b) =
label.top("str:(" & a & "," & b & ")",(3cm,3cm)) ;
enddef ;
mymacro("\MPvariable{lbl}","\MPvariable{label}")
\stopuseMPgraphic

\starttext
  \useMPgraphic{name}{lbl=abc,label=pqr}
  \useMPgraphic{name}{lbl=def,label=xyz}
\stoptext

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

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


Re: [NTG-context] \setbreakpoints[compound] with numbers

2020-09-18 Thread Denis Maier

Am 17.09.2020 um 19:07 schrieb Hans Hagen:

On 9/17/2020 4:54 PM, Denis Maier wrote:

Hi,

In the texts I'm currently typesetting, I occassionaly have to deal 
with ISBNs. So, e.g. 978-3-123456-78-9


\setbreakpoints[compound] does not enable automatic linebreaks after 
or before the hyphens. Is there a way to deal with this? Perhaps 
something similar like \hyphenatedurl{} or an extended version of 
\setbreakpoints.


(I currently use zero-width spaces, so I got rid of ISBNs in the 
margins, but a more automatic solution would be great.)


\unexpanded\def\isbnnumber#1%
   {\cldcontext{string.gsub("#1","-","\\automaticdiscretionary")}}

\hsize 1mm \isbnnumber{123-456}


Thanks.
___
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
___