Re: [NTG-context] How to let a macro check the previous value of #1 the last time the same macro was called?

2022-01-10 Thread Henning Hraban Ramm via ntg-context

Am 09.01.22 um 16:03 schrieb Wolfgang Schuster via ntg-context:

Joel via ntg-context schrieb am 09.01.2022 um 15:16:
Is there a way for a macro to check the previous value of #1, the last 
time that same macro was called?


To check is the current value differs from the last one you need a temp 
macro where you store the current value at the end of your command to 
check it in the next call.


Would it make more sense, or would it be “cleaner” to use a variable?

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
___


[NTG-context] Regular online meet-up (tomorrow!)

2022-01-10 Thread Henning Hraban Ramm via ntg-context

You’re invited to join Tuesday, January 11th, 15:00 CET

at https://lecture.senfcall.de/hen-rbr-rku-oke

ConTeXt users of all levels are welcome!

Hans offered to give a Q session again – please announce subjects 
you’d like to discuss ASAP, so that he can prepare.



I guess we can talk more about the requirements of critical editions,
and I’d like to know how to translate indirect \doSomething definitions 
into LMTX style.



[Howto]
* No special software installation required; most modern browsers should 
work (WebRTC required).

* Open the above URL, accept the privacy statement,
* enter your name,
* click "join" (or "start" if you’re the first),
* click "with microphone", allow your browser to access it, check the audio.
* Your microphone is muted if you join. Activate microphone and/or 
camera with the buttons at the bottom.

* Minimize the default presentation with the "screen" button, bottom right.

* If you’d like to share your screen or upload a file, you can make 
yourself the presenter: Click on your user name, change the setting, 
then you’ll see the "screen sharing" button beside the camera button; 
also there’s now "manage presentations" behind the "plus" button. Beware 
there is only one presenter, so don’t kill someone else’s presentation.


[Technical hints]
* Sound is usually better if you use a headset (less noise for everyone).

* Connection problems are mostly due to low bandwidth or high latency on 
your side, e.g. with mobile connections.

* Screen sharing needs a lot of bandwidth.
* If audio/video doesn’t work for you, try a different browser, and you 
can still use the text chat.


* You can also join with a regular telephone (audio only, of course), 
call +49-6151-86275-22 (German landline); then you must enter a PIN that 
changes every time – if you need it, ask me for it via email. 
Mute/unmute your microphone with "0".


[Netiquette]
* Please use a name that we recognize from here. Some feel uncomfortable 
with anonymous lurkers.

* Mute your microphone while you’re not talking.
* It’s nice to show your face at least when you join.
* If there are connection problems, stop camera sharing.
* The room is set to “everyone’s a moderator“, I trust you...

Next time will be February 8th.

See you, 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] How to let a macro check the previous value of #1 the last time the same macro was called?

2022-01-09 Thread Wolfgang Schuster via ntg-context

Joel via ntg-context schrieb am 09.01.2022 um 15:16:
Is there a way for a macro to check the previous value of #1, the last 
time that same macro was called?


Here is a minimum working example, pretending that `\previousvalue` is 
equal to #1 from the last time the same macro was called:


[...]


To check is the current value differs from the last one you need a temp 
macro where you store the current value at the end of your command to 
check it in the next call.


\let\previousmymacro\empty

\define[1]\mymacro
  {\edef\currentmymacro{#1}%
   \ifx\previousmymacro\currentmymacro
 same as last time
   \else
 it is different from last time
   \fi
   \let\previousmymacro\currentmymacro}

\starttext

\startlines
cat: \mymacro{cat}
cat: \mymacro{cat}
mouse: \mymacro{mouse}
mouse: \mymacro{mouse}
cat: \mymacro{cat}
\stoplines

\stoptext

Wolfgang

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

maillist : ntg-context@ntg.nl / 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] How to let a macro check the previous value of #1 the last time the same macro was called?

2022-01-09 Thread Joel via ntg-context
Is there a way for a macro to check the previous value of #1, the last time 
that same macro was called?

Here is a minimum working example, pretending that `\previousvalue` is equal to 
#1 from the last time the same macro was called:

    \define[1]\mymacro{
    \if\previousvalue=#1
        same as last time
    \else
        it is different from last time
    \fi
    }

\starttext

    \mymacro{cat}
    \mymacro{cat}
    \mymacro{mouse}
    \mymacro{mouse}
    \mymacro{cat}

\stoptext

This would print:

    it is different from last time <--it was never called previously
    same as last time
    it is different from last time
    same as last time
    it is different from last time

--Joel
___
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] Fallback fails for Linux Libertine O to Junicode over private area, debugging?

2022-01-08 Thread Hans Hagen via ntg-context

On 1/7/2022 10:39 PM, J. P. Ascher wrote:

in that case you can best use a rather bare font i.e. no features at
all apart from kerning and use dynamic features grouped

in lmtx there are other tricks too

\noleftligaturing
\norightligaturing
\noligaturing

and other conbtrols like

\noleftkerning
etc


This is very useful.  I'm thinking of writing an environment that
switches: I like keeping the ease of typing normal characters, rather
than getting glyphs directly, because it's easier to proof on screen in
the editor.


writing about reproduced in my work and thus now can in the historical
item itself.


one aspect is how ligatures are made: some fonts have single shapes,
others use replacements and kerning of (then) multiple shapes


I think you wrote about this somewhere else and it got me interested in
physical type from my period: it looks like some printers did some of
the same things, sometimes!  You might have a box of pre-composed
ligatures, or not; you might take a knife to some letters to tweak them
for specific uses, or not; you might even shave wrong-sized letters to
fit them in where they don't belong.  Those shaved down letters could
end up back with their siblings, now shifting around during printing, or
they could be tossed.

The pre-composed ligatures might most often be made on matrices struck
with the same punches as for the non-ligatured glyphs, but typefounders
might re-strike matries now and then, so you might end up with slightly
different pre-composed ligatures in different, or even the same, fount
of type.  It's nuts!

Fred Smeijers writes about this a little bit in *Counterpunch*, but
I had already started thinking about it because of ConTeXt.

I wouldn't have known to look if it weren't for the typographical
education you and your colleagues pass around; so, thank you again!
One problem with writing about things related to fonts is that when a 
font changes rendering changes 9this is a pain for manuals or articles 
that then no longer show examplex right)


for that reason one needs to

- save a font, best rename it
- define fonts by filename
- make sure that font specific manipulations are also saved

Fonts more and more have become like programs. In the past a font never 
changed (even expensive fonts had no update policy like programs do) but 
with open type fonts became way less stable especially free ones 
(vendors still freeze and then just sell them). Add to that forking, 
abandoning etc. With complex features being used, and features not 
always being applied consistently (bascially we have 1-1, 1-many, 
many-1, many-many mapping plus contextual lookups) we can expect bugs 
and they get fixed or not. It also depends on views of designer, 
programs being used to make them, programs used to test them, all of 
which can change over time, so in a way fonts have become less stable (a 
bit like hyphenation patterns as more fluid resource). At some point we 
can expect bug(let)s or imperfections to stay and adapt to that (as we 
do with math now). (This is not new: for a long time tex users had to 
deal with computer modern fonts with basically only proper kerning for 
english.)


Add to that evolving technologies (color fonts, image based ones e.g. 
emoji, variable fonts) that show up, then need fonts, where often the 
first ones are not okay, so bug show up, features changes, specs become 
better (or worse), bugs become features when programs compensate for 
issues, often a side effect of release before maturing (the haste of/on 
the web) but all that can settle after a decade (because in the tex 
world we talk decades anyway). In context so far we managed to keep up 
with e.g. color fonts, variables fonts pretty early (we were one of the 
first to actually typeset with variable fonts) but that of course also 
comes a price of later adaptation (when fonts show up, specs become 
clear). Here definitely a longer time scale matters so using such fonts 
in a project is more tricky for various reasons.


The best would be if we had a repository for context where we put fonts 
(clean file names, maybe with normalized version/date in file name) that 
we can then trust to stay the same. In that case a typescript and lua 
extensions can check for versions reliable.


(We might do that for math to start with.)

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

Re: [NTG-context] Fallback fails for Linux Libertine O to Junicode over private area, debugging?

2022-01-07 Thread Hans Hagen via ntg-context

On 1/7/2022 4:18 PM, J. P. Ascher via ntg-context wrote:

Hi, all,

I'm a long time lurker (on gmane), first time poster. First, thank you
all, very much, for your excellent work and superb community.
ConTeXt has become a critical part of my academic writing and integral
to my research.  I'm not exaggerating when I say it changed how
I thought about texts and became a major source for my dissertation
work.  Thank you!

I'm trying to get a typescript for setting a text in Libertine with
Junicode fallbacks for characters in MUFI, in the private use area.
For some reason Libertine roman will not fallback no matter what
I do. However Libertine italic will.  I can also work around it by using
Junicode as a base and forcing fallback to Libertine.

My question is: why?  What's wrong with Libertine roman?  Or my approach?

My hypothesis is that there's something about `LinLibertine_R.otf`
that's not quite right.  I looked in FontForge, but couldn't
spot anything.

Does anyone have a suggestion as to another place to look?  Or something
I'm overlooking?

Minimal example (attached too, if it comes through):

```
\definefontfeature[default][default][script=latn]


% Libertine with a Junicode fallback, lib-fb-jun

\definefontfallback[junicodefallback][name:Junicode][privateusearea][check=yes,force=no]

\starttypescript [serif] [lib-fb-jun]
   \definefontsynonym [Libertine-Roman] [file:linlibertiner]
   \definefontsynonym [Libertine-Slanted]  [file:linlibertineri]  % works fine
\stoptypescript
  
\starttypescript [serif] [lib-fb-jun] [name]

   \definefontsynonym [Serif][Libertine-Roman]   
[features=default,fallbacks=junicodefallback]
   \definefontsynonym [SerifSlanted] [Libertine-Slanted] 
[features=default,fallbacks=junicodefallback]
\stoptypescript
  
\starttypescript [lib-fb-jun]

   \definetypeface [lib-fb-jun] [rm] [serif] [lib-fb-jun] [default]
\stoptypescript


% Junicode with Libertine as a fallback, preferring Libertine, jun-pr-lib
% this hack does what I want the above to do

\definefontfallback[preferlibertine][name:linlibertineo][0-F][check=yes,force=yes]

\starttypescript[serif] [jun-pr-lib]
\definefontsynonym [JunicodeRoman] [name:Junicode]
\stoptypescript

\starttypescript[serif] [jun-pr-lib] [name]
\definefontsynonym [Serif] [JunicodeRoman] [fallbacks=preferlibertine]
\stoptypescript

\starttypescript [jun-pr-lib]
   \definetypeface [jun-pr-lib] [rm] [serif] [jun-pr-lib] [default]
\stoptypescript


% some tracking stuff

\enabletrackers[fonts.missing=replace]
\enabledirectives[logs.errors]


% text, we use lib-fb-jun first, then jun-pr-lib

\starttext
\setupbodyfont[lib-fb-jun]

{\em emph. lib-fb-jun: \Uchar61125 \char64259 \utfchar{"eec5} (three glyphs)}

lib-fb-jun: \Uchar61125 \char64259 \utfchar{"eec5} (three glyphs)  % <- 
fallback fails here

\switchtobodyfont[jun-pr-lib]

jun-pr-lib: \Uchar61125 \char64259 \utfchar{"eec5} (three glyphs) % <- works

\stoptext
```

Any ideas?
when you use a complex font (in this case with lots of ligatures) doing 
a fallback can interfere with these features especially when they have 
been put in the private areas which are basically 'undefined'


you're accessing an st ligature directly but normally you will do that 
by enabling a font feature


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] Fallback fails for Linux Libertine O to Junicode over private area, debugging?

2022-01-07 Thread J .  P . Ascher via ntg-context
Thanks for asking!

It's just my example.  I maintain JunicodeRX (...with Restoration
Typographical Extensions) which includes yet more non-standard code
points and which I continue to add to.  In my actual work, I also add in
Symbola for additional fallbacks.

Some fonts have better language coverage (Libertine) and others have
some custom glyphs I want (JunicodeRX and Symbola).  If I had a bit more
time, I suspect maintaining a stand-alone
Libertine+JunicodeRX+Symbola.otf would be the best approach, but that's
a bit beyond me these days.

On Fri, Jan 07 2022, 13:52:05 -03 Youssef Cherem  wrote:

> Is it just your example, or do you really just want those ligatures? 
>
> fre. 7. jan. 2022 kl. 12:33 skrev J. P. Ascher via ntg-context 
> :
>
>  Hi, all,
>
>  I'm a long time lurker (on gmane), first time poster. First, thank you
>  all, very much, for your excellent work and superb community.
>  ConTeXt has become a critical part of my academic writing and integral
>  to my research.  I'm not exaggerating when I say it changed how
>  I thought about texts and became a major source for my dissertation
>  work.  Thank you!
>
>  I'm trying to get a typescript for setting a text in Libertine with
>  Junicode fallbacks for characters in MUFI, in the private use area.
>  For some reason Libertine roman will not fallback no matter what
>  I do. However Libertine italic will.  I can also work around it by using
>  Junicode as a base and forcing fallback to Libertine.
>
>  My question is: why?  What's wrong with Libertine roman?  Or my approach?
>
>  My hypothesis is that there's something about `LinLibertine_R.otf`
>  that's not quite right.  I looked in FontForge, but couldn't
>  spot anything.
>
>  Does anyone have a suggestion as to another place to look?  Or something
>  I'm overlooking?
>
>  Minimal example (attached too, if it comes through):
>
>  ```
>  \definefontfeature[default][default][script=latn]
>
>  % Libertine with a Junicode fallback, lib-fb-jun
>
>  
> \definefontfallback[junicodefallback][name:Junicode][privateusearea][check=yes,force=no]
>
>  \starttypescript [serif] [lib-fb-jun]
>\definefontsynonym [Libertine-Roman] [file:linlibertiner]
>\definefontsynonym [Libertine-Slanted]  [file:linlibertineri]  % works fine
>  \stoptypescript
>
>  \starttypescript [serif] [lib-fb-jun] [name]
>\definefontsynonym [Serif][Libertine-Roman]   
> [features=default,fallbacks=junicodefallback]
>\definefontsynonym [SerifSlanted] [Libertine-Slanted] 
> [features=default,fallbacks=junicodefallback]
>  \stoptypescript
>
>  \starttypescript [lib-fb-jun]
>\definetypeface [lib-fb-jun] [rm] [serif] [lib-fb-jun] [default]
>  \stoptypescript
>
>  % Junicode with Libertine as a fallback, preferring Libertine, jun-pr-lib
>  % this hack does what I want the above to do
>
>  
> \definefontfallback[preferlibertine][name:linlibertineo][0-F][check=yes,force=yes]
>
>  \starttypescript[serif] [jun-pr-lib]
> \definefontsynonym [JunicodeRoman] [name:Junicode]
>  \stoptypescript
>
>  \starttypescript[serif] [jun-pr-lib] [name]
> \definefontsynonym [Serif] [JunicodeRoman] [fallbacks=preferlibertine]
>  \stoptypescript
>
>  \starttypescript [jun-pr-lib]
>\definetypeface [jun-pr-lib] [rm] [serif] [jun-pr-lib] [default]
>  \stoptypescript
>
>  % some tracking stuff
>
>  \enabletrackers[fonts.missing=replace]
>  \enabledirectives[logs.errors]
>
>  % text, we use lib-fb-jun first, then jun-pr-lib
>
>  \starttext
>  \setupbodyfont[lib-fb-jun]
>
>  {\em emph. lib-fb-jun: \Uchar61125 \char64259 \utfchar{"eec5} (three glyphs)}
>
>  lib-fb-jun: \Uchar61125 \char64259 \utfchar{"eec5} (three glyphs)  % <- 
> fallback fails here
>
>  \switchtobodyfont[jun-pr-lib]
>
>  jun-pr-lib: \Uchar61125 \char64259 \utfchar{"eec5} (three glyphs) % <- works
>
>  \stoptext
>  ```
>
>  Any ideas?
>
>  Most warmly,
>  -jp
>
>  -- 
>  J. P. Ascher
>  Preceding: https://doi.org/10.18130/jqpe-zc65
>  Current: http://www.bibsoc.org.uk/content/2020-2021-0
>
>  
> ___
>  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] Fallback fails for Linux Libertine O to Junicode over private area, debugging?

2022-01-07 Thread Youssef Cherem via ntg-context
Is it just your example, or do you really just want those ligatures?

fre. 7. jan. 2022 kl. 12:33 skrev J. P. Ascher via ntg-context <
ntg-context@ntg.nl>:

> Hi, all,
>
> I'm a long time lurker (on gmane), first time poster. First, thank you
> all, very much, for your excellent work and superb community.
> ConTeXt has become a critical part of my academic writing and integral
> to my research.  I'm not exaggerating when I say it changed how
> I thought about texts and became a major source for my dissertation
> work.  Thank you!
>
> I'm trying to get a typescript for setting a text in Libertine with
> Junicode fallbacks for characters in MUFI, in the private use area.
> For some reason Libertine roman will not fallback no matter what
> I do. However Libertine italic will.  I can also work around it by using
> Junicode as a base and forcing fallback to Libertine.
>
> My question is: why?  What's wrong with Libertine roman?  Or my approach?
>
> My hypothesis is that there's something about `LinLibertine_R.otf`
> that's not quite right.  I looked in FontForge, but couldn't
> spot anything.
>
> Does anyone have a suggestion as to another place to look?  Or something
> I'm overlooking?
>
> Minimal example (attached too, if it comes through):
>
> ```
> \definefontfeature[default][default][script=latn]
>
>
> % Libertine with a Junicode fallback, lib-fb-jun
>
>
> \definefontfallback[junicodefallback][name:Junicode][privateusearea][check=yes,force=no]
>
> \starttypescript [serif] [lib-fb-jun]
>   \definefontsynonym [Libertine-Roman] [file:linlibertiner]
>   \definefontsynonym [Libertine-Slanted]  [file:linlibertineri]  % works
> fine
> \stoptypescript
>
> \starttypescript [serif] [lib-fb-jun] [name]
>   \definefontsynonym [Serif][Libertine-Roman]
>  [features=default,fallbacks=junicodefallback]
>   \definefontsynonym [SerifSlanted] [Libertine-Slanted]
> [features=default,fallbacks=junicodefallback]
> \stoptypescript
>
> \starttypescript [lib-fb-jun]
>   \definetypeface [lib-fb-jun] [rm] [serif] [lib-fb-jun] [default]
> \stoptypescript
>
>
> % Junicode with Libertine as a fallback, preferring Libertine, jun-pr-lib
> % this hack does what I want the above to do
>
>
> \definefontfallback[preferlibertine][name:linlibertineo][0-F][check=yes,force=yes]
>
> \starttypescript[serif] [jun-pr-lib]
>\definefontsynonym [JunicodeRoman] [name:Junicode]
> \stoptypescript
>
> \starttypescript[serif] [jun-pr-lib] [name]
>\definefontsynonym [Serif] [JunicodeRoman] [fallbacks=preferlibertine]
> \stoptypescript
>
> \starttypescript [jun-pr-lib]
>   \definetypeface [jun-pr-lib] [rm] [serif] [jun-pr-lib] [default]
> \stoptypescript
>
>
> % some tracking stuff
>
> \enabletrackers[fonts.missing=replace]
> \enabledirectives[logs.errors]
>
>
> % text, we use lib-fb-jun first, then jun-pr-lib
>
> \starttext
> \setupbodyfont[lib-fb-jun]
>
> {\em emph. lib-fb-jun: \Uchar61125 \char64259 \utfchar{"eec5} (three
> glyphs)}
>
> lib-fb-jun: \Uchar61125 \char64259 \utfchar{"eec5} (three glyphs)  % <-
> fallback fails here
>
> \switchtobodyfont[jun-pr-lib]
>
> jun-pr-lib: \Uchar61125 \char64259 \utfchar{"eec5} (three glyphs) % <-
> works
>
> \stoptext
> ```
>
> Any ideas?
>
> Most warmly,
> -jp
>
> --
> J. P. Ascher
> Preceding: https://doi.org/10.18130/jqpe-zc65
> Current: http://www.bibsoc.org.uk/content/2020-2021-0
>
>
> ___
> 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] Fallback fails for Linux Libertine O to Junicode over private area, debugging?

2022-01-07 Thread J .  P . Ascher via ntg-context
Hi, all,

I'm a long time lurker (on gmane), first time poster. First, thank you
all, very much, for your excellent work and superb community.
ConTeXt has become a critical part of my academic writing and integral
to my research.  I'm not exaggerating when I say it changed how
I thought about texts and became a major source for my dissertation
work.  Thank you!

I'm trying to get a typescript for setting a text in Libertine with
Junicode fallbacks for characters in MUFI, in the private use area.
For some reason Libertine roman will not fallback no matter what
I do. However Libertine italic will.  I can also work around it by using
Junicode as a base and forcing fallback to Libertine.

My question is: why?  What's wrong with Libertine roman?  Or my approach?

My hypothesis is that there's something about `LinLibertine_R.otf`
that's not quite right.  I looked in FontForge, but couldn't
spot anything.

Does anyone have a suggestion as to another place to look?  Or something
I'm overlooking?

Minimal example (attached too, if it comes through):

```
\definefontfeature[default][default][script=latn]


% Libertine with a Junicode fallback, lib-fb-jun

\definefontfallback[junicodefallback][name:Junicode][privateusearea][check=yes,force=no]

\starttypescript [serif] [lib-fb-jun]
  \definefontsynonym [Libertine-Roman] [file:linlibertiner]
  \definefontsynonym [Libertine-Slanted]  [file:linlibertineri]  % works fine
\stoptypescript
 
\starttypescript [serif] [lib-fb-jun] [name]
  \definefontsynonym [Serif][Libertine-Roman]   
[features=default,fallbacks=junicodefallback]
  \definefontsynonym [SerifSlanted] [Libertine-Slanted] 
[features=default,fallbacks=junicodefallback]
\stoptypescript
 
\starttypescript [lib-fb-jun]
  \definetypeface [lib-fb-jun] [rm] [serif] [lib-fb-jun] [default]
\stoptypescript


% Junicode with Libertine as a fallback, preferring Libertine, jun-pr-lib
% this hack does what I want the above to do

\definefontfallback[preferlibertine][name:linlibertineo][0-F][check=yes,force=yes]

\starttypescript[serif] [jun-pr-lib]
   \definefontsynonym [JunicodeRoman] [name:Junicode]
\stoptypescript

\starttypescript[serif] [jun-pr-lib] [name]
   \definefontsynonym [Serif] [JunicodeRoman] [fallbacks=preferlibertine]
\stoptypescript

\starttypescript [jun-pr-lib]
  \definetypeface [jun-pr-lib] [rm] [serif] [jun-pr-lib] [default]
\stoptypescript


% some tracking stuff

\enabletrackers[fonts.missing=replace]
\enabledirectives[logs.errors]


% text, we use lib-fb-jun first, then jun-pr-lib

\starttext
\setupbodyfont[lib-fb-jun]

{\em emph. lib-fb-jun: \Uchar61125 \char64259 \utfchar{"eec5} (three glyphs)}

lib-fb-jun: \Uchar61125 \char64259 \utfchar{"eec5} (three glyphs)  % <- 
fallback fails here

\switchtobodyfont[jun-pr-lib]

jun-pr-lib: \Uchar61125 \char64259 \utfchar{"eec5} (three glyphs) % <- works

\stoptext
```

Any ideas?

Most warmly,
-jp

-- 
J. P. Ascher
Preceding: https://doi.org/10.18130/jqpe-zc65
Current: http://www.bibsoc.org.uk/content/2020-2021-0



min.log
Description: Binary data


min.pdf
Description: Adobe PDF document


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

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


Re: [NTG-context] STIX2 font issues with freshly installed LMTX

2022-01-05 Thread Heinrich Paeßens via ntg-context
Hi there

Issue solved by deleting the context-internal fonts and recurring on the 
system-wide installed fonts … never mind ;-)

 
<https://www.dropbox.com/s/g31kwg14tcs5621/Untitled_Test%20-compressed.pdf?dl=0>

Happy New Year
Heinrich

> 
>> On 3 Jan 2022, at 21:46, Heinrich Paeßens > <mailto:paess...@me.com>> wrote:
>>> 
>>> Hi there
>>> 
>>> as a newcomer in ConTeXt I installed according to 
>>> 
>>> https://wiki.contextgarden.net/Installing_ConTeXt_LMTX_on_MacOS/ 
>>> <https://wiki.contextgarden.net/Installing_ConTeXt_LMTX_on_MacOS/>
>>> 
>>> and using TeXShop on macos as advised.
>>> 
>>> However, I like to use STIX2-Fonts for Text and Math and hence my MWE to 
>>> test which fonts are going to be embedded (CLI pdffonts):
>>> 
>>> -
>>> \setupbodyfont[stixtwo]
>>> \starttext
>>> 
>>> Test ß 1lIjJuQ \% § \& ?! VERSAL-ẞ- \|> --- 1234567890 --- //
>>> 
>>> \placeformula[eqn:def-m]
>>> \startformula
>>> m = \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}}
>>> \stopformula
>>> \stoptext
>>> -
>>> 
>>> Unfortunately the compiler throws an error — why is there a check of 
>>> STIX2-fonts versions, why is that important?
>>> 
>>> I checked and found 
>>> 
>>> /Users/hp/Library/Fonts/STIXTwoText-Regular.otf Version 2.12 b168
>>> /Users/hp/Library/context-osx-64/tex/texmf/fonts/opentype/public/stix2-otf/STIXTwoText-Regular.otf
>>>  Version 2.11 b159
>>> 
>>> Could you please advise for a work around?
>>> 
>>> from the log:
>>> 
>>> -
>>> fonts   > otf loading > loading 'stixtwotext-regular.otf', hash 
>>> 'stixtwotext-regular'
>>> otf reader  > unknown version '
>>> 
>>> 
>>> 
>>> ' in file 'stixtwotext-regular.otf'
>>> fonts   > otf loading > loading done
>>> fonts   > otf loading > saving 'stixtwotext-regular.otf' in cache
>>> system  > lua > compiling 
>>> '/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/fonts/otl/stixtwotext-regular.tma'
>>>  into 
>>> '/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/fonts/otl/stixtwotext-regular.tmd'
>>> system  > lua > dumping 
>>> '/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/fonts/otl/stixtwotext-regular.tma'
>>>  into 
>>> '/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/fonts/otl/stixtwotext-regular.tmd'
>>>  stripped
>>> fonts   > otf loading > loading, optimizing, packing and caching 
>>> time 0.002
>>> lua error   > lua error on line 1 in file ./Untitled.tex:
>>> 
>>> registered function call [1129]: 
>>> ...-64/tex/texmf-context/tex/context/base/mkiv/font-otc.lua:325: attempt to 
>>> index a nil value (upvalue 'descriptions')
>>> stack traceback:
>>> ...-64/tex/texmf-context/tex/context/base/mkiv/font-otc.lua:325: in 
>>> local 'prepare_ligature'
>>> ...-64/tex/texmf-context/tex/context/base/mkiv/font-otc.lua:770: in 
>>> upvalue 'addfeature'
>>> ...-64/tex/texmf-context/tex/context/base/mkiv/font-otc.lua:899: in 
>>> local 'enhancer'
>>> ...-64/tex/texmf-context/tex/context/base/mkxl/font-con.lmt:1269: in 
>>> upvalue 'enhance'
>>> ...-64/tex/texmf-context/tex/context/base/mkxl/font-con.lmt:1291: in 
>>> field 'apply'
>>> ...-64/tex/texmf-context/tex/context/base/mkxl/font-otl.lmt:263: in 
>>> field 'load'
>>> ...-64/tex/texmf-context/tex/context/base/mkxl/font-otl.lmt:602: in 
>>> upvalue 'otftotfm'
>>> ...-64/tex/texmf-context/tex/context/base/mkxl/font-otl.lmt:630: in 
>>> function <...-64/tex/texmf-context/tex/context/base/mkxl/font-otl.lmt:629>
>>> (...tail calls...)
>>> ...-64/tex/texmf-context/tex/context/base/mkxl/font-def.lmt:378: in 
>>> function <...-64/tex/texmf-context/tex/context/base/mkxl/font-def.lmt:366>
>>> (...tail calls...)
>>> ...-64/tex/texmf-context/tex/context/base/mkxl/font-def.lmt:484: in 
>>> field 'read'
>>> ...-64/tex/texmf-context/tex/context/base/mkxl/font-ctx.lmt:1336: in 
>>> function <...-64/tex/texmf-context/tex/context/base/mkxl/font-ctx.lmt:1193>
>>> (...tail calls...)
>>>  1 >>  \setupbodyfont[stixtwo]
>>> -
>>> 
>>> Many thanks for your support.
>>> Kind regards
>>> 
>>> Heinrich Paeßens 
>>> Mobile +49 1512 123 9876 
>>> Business Card 
>>> <https://www.paessens.tel/img/heinrich-paessens_bc-2021-03-11_signed.pdf>
>>> 
>> 
> 

___
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] issue with \placenotes[linenote]

2022-01-05 Thread Pablo Rodriguez via ntg-context
On 1/4/22 5:09 PM, Hans Hagen via ntg-context wrote:
> On 1/4/2022 2:23 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> I cannot compile it. ConTeXt complains about "\placenotes[linenote]"
>> being undefined.
>>
> can you check with

I’m afraid I get the following error message:

  tex error   > tex error on line 11 in file a.tex: Undefined
   control sequence \p_linenotes_compressmethod

Pablo
___
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] issue with \placenotes[linenote]

2022-01-04 Thread Hans Hagen via ntg-context

On 1/4/2022 2:23 PM, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following sample:

 \setuplinenote[location=text, paragraph=yes]
 \starttext
 \startbuffer
 \startlinenumbering[step=3]
 \dorecurse{25}
  {a\linenote{b} }
 \stoplinenumbering
 \stopbuffer

 \getbuffer
 \placenotes[linenote]
 \stoptext

I cannot compile it. ConTeXt complains about "\placenotes[linenote]"
being undefined.

Is there something I’m missing or have I hit a bug?

Many thanks for your help,

can you check with

\unprotect

\def\strc_linenotes_inbetween
  {\begingroup
   \strc_linenotes_check_compression

\begincsname\??linenotescompressmethod\p_linenotes_compressmethod\endcsname
   \endgroup}

\protect

at some point grouping was added to we have an unknown

-
  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] STIX2 font issues with freshly installed FMTX

2022-01-03 Thread Heinrich Paeßens via ntg-context
Hi there

as a newcomer in ConTeXt I installed according to 

https://wiki.contextgarden.net/Installing_ConTeXt_LMTX_on_MacOS/

and using TeXShop on macos as advised.

However, I like to use STIX2-Fonts for Text and Math and hence my MWE to test 
which fonts are going to be embedded (CLI pdffonts):

-
\setupbodyfont[stixtwo]
\starttext

Test ß 1lIjJuQ \% § \& ?! VERSAL-ẞ- \|> --- 1234567890 --- //

\placeformula[eqn:def-m]
\startformula
m = \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}}
\stopformula
\stoptext
-

Unfortunately the compiler throws an error — why is there a check of 
STIX2-fonts versions, why is that important?

I checked and found 

/Users/hp/Library/Fonts/STIXTwoText-Regular.otf Version 2.12 b168
/Users/hp/Library/context-osx-64/tex/texmf/fonts/opentype/public/stix2-otf/STIXTwoText-Regular.otf
 Version 2.11 b159

Could you please advise for a work around?

from the log:

-
fonts   > otf loading > loading 'stixtwotext-regular.otf', hash 
'stixtwotext-regular'
otf reader  > unknown version '



' in file 'stixtwotext-regular.otf'
fonts   > otf loading > loading done
fonts   > otf loading > saving 'stixtwotext-regular.otf' in cache
system  > lua > compiling 
'/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/fonts/otl/stixtwotext-regular.tma'
 into 
'/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/fonts/otl/stixtwotext-regular.tmd'
system  > lua > dumping 
'/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/fonts/otl/stixtwotext-regular.tma'
 into 
'/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/fonts/otl/stixtwotext-regular.tmd'
 stripped
fonts   > otf loading > loading, optimizing, packing and caching time 
0.002
lua error   > lua error on line 1 in file ./Untitled.tex:

registered function call [1129]: 
...-64/tex/texmf-context/tex/context/base/mkiv/font-otc.lua:325: attempt to 
index a nil value (upvalue 'descriptions')
stack traceback:
...-64/tex/texmf-context/tex/context/base/mkiv/font-otc.lua:325: in 
local 'prepare_ligature'
...-64/tex/texmf-context/tex/context/base/mkiv/font-otc.lua:770: in 
upvalue 'addfeature'
...-64/tex/texmf-context/tex/context/base/mkiv/font-otc.lua:899: in 
local 'enhancer'
...-64/tex/texmf-context/tex/context/base/mkxl/font-con.lmt:1269: in 
upvalue 'enhance'
...-64/tex/texmf-context/tex/context/base/mkxl/font-con.lmt:1291: in 
field 'apply'
...-64/tex/texmf-context/tex/context/base/mkxl/font-otl.lmt:263: in 
field 'load'
...-64/tex/texmf-context/tex/context/base/mkxl/font-otl.lmt:602: in 
upvalue 'otftotfm'
...-64/tex/texmf-context/tex/context/base/mkxl/font-otl.lmt:630: in 
function <...-64/tex/texmf-context/tex/context/base/mkxl/font-otl.lmt:629>
(...tail calls...)
...-64/tex/texmf-context/tex/context/base/mkxl/font-def.lmt:378: in 
function <...-64/tex/texmf-context/tex/context/base/mkxl/font-def.lmt:366>
(...tail calls...)
...-64/tex/texmf-context/tex/context/base/mkxl/font-def.lmt:484: in 
field 'read'
...-64/tex/texmf-context/tex/context/base/mkxl/font-ctx.lmt:1336: in 
function <...-64/tex/texmf-context/tex/context/base/mkxl/font-ctx.lmt:1193>
(...tail calls...)
 1 >>  \setupbodyfont[stixtwo]
-

Many thanks for your support.
Kind regards

Heinrich Paeßens 
Mobile +49 1512 123 9876 
Business Card 
<https://www.paessens.tel/img/heinrich-paessens_bc-2021-03-11_signed.pdf>

___
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] Documentation about CTX installation on MacOS X

2022-01-03 Thread Jean-Pierre Delange via ntg-context


> Le 3 janv. 2022 à 09:22, Henning Hraban Ramm via ntg-context 
>  a écrit :
> 
> Am 03.01.22 um 08:09 schrieb Jean-Pierre Delange via ntg-context:
>> Thank you very much for your quick answer to you both Fabrice and Henning ! 
>> It seems there is no detailed documentation about peculiar aspects of CTX on 
>> MacOS.
>> For instance, the use of fonts database on unix-like and MacOS are a bit 
>> different (but not quite a lot) and this command :
>> mtxrun --script fonts —reload
>> Works fine with this one based on fontconfig: fc-cache -v -f
> 
> I don’t remember to have used this for years. ConTeXt AFAIK doesn’t use 
> fontconfig. (LilyPond does…)
> 

fc-cache -v -f works fine on MacOS aswell as on Linux; try some command like 
this one : fc-list : file family |grep \/Library which list all fonts and their 
location 

> 
>> There is some adaptation in the transition from Linux to MacOS, because one 
>> has to play and to look for the fonts paths which are a bit different with 
>> Mac than the Unix paths …
> 
> Of course, but that is basic MacOS knowledge and not specific to ConTeXt.
You’re right !
> 
> You might want to set:
> 
> OSFONTDIR='/System/Library/Fonts//:/Library/Fonts//:~/Library/Fonts//:/Library/Application
>  Support/Adobe/Fonts//
> #:~/FontExplorer\ X/Font\ Library//'
> 
> ICCPROFILES='~/Library/ColorSync/Profiles//:/Library/ColorSync/Profiles//:/System/Library/ColorSync/Profiles//:'
> 
> PATH=~/lmtx/tex/texmf-osx-64/bin:/Library/TeX/texbin:...
> (whereever you installed ConTeXt)
 context, latex, mtxrun, mtxrun.lua are installed in 
/Users/xxx/context/tex/texmf-osx-64/bin … I’ve forgotten that CTX doesn’t exist 
no more since it replacement by Luametatex ! I still use ConTeXt MKIV ...
> 
> I also suggest to install everything personal in ~/texmf (same on Linux) and 
> not in texmf-local or texmf-project, at least if you are planning to have 
> parallel installations (which make sense if you want to keep a "stable" 
> version but also want to check out new features/bugfixes).
I thought that all personal fonts should be added in texmf-fonts ? 

By the way, it might be useful to have . setuptex command. How to deal with 
such a situation, when mtxrun command doesn’t work ? 
> 
> Hraban
 
Thanks you very much, Hraban, for these advices !
JP 
> ___
> 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] Documentation about CTX installation on MacOS X

2022-01-03 Thread Henning Hraban Ramm via ntg-context

Am 03.01.22 um 08:09 schrieb Jean-Pierre Delange via ntg-context:
Thank you very much for your quick answer to you both Fabrice and 
Henning ! It seems there is no detailed documentation about peculiar 
aspects of CTX on MacOS.


For instance, the use of fonts database on unix-like and MacOS are a bit 
different (but not quite a lot) and this command :

mtxrun --script fonts —reload

Works fine with this one based on fontconfig: fc-cache -v -f


I don’t remember to have used this for years. ConTeXt AFAIK doesn’t use 
fontconfig. (LilyPond does...)


There is some adaptation in the transition from Linux to MacOS, because 
one has to play and to look for the fonts paths which are a bit 
different with Mac than the Unix paths …


Of course, but that is basic MacOS knowledge and not specific to ConTeXt.

You might want to set:

OSFONTDIR='/System/Library/Fonts//:/Library/Fonts//:~/Library/Fonts//:/Library/Application 
Support/Adobe/Fonts//

#:~/FontExplorer\ X/Font\ Library//'

ICCPROFILES='~/Library/ColorSync/Profiles//:/Library/ColorSync/Profiles//:/System/Library/ColorSync/Profiles//:'

PATH=~/lmtx/tex/texmf-osx-64/bin:/Library/TeX/texbin:...
(whereever you installed ConTeXt)

I also suggest to install everything personal in ~/texmf (same on Linux) 
and not in texmf-local or texmf-project, at least if you are planning to 
have parallel installations (which make sense if you want to keep a 
"stable" version but also want to check out new features/bugfixes).


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] Asking context to switch to a different font for a single character in many places

2022-01-01 Thread Wolfgang Schuster via ntg-context

Ajith R via ntg-context schrieb am 01.01.2022 um 11:06:

On Sat, 01 Jan 2022 14:28:12 +0530
kauśika  wrote:


Try with the following:

\definefallbackfamily
   [malayalam]
   [serif]
   [TeX Gyre Pagella][range=controlpictures,force=yes]
\definefontfamily
   [malayalam]
   [serif]
   [RIT Rachana][features=malayalam-two]

\setupbodyfont[malayalam]


I have tested that this works on my system. Ensure that the TeX Gyre
Pagella font is available on your system (ConTeXt ships with a copy
of this font). If it still does not work check the log file for any
messages regarding fallback font.

kauśika

Hi Kaushika,

Thanks. This is working.
But, I don't understand why this is working while the other wasn't even
when it could display the open box when it was the solo font defined?


You used "Latin Modern" which isn't a valid font name, the correct name 
is "Latin Modern Roman".


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] Asking context to switch to a different font for a single character in many places

2022-01-01 Thread Ajith R via ntg-context
On Sat, 01 Jan 2022 14:28:12 +0530
kauśika  wrote:


> Try with the following:
> 
> \definefallbackfamily
>   [malayalam]
>   [serif]
>   [TeX Gyre Pagella][range=controlpictures,force=yes]
> \definefontfamily
>   [malayalam]
>   [serif]
>   [RIT Rachana][features=malayalam-two]
> 
> \setupbodyfont[malayalam]
> 
> 
> I have tested that this works on my system. Ensure that the TeX Gyre
> Pagella font is available on your system (ConTeXt ships with a copy
> of this font). If it still does not work check the log file for any
> messages regarding fallback font.
> 
> kauśika
> 
> 

Hi Kaushika,

Thanks. This is working.
But, I don't understand why this is working while the other wasn't even
when it could display the open box when it was the solo font defined?

Thanks,
ajith

___
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] Asking context to switch to a different font for a single character in many places

2022-01-01 Thread Ajith R via ntg-context
On Sat, 01 Jan 2022 14:28:12 +0530
kauśika  wrote:


> Try with the following:
> 
> \definefallbackfamily
>   [malayalam]
>   [serif]
>   [TeX Gyre Pagella][range=controlpictures,force=yes]
> \definefontfamily
>   [malayalam]
>   [serif]
>   [RIT Rachana][features=malayalam-two]
> 
> \setupbodyfont[malayalam]
> 
> 
> I have tested that this works on my system. Ensure that the TeX Gyre
> Pagella font is available on your system (ConTeXt ships with a copy
> of this font). If it still does not work check the log file for any
> messages regarding fallback font.
> 
> kauśika
> 
> 

Hi Kaushika,

Thanks. This is working.
But, I don't understand why this is working while the other wasn't even
when it could display the open box when it was the solo font defined?

Thanks,
ajith

___
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] Asking context to switch to a different font for a single character in many places

2022-01-01 Thread kauśika via ntg-context
On Saturday, January 1, 2022 1:37:49 PM IST Ajith R wrote:
> This doesn't print the open box. If I remove the definefontfamily
> command or define font family using only Latin Modern, open box is
> printed, but not the title.
> 
> What am I missing?

Try with the following:

\definefallbackfamily
  [malayalam]
  [serif]
  [TeX Gyre Pagella][range=controlpictures,force=yes]
\definefontfamily
  [malayalam]
  [serif]
  [RIT Rachana][features=malayalam-two]

\setupbodyfont[malayalam]


I have tested that this works on my system. Ensure that the TeX Gyre Pagella 
font is available on your system (ConTeXt ships with a copy of this font). If 
it still does not work check the log file for any messages regarding fallback 
font.

kauśika


___
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] Unicode superscript and subscript parentheses as operators

2021-12-28 Thread Hans Åberg via ntg-context

> On 28 Dec 2021, at 23:05, Hans Hagen  wrote:
> 
> On 12/28/2021 10:53 PM, Hans Åberg wrote:
> 
>> This is great, though there is a typo in the second line. I attach a 
>> corrected example, illustrating what I might use it for: A logic program, 
>> where I found it readable in plain text to use the Unicode superscript and 
>> subscript parentheses. But when typeset, they should be superscripts and 
>> subscripts.
> i still want to come up with domain specific math features ... sp fpr 
> instance we could have a module for logic but it's users who have to come up 
> with demands ...

I found using Unicode superscript and subscript parentheses more readable in 
general than the TeX convention in plain text. Otherwise, the program has logic 
as a basis, but is not intended to be restricted to that. FYI, the program is 
posted here, but has some dependencies to get running. The directory 'tests' 
has examples that are precompiled (checked agains with 'make check').

https://savannah.gnu.org/git/?group=metalogic-inference


___
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] Why are endnotes not working with ConTeXt-SBL?

2021-12-26 Thread Joey McCollum via ntg-context
This actually seems to be rooted in a more general problem with the
publications support module. Why does invoking the fastsetup for citations
work within the default footnote setup, but not within endnotes flushed via
\placenotes[footnote]? If I modify the original MWE to use ConTeXt's
default btx rendering, I get the same error:

```
\startbuffer [bib]

@Book{clark1989,
author = {Clark, William},
title = {Railroads \word{and} railroad towns \word{in} New Mexico},
publisher = {New Mexico Magazine},
year = {1989},
address = {Albuquerque, New Mexico},
isbn = {9780937206126}
}

\stopbuffer

\usebtxdataset[bib.buffer]

\setupbtx[dataset=default]

\setupnote[footnote][location=none] % commenting out this line will produce
footnotes that expand the citation correctly

\starttext

   \input knuth
\cite[alternative=footnote][clark1989]
\page
\placenotes[footnote]

\startchapter[title=Bibliography]
\placelistofpublications
\stopchapter

\stoptext
```

If it helps, the relevant code in publications support is the following
block in publ-imp-cite.mkvi:

```
\startsetups \s!btx:\s!cite:footnote
\startfootnote
\fastsetup{btx:cite:entry}
\stopfootnote
\stopsetups
```

The \fastsetup{btx:cite:entry} doesn't expand to anything if the footnote
is flushed as an endnote via \placenotes[footnote]. Does anyone have any
idea why this happens and how to fix it?

Joey

On Sat, Dec 25, 2021 at 3:34 PM Joey McCollum 
wrote:

> A reasonable solution for the time being would be to check if the
> righttext argument is empty, and add a final period in the footnote only if
> it is not (with the assumption being that the user would provide
> punctuation in any righttext for footnote/endnote citations). I've pushed
> the following change to the GitHub repo, if you'd like to pull and use it:
>
> ```
> % Inline footnote citation setup (with intelligent trailing punctuation
> replacement)
> \startsetups btx:sbl:cite:footnote
>   \removeunwantedspaces
>
> \doifinstring{\btxparameter{punct}}{\btxparameter{autopunctuation}}{\btxparameter{punct}}
>   \begingroup
>   \letbtxparameter{punct}\empty % don't pass the trailing punctuation down
> to the inline setup
>   \startfootnote
> \Word{\fastsetup{btx:sbl:cite:inline}}% capitalize the first word in
> the footnote (needed to render "Ibid." and "Idem" correctly)
> % Add a closing period if there is no righttext
> \doif{\btxparameter{righttext}}{\empty} {
>   \btxperiod
> }
>   \stopfootnote
>   \endgroup
>
> \doifnotinstring{\btxparameter{punct}}{\btxparameter{autopunctuation}}{\btxparameter{punct}}
> \stopsetups
> ```
>
> This should allow your script to compile, but unfortunately, it doesn't
> seem to make endnotes work, at least not when I try it. For some reason,
> the macro \Word{\fastsetup{btx:sbl:cite:inline}} is expanding to nothing
> inside the \startfootnote ... \stopfootnote environment. I have no idea why
> this is happening, so any ideas are appreciated.
>
> Joey
>
> On Sat, Dec 25, 2021 at 1:11 PM Joey McCollum 
> wrote:
>
>> Joel,
>>
>> You may not have done anything wrong; this may be an issue with
>> ConTeXt-SBL. In my code for the btx:sbl:cite:footnote setup in
>> publ-imp-sbl.mkvi, I added a comment to this effect:
>>
>> ```
>> \startsetups btx:sbl:cite:footnote
>>   \removeunwantedspaces
>>
>> \doifinstring{\btxparameter{punct}}{\btxparameter{autopunctuation}}{\btxparameter{punct}}
>>   \begingroup
>>   \letbtxparameter{punct}\empty % don't pass the trailing punctuation
>> down to the inline setup
>>   \let\doifendswithpunctelse\btx_sbl_doifendswithpunctelse % why is this
>> necessary? For some reason, \btx_sbl_doifendswithpunctelse is not
>> recognized within the footnote environment...
>>   \startfootnote
>> \Word{\fastsetup{btx:sbl:cite:inline}}% capitalize the first word in
>> the footnote (needed to render "Ibid." and "Idem" correctly)
>> % Add a closing period, unless the righttext ends with punctuation
>> \doifendswithpunctelse{\btxparameter{righttext}} {
>>   \removeunwantedspaces
>> } {
>>   \removeunwantedspaces
>>   \btxperiod
>> }
>>   \stopfootnote
>>   \endgroup
>>
>> \doifnotinstring{\btxparameter{punct}}{\btxparameter{autopunctuation}}{\btxparameter{punct}}
>> \stopsetups
>> ```
>>
>> I define the \btx_sbl_doifendswithpunctelse macro earlier in the module.
>> Initially, when I tried to invoke this macro within the \startfootnote ...
>> \stopfootnote environment (to conditionally add a period at the end of a
>> footnote citation if it does not have a righttext ending with p

Re: [NTG-context] Why are endnotes not working with ConTeXt-SBL?

2021-12-25 Thread Joey McCollum via ntg-context
A reasonable solution for the time being would be to check if the
righttext argument is empty, and add a final period in the footnote only if
it is not (with the assumption being that the user would provide
punctuation in any righttext for footnote/endnote citations). I've pushed
the following change to the GitHub repo, if you'd like to pull and use it:

```
% Inline footnote citation setup (with intelligent trailing punctuation
replacement)
\startsetups btx:sbl:cite:footnote
  \removeunwantedspaces

\doifinstring{\btxparameter{punct}}{\btxparameter{autopunctuation}}{\btxparameter{punct}}
  \begingroup
  \letbtxparameter{punct}\empty % don't pass the trailing punctuation down
to the inline setup
  \startfootnote
\Word{\fastsetup{btx:sbl:cite:inline}}% capitalize the first word in
the footnote (needed to render "Ibid." and "Idem" correctly)
% Add a closing period if there is no righttext
\doif{\btxparameter{righttext}}{\empty} {
  \btxperiod
}
  \stopfootnote
  \endgroup

\doifnotinstring{\btxparameter{punct}}{\btxparameter{autopunctuation}}{\btxparameter{punct}}
\stopsetups
```

This should allow your script to compile, but unfortunately, it doesn't
seem to make endnotes work, at least not when I try it. For some reason,
the macro \Word{\fastsetup{btx:sbl:cite:inline}} is expanding to nothing
inside the \startfootnote ... \stopfootnote environment. I have no idea why
this is happening, so any ideas are appreciated.

Joey

On Sat, Dec 25, 2021 at 1:11 PM Joey McCollum 
wrote:

> Joel,
>
> You may not have done anything wrong; this may be an issue with
> ConTeXt-SBL. In my code for the btx:sbl:cite:footnote setup in
> publ-imp-sbl.mkvi, I added a comment to this effect:
>
> ```
> \startsetups btx:sbl:cite:footnote
>   \removeunwantedspaces
>
> \doifinstring{\btxparameter{punct}}{\btxparameter{autopunctuation}}{\btxparameter{punct}}
>   \begingroup
>   \letbtxparameter{punct}\empty % don't pass the trailing punctuation down
> to the inline setup
>   \let\doifendswithpunctelse\btx_sbl_doifendswithpunctelse % why is this
> necessary? For some reason, \btx_sbl_doifendswithpunctelse is not
> recognized within the footnote environment...
>   \startfootnote
> \Word{\fastsetup{btx:sbl:cite:inline}}% capitalize the first word in
> the footnote (needed to render "Ibid." and "Idem" correctly)
> % Add a closing period, unless the righttext ends with punctuation
> \doifendswithpunctelse{\btxparameter{righttext}} {
>   \removeunwantedspaces
> } {
>   \removeunwantedspaces
>   \btxperiod
> }
>   \stopfootnote
>   \endgroup
>
> \doifnotinstring{\btxparameter{punct}}{\btxparameter{autopunctuation}}{\btxparameter{punct}}
> \stopsetups
> ```
>
> I define the \btx_sbl_doifendswithpunctelse macro earlier in the module.
> Initially, when I tried to invoke this macro within the \startfootnote ...
> \stopfootnote environment (to conditionally add a period at the end of a
> footnote citation if it does not have a righttext ending with punctuation),
> I got the same error you got, but for \btx_sbl_doifendswithpunctelse. I
> wasn't sure why this was happening, so I tried defining a new
> \doifendswithpunctelse macro. Unfortunately, based on your e-mail, it looks
> like this doesn't actually fix the problem.
>
> Any help from other developers would be appreciated here! Unfortunately, I
> don't have a MWE replicating the problem on hand at the moment.
>
> Joey
>
> On Sat, Dec 25, 2021 at 1:04 PM Joel via ntg-context 
> wrote:
>
>> I am using the ConTeXt-SBL package for citations. I need to move my
>> footnotes to the end of each article.
>>
>> According to the manual, I can suppress the placement of footnotes using
>> two lines of code. I've added these to my minimal working code, placing 
>> \setupnote[footnote][location=none]
>> in the header and \placenotes[footnote] where I want the endnotes to
>> appear. It complains this error:
>>
>> "Undefined control sequence \doifendswithpunctelse"
>>
>> What did I do wrong?
>>
>> --Joel
>>
>> Code follows:
>>
>> \usemodule[publ-imp-sbl]
>> \startbuffer [bib]
>>
>> @Article{na2006,
>> title={Volcanoes \word{of} New Mexico},
>> year={2006},
>> journal={New Mexico Earth Matters},
>> publisher={New Mexico Bureau \word{of} Geology \word{and} Mineral
>> Resources},
>> volume={6},
>> number={1},
>> location={Socorro, New Mexico}
>> }
>>
>> @Book{clark1989,
>> author = {Clark, William},
>> title = {Railroads \word{and} railroad towns \word{in} New Mexico},
>> publisher = {New Mexico Magazine},
>> year = {1989},
>> address = {

Re: [NTG-context] Why are back-to-back \autocite commands not working in ConTeXt-SBL?

2021-12-24 Thread Joey McCollum via ntg-context
That may work with something like

```
\cite[loctext={{2},{2}}][{na2006,clark1989}]
```

or

```
\autocite[{{\loc[2]},{\loc[2]}}]{{na2006,clark1989}}
```

(I know that the ConTeXt \cite command supports multicites with
comma-separated entries, but I forget exactly what the expected syntax
looks like.)

Joey

On Fri, Dec 24, 2021 at 10:14 AM Denis Maier via ntg-context <
ntg-context@ntg.nl> wrote:

> biblatex has special multicite commands=> e.g. autocites. could that be
> used in that case?
>
> Denis
>
> Joey McCollum via ntg-context  hat am 24.12.2021
> 15:43 geschrieben:
>
>
> Joel,
>
> Thanks for mentioning this! I think I've run into the same issue before,
> but I wasn't sure how I should go about fixing it, so this might be a good
> place to get suggestions from others.
>
> The \autocite, \inlinecite, \parencite, and \footcite helper commands are
> intended to handle trailing punctuation intelligently (in order to do
> things like move punctuation after a footnote citation before the footnote
> marker), so they treat the next character after the command as a "hidden"
> parameter. This works as expected if the next character is a punctuation
> character or something like a \blank command, but if it's something like a
> \section command (or another \autocite command, as you've discovered), then
> this causes problems.
>
> That said, I think you should be able to get your ConTeXt to compile if
> you follow your \autocite command with punctuation or some form of
> whitespace (which is why a double newline works, as you've discovered,
> while a single newline does not).
>
> I'd like to keep the intelligent trailing punctuation adjustment feature
> if possible, but this problem definitely needs to be fixed. If anyone has
> any suggestions, I welcome them! My hope is that this can be resolved with
> a simple check.
>
> Joey
>
> On Fri, Dec 24, 2021 at 9:37 AM Joel via ntg-context 
> wrote:
>
> I am using the ConTeXt-SBL module to handle the citations in my article.
> Using the plain \cite[na2006] command has worked fine.
>
> But there are some situations where I want the footnote to include page
> number details. I tried using \cite[extra=2][na2006], but that doesn't seem
> compatible with ConTeXt-SBL. I checked the documentation, and if I
> understand correctly, I should use the autocite command to add page numbers
> to my citation? Like this:
>
> \autocite[{\loc[2]}][]{na2006}
>
> This solution works in 95% of cases, but when I need to cite another book
> immediately after that, it throws up errors:
>
>
> This won't compile:
>
> \autocite[{\loc[2]}][]{na2006}
> \autocite[{\loc[2]}][]{clark1989}
>
> This won't compile:
>
> \autocite[{\loc[2]}][]{na2006}%
> %
>\autocite[{\loc[2]}][]{clark1989}
>
> This also won't compile:
>
> \autocite[{\loc[2]}][]{na2006}\autocite[{\loc[2]}][]{clark1989}
>
> After much trial and error, I found this will compile:
>
> \autocite[{\loc[2]}][]{na2006}
>
> \autocite[{\loc[2]}][]{clark1989}
>
> The problem with this last example, is if my citations appear within the
> paragraph, then I end up with a paragraph break in the wrong place!
>
> Here is my minimum working example, which won't compile unless I add a
> blank line between the two citations.
>
> \usemodule[publ-imp-sbl]
> \startbuffer [bib]
>
> @Article{na2006,
> title={Volcanoes \word{of} New Mexico},
> year={2006},
> journal={New Mexico Earth Matters},
> publisher={New Mexico Bureau \word{of} Geology \word{and} Mineral
> Resources},
> volume={6},
> number={1},
> location={Socorro, New Mexico}
> }
>
> @Book{clark1989,
> author = {Clark, William},
> title = {Railroads \word{and} railroad towns \word{in} New Mexico},
> publisher = {New Mexico Magazine},
> year = {1989},
> address = {Albuquerque, New Mexico},
> isbn = {9780937206126}
> }
>
> \stopbuffer
>
> \usebtxdataset[bib.buffer]
>
> \setupbtx[dataset=default]
> \usebtxdefinitions[sbl]
> \setupbtx[sbl]
>
> \starttext
>
> \autocite[{\loc[2]}][]{na2006}
> \autocite[{\loc[3]}][]{clark1989}
>
>
> \startchapter[title=Bibliography]
> \placelistofpublications
> \stopchapter
>
> \stoptext
>
> Is the autocite command the wrong tool for what I need? How can I place
> citations right next to each other, but also include page number
> information with ConTeXt-SBL?
>
> --Joel
>
> ___
>
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.nt

Re: [NTG-context] Why are back-to-back \autocite commands not working in ConTeXt-SBL?

2021-12-24 Thread Denis Maier via ntg-context


 
 
  
   biblatex has special multicite commands=> e.g. autocites. could that be used in that case?
   
  
  
   
  
  
   Denis
   
  
  
   
Joey McCollum via ntg-context  hat am 24.12.2021 15:43 geschrieben:
   
   

   
   

   
   
Joel,

 


 Thanks for mentioning this! I think I've run into the same issue before, but I wasn't sure how I should go about fixing it, so this might be a good place to get suggestions from others.
 
 The \autocite, \inlinecite, \parencite, and \footcite helper commands are intended to handle trailing punctuation intelligently (in order to do things like move punctuation after a footnote citation before the footnote marker), so they treat the next character after the command as a "hidden" parameter. This works as expected if the next character is a punctuation character or something like a \blank command, but if it's something like a \section command (or another \autocite command, as you've discovered), then this causes problems.
 
 That said, I think you should be able to get your ConTeXt to compile if you follow your \autocite command with punctuation or some form of whitespace (which is why a double newline works, as you've discovered, while a single newline does not).


 


 I'd like to keep the intelligent trailing punctuation adjustment feature if possible, but this problem definitely needs to be fixed. If anyone has any suggestions, I welcome them! My hope is that this can be resolved with a simple check.


 


 Joey

   
   
   

 On Fri, Dec 24, 2021 at 9:37 AM Joel via ntg-context <ntg-context@ntg.nl> wrote:
 


 
  
   
I am using the ConTeXt-SBL module to handle the citations in my article. Using the plain \cite[na2006] command has worked fine.
   
   

   
   
But there are some situations where I want the footnote to include page number details. I tried using \cite[extra=2][na2006], but that doesn't seem compatible with ConTeXt-SBL. I checked the documentation, and if I understand correctly, I should use the autocite command to add page numbers to my citation? Like this:

   
   

   
   
    \autocite[{\loc[2]}][]{na2006}
   
   

   
   
This solution works in 95% of cases, but when I need to cite another book immediately after that, it throws up errors:
   
   

   
   

   
   

 This won't compile:


 


     \autocite[{\loc[2]}][]{na2006}
 
  
       \autocite[{\loc[2]}][]{clark1989}
  
 
 
     
  
   
This won't compile:
   
   

   
   

     \autocite[{\loc[2]}][]{na2006}%


 %
 


 
     \autocite[{\loc[2]}][]{clark1989}
 

   
  
 
 
  
 
 
  This also won't compile:
  
   

   
   

 
  
       \autocite[{\loc[2]}][]{na2006}\autocite[{\loc[2]}][]{clark1989}
  
 


 
  
 

   
  
 
 
  After much trial and error, I found this will compile:
  
 
 
  
   

   
   

     \autocite[{\loc[2]}][]{na2006}


 


 
  
       \autocite[{\loc[2]}][]{clark1989}
  
  
   
  
 
 
  The problem with this last example, is if my citations appear within the paragraph, then I end up with a paragraph break in the wrong place!
  
 
 
  
 


 Here is my minimum working example, which won't compile unless I add a blank line between the two citations.
 

   
  
  
   
  
  
   \usemodule[publ-imp-sbl]
   \startbuffer [bib]
   
   @Article{na2006,
   title={Volcanoes \word{of} New Mexico},
   year={2006},
   journal={New Mexico Earth Matters},
   publisher={New Mexico Bureau \word{of} Geology \word{and} Mineral Resources},
   volume={6},
   number={1},
   location={Socorro, New Mexico}
   }
   
   

Re: [NTG-context] Why are back-to-back \autocite commands not working in ConTeXt-SBL?

2021-12-24 Thread Joey McCollum via ntg-context
Additionally, if you want to cite page numbers, the key to use in
ConTeXt-SBL is "loctext". (I was not aware of an "extra" key when I was
developing the module.) So, you should be able to make the ConTeXt-style
\cite command work as follows:

```
\cite[loctext=2][na2006]
```

I hope this helps, too!

Joey

On Fri, Dec 24, 2021 at 9:43 AM Joey McCollum 
wrote:

> Joel,
>
> Thanks for mentioning this! I think I've run into the same issue before,
> but I wasn't sure how I should go about fixing it, so this might be a good
> place to get suggestions from others.
>
> The \autocite, \inlinecite, \parencite, and \footcite helper commands are
> intended to handle trailing punctuation intelligently (in order to do
> things like move punctuation after a footnote citation before the footnote
> marker), so they treat the next character after the command as a "hidden"
> parameter. This works as expected if the next character is a punctuation
> character or something like a \blank command, but if it's something like a
> \section command (or another \autocite command, as you've discovered), then
> this causes problems.
>
> That said, I think you should be able to get your ConTeXt to compile if
> you follow your \autocite command with punctuation or some form of
> whitespace (which is why a double newline works, as you've discovered,
> while a single newline does not).
>
> I'd like to keep the intelligent trailing punctuation adjustment feature
> if possible, but this problem definitely needs to be fixed. If anyone has
> any suggestions, I welcome them! My hope is that this can be resolved with
> a simple check.
>
> Joey
>
> On Fri, Dec 24, 2021 at 9:37 AM Joel via ntg-context 
> wrote:
>
>> I am using the ConTeXt-SBL module to handle the citations in my article.
>> Using the plain \cite[na2006] command has worked fine.
>>
>> But there are some situations where I want the footnote to include page
>> number details. I tried using \cite[extra=2][na2006], but that doesn't seem
>> compatible with ConTeXt-SBL. I checked the documentation, and if I
>> understand correctly, I should use the autocite command to add page numbers
>> to my citation? Like this:
>>
>> \autocite[{\loc[2]}][]{na2006}
>>
>> This solution works in 95% of cases, but when I need to cite another book
>> immediately after that, it throws up errors:
>>
>>
>> This won't compile:
>>
>> \autocite[{\loc[2]}][]{na2006}
>> \autocite[{\loc[2]}][]{clark1989}
>>
>> This won't compile:
>>
>> \autocite[{\loc[2]}][]{na2006}%
>> %
>>\autocite[{\loc[2]}][]{clark1989}
>>
>> This also won't compile:
>>
>> \autocite[{\loc[2]}][]{na2006}\autocite[{\loc[2]}][]{clark1989}
>>
>> After much trial and error, I found this will compile:
>>
>> \autocite[{\loc[2]}][]{na2006}
>>
>> \autocite[{\loc[2]}][]{clark1989}
>>
>> The problem with this last example, is if my citations appear within the
>> paragraph, then I end up with a paragraph break in the wrong place!
>>
>> Here is my minimum working example, which won't compile unless I add a
>> blank line between the two citations.
>>
>> \usemodule[publ-imp-sbl]
>> \startbuffer [bib]
>>
>> @Article{na2006,
>> title={Volcanoes \word{of} New Mexico},
>> year={2006},
>> journal={New Mexico Earth Matters},
>> publisher={New Mexico Bureau \word{of} Geology \word{and} Mineral
>> Resources},
>> volume={6},
>> number={1},
>> location={Socorro, New Mexico}
>> }
>>
>> @Book{clark1989,
>> author = {Clark, William},
>> title = {Railroads \word{and} railroad towns \word{in} New Mexico},
>> publisher = {New Mexico Magazine},
>> year = {1989},
>> address = {Albuquerque, New Mexico},
>> isbn = {9780937206126}
>> }
>>
>> \stopbuffer
>>
>> \usebtxdataset[bib.buffer]
>>
>> \setupbtx[dataset=default]
>> \usebtxdefinitions[sbl]
>> \setupbtx[sbl]
>>
>> \starttext
>>
>> \autocite[{\loc[2]}][]{na2006}
>> \autocite[{\loc[3]}][]{clark1989}
>>
>>
>> \startchapter[title=Bibliography]
>> \placelistofpublications
>> \stopchapter
>>
>> \stoptext
>>
>> Is the autocite command the wrong tool for what I need? How can I place
>> citations right next to each other, but also include page number
>> information with ConTeXt-SBL?
>>
>> --Joel
>>
>>
>> ___
>> If your ques

Re: [NTG-context] Why are back-to-back \autocite commands not working in ConTeXt-SBL?

2021-12-24 Thread Joey McCollum via ntg-context
Joel,

Thanks for mentioning this! I think I've run into the same issue before,
but I wasn't sure how I should go about fixing it, so this might be a good
place to get suggestions from others.

The \autocite, \inlinecite, \parencite, and \footcite helper commands are
intended to handle trailing punctuation intelligently (in order to do
things like move punctuation after a footnote citation before the footnote
marker), so they treat the next character after the command as a "hidden"
parameter. This works as expected if the next character is a punctuation
character or something like a \blank command, but if it's something like a
\section command (or another \autocite command, as you've discovered), then
this causes problems.

That said, I think you should be able to get your ConTeXt to compile if you
follow your \autocite command with punctuation or some form of whitespace
(which is why a double newline works, as you've discovered, while a single
newline does not).

I'd like to keep the intelligent trailing punctuation adjustment feature if
possible, but this problem definitely needs to be fixed. If anyone has any
suggestions, I welcome them! My hope is that this can be resolved with a
simple check.

Joey

On Fri, Dec 24, 2021 at 9:37 AM Joel via ntg-context 
wrote:

> I am using the ConTeXt-SBL module to handle the citations in my article.
> Using the plain \cite[na2006] command has worked fine.
>
> But there are some situations where I want the footnote to include page
> number details. I tried using \cite[extra=2][na2006], but that doesn't seem
> compatible with ConTeXt-SBL. I checked the documentation, and if I
> understand correctly, I should use the autocite command to add page numbers
> to my citation? Like this:
>
> \autocite[{\loc[2]}][]{na2006}
>
> This solution works in 95% of cases, but when I need to cite another book
> immediately after that, it throws up errors:
>
>
> This won't compile:
>
> \autocite[{\loc[2]}][]{na2006}
> \autocite[{\loc[2]}][]{clark1989}
>
> This won't compile:
>
> \autocite[{\loc[2]}][]{na2006}%
> %
>\autocite[{\loc[2]}][]{clark1989}
>
> This also won't compile:
>
> \autocite[{\loc[2]}][]{na2006}\autocite[{\loc[2]}][]{clark1989}
>
> After much trial and error, I found this will compile:
>
> \autocite[{\loc[2]}][]{na2006}
>
> \autocite[{\loc[2]}][]{clark1989}
>
> The problem with this last example, is if my citations appear within the
> paragraph, then I end up with a paragraph break in the wrong place!
>
> Here is my minimum working example, which won't compile unless I add a
> blank line between the two citations.
>
> \usemodule[publ-imp-sbl]
> \startbuffer [bib]
>
> @Article{na2006,
> title={Volcanoes \word{of} New Mexico},
> year={2006},
> journal={New Mexico Earth Matters},
> publisher={New Mexico Bureau \word{of} Geology \word{and} Mineral
> Resources},
> volume={6},
> number={1},
> location={Socorro, New Mexico}
> }
>
> @Book{clark1989,
> author = {Clark, William},
> title = {Railroads \word{and} railroad towns \word{in} New Mexico},
> publisher = {New Mexico Magazine},
> year = {1989},
> address = {Albuquerque, New Mexico},
> isbn = {9780937206126}
> }
>
> \stopbuffer
>
> \usebtxdataset[bib.buffer]
>
> \setupbtx[dataset=default]
> \usebtxdefinitions[sbl]
> \setupbtx[sbl]
>
> \starttext
>
> \autocite[{\loc[2]}][]{na2006}
> \autocite[{\loc[3]}][]{clark1989}
>
>
> \startchapter[title=Bibliography]
> \placelistofpublications
> \stopchapter
>
> \stoptext
>
> Is the autocite command the wrong tool for what I need? How can I place
> citations right next to each other, but also include page number
> information with ConTeXt-SBL?
>
> --Joel
>
>
> ___
> 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] Errors in source files return success

2021-12-15 Thread Hans Hagen via ntg-context

On 12/15/2021 9:16 PM, Marco Patzer via ntg-context wrote:

On Wed, 15 Dec 2021 20:48:29 +0100
Hans Hagen  wrote:


You can check in the next upload:

- The 'failure' that you saw was actually a real lua error because I
hadn't adapted some fancy, a very old 'around' 2006 feature, seldom
used as it's more 'an example of possibilities' code to luametatex
yet ... fwiw, we still share some lua files between engines.


Thanks for looking into that. I'll check the next upload.


- Afaiks you should now get return code 1 for other cases (say you
give \foo without meaning). It's a it tricky as this info has to pass
through several subsystems.


Hard TeX errors (like \undefined) already return 1.


- The runaway error is actually kind of special (there are a few
more) where the engine simply quits in confusion and doesn't exit
hard as error (often because tex could somehow recover). If needed I
can actually do a real error but it's not entirely compatible then
(not that i care that much about compatibility in these shady areas.)


I'd vote to handle those as hard errors because

   1) Luametatex isn't focused on compatibility.


ok, but let's first test this ... it's mostly cosmetics (read: come up 
wiht a better error message than the default sometimes unclear tex one)



   2) The user explicitly requested error reporting (by providing --errors).



   3) No one is recovering tex runs these days.
indeed, makes no sense (it all dates from (paper) terminals and 
night-time runs .. the good old 300 baud transfer days)


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] Errors in source files return success

2021-12-15 Thread Marco Patzer via ntg-context
On Wed, 15 Dec 2021 20:48:29 +0100
Hans Hagen  wrote:

> You can check in the next upload:
> 
> - The 'failure' that you saw was actually a real lua error because I 
> hadn't adapted some fancy, a very old 'around' 2006 feature, seldom
> used as it's more 'an example of possibilities' code to luametatex
> yet ... fwiw, we still share some lua files between engines.

Thanks for looking into that. I'll check the next upload.

> - Afaiks you should now get return code 1 for other cases (say you
> give \foo without meaning). It's a it tricky as this info has to pass
> through several subsystems.

Hard TeX errors (like \undefined) already return 1.

> - The runaway error is actually kind of special (there are a few
> more) where the engine simply quits in confusion and doesn't exit
> hard as error (often because tex could somehow recover). If needed I
> can actually do a real error but it's not entirely compatible then
> (not that i care that much about compatibility in these shady areas.)

I'd vote to handle those as hard errors because

  1) Luametatex isn't focused on compatibility.
  2) The user explicitly requested error reporting (by providing --errors).
  3) No one is recovering tex runs these days.

Marco
___
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] Errors in source files return success

2021-12-15 Thread Hans Hagen via ntg-context

On 12/15/2021 4:21 PM, Marco Patzer wrote:

Hi Hans,

a followup to our conversation in the meeting: here's an MWE
demonstrating that errors aren't passed on to the runner script,
except for "logs.errors=missing characters", which in fact do return
failure, all others do return success.

%% enables logging of errors same as --errors
\enabledirectives
   [logs.errors]

\starttext

%% ### semi simple group … entered at line
\startalignment [middle]
   foo

\stoptext

You can check in the next upload:

- The 'failure' that you saw was actually a real lua error because I 
hadn't adapted some fancy, a very old 'around' 2006 feature, seldom used 
as it's more 'an example of possibilities' code to luametatex yet ... 
fwiw, we still share some lua files between engines.


- Afaiks you should now get return code 1 for other cases (say you give 
\foo without meaning). It's a it tricky as this info has to pass through 
several subsystems.


- The runaway error is actually kind of special (there are a few more) 
where the engine simply quits in confusion and doesn't exit hard as 
error (often because tex could somehow recover). If needed I can 
actually do a real error but it's not entirely compatible then (not that 
i care that much about compatibility in these shady areas.)


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] how to setup path of ConTeXtLMTX for MacVim?

2021-12-14 Thread Jan-Erik Hägglöf via ntg-context
Check if your *.tex file is recognized as a context file and not a plaintex 
file. 

I’ve struggelled a lot with macvim before I got what I want.

I recommend following places learning everything in vim and many nice plugins 
that helps a lot.

If you want I can provide my .vimrc as an inspiration and starting point. Se 
below.

https://wiki.contextgarden.net/Vim <https://wiki.contextgarden.net/Vim>

https://vim.fandom.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_1) 
<https://vim.fandom.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_1)>

https://devhints.io/vim <https://devhints.io/vim> a cheatsheet


In the MacVim application it took some time to figure out why my *.tex files 
never recognizes as context files and the hardcoded solution was to comment out 
the following in

/Applications/MacVim.app/Contents/Resources/vim/runtime/filetype.vim

" TeX
"au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl  setf tex
"au BufNewFile,BufRead *.texcall dist#ft#FTtex()

and instead adding

" ConTeXt
au BufNewFile,BufRead *.tex,*.ctx,*.mkii,*.mkiv,*.mkvi,*.mkxl,*.mklx   setf 
context

It works for Me who only using context as a typesetting engine.

Normally you do not need to do this but it seems that my own filetype.vim on 
upstart never reads.

Here is my .vimrc if you find it useful, enjoy. 

set lines=68
set columns=140
set guifont=Monaco:h16

" Install vim-plug
if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  "autocmd VimEnter * PlugInstall
  "autocmd VimEnter * PlugInstall | source $MYVIMRC
endif

call plug#begin()
" Better Syntax Support
Plug 'sheerun/vim-polyglot'
" File Explorer
Plug 'scrooloose/NERDTree'
" Auto pairs for '(' '[' '{'"call plug#begin('~/.config/nvim/autoload/plugged')
Plug 'jiangmiao/auto-pairs'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug '907th/vim-auto-save'
call plug#end()

" Settings for Ultisnips
let g:UltiSnipsExpandTrigger=""
let g:UltiSnipsJumpForwardTrigger=""
let g:UltiSnipsJumpBackwardTrigger=""

" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"

" set leader key
let g:mapleader = "\"
" enable AutoSave on Vim startup
let g:auto_save = 1
set number  " Line numbers
set cmdheight=2 " More space for displaying messages
set cursorline  " Enable highlighting of the current 
line

set clipboard=unnamed

syntax enable   " Enables syntax highlighing

let g:AutoPairsShortcutFastWrap = ""


" Better nav for omnicomplete
" inoremap   ("\")
" inoremap   ("\")

" Use alt + hjkl to resize windows
nnoremap :resize -2
nnoremap :resize +2
nnoremap :vertical resize -2
nnoremap :vertical resize +2

" I hate escape more than anything else
inoremap jk 
inoremap kj 

" Easy CAPS
inoremap  viwUi
nnoremap  viwU

" TAB in general mode will move to text buffer
nnoremap  :bnext

" SHIFT-TAB will go back
nnoremap  :bprevious

" Alternate way to save
nnoremap  :w

" Alternate way to quit
nnoremap  :wq!

" Use control-c instead of escape
nnoremap  


" Better window navigation
nnoremap  h
nnoremap  j
nnoremap  k
nnoremap  l

nnoremap o o^Da
nnoremap O O^Da

nnoremap  :NERDTreeToggle $HOME

Regards

Jan-Erik


> 14 dec. 2021 kl. 15:37 skrev Jeong Dal via ntg-context :
> 
> Dear Nicola, Jan-Erik, and John,
> 
> Although you have explained about the way out of my problem, 
> I am still in the problem.
> 
> I need to learn more about vim.
> I’ll do more try following your advice and  the explanation in wiki.
> 
> Thank you again for your help.
> 
> Best regards,
> 
> Dalyoung
> 
>> 2021. 12. 14. 오전 8:56, ntg-context-requ...@ntg.nl 작성:
>> 
>> Send ntg-context mailing list submissions to
>>  ntg-context@ntg.nl
>> 
>> To subscribe or unsubscribe via the World Wide Web, visit
>>  https://mailman.ntg.nl/mailman/listinfo/ntg-context
>> or, via email, send a message with subject or body 'help' to
>>  ntg-context-requ...@ntg.nl
>> 
>> You can reach the person managing the list at
>>  ntg-context-ow...@ntg.nl
>> 
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of ntg-context digest..."
>> 
>> 
>> Today's Topics:
>> 
>>  1. Re: how to setup path of ConTeXtLMTX for MacVim?
>> (Jan-Erik Hägglöf)
>>  2. Re: circuitikz module seems broken (Hans H

Re: [NTG-context] how to setup path of ConTeXtLMTX for MacVim?

2021-12-14 Thread Jeong Dal via ntg-context
Dear Nicola, Jan-Erik, and John,

Although you have explained about the way out of my problem, 
I am still in the problem.

I need to learn more about vim.
I’ll do more try following your advice and  the explanation in wiki.

Thank you again for your help.

Best regards,

Dalyoung

> 2021. 12. 14. 오전 8:56, ntg-context-requ...@ntg.nl 작성:
> 
> Send ntg-context mailing list submissions to
>   ntg-context@ntg.nl
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   https://mailman.ntg.nl/mailman/listinfo/ntg-context
> or, via email, send a message with subject or body 'help' to
>   ntg-context-requ...@ntg.nl
> 
> You can reach the person managing the list at
>   ntg-context-ow...@ntg.nl
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ntg-context digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: how to setup path of ConTeXtLMTX for MacVim?
>  (Jan-Erik Hägglöf)
>   2. Re: circuitikz module seems broken (Hans Hagen)
>   3. Re: TeXWorks and synctex SOLVED (Bruce Horrocks)
> 
> 
> --
> 
> Message: 1
> Date: Tue, 14 Dec 2021 00:48:25 +0100
> From: Jan-Erik Hägglöf 
> To: mailing list for ConTeXt users 
> Subject: Re: [NTG-context] how to setup path of ConTeXtLMTX for
>   MacVim?
> Message-ID: <32566c08-2359-48df-b24c-2aa2e3d02...@gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> let g:context_mtxrun = 
> 'PATH=$HOME/context/context-osx-64/tex/texmf-osx-64/bin:$PATH mtxrun'
> 
> nnoremap å :ConTeXt
> nnoremap  ö :call tex#preview()
> nnoremap  ä
>\ :call tex#goto_texshop(expand("%:p"), line('.'), col('.'), 1, 1)
> 
> Here is my snippet from my personal context.vim file
> 
> I see that you have :! and that means that you instruct vim to execute a 
> shell command.
> 
> Just write :ConTeXt and it should work fine
> 
>> 13 dec. 2021 kl. 14:30 skrev Jeong Dal via ntg-context :
>> 
>> Dear John, Nicola,
>> 
>> I created a file context.vim under the folder ~/.vim/after/ftplugin/ which 
>> contains
>> 
>> map > :w:!ConTeXt
>> let g:context_mtxrun = 'PATH=$HOME/ConTeXtLM/tex/texmf-osx-64/bin:$PATH 
>> mtxrun'
>> let g:tex_flavor = "context"
>> 
>> The result is
>> 1. using “:ConTeXt”   issued an error message:  “E492: not an editor 
>> command: ConTeXt
>> 2. using “make” issued an error message: "No targets specified and no 
>> makefile found. …" 
>> Pressing C-h, compiling started and succesfully ended. However, it use 
>> /usr/local/texlive/… not LMTX tex folder.
>> 
>> Without context.vim, “:ConTeXt" and “:make" worked fine.
>> 
>> I’ll do more test. 
>> 
>> Thank you.
>> Best regards,
>> 
>> Dalyoung
>> 
>> ___
>> 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
>> ___
> 
> -- next part --
> An HTML attachment was scrubbed...
> URL: 
> <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20211214/d4e3531d/attachment-0001.htm>
> 
> --
> 
> Message: 2
> Date: Tue, 14 Dec 2021 00:54:44 +0100
> From: Hans Hagen 
> To: mailing list for ConTeXt users , Aditya
>   Mahajan 
> Subject: Re: [NTG-context] circuitikz module seems broken
> Message-ID: <41f06234-caab-6576-aa5e-8396c8ee3...@xs4all.nl>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
> 
> Hi,
> 
> This works here:
> 
> \usemodule[circuitikz]
> 
> \starttext
> \startcircuitikz
> \draw (0,2) to[I] (2,2);
> \stopcircuitikz
> \startcircuitikz
> \draw (0,2) to[I] (2,2);
> \stopcircuitikz
> \stoptext
> 
> with the attached. Make sure to put it in the regular context base path 
> and run mtxrun --generate.
> 
> Aditya: can you check if we load enough? We really need to get rid of 
> all these (kind of strange) t-* modules that somehow ended up in tikz 
> and it's way easier and robust to occasionally add something needed to 
> m-tikz than to try to catch hard-to-l

Re: [NTG-context] Regular online meet-up

2021-12-14 Thread Henning Hraban Ramm via ntg-context

We’re online NOW! You can still join us. ;)

Hraban

Am 07.12.21 um 15:29 schrieb Henning Hraban Ramm via ntg-context:

You’re invited to join next Tuesday, December 14th, 15:00 CET (UTC+1)

at https://lecture.senfcall.de/hen-rbr-rku-oke

ConTeXt users of all levels are welcome!

Hans offered to give a Q session again – please announce subjects 
you’d like to discuss ASAP, so that he can prepare.



I’d suggest to have a look at the recent changes to learn how they might 
affect us: math font settings, bars, some outdated modules, low-level 
stuff...



[Howto]
* No special software installation required; most modern browsers should 
work (WebRTC required).

* Open the above URL, accept the privacy statement,
* enter your name,
* click "join" (or "start" if you’re the first),
* click "with microphone", allow your browser to access it, check the 
audio.
(Some strings might be different, I see the German interface, you should 
get the main language of your browser.)
* Your microphone is muted if you join. Activate microphone and/or 
camera with the buttons at the bottom.

* Minimize the default presentation with the "screen" button, bottom right.

* If you’d like to share your screen or upload a file, you can make 
yourself the presenter: Click on your user name, change the setting, 
then you’ll see the "screen sharing" button beside the camera button; 
also there’s now "manage presentations" behind the "plus" button. Beware 
there is only one presenter, so don’t kill someone else’s presentation.


[Technical hints]
* Sound is usually better if you use a headset (less noise for everyone).

* Connection problems are mostly due to low bandwidth or high latency on 
your side, e.g. with mobile connections.

* If audio/video doesn’t work for you, you can still use the text chat.
* Screen sharing needs a lot of bandwidth.

* You can also join with a regular telephone (audio only, of course), 
call +49-6151-86275-22 (German landline); then you must enter a PIN that 
changes every time – if you need it, ask me for it via email. 
Mute/unmute your microphone with "0".


[Netiquette]
* Please use a name that we recognize from here. Some feel uncomfortable 
with anonymous lurkers.

* Mute your microphone while you’re not talking.
* It’s nice to show your face at least when you join.
* If there are connection problems, stop camera sharing.
* The room is set to “everyone’s a moderator“, I trust you...

Next time will be January 11th.

See you, 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] circuitikz module seems broken

2021-12-14 Thread Jan-Erik Hägglöf via ntg-context
HI ALL!

Finally it worked after complete reinstall

Tikz circuitikz pgfplots from ctan, updated LMTX to latest 2021.12.10

And replaced m-tikz.mkxl and m-circuitikz.mkxl with the attached files from 
Hans.

test2.log
Description: Binary data


Fingers crossed and praying and impressive help from Hans and Aditya

Many thanks

Sincerely

Jan-Erik

> 14 dec. 2021 kl. 04:57 skrev Aditya Mahajan via ntg-context 
> :
> 
> I tested with my course assignments (simple tikz block diagrams, lots of 
> pgdplots code) and everything works correctly. I haven't tested circuitikz; 
> the simple example fails and I am trying to understand why that is happening.
> 
>> Aditya: can you check if we load enough? 
> 
> I believe so. This is what my notes say (it is no fun to trace down these 
> files):
> 
> % Order in which files are loaded
> % 1. t-tikz
> % 1.1 t-pgf
> % 1.1.1 t-pgfcor
> % 1.1.1.1 t-pgfsys
> % 1.1.1.1.1 t-pgfrcs
> % 1.1.1.1.1.1 t-pgfmod  % Ignore
> % 1.1.1.1.1.2 pgfutil-common.tex(1)
> % 1.1.1.1.1.3 pgfutil-context.def   (2)
> % 1.1.1.1.1.4 pgfrcs.code.tex   (3)
> % 1.1.1.1.2 pgfsys.code.tex (4)
> % 1.1.1.1.3 pgfsyssoftpath.code.tex (5)
> % 1.1.1.1.4 pgfsysprotocol.code.tex (6)
> % 1.1.1.2 pgfcore.code.tex  (7)
> % 1.1.2 \usepgfmodule[shapes,plot]  (8)
> % 1.2 t-pgffor
> % 1.2.1 t-pgfrcs (already loaded)
> % 1.2.2 t-pgfkey
> % 1.2.2.1 pgfkeys.code.tex  (9)
> % 1.2.3 pgffor.code.tex(10)
> % 1.3 tikz.code.tex(11)
> 
> You also have pgfmoduleplot.code.tex, which I had missed.
> 
>> We really need to get rid of all
>> these (kind of strange) t-* modules that somehow ended up in tikz and it's 
>> way
>> easier and robust to occasionally add something needed to m-tikz than to try
>> to catch hard-to-locate-and-fix stuff in the tikz distribution. If needed we
>> can apply runtime patches too.
> 
> Agreed. I believe that the pgf module provides so many modules as a means to 
> be modular. For example, it possible to use `pgffor` module to get the for 
> loop syntax; or load `pgfkey` to get the key-value arguments, etc. But each 
> of these t-* files has so much boilerplate code, so I like your method 
> better. 
> 
>> (nyw, it looks like tikz creates empty pfg files during a run but that's
>> probbably has a reason)
> 
> tikz's ChangeLog has the following entries:
> 
> 2007-01-18:
>- Fixed .aux problems in plain and ConTeXt mode. Using .pgf as
>  extension now.
> 
> Grepping the source for `.pgf` gives:
> 
> tex/generic/pgf/utilities/pgfutil-context.def:  
> \pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{}
> tex/generic/pgf/utilities/pgfutil-context.def:  \immediate\csname 
> openout\endcsname\pgfutil@auxout\jobname.pgf\relax
> tex/generic/pgf/utilities/pgfutil-plain.def:  
> \pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{}
> tex/generic/pgf/utilities/pgfutil-plain.def:  \immediate\csname 
> openout\endcsname\pgfutil@auxout\jobname.pgf
> 
> The file handle \pgfutil@auxout is used in the macro \pgfutil@writetoaux 
> which gets used in the driver files to write absolute positioning stuff to 
> file. For example, pgfsys-luatex.def has:
> 
> \def\pgfsys@markposition#1{%
>  \savepos%
>  \edef\pgf@temp{#1}%
>  \expandafter\pgfutil@writetoaux\expandafter{%
>
> \expandafter\noexpand\expandafter\pgfsyspdfmark\expandafter{\pgf@temp}{\the\lastxpos}{\the\lastypos}}%
> }
> 
> This can easily be stored in the tuc file using two-pass data, but I don't 
> use this feature of tikz, so don't have examples to test this. 
> 
> @HenriMenke: Do you know if it is save to not create the `.pgf` file and 
> rewrite the above macro to read store the \pgfsyspdfmark table in the `.tuc` 
> file?
> 
> 
> 
> ___
> 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] circuitikz module seems broken

2021-12-13 Thread Aditya Mahajan via ntg-context
I tested with my course assignments (simple tikz block diagrams, lots of 
pgdplots code) and everything works correctly. I haven't tested circuitikz; the 
simple example fails and I am trying to understand why that is happening.

> Aditya: can you check if we load enough? 

I believe so. This is what my notes say (it is no fun to trace down these 
files):

% Order in which files are loaded
% 1. t-tikz
% 1.1 t-pgf
% 1.1.1 t-pgfcor
% 1.1.1.1 t-pgfsys
% 1.1.1.1.1 t-pgfrcs
% 1.1.1.1.1.1 t-pgfmod  % Ignore
% 1.1.1.1.1.2 pgfutil-common.tex(1)
% 1.1.1.1.1.3 pgfutil-context.def   (2)
% 1.1.1.1.1.4 pgfrcs.code.tex   (3)
% 1.1.1.1.2 pgfsys.code.tex (4)
% 1.1.1.1.3 pgfsyssoftpath.code.tex (5)
% 1.1.1.1.4 pgfsysprotocol.code.tex (6)
% 1.1.1.2 pgfcore.code.tex  (7)
% 1.1.2 \usepgfmodule[shapes,plot]  (8)
% 1.2 t-pgffor
% 1.2.1 t-pgfrcs (already loaded)
% 1.2.2 t-pgfkey
% 1.2.2.1 pgfkeys.code.tex  (9)
% 1.2.3 pgffor.code.tex(10)
% 1.3 tikz.code.tex(11)

You also have pgfmoduleplot.code.tex, which I had missed.

> We really need to get rid of all
> these (kind of strange) t-* modules that somehow ended up in tikz and it's way
> easier and robust to occasionally add something needed to m-tikz than to try
> to catch hard-to-locate-and-fix stuff in the tikz distribution. If needed we
> can apply runtime patches too.

Agreed. I believe that the pgf module provides so many modules as a means to be 
modular. For example, it possible to use `pgffor` module to get the for loop 
syntax; or load `pgfkey` to get the key-value arguments, etc. But each of these 
t-* files has so much boilerplate code, so I like your method better. 

> (nyw, it looks like tikz creates empty pfg files during a run but that's
> probbably has a reason)

tikz's ChangeLog has the following entries:

2007-01-18:
- Fixed .aux problems in plain and ConTeXt mode. Using .pgf as
  extension now.

Grepping the source for `.pgf` gives:

tex/generic/pgf/utilities/pgfutil-context.def:  
\pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{}
tex/generic/pgf/utilities/pgfutil-context.def:  \immediate\csname 
openout\endcsname\pgfutil@auxout\jobname.pgf\relax
tex/generic/pgf/utilities/pgfutil-plain.def:  
\pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{}
tex/generic/pgf/utilities/pgfutil-plain.def:  \immediate\csname 
openout\endcsname\pgfutil@auxout\jobname.pgf

The file handle \pgfutil@auxout is used in the macro \pgfutil@writetoaux which 
gets used in the driver files to write absolute positioning stuff to file. For 
example, pgfsys-luatex.def has:

\def\pgfsys@markposition#1{%
  \savepos%
  \edef\pgf@temp{#1}%
  \expandafter\pgfutil@writetoaux\expandafter{%

\expandafter\noexpand\expandafter\pgfsyspdfmark\expandafter{\pgf@temp}{\the\lastxpos}{\the\lastypos}}%
}

This can easily be stored in the tuc file using two-pass data, but I don't use 
this feature of tikz, so don't have examples to test this. 

@HenriMenke: Do you know if it is save to not create the `.pgf` file and 
rewrite the above macro to read store the \pgfsyspdfmark table in the `.tuc` 
file?



___
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] circuitikz module seems broken

2021-12-13 Thread Hans Hagen via ntg-context

Hi,

This works here:

\usemodule[circuitikz]

\starttext
\startcircuitikz
\draw (0,2) to[I] (2,2);
\stopcircuitikz
\startcircuitikz
\draw (0,2) to[I] (2,2);
\stopcircuitikz
\stoptext

with the attached. Make sure to put it in the regular context base path 
and run mtxrun --generate.


Aditya: can you check if we load enough? We really need to get rid of 
all these (kind of strange) t-* modules that somehow ended up in tikz 
and it's way easier and robust to occasionally add something needed to 
m-tikz than to try to catch hard-to-locate-and-fix stuff in the tikz 
distribution. If needed we can apply runtime patches too.


(nyw, it looks like tikz creates empty pfg files during a run but that's 
probbably has a reason)


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
-%D \module
%D   [   file=m-tikz,
%Dversion=2021.07.12,
%D  title=\CONTEXT\ Extra Modules,
%D   subtitle=TIKZ support,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D A fixed variant of the t-tikz module distributed with tikz. For practical 
reasons
%D per 2021 we split the module for \MKIV\ and \LMTX. (Maybe some day I'll 
optimize
%D TIKZ a bit.)
%D
%D All these t-* modules in the tikz distribution make no sense as we can just 
load
%D them here which is way cleaner. There is also some mkii filename mapping 
going on
%D that is not needed on todays systems (windows has no 8.3 limitation and on 
unix
%D tds finally adopted a case insensitive approach.)

%D Just in case someone does a hard input ...

\ifdefined\pgfdefined\endinput \fi
\ifdefined\pgfcoredefined\endinput \fi

%D ... but normally we end up here:

\startmodule[tikz]

\ifdefined\pdflastxpos \else
\unprotect

\frozen\overloaded\protected\def\pdflastxpos{\numexpr\clf_lastxpos\relax}

\frozen\overloaded\protected\def\pdflastypos{\numexpr\clf_lastypos\relax}
\protect
\fi

\permanent\protected\def\starttikzinput
  {\pushoverloadmode
   \pushcatcodetable
   \setcatcodetable\texcatcodes
   \catcode`\@=11
   \catcode`\|=12
   \catcode`\!=12
   \autoparagraphmode\zerocount}

\permanent\protected\def\stoptikzinput
  {\autoparagraphmode\plusone
   \popcatcodetable
   \popoverloadmode}

\permanent\protected\def\tikzinputfile#1%
  {\starttikzinput
   \input{#1}\relax
   \stoptikzinput}

\permanent\protected\def\tikzerrormessage#1#2#3%
  {\writestatus{#1}{#2}}

% For now we need this but we need to educate the user to wrap settings in the
% wrappers. So some day the next line will go. I need to check what commands are
% possible outside a picture.

\overloadmode\zerocount

\permanent\protected\def\starttikzsettings
  {\pushoverloadmode
   \autoparagraphmode\zerocount}

\permanent\protected\def\stoptikzsettings
  {\autoparagraphmode\plusone
   \popoverloadmode}

\permanent\protected\def\starttikzpicture
  {\dontleavehmode
   \hcontainer\bgroup
   \autoparagraphmode\zerocount
 % \pushoverloadmode
   \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi
   \tikzpicture}

\permanent\protected\def\stoptikzpicture
  {\endtikzpicture
 % \popoverloadmode
   \egroup}

\let\pgfdefined\relax
\let\pgfcoredefined\relax

\tikzinputfile{pgfutil-common.tex}
\tikzinputfile{pgfutil-context.def}
\tikzinputfile{pgfrcs.code.tex}
\tikzinputfile{pgfsys.code.tex}
\tikzinputfile{pgfkeys.code.tex}
\tikzinputfile{pgfsyssoftpath.code.tex}
\tikzinputfile{pgfsysprotocol.code.tex}
\tikzinputfile{pgfcore.code.tex}
\tikzinputfile{pgffor.code.tex}
\tikzinputfile{pgfmoduleplot.code.tex}
\tikzinputfile{tikz.code.tex}

\let\startpgfpicture \pgfpicture  \let\stoppgfpicture   
 \endpgfpicture
\let\startpgfscope   \pgfscope\let\stoppgfscope 
 \endpgfscope
\let\startpgflowlevelscope   \pgflowlevelscope
\let\stoppgflowlevelscope  \endpgflowlevelscope
\let\startpgfinterruptpath   \pgfinterruptpath
\let\stoppgfinterruptpath  \endpgfinterruptpath
\let\startpgfinterruptpicture\pgfinterruptpicture 
\let\stoppgfinterruptpicture   \endpgfinterruptpicture
\let\startpgfinterruptboundingbox\pgfinterruptboundinbox  
\let\stoppgfinterruptboudingbox\endpgfinterruptboundingbox

\let\normalusepgfmodule\usepgfmodule
\let\normalusepgflibrary\usepgflibrary

\tolerant\protected\def\usepgfmodule[#1]#;#2% somehow both variants are used
  {\starttikzinput
   \normalusepgfmodule[#1#2]%
   \stoptikzinput}

\tolerant\protected\def\usepgflibrary[#1]

Re: [NTG-context] how to setup path of ConTeXtLMTX for MacVim?

2021-12-13 Thread Jeong Dal via ntg-context
Dear John, Nicola,

Thank you for your help.
I have to check the wiki carefully first.

I’ll do what you said and report it later.

Thank you again.

Best regards,

Dalyoung

___
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] Initial release of SBL bibliographic rendering and biblio wishlist

2021-12-10 Thread J Huisman via ntg-context
Hello Joey,

Just a quick note to thank you for your work on this. I use Chicago
which is close enough to SBL that I can use it. I'll test it for a
while and report any issues I encounter.

Jelle

On Thu, Dec 9, 2021 at 12:47 AM Joey McCollum via ntg-context
 wrote:
>
> A while ago, I mentioned in a thread on the mailing list that I was working 
> on a new bibliographic rendering for the SBL citation style. After additional 
> testing and implementation of various features (e.g., an authorconversion 
> that inverts the first author and prints all subsequent authors in normal 
> order, an author-title sort order for bibliographic entries, support for 
> shorthands/abbreviations, support for Citation Style Language locators, and 
> support for biblatex-style citation macros that intelligently move 
> punctuation that follows them). While optimizations for performance, 
> simplifications of the code, and new feature additions are still desirable, 
> the module is in working condition and can now be incorporated in a future 
> ConTeXt update. The new .lua and .mkvi files for the SBL rendering, updated 
> publ-aut.lua and publ-imp-author.mkvi files, and some new code intended to be 
> incorporated into publ-ini.lua and publ-ini.mkiv can all be found in project 
> GitHub repo at the https://github.com/jjmccollum/context-sbl.
>
> While I worked on this module, Denis Maier (who provided valuable feedback 
> and suggestions throughout) and I put together a wish list of new features we 
> would like to see implemented in the publications support core modules. We 
> put together the list with Hans and Alan in mind, but any help is 
> appreciated! The list follows:
>
> Probably the most urgent need is for field inheritance mappings through 
> crossrefs to be fixed. These should be customizable in bibliographic 
> specification .lua files (e.g., publ-imp-sbl.lua), or at the very least, they 
> should follow the pattern of biblatex. As it is currently implemented, field 
> inheritance seems to map any field from the cross-referenced entry to a field 
> of the same name in the current entry if it doesn't have a field of this name 
> already. But this causes serious problems when one needs to check if an entry 
> has a given field (such as "shorthand") at all; specifically, the \btxdoif 
> macro will execute its argument if the current entry or any entry it 
> cross-references contains a field with that name. What we want is a more 
> disambiguated mapping of inherited fields: for many common entry types (such 
> as @book, @collection, @reference, @proceedings, and @inbook, @incollection, 
> @inreference, and @inproceedings), biblatex maps the title field of the 
> cross-referenced entry to a different-named field in the lower-level entry 
> (e.g., maintitle -> booktitle -> title, maineditor -> bookeditor -> editor, 
> etc.).
> A mechanism for setting default field values (e.g., "pagination", "options") 
> by category in the .lua file for a given specification. (In the SBL spec, for 
> instance, an entry of category @ancienttext or @classictext should have 
> options={skipbib=true} by default.) If the user actually specifies this field 
> in an entry, then the default value would be overwritten.
> If it hasn't been done already, the \btxdoifelsecitedone macro defined in the 
> cont-new.mkiv file in https://github.com/jjmccollum/context-sbl should be 
> implemented in publ-ini.lua and publ-ini.mkiv.
> Related to the previous entry, the ability to remove existing entry tags from 
> the "collected" or "tobesaved" lists defined in publ-ini.lua. This would 
> allow us to override the usual list registry rules of \cite based on the 
> values of, say, an entry's category, "type" field or "options" field.
> General support for the useauthor, useeditor, usetranslator, skipbib, and 
> skipbiblist entry options from biblatex. These could be implemented as 
> citation-level btx options (currently, useauthor already is implemented for 
> the SBL style).
> Support for disambiguation in "author" citations made with the "name" 
> authorconversion. Publications support already allows us to map different 
> versions of the same name (e.g., "John Doe" and "J. Doe" to a single value. 
> But ideally, the publications support module should also check if surnames 
> are shared by distinct authors, and if so, it should then check for distinct 
> first and middle initials, and then distinct full names, until it finds a 
> difference. The shortest distinct renderings should then be used for the 
> "name" authorconversion. Different bibliographic renderings have different 
> rules for this, so implementations of these differen

Re: [NTG-context] \WORD regression

2021-12-10 Thread Henning Hraban Ramm via ntg-context

Am 10.12.21 um 12:53 schrieb Wolfgang Schuster:

Henning Hraban Ramm via ntg-context schrieb am 10.12.2021 um 08:20:

Am 09.12.21 um 19:00 schrieb Henning Hraban Ramm via ntg-context:


\starttext
\WORD{größer}
\stoptext

\WORD used to handle "ß" correctly, i.e. convert it to "SS"; now it 
makes "sS".


(If the current font contains an uppercase ß that would be even 
better, but those are rare).


I can’t tell when it changed (some LMTX versions ago) and can’t check 
MkIV, since "mtxrun --generate --luatex" doesn’t work.


Hans sent me a fix, I guess it will be included in the next upload.

And yes, uppercase ß (ẞ, U1E9E) would be even better, even according 
to the official German orthography rules since 2017, but there are 
still not many fonts that have it.


\usemodule[lingual-de]

\enabledirectives[fonts.uppercasesharps]

\setupbodyfont[libertinus]

\starttext
\WORD{größer}
\stoptext


Cool, thank you!

It would have been kind of a wonder if ConTeXt wouldn’t already contain 
something like that... ;)


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] \WORD regression

2021-12-10 Thread Wolfgang Schuster via ntg-context

Henning Hraban Ramm via ntg-context schrieb am 10.12.2021 um 08:20:

Am 09.12.21 um 19:00 schrieb Henning Hraban Ramm via ntg-context:


\starttext
\WORD{größer}
\stoptext

\WORD used to handle "ß" correctly, i.e. convert it to "SS"; now it 
makes "sS".


(If the current font contains an uppercase ß that would be even 
better, but those are rare).


I can’t tell when it changed (some LMTX versions ago) and can’t check 
MkIV, since "mtxrun --generate --luatex" doesn’t work.


Hans sent me a fix, I guess it will be included in the next upload.

And yes, uppercase ß (ẞ, U1E9E) would be even better, even according 
to the official German orthography rules since 2017, but there are 
still not many fonts that have it.


\usemodule[lingual-de]

\enabledirectives[fonts.uppercasesharps]

\setupbodyfont[libertinus]

\starttext
\WORD{größer}
\stoptext

Wolfgang

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

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


[NTG-context] upload ... new feature

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

Hi,

This time the lmtx upload has a (for some maybe) interesting new 
features: runtime pdf encryption.


context
   --ownerpassword=foo
  [--userpassword=bar]
  [--permissions="see context --help --expert"]

One can also use the document banner line, like:

% ownerpassword="foo" userpassword="" permissions="print,extract,quality"

Now, this is a feature that relies on the viewer to deal properly with 
it as we only support the not depricated method (why bother with the old 
stuff).


acrobat  : it took some effort (and trial and error) to make that one 
happy but it seems to work ok


summatra : the one i use, it works ok in the latest greatest (i use 
3.3.13418)


mutool   : okay but sometimes with a warning (i have a workearound but 
not enabled it because i consider it to be a bug)


qpdf : happy but check gives a permissions warning (understandable 
as that is a real mess)


firefox  : opens ok in the latest version (pdf.js)

chrome   : can't handle the revision level we use (the rest is 
depricated so i consider it a lack of feature for now)


edge : idem

okular   : my (windows) version is too old

xpdf : not up to it yet

foxit: (i never use it, but tried ... it's code seems to be what is 
used in chrome) doesn't work with this revision


I would be surprised if the native apple viewer works but I can't test that.

Given earlier pdf threads, I wanna check with Michal Vlasák what can be 
improved.


Performance is okay, the luametatex manual takes 1% more runtime and 
that's within the runtime measurement margin that I use. I didn't test 
with external images yet but will do that so don't expection yet. It 
will probably take a few months to reach a stable state anyway. (But ... 
afaiks tikz pdf generation, which is also somewhat alien to context, 
seems to work).


Hopefully I didn't mess up the unrelated code,

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] \WORD regression

2021-12-09 Thread Hans Hagen via ntg-context

On 12/10/2021 8:20 AM, Henning Hraban Ramm via ntg-context wrote:

Am 09.12.21 um 19:00 schrieb Henning Hraban Ramm via ntg-context:


\starttext
\WORD{größer}
\stoptext

\WORD used to handle "ß" correctly, i.e. convert it to "SS"; now it 
makes "sS".


(If the current font contains an uppercase ß that would be even 
better, but those are rare).


I can’t tell when it changed (some LMTX versions ago) and can’t check 
MkIV, since "mtxrun --generate --luatex" doesn’t work.


Hans sent me a fix, I guess it will be included in the next upload.

And yes, uppercase ß (ẞ, U1E9E) would be even better, even according to 
the official German orthography rules since 2017, but there are still 
not many fonts that have it.
if needed we could catch that with a fallback feature (could cover more 
such cases)


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] \WORD regression

2021-12-09 Thread Henning Hraban Ramm via ntg-context

Am 09.12.21 um 19:00 schrieb Henning Hraban Ramm via ntg-context:


\starttext
\WORD{größer}
\stoptext

\WORD used to handle "ß" correctly, i.e. convert it to "SS"; now it 
makes "sS".


(If the current font contains an uppercase ß that would be even better, 
but those are rare).


I can’t tell when it changed (some LMTX versions ago) and can’t check 
MkIV, since "mtxrun --generate --luatex" doesn’t work.


Hans sent me a fix, I guess it will be included in the next upload.

And yes, uppercase ß (ẞ, U1E9E) would be even better, even according to 
the official German orthography rules since 2017, but there are still 
not many fonts that have it.


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
___


[NTG-context] \WORD regression

2021-12-09 Thread Henning Hraban Ramm via ntg-context


\starttext
\WORD{größer}
\stoptext

\WORD used to handle "ß" correctly, i.e. convert it to "SS"; now it 
makes "sS".


(If the current font contains an uppercase ß that would be even better, 
but those are rare).


I can’t tell when it changed (some LMTX versions ago) and can’t check 
MkIV, since "mtxrun --generate --luatex" doesn’t work.


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
___


[NTG-context] Initial release of SBL bibliographic rendering and biblio wishlist

2021-12-08 Thread Joey McCollum via ntg-context
A while ago, I mentioned in a thread on the mailing list that I was working
on a new bibliographic rendering for the SBL citation style. After
additional testing and implementation of various features (e.g., an
authorconversion that inverts the first author and prints all subsequent
authors in normal order, an author-title sort order for bibliographic
entries, support for shorthands/abbreviations, support for Citation Style
Language locators, and support for biblatex-style citation macros that
intelligently move punctuation that follows them). While optimizations for
performance, simplifications of the code, and new feature additions are
still desirable, the module is in working condition and can now be
incorporated in a future ConTeXt update. The new .lua and .mkvi files for
the SBL rendering, updated publ-aut.lua and publ-imp-author.mkvi files, and
some new code intended to be incorporated into publ-ini.lua and
publ-ini.mkiv can all be found in project GitHub repo at the
https://github.com/jjmccollum/context-sbl.

While I worked on this module, Denis Maier (who provided valuable feedback
and suggestions throughout) and I put together a wish list of new features
we would like to see implemented in the publications support core modules.
We put together the list with Hans and Alan in mind, but any help is
appreciated! The list follows:

   - Probably the most urgent need is for field inheritance mappings
   through crossrefs to be fixed. These should be customizable in
   bibliographic specification .lua files (e.g., publ-imp-sbl.lua), or at the
   very least, they should follow the pattern of biblatex. As it is currently
   implemented, field inheritance seems to map any field from the
   cross-referenced entry to a field *of the same name* in the current
   entry if it doesn't have a field of this name already. But this causes
   serious problems when one needs to check if an entry has a given field
   (such as "shorthand") at all; specifically, the \btxdoif macro will execute
   its argument if the current entry *or any entry it cross-references*
   contains a field with that name. What we want is a more disambiguated
   mapping of inherited fields: for many common entry types (such as @book,
   @collection, @reference, @proceedings, and @inbook, @incollection,
   @inreference, and @inproceedings), biblatex maps the title field of the
   cross-referenced entry to a different-named field in the lower-level entry
   (e.g., maintitle -> booktitle -> title, maineditor -> bookeditor -> editor,
   etc.).
   - A mechanism for setting default field values (e.g., "pagination",
   "options") by category in the .lua file for a given specification. (In the
   SBL spec, for instance, an entry of category @ancienttext or @classictext
   should have options={skipbib=true} by default.) If the user actually
   specifies this field in an entry, then the default value would be
   overwritten.
   - If it hasn't been done already, the \btxdoifelsecitedone macro defined
   in the cont-new.mkiv file in https://github.com/jjmccollum/context-sbl
   should be implemented in publ-ini.lua and publ-ini.mkiv.
   - Related to the previous entry, the ability to remove existing entry
   tags from the "collected" or "tobesaved" lists defined in publ-ini.lua.
   This would allow us to override the usual list registry rules of \cite
   based on the values of, say, an entry's category, "type" field or "options"
   field.
   - General support for the useauthor, useeditor, usetranslator, skipbib,
   and skipbiblist entry options from biblatex. These could be implemented as
   citation-level btx options (currently, useauthor already is implemented for
   the SBL style).
   - Support for disambiguation in "author" citations made with the "name"
   authorconversion. Publications support already allows us to map different
   versions of the same name (e.g., "John Doe" and "J. Doe" to a single value.
   But ideally, the publications support module should also check if surnames
   are shared by distinct authors, and if so, it should then check for
   distinct first and middle initials, and then distinct full names, until it
   finds a difference. The shortest distinct renderings should then be used
   for the "name" authorconversion. Different bibliographic renderings have
   different rules for this, so implementations of these different rules
   (detailed at
   https://docs.citationstyles.org/en/stable/specification.html#disambiguation)
   would be ideal.
   - General support for *ibidem* (same entry), *idem* (same author), and *op.
   cit.* (same title) tracking in the publ-ini module. These could be
   implemented with default settings that could be overridden as needed in
   individual specifications. Following biblatex, the user should be able to
   specify yes/no "ibidtracker", "

Re: [NTG-context] Regular online meet-up

2021-12-07 Thread Henning Hraban Ramm via ntg-context

You’re invited to join next Tuesday, December 14th, 15:00 CET (UTC+1)

at https://lecture.senfcall.de/hen-rbr-rku-oke

ConTeXt users of all levels are welcome!

Hans offered to give a Q session again – please announce subjects 
you’d like to discuss ASAP, so that he can prepare.



I’d suggest to have a look at the recent changes to learn how they might 
affect us: math font settings, bars, some outdated modules, low-level 
stuff...



[Howto]
* No special software installation required; most modern browsers should 
work (WebRTC required).

* Open the above URL, accept the privacy statement,
* enter your name,
* click "join" (or "start" if you’re the first),
* click "with microphone", allow your browser to access it, check the audio.
(Some strings might be different, I see the German interface, you should 
get the main language of your browser.)
* Your microphone is muted if you join. Activate microphone and/or 
camera with the buttons at the bottom.

* Minimize the default presentation with the "screen" button, bottom right.

* If you’d like to share your screen or upload a file, you can make 
yourself the presenter: Click on your user name, change the setting, 
then you’ll see the "screen sharing" button beside the camera button; 
also there’s now "manage presentations" behind the "plus" button. Beware 
there is only one presenter, so don’t kill someone else’s presentation.


[Technical hints]
* Sound is usually better if you use a headset (less noise for everyone).

* Connection problems are mostly due to low bandwidth or high latency on 
your side, e.g. with mobile connections.

* If audio/video doesn’t work for you, you can still use the text chat.
* Screen sharing needs a lot of bandwidth.

* You can also join with a regular telephone (audio only, of course), 
call +49-6151-86275-22 (German landline); then you must enter a PIN that 
changes every time – if you need it, ask me for it via email. 
Mute/unmute your microphone with "0".


[Netiquette]
* Please use a name that we recognize from here. Some feel uncomfortable 
with anonymous lurkers.

* Mute your microphone while you’re not talking.
* It’s nice to show your face at least when you join.
* If there are connection problems, stop camera sharing.
* The room is set to “everyone’s a moderator“, I trust you...

Next time will be January 11th.

See you, 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] [DKIM] Re: [DKIM] circuitikz module seems broken

2021-12-06 Thread Hans Hagen via ntg-context
go. I need to check what commands are
% possible outside a picture.

\overloadmode\zerocount

\permanent\protected\def\starttikzsettings
  {\pushoverloadmode
   \autoparagraphmode\zerocount}

\permanent\protected\def\stoptikzsettings
  {\autoparagraphmode\plusone
   \popoverloadmode}

\permanent\protected\def\starttikzpicture
  {\dontleavehmode
   \hcontainer\bgroup
   \autoparagraphmode\zerocount
 % \pushoverloadmode
   \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi
   \tikzpicture}

\permanent\protected\def\stoptikzpicture
  {\endtikzpicture
 % \popoverloadmode
   \egroup}

\ifx\pgfdefined\undefined

\let\pgfdefined\relax

\ifx\pgfcoredefined\undefined

\let\pgfcoredefined\relax

\tikzinputfile{pgfsys.code.tex}
\tikzinputfile{pgfsyssoftpath.code.tex}
\tikzinputfile{pgfsysprotocol.code.tex}
\tikzinputfile{pgfcore.code.tex}

\let\startpgfpicture \pgfpicture  
\let\stoppgfpicture\endpgfpicture
\let\startpgfscope   \pgfscope
\let\stoppgfscope  \endpgfscope
\let\startpgflowlevelscope   \pgflowlevelscope
\let\stoppgflowlevelscope  \endpgflowlevelscope
\let\startpgfinterruptpath   \pgfinterruptpath
\let\stoppgfinterruptpath  \endpgfinterruptpath
\let\startpgfinterruptpicture\pgfinterruptpicture 
\let\stoppgfinterruptpicture   \endpgfinterruptpicture
\let\startpgfinterruptboundingbox\pgfinterruptboundinbox  
\let\stoppgfinterruptboudingbox\endpgfinterruptboundingbox

\fi

\let\normalusepgfmodule\usepgfmodule

\protected\def\usepgfmodule[#1]%
  {\starttikzinput
   \normalusepgfmodule[#1]%
   \stoptikzinput}

\usepgfmodule[shapes,plot]

\fi

\stopmodule
%D \module
%D   [   file=m-circuitikz,
%Dversion=2021.12.03,
%D  title=\CONTEXT\ Extra Modules,
%D   subtitle=CURCUITIKZ support,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D A fixed variant of the t-curcuitikz module distributed with tikz. This one
%D is for \LMTX.

\usemodule[m][tikz]

\startmodule[circuitikz]

\def\pgfcircversion {1.4.4}
\def\pgfcircversiondate {2021/10/31}

\usetikzlibrary[calc]
\usetikzlibrary[arrows.meta, bending]
\usetikzlibrary[fpu] % may be needed for use fpu reciprocal (v1.0.1)

\tikzinputfile{pgfcirc.defines.tex}
\tikzinputfile{pgfcircutils.tex}
\tikzinputfile{pgfcircpath.tex}

\tikzinputfile{pgfcircshapes.tex}
\tikzinputfile{pgfcircmonopoles.tex}
\tikzinputfile{pgfcircbipoles.tex}
\tikzinputfile{pgfcirctripoles.tex}
\tikzinputfile{pgfcircquadpoles.tex}
\tikzinputfile{pgfcircmultipoles.tex}

\tikzinputfile{pgfcirclabel.tex}
\tikzinputfile{pgfcircvoltage.tex}
\tikzinputfile{pgfcirccurrent.tex}
\tikzinputfile{pgfcircflow.tex}

% defaults

\setupmodule
  [current=european,
   voltage=european,
   resistor=american,
   inductor=cute,
   logic=american,
   siunitx=true,
   arrowmos=false]

% can be done nicer ... todo

\processaction
  [\currentmoduleparameter{voltage}]
  [european=>\ctikzset{voltage=european},
   american=>\ctikzset{voltage=american}]

\processaction
  [\currentmoduleparameter{current}]
  [european=>\ctikzset{ current=european},
   american=>\ctikzset{ current=american}]

\processaction
  [\currentmoduleparameter{label}]
  [straight=>\ctikzset{label/align = straight},
   align=>\ctikzset{label/align = rotate},
   smart=>\ctikzset{label/align = smart}]

\processaction
  [\currentmoduleparameter{resistor}]
  [european=>\ctikzset{ resistor=european},
   american=>\ctikzset{ resistor=american}]

\processaction
  [\currentmoduleparameter{inductor}]
  [european=>\ctikzset{ inductor=european},
   american=>\ctikzset{ inductor=american},
   cute=>\ctikzset{ inductor=cute}]

\processaction
  [\currentmoduleparameter{diode}]
  [full=>\ctikzset{ diode=full},
   empty=>\ctikzset{ diode=empty}]

\processaction
  [\currentmoduleparameter{logic}]
  [european=>\ctikzset{ logic ports=european},
   american=>\ctikzset{ logic ports=american}]

% hm, we have units built in and in mkii one can load the units module
% ... always been so ...

\processaction
  [\currentmoduleparameter{siunitx}]
  [true=>\def\SI#1#2{#1\,#2}
 \def\ampere{\rm{A}}
 \def\volt  {\rm{V}}
 \def\ohm   {\Omega}
 \def\siemens   {\rm{S}}
 \def\farad {\rm{F}}
 \def\henry {\rm{H}}
 \def\second{\rm{s}}
 \def\coulomb   {\rm{C}}
 \def\siemens   {\rm{S}}
 \def\radians   {\rm{rad}}
 \def\milli {\rm{m}}
 \def\micro {\mu}
 \def\nano  {\rm{n}}
 \def\pico  {\rm{p}}
 \def\kilo 

Re: [NTG-context] [DKIM] Re: [DKIM] circuitikz module seems broken

2021-12-03 Thread Hans Hagen via ntg-context

On 12/3/2021 3:47 PM, Aditya Mahajan via ntg-context wrote:

On Fri, 3 Dec 2021, Hans Hagen via ntg-context wrote:


On 12/3/2021 10:49 AM, Hans Hagen via ntg-context wrote:


I’ve been struggeling with the circuitikz module since my upgrade to
LMTX.

btw, We can have more 'catches' in the loader (t) module if needed. In
any case, also check if things work with mkiv.


I tested the example on mkiv, I got error that dipchip and fliflop JK are not defined. 
The file compiles if I comment those out. But in LMTX, I also get a "missing 
semicolon" error. There is also this warning, which may have something to do with 
what is going wrong:

system  > module wrapping error in 'tikz'

The error appears to be related to keyword arguments. The following example 
works:

 \usemodule[circuitikz]
 \starttext
 \startcircuitikz
 \draw (0,2) to[I] (2,2) ;
 \stopcircuitikz
 \stoptext

But this does not:

 \usemodule[circuitikz]
 \starttext
 \startcircuitikz
 \draw (0,2) to[I=1] (2,2) ;
 \stopcircuitikz
 \stoptext

can you test the attached ... this works here

\usemodule[circuitikz]
% \usemodule[tikz]

\starttext

\starttikzpicture
\draw (0,2) -- (2,2) ;
\stoptikzpicture

\startcircuitikz
\draw (0,2) to[I=1] (2,2) ;
\stopcircuitikz

\stoptext



Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-%D \module
%D   [   file=m-circuitikz,
%Dversion=2021.12.03,
%D  title=\CONTEXT\ Extra Modules,
%D   subtitle=CURCUITIKZ support,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D A fixed variant of the t-curcuitikz module distributed with tikz. This one
%D is for \LMTX.

\usemodule[m][tikz]

\startmodule[circuitikz]

\def\pgfcircversion {1.4.4}
\def\pgfcircversiondate {2021/10/31}

\usetikzlibrary[calc]
\usetikzlibrary[arrows.meta, bending]
\usetikzlibrary[fpu] % may be needed for use fpu reciprocal (v1.0.1)

\tikzinputfile{pgfcirc.defines.tex}
\tikzinputfile{pgfcircutils.tex}
\tikzinputfile{pgfcircpath.tex}

\tikzinputfile{pgfcircshapes.tex}
\tikzinputfile{pgfcircmonopoles.tex}
\tikzinputfile{pgfcircbipoles.tex}
\tikzinputfile{pgfcirctripoles.tex}
\tikzinputfile{pgfcircquadpoles.tex}
\tikzinputfile{pgfcircmultipoles.tex}

\tikzinputfile{pgfcirclabel.tex}
\tikzinputfile{pgfcircvoltage.tex}
\tikzinputfile{pgfcirccurrent.tex}
\tikzinputfile{pgfcircflow.tex}

% defaults

\setupmodule
  [current=european,
   voltage=european,
   resistor=american,
   inductor=cute,
   logic=american,
   siunitx=true,
   arrowmos=false]

% can be done nicer ... todo

\processaction
  [\currentmoduleparameter{voltage}]
  [european=>\ctikzset{voltage=european},
   american=>\ctikzset{voltage=american}]

\processaction
  [\currentmoduleparameter{current}]
  [european=>\ctikzset{ current=european},
   american=>\ctikzset{ current=american}]

\processaction
  [\currentmoduleparameter{label}]
  [straight=>\ctikzset{label/align = straight},
   align=>\ctikzset{label/align = rotate},
   smart=>\ctikzset{label/align = smart}]

\processaction
  [\currentmoduleparameter{resistor}]
  [european=>\ctikzset{ resistor=european},
   american=>\ctikzset{ resistor=american}]

\processaction
  [\currentmoduleparameter{inductor}]
  [european=>\ctikzset{ inductor=european},
   american=>\ctikzset{ inductor=american},
   cute=>\ctikzset{ inductor=cute}]

\processaction
  [\currentmoduleparameter{diode}]
  [full=>\ctikzset{ diode=full},
   empty=>\ctikzset{ diode=empty}]

\processaction
  [\currentmoduleparameter{logic}]
  [european=>\ctikzset{ logic ports=european},
   american=>\ctikzset{ logic ports=american}]

% hm, we have units built in and in mkii one can load the units module
% ... always been so ...

\processaction
  [\currentmoduleparameter{siunitx}]
  [true=>\def\SI#1#2{#1\,#2}
 \def\ampere{\rm{A}}
 \def\volt  {\rm{V}}
 \def\ohm   {\Omega}
 \def\siemens   {\rm{S}}
 \def\farad {\rm{F}}
 \def\henry {\rm{H}}
 \def\second{\rm{s}}
 \def\coulomb   {\rm{C}}
 \def\siemens   {\rm{S}}
 \def\radians   {\rm{rad}}
 \def\milli {\rm{m}}
 \def\micro {\mu}
 \def\nano  {\rm{n}}
 \def\pico  {\rm{p}}
 \def\kilo  {\rm{k}}
 \def\mega  {\rm{M}}
 \def\giga  {\rm{G}}
 \def\tera  {\rm{T}}]

\unprotect

\processaction
  [\cu

Re: [NTG-context] [DKIM] Re: [DKIM] circuitikz module seems broken

2021-12-03 Thread Aditya Mahajan via ntg-context
On Fri, 3 Dec 2021, Hans Hagen via ntg-context wrote:

> On 12/3/2021 10:49 AM, Hans Hagen via ntg-context wrote:
> 
> >> I’ve been struggeling with the circuitikz module since my upgrade to 
> >> LMTX.
> btw, We can have more 'catches' in the loader (t) module if needed. In 
> any case, also check if things work with mkiv. 

I tested the example on mkiv, I got error that dipchip and fliflop JK are not 
defined. The file compiles if I comment those out. But in LMTX, I also get a 
"missing semicolon" error. There is also this warning, which may have something 
to do with what is going wrong:

system  > module wrapping error in 'tikz'

The error appears to be related to keyword arguments. The following example 
works:

\usemodule[circuitikz]
\starttext
\startcircuitikz
\draw (0,2) to[I] (2,2) ;
\stopcircuitikz
\stoptext

But this does not:

\usemodule[circuitikz]
\starttext
\startcircuitikz
\draw (0,2) to[I=1] (2,2) ;
\stopcircuitikz
\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] [DKIM] Re: [DKIM] circuitikz module seems broken

2021-12-03 Thread skrantajanneman via ntg-context
My thougts on this, if it is a possible alternative, to do such things in 
metafun instead?By the way I try this out.Thanks for all help,  appreciated.mvh 
Jan-Erik Hägglöf 
 Originalmeddelande Från: Hans Hagen via ntg-context 
 Datum: 2021-12-03  14:55  (GMT+01:00) Till: mailing list 
for ConTeXt users  Kopia: Hans Hagen  
Ämne: Re: [NTG-context] [DKIM] Re: [DKIM] circuitikz module seems broken On 
12/3/2021 10:49 AM, Hans Hagen via ntg-context wrote:>> I’ve been struggeling 
with the circuitikz module since my upgrade to >> LMTX.btw, We can have more 
'catches' in the loader (t) module if needed. In any case, also check if things 
work with mkiv. That version has hardly been touched the last few years (and 
basically is frozen, apart from bug fixes) so if it doesn't work there it might 
be an indication of something in tikz or 
circuit.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-contextwebpage  : 
http://www.pragma-ade.nl / http://context.aanhet.netarchive  : 
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] [DKIM] Re: [DKIM] circuitikz module seems broken

2021-12-03 Thread Hans Hagen via ntg-context

On 12/3/2021 10:49 AM, Hans Hagen via ntg-context wrote:

I’ve been struggeling with the circuitikz module since my upgrade to 
LMTX.
btw, We can have more 'catches' in the loader (t) module if needed. In 
any case, also check if things work with mkiv. That version has hardly 
been touched the last few years (and basically is frozen, apart from bug 
fixes) so if it doesn't work there it might be an indication of 
something in tikz or circuit.


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] Have a cell span multiple columns with tabulate

2021-11-28 Thread Hans Hagen via ntg-context

On 11/28/2021 9:26 AM, Denis Maier via ntg-context wrote:

Ok, did some tests: Now I understand what was meant with the limitation that 
this only supports single line cells:

%
\starttext

% this works
\starttabulate[|l|l|]
\NS[1][c] Manuskript X \NC\NR
\NC foo \NC bar  \NC\NR
\stoptabulate

% this does not work
\starttabulate[|p|p|]
\NS[1][c] Manuskript X \NC\NR
\NC foo \NC bar  \NC\NR
\stoptabulate
\stoptext
%

Changing the column definitions from l,c,r to p breaks it.
indeed, i check if that can be handled but it's too intrusive (for now) 
so i leave that as limitation


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] Checking for a Unicode prefix of a Unicode string

2021-11-27 Thread Joey McCollum via ntg-context
I was afraid that might be the problem. I've described some of the intended
purpose of this code near the end of the "Checking for a macro in a string
without expanding it" thread on the mailing list, but I will get into more
detail here. I'm working on a ConTeXt implementation of citation style
language (CSL) locators, particularly for the SBL citation rendering
(although the code could easily be adapted for use in general or with other
bibliographic renderings). This would allow for a consistent,
language-sensitive syntax that could be used within citations or in any
part of a text and could accommodate changes in bibliographic style without
requiring the user to reformat all their page number citations. In SBL
style, for instance, volume, part, and page numbers are not prefixed by
abbreviations like "vol.", "pt." and "p.", but in other styles, they might
be. The locator syntax

```
\loc[vol=33,pt=1,p=86]
```

would be defined in the SBL rendering file to output

```
33.1:86
```

while in some other style, it might be defined to output

```
vol. 33, pt. 1, p. 86
```

To accommodate the use of these macros within citations, I've added
"loctext" (locator text) and "altloctext" (alternate locator text)
arguments to the set of parameters used by the \cite macro, because in some
bibliographic categories, different locators can be specified for different
parts of a citation (e.g., one for a passage in an ancient text and another
for the book reproducing it), and therefore cannot just be specified in the
"righttext" parameter. So now we can do something like

```
\cite[lefttext={See},altloctext={1.3},loctext={8:223},righttext={for
further details}][clementinehomilies]
```

to get

See *The Clementine Homilies* 1.3 (*ANF *8:223) for further details.

or

```
\cite[lefttext={See},loctext={\loc[p=8]},righttext={; but there are also
contradictory statements, e.g. \loc[p=12].}][Doe:Title]
```

to get

See Doe, *Title*, 8; but there are also contradictory statements, e.g. 12.


The main problem is determining when to include a comma before printing the
"loctext" and when not to include one. In the first example above, we don't
want a comma between *ANF* and 8:223 (SBL style does not add a comma
between a multivolume set abbreviation and a volume number), but in the
second example, we do want one between *Title *and 8. Similarly, we want to
remove the comma if the first locator in the loctext is a section marker
(§) or paragraph marker (¶). This is why I want to check the beginning of
the \currentloctext macro for the presence of a volume number (a number
followed by a colon), a section mark, or a paragraph mark.

While storing the locator parameters as btx parameters would allow for
another solution to this problem, it would complicate defining the \loc
macro in a way that would be suitable outside of citations or for multiple
uses in the same citation (notice how a second \loc invocation occurs in
the righttext of the second example above). Parsing the output of \loc
seemed like the simplest solution, but as you've pointed out, it has its
own difficulties. I'm inclined to try one of the TeX-based solutions you
describe above to avoid complicating other things, but if my description of
the intended use gives you any better ideas, please suggest them!

Thanks again!

Joey

On Sat, Nov 27, 2021 at 1:44 PM Hans Hagen  wrote:

> On 11/27/2021 6:13 PM, Joey McCollum wrote:
> > All right, I think I've solved the expansion problem I described before:
> > to ensure that the first input is expanded when it is passed to Lua, I
> > have to pass it as [==[#1]==], not "#1". But the updated MWE below still
> > does not seem to work, as the \DoIfPrefixElse macro is printing "NOP"
> > instead of "YES":
> >
> > ```
> >
> > \starttexdefinition loc [#1]
> >
> > \doifassignmentelse{#1} {
> >
> > % if an assignment, then parse and format accordingly
> >
> > \getparameters[loc][#1]
> >
> > % Was a section number specified?
> >
> > \doifdefined{locsec} {
> >
> > § \locsec
> >
> > }
> >
> > } {
> >
> > % otherwise, just print the input as-is
> >
> > #1
> >
> > }
> >
> > \stoptexdefinition
> >
> >
> >
> \def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find([==[#2]==],"^"..[==[#1]==]))}}
> >
> >
> > \def\currentbtxloctext{\loc[sec=31]}
> >
> >
> > \starttext
> >
> > \currentbtxloctext\blank
> >
> > \DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP}
> >
> > \stoptext
> >
> > ```
> >
> > Indeed, if I add a simple \doifelse equality check, it looks like the
> > value I expect is not th

Re: [NTG-context] Checking for a Unicode prefix of a Unicode string

2021-11-27 Thread Hans Hagen via ntg-context

On 11/27/2021 6:13 PM, Joey McCollum wrote:
All right, I think I've solved the expansion problem I described before: 
to ensure that the first input is expanded when it is passed to Lua, I 
have to pass it as [==[#1]==], not "#1". But the updated MWE below still 
does not seem to work, as the \DoIfPrefixElse macro is printing "NOP" 
instead of "YES":


```

\starttexdefinition loc [#1]

\doifassignmentelse{#1} {

% if an assignment, then parse and format accordingly

\getparameters[loc][#1]

% Was a section number specified?

\doifdefined{locsec} {

§ \locsec

}

} {

% otherwise, just print the input as-is

#1

}

\stoptexdefinition


\def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find([==[#2]==],"^"..[==[#1]==]))}}


\def\currentbtxloctext{\loc[sec=31]}


\starttext

\currentbtxloctext\blank

\DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP}

\stoptext

```

Indeed, if I add a simple \doifelse equality check, it looks like the 
value I expect is not the same as what the macro produces, even though 
they look identical:


```

\starttexdefinition loc [#1]
     \doifassignmentelse{#1} {
         % if an assignment, then parse and format accordingly
         \getparameters[loc][#1]
         % Was a section number specified?
         \doifdefined{locsec} {
             § \locsec
         }
     } {
         % otherwise, just print the input as-is
         #1
     }
\stoptexdefinition

\def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find([==[#2]==],"^"..[==[#1]==]))}}

\def\currentbtxloctext{\loc[sec=31]}

\starttext
     § 31\blank%the raw text we expect
     \currentbtxloctext\blank%the text as produced by the macro
     \doifelse{\currentbtxloctext}{§ 31}{YES}{NOP}\blank% should output 
YES, but doesn't
     \DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP}\blank% should 
output YES, but doesn't

\stoptext

```

What am I missing here?
Expansion hell ... and i fear that you draw yourself into more and more 
trouble with this approach (which is why you don't find that kind of 
hackery in the core unless we're real desperate) so maybe try to explain 
what the real problem is that needs to be solved. Parsing tex is seldom 
a solution (at least not in context).


You can add:

\edef\Whatever{\currentbtxloctext}\meaning\Whatever
\doifelse{\currentbtxloctext}{§ 31}{YES}{NOP}\blank

and see what comes back. Now, as always in tex, there's of course a 
solution because after all it's a programming language too (and at some 
point these solutions start looking so complex that one enters guru state)


\starttexdefinition loc [#1]
\beginlocalcontrol
\doifassignmentelse{#1} {
\getparameters[loc][#1]
\doifdefinedelse{locsec} {
\endlocalcontrol
§ \locsec
} {
\endlocalcontrol
}
} {
\endlocalcontrol
#1
}
\stoptexdefinition

a curious mix between a fully expanded result, using protected macros 
and hiding what tex does but hard to explain


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] Checking for a Unicode prefix of a Unicode string

2021-11-27 Thread Joey McCollum via ntg-context
All right, I think I've solved the expansion problem I described before: to
ensure that the first input is expanded when it is passed to Lua, I have to
pass it as [==[#1]==], not "#1". But the updated MWE below still does not
seem to work, as the \DoIfPrefixElse macro is printing "NOP" instead of
"YES":

```

\starttexdefinition loc [#1]

\doifassignmentelse{#1} {

% if an assignment, then parse and format accordingly

\getparameters[loc][#1]

% Was a section number specified?

\doifdefined{locsec} {

§ \locsec

}

} {

% otherwise, just print the input as-is

#1

}

\stoptexdefinition


\def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find([==[#2]==],"^"..[==[#1]==]))}}


\def\currentbtxloctext{\loc[sec=31]}


\starttext

\currentbtxloctext\blank

\DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP}

\stoptext
```

Indeed, if I add a simple \doifelse equality check, it looks like the value
I expect is not the same as what the macro produces, even though they look
identical:

```

\starttexdefinition loc [#1]
\doifassignmentelse{#1} {
% if an assignment, then parse and format accordingly
\getparameters[loc][#1]
% Was a section number specified?
\doifdefined{locsec} {
§ \locsec
}
} {
% otherwise, just print the input as-is
#1
}
\stoptexdefinition

\def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find([==[#2]==],"^"..[==[#1]==]))}}

\def\currentbtxloctext{\loc[sec=31]}

\starttext
§ 31\blank%the raw text we expect
\currentbtxloctext\blank%the text as produced by the macro
\doifelse{\currentbtxloctext}{§ 31}{YES}{NOP}\blank% should output YES,
but doesn't
\DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP}\blank% should output
YES, but doesn't
\stoptext
```

What am I missing here?

Joey

On Fri, Nov 26, 2021 at 11:57 AM Joey McCollum 
wrote:

> Thanks! Invoking string.find(str,"^"..pre) is certainly much easier. This
> sort of thing would be a nice general-purpose helper function. Denis Maier
> and I should have a "wish list" of desired helpers and features (mostly
> related to bibliographies/publication support) ready for you (and Alan)
> sometime soon.
>
> But for now, it looks like I still need to work out errors that arise when
> I pass a macro as the "str" input to be searched. I've defined a \loc macro
> that accepts an assignment and outputs a formatted string, and later, I
> want to check if this macro (after it has been fully expanded) starts with
> a certain prefix. A minimal (non-)working example follows:
>
> ```
>
> \starttexdefinition loc [#1]
>
> \doifassignmentelse{#1} {
>
> % if an assignment, then parse and format accordingly
>
> \getparameters[loc][#1]
>
> % Was a section number specified?
>
> \doifdefined{locsec} {
>
> § \locsec\btxcomma
>
> }
>
> } {
>
> % otherwise, just print the input as-is
>
> #1
>
> }
>
> \stoptexdefinition
>
>
>
> \def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find("#2","^".."#1"))}}
>
>
> \def\currentbtxloctext{\loc[sec=31]}
>
>
> \starttext
>
> \DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP}
>
> \stoptext
> ```
>
> Lua is throwing an "invalid escape sequence near '"\l'" error, which is
> presumably because the macro \loc[sec=31] is not being expanded. How do I
> fix this?
>
> Thanks!
>
> Joey
>
> On Fri, Nov 26, 2021 at 3:46 AM Hans Hagen via ntg-context <
> ntg-context@ntg.nl> wrote:
>
>> On 11/26/2021 7:42 AM, Joey McCollum via ntg-context wrote:
>> > I wasn't aware of a general-purpose "doifstartswith" macro in ConTeXt
>> > (the \doifnextcharelse macro only works one character at a time, and
>> the
>> > \doifinstring macros may capture substrings that are not prefixes), and
>> > I'd like to develop one for something I'm working on. I've been trying
>> > to do this in Lua, as that seemed like the most natural approach.
>> > Normally, something like this would work fine as a foundation:
>> >
>> > ```
>> >function isprefix(prefix, str)
>> >  if string.sub(str, 1, string.len(prefix)) == prefix then
>> >return true
>> >  end
>> >  return false
>> >end
>> > ```
>>
>> how about
>>
>> if string.find(str,"^"..prefix) then
>>
>> in:
>>
>> \starttext
>>
>>
>> \def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find("#2","^".."#1"))}}
>>
>> \DoIfPrefixElse{pre}{prefix}{YES}{NOP}
>> \DoIfPrefixElse{pre}{suffix}{YES}{NOP}
>>

Re: [NTG-context] Typographical quotes

2021-11-27 Thread Denis Maier via ntg-context
Oh, but I’m still on ConTeXt  ver: 2021.10.24 21:45
I’ll need to check after an update.

Denis

Von: Maier, Denis Christian (UB)
Gesendet: Samstag, 27. November 2021 17:47
An: 'mailing list for ConTeXt users' 
Cc: Jean-Philippe Rey 
Betreff: AW: [NTG-context] Typographical quotes

Same here, but I get correct results with the –luatex flag

Denis

Von: ntg-context 
mailto:ntg-context-boun...@ntg.nl>> Im Auftrag von 
Jean-Philippe Rey via ntg-context
Gesendet: Samstag, 27. November 2021 16:22
An: ntg-context@ntg.nl<mailto:ntg-context@ntg.nl>
Cc: Jean-Philippe Rey 
mailto:jean-philippe@centralesupelec.fr>>
Betreff: [NTG-context] Typographical quotes

Dear list,

When typing a straight quotation mark, I used to get a curly apostrophe. But 
with a recent version of ConTeXt, I now get a straight apostrophe. Is there a 
new option to convert automatically straight into curly apostrophes ?

\starttext
John's
\stoptext

gives


where I used to get

Here is my log file

resolvers   | formats | executing runner 'run luametatex format': 
/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-osx-64/bin/luametatex
 --jobname="./mfe-quote.tex" 
--fmt=/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt
 
--lua=/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui
  --c:currentrun=1 --c:fulljobname="./mfe-quote.tex" 
--c:input="./mfe-quote.tex" --c:kindofrun=1 --c:maxnofruns=9 
--c:texmfbinpath="/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-osx-64/bin"
system  >
system  > ConTeXt  ver: 2021.11.19 09:31 LMTX  fmt: 2021.11.22  int: 
english/english
system  >
system  > 'cont-new.mkxl' loaded
open source > level 1, order 1, name 
'/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 1, order 1, name 
'/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > files > jobname './mfe-quote', input './mfe-quote.tex', 
result './mfe-quote'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 1, order 2, name './mfe-quote.tex'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
backend > xmp > using file 
'/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages   > flushing realpage 1, userpage 1, subpage 1
close source> level 1, order 2, name './mfe-quote.tex'
mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: 
/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.013 seconds, 0 scans with 
scantime 0.000 seconds, 0 shared scans, 9 found files, scanned paths: 
mkiv lua stats  > stored bytecode data: 499 modules (0.248 sec), 99 tables 
(0.013 sec), 598 chunks (0.260 sec)
mkiv lua stats  > traced context: maxstack: 1607, freed: 0, unreachable: 1607
mkiv lua stats  > cleaned up reserved nodes: 71 nodes, 9 lists of 435
mkiv lua stats  > node memory usage: 6 attribute, 3 attribute_list, 1 glue, 58 
glue_spec, 3 kern, 2 penalty, 2 temp
mkiv lua stats  > node list callback tasks: 12 unique task lists, 7 instances 
(re)created, 45 calls
mkiv lua stats  > used backend: pdf
mkiv lua stats  > jobdata time: 0.001 seconds saving, 0.000 seconds loading
mkiv lua stats  > callbacks: file: 57, saved: 146, direct: 2, function: 973, 
value: 1, message: 0, bytecode: 598, late 0, total: 1777 (0 per page)
mkiv lua stats  > randomizer: initialized with value 0.051172108195605
mkiv lua stats  > loaded patterns: en::1, load time: 0.000
mkiv lua stats  > loaded fonts: 2 files: latinmodern-math.otf, 
lmroman12-regular.otf
mkiv lua stats  > font engine: otf 3.119, afm 1.513, tfm 1.000, 7 instances, 3 
shared in backend, 3 common vectors, 0 common hashes, load time 0.151 seconds
mkiv lua stats  > font embedding time: 0.002 seconds, 1 fonts
mkiv lua stats  > result saved in file: mfe-quote.pdf, compresslevel 1, 
objectcompresslevel 3
mkiv lua stats  > positions: 4 collected, 0 deltas, 0 shared partials, 0 
partial entries
mkiv lua stats  > used platform: osx-64, type: unix, binary subtree: 
texmf-osx-64
mkiv lua stats  > used engine: luametatex version: 2.093, functionality level: 
2027, format id: 603, compiler: clang
mkiv lua stats  > 

Re: [NTG-context] Math prime issues for some fonts

2021-11-27 Thread Hans Hagen via ntg-context

On 11/26/2021 10:05 PM, Mikael Sundqvist via ntg-context wrote:

Hi Jack,

I've been working with Hans on math in general and primes in
particular in the last week. I do not understand all the details, but
I think primes are handled differently now, and that one essentially
need to have some tuning in goodie files (the reason is that they are
done differently in different fonts, and that there was not simple
one-fits-all solution). We have not touched eulernova yet.

It's not easy to explain in a few sentences so here we go.

In unicode, math is a script. There are plenty scripts supported and 
unicode supports their properties. Unicode tries to avoid duplicates 
but we have an latin A and a greek A, and we have plenty of nukta in 
indic scripts even if the shapes are the same. In math however, for some 
reason, we have ended up with some math code points being shared. So, we 
don't have a small italic h (because every italic h is supposed to be 
plank constant) and we don't have primes because minutes are primes. 
Maybe today some strong arguing could avoid those anomalities but i fear 
that we're stuck with it forever now (math legacy stuff etc).


This results of for instance holes in math alphabets (less such holes in 
other scripts) that every application has to deal with and we end up 
with symbols that depending on their usage need some interpretation and 
handling. Btw, a side effect is that where an one can distinguish 
between f as variable or function by using an indicator this is not 
possible with h so in copy/paste or interpretation one has to guess what 
it is. The same is true for prime like symbols: are they minutes or primes.


So, as the unicode slot for a prime is used for minutes (in text) the 
symbols in a font ends up as superscript but in math text mode it would 
not be in the right spot. Keep in mind that we have specific math fonts 
so ther ei sno real reason for not making primes consistent in text, 
script and scriptscript (ssty features): it simply is not done which in 
turn is probably a side effect of cmr being uses as template even if for 
other properties cmr fundamentally differs from open type math fonts.


Anyway, in the traditional tex approach to primes, the prime symbol is 
taken from the script variant, where is has a different size (or not), 
different boundingbox (or not) and/or is already raised (or not). Also, 
in tex the ' is made into an "active in math mode" character (one of 
few, an dit might even be that the reason for active math characters is 
in primes) in order to ease input. It effectively being a macro means 
that it can do some lookahead in order to (1) position itself as well as 
(2) make it possible to be followed by a superscript and/or subscript.


And, because the way math is coded and dealt with in tex basically has 
been chisseled in stone early after tex showed up, that situation is 
supposed to be dealt with: a multi-purpose shape with somewhat weird 
properties, parsing preferably in a robust way, positioning in a 
superscript like position (before or after a script), i fpossible 
intercepting interference etc. And ... all that is resembled in unicode 
math as well as all these math fonts out there.


But it is not the way i want to deal with it in context, also because 
there is even more involved (which i happily let you guess about). I 
want clean solution with no fancy (and somewhat obscure) tex macro doing 
magic that only a few are supposed to understand.


When we started with luatex, and thereby mkiv, we immediately went full 
unicode math (also with old fonts) and primes (plus a few other things) 
were a pain in the butt from the start due to fonts. For more than a 
decade I tried to catch this automagically by runtime patching and that 
works ok for most fonts but as recently more opentype math fonts showed 
up, some actually more opentypish than what we had, the decision was 
made to delegate this to the goodies mechanism than Mikael refers to. It 
means that we can control individual fonts (and users can patch that 
themselves if needed) because in the end, as always with fonts, scripts, 
languages and probably most of tex, heuristics tend to fail and clash.


It means that, as Wolfgang explained, you need to specify a goodie file 
with \definefontfamily (could be your own copy with personal 
preferences). Just for the record, some more is done on goodies and some 
more runtime patching might move that goodie control. It actually does 
mean that when a font (if ever) gets updated we need to check things 
which is why a mismatch in version will be reported on your console. 
Among the things we still need to discuss are if we wil freeze fonts in 
the distribution (only explicit updates) and if we drop official support 
for obsolete or (just) bad (looking) math fonts.


So to summarize: with primes we have to deal with (1) frozen tex math 
expectations that won't change (although in context we're free to do 
so), whic

Re: [NTG-context] Checking for a Unicode prefix of a Unicode string

2021-11-26 Thread Joey McCollum via ntg-context
Thanks! Invoking string.find(str,"^"..pre) is certainly much easier. This
sort of thing would be a nice general-purpose helper function. Denis Maier
and I should have a "wish list" of desired helpers and features (mostly
related to bibliographies/publication support) ready for you (and Alan)
sometime soon.

But for now, it looks like I still need to work out errors that arise when
I pass a macro as the "str" input to be searched. I've defined a \loc macro
that accepts an assignment and outputs a formatted string, and later, I
want to check if this macro (after it has been fully expanded) starts with
a certain prefix. A minimal (non-)working example follows:

```

\starttexdefinition loc [#1]

\doifassignmentelse{#1} {

% if an assignment, then parse and format accordingly

\getparameters[loc][#1]

% Was a section number specified?

\doifdefined{locsec} {

§ \locsec\btxcomma

}

} {

% otherwise, just print the input as-is

#1

}

\stoptexdefinition


\def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find("#2","^".."#1"))}}


\def\currentbtxloctext{\loc[sec=31]}


\starttext

\DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP}

\stoptext
```

Lua is throwing an "invalid escape sequence near '"\l'" error, which is
presumably because the macro \loc[sec=31] is not being expanded. How do I
fix this?

Thanks!

Joey

On Fri, Nov 26, 2021 at 3:46 AM Hans Hagen via ntg-context <
ntg-context@ntg.nl> wrote:

> On 11/26/2021 7:42 AM, Joey McCollum via ntg-context wrote:
> > I wasn't aware of a general-purpose "doifstartswith" macro in ConTeXt
> > (the \doifnextcharelse macro only works one character at a time, and the
> > \doifinstring macros may capture substrings that are not prefixes), and
> > I'd like to develop one for something I'm working on. I've been trying
> > to do this in Lua, as that seemed like the most natural approach.
> > Normally, something like this would work fine as a foundation:
> >
> > ```
> >function isprefix(prefix, str)
> >  if string.sub(str, 1, string.len(prefix)) == prefix then
> >return true
> >  end
> >  return false
> >end
> > ```
>
> how about
>
> if string.find(str,"^"..prefix) then
>
> in:
>
> \starttext
>
>
> \def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find("#2","^".."#1"))}}
>
> \DoIfPrefixElse{pre}{prefix}{YES}{NOP}
> \DoIfPrefixElse{pre}{suffix}{YES}{NOP}
>
> \stoptext
>
> utf strings are just sequences of bytes so matching works
>
> when you want to do more in lua you can decide for
>
> \startluacode
> interfaces.implement {
>  name  = "DoIfPrefixElse",
>  arguments = { "argument", "argument" },
>  actions   = function(pre,str)
>  commands.doifelse(string.find(str,"^"..pre))
>  end
> }
> \stopluacode
>
> \DoIfPrefixElse{pre}{prefix}{YES}{NOP}
> \DoIfPrefixElse{pre}{suffix}{YES}{NOP}
>
> but in any case: make sure that you don't clash with built in ...
>
> if needed i can make a set of fast(er) ones but someone has to collect a
> list of 'handy helpers' first
>
> 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
>
> ___
>
___
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] Checking for a Unicode prefix of a Unicode string

2021-11-25 Thread Joey McCollum via ntg-context
I wasn't aware of a general-purpose "doifstartswith" macro in ConTeXt (the
\doifnextcharelse macro only works one character at a time, and the
\doifinstring macros may capture substrings that are not prefixes), and I'd
like to develop one for something I'm working on. I've been trying to do
this in Lua, as that seemed like the most natural approach. Normally,
something like this would work fine as a foundation:

```
  function isprefix(prefix, str)
if string.sub(str, 1, string.len(prefix)) == prefix then
  return true
end
return false
  end
```

Unfortunately, if I want to check for prefixes that include two-byte
characters like § and ¶, then the positions and string lengths that I
specify no longer correspond to the actual byte offsets and lengths that
Lua uses. I'm aware of the utf8 plugin that was intended to address this
issue, but the following code also isn't working:

```
  function sbl.isprefix(prefix, str)
-- lua is devious and measures string length in bytes, not chars,
-- so we can't just use string.sub and string.len as we normally would.
local i = utf8.offset(str, 1)
local j = utf8.offset(str, utf8.len(prefix) + 1) - 1
if string.sub(str, i, j) == prefix then
  return true
end
return false
  end
```

The only other detail that may be relevant is that I'm passing a macro as
the "str" input. But this should be expanded when the Lua code is
manipulating it, right?

I'm sure there's something obvious that I'm doing wrong, but I've been
trying to get this to work for at least a couple hours now, and I don't
know what else to try. If there is a simple fix to my Lua code or an
existing ConTeXt macro that will get the job done, I'd appreciate it!

Joey
___
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] Macro for a comma separated list of authors

2021-11-24 Thread Jairo A. del Rio via ntg-context
Hola.

Maybe you need \commalistsentence?

\def\Autores{%
  {Luis David Gómez-Méndez, Ph. D.},
  {Adriana del Pilar Pulido-Villamarín, M. Sc.},
  {Rubiela Castañeda-Salazar, M. Sc.},
  {Juan Carlos Ulloa-Rubiano, Ph. D.},
  {Adriana Matiz-Villamil, M. Sc.},
  {Fidson Juarismy Vesga-Pérez, Ph. D}%
}
\starttext
\commalistsentence[\Autores][{;\space},{\space\letterampersand\space}]
\stoptext

Check lang-lab.mkxl for other goodies and examples.

Best regards,

Jairo

El mié, 24 de nov. de 2021 a la(s) 19:10, Andres Conrado Montoya via
ntg-context (ntg-context@ntg.nl) escribió:

> I'm trying to produce a document with several authors, using macros for
> comma separated lists. My MWE is as follows:
>
> %%
> \def\autores{%
>   {Luis David Gómez-Méndez, Ph. D.},
>   {Adriana del Pilar Pulido-Villamarín, M. Sc.},
>   {Rubiela Castañeda-Salazar, M. Sc.},
>   {Juan Carlos Ulloa-Rubiano, Ph. D.},
>   {Adriana Matiz-Villamil, M. Sc.}%
> }
>
> \def\lastAutor{Fidson Juarismy Vesga-Pérez, Ph. D}
>
> \def\autorParaLista#1{#1;\space}
> \def\listaAutores{\processcommacommand[\autores]\autorParaLista &
> \lastAutor: autores.}
>
> \starttext
>
> \listaAutores
>
> \stoptext
> %%%
>
> So far, no luck trying to extract the last item from a comma separated
> list. That's the reason I created a "\lastAutor" macro, so I can treat the
> last one differently.
>
> This produces:
>
> %%
> Luis David Gómez-Méndez, Ph.D.; Adriana del Pilar Pulido-Villamarín, M.
> Sc.; Rubiela Castañeda-Salazar, M. Sc.; Juan Carlos Ulloa-Rubiano, Ph.D.;
> Adriana Matiz-Villamil, M. Sc.; & Fidson Juarismy Vesga-Pérez, Ph.D:
> autores.
> %%
>
> However, what I'm trying to get is:
>
> %%
> Luis David Gómez-Méndez, Ph.D.; Adriana del Pilar Pulido-Villamarín, M.
> Sc.; Rubiela Castañeda-Salazar, M. Sc.; Juan Carlos Ulloa-Rubiano, Ph.D.;
> Adriana Matiz-Villamil, M. Sc. & Fidson Juarismy Vesga-Pérez, Ph.D: autores.
> %%
>
> Which is very close to what I need, except the ";" just before the "&". So
> the question is: is it possible to do this in a more effective or simpler,
> or better way, and write a macro that outputs something like "Author1;
> Author2; Author3 & Author4: authors.", given a comma separated list of
> authors?
>
> --
> Andrés Conrado Montoya
> Andi Kú
> andresconr...@gmail.com
> http://sesentaycuatro.com
> http://messier87.com
> http://chiquitico.org
> 
> Los fines no justifican los medios, porque la medida verdadera de nuestro
> carácter está dada por los medios que estamos dispuestos a utilizar, no por
> los fines que proclamamos.
> 
>
> “You develop an instant global consciousness, a people orientation, an
> intense dissatisfaction with the state of the world, and a compulsion to do
> something about it. From out there on the moon, international politics look
> so petty. You want to grab a politician by the scruff of the neck and drag
> him a quarter of a million miles out and say, ‘Look at that, you son of a
> bitch.’” — Apollo 14 astronaut Edgar Mitchell
>
> ___
> 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] Neovim and ConTeXt

2021-11-24 Thread Aditya Mahajan via ntg-context
On Wed, 24 Nov 2021, Clint Grady via ntg-context wrote:

> Are there any known ways to use ConTeXtLMTX with Neovim? 

Not that I am aware of. 

> I read the wiki page for Vim and it describes a hack to get latex-suite to 
> work with ConTeXt. [1] It wouldn't be too much work to submit a pull-request 
> to VimTeX (despite the name, this is for Neovim) [2] to add ConTeXt support, 
> but I don't want to duplicate work if someone else has already done it.

Please do so. There are different levels of what it means for a editor to 
support a language. I guess that you are talking about async compilation 
support, but keep in mind that context has a different error format than latex 
for that needs to be set different as well. It will be nice to have support to 
pass command line flags via the editor. Context also has a (slightly buggy) 
syntax checker (mtxrun --script check ..) which could be integrated.

I don't know what is the current state of context syntax highlighting support 
in vim/neovim (I use a highly modifies syntax file). It will be nice to have 
support of \startMP(code|page) and \startluacode to do syntax highlighting for 
metapost and lua. Metafun has added some new keywords and it will be nice to 
support those. I believe that context ships with a file that outputs all these 
keywords but I don't remember the name. 

It will be cool to have a more integrated support, like showing table of 
contents in the sidebar, (these are stored as a lua table in the tuc file and 
neovim has inbuilt lua interpreter, so...), modifying the jump keys so that so 
that ]] etc work correctly (with the context syntax) and so on. 

I'll be happy to test your pull request if you want. 

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] \doifanydefinedelse, \doifallundefinedelse

2021-11-19 Thread Hans Hagen via ntg-context

On 11/19/2021 4:26 PM, Joey McCollum via ntg-context wrote:
I was checking the "Branches and Decisions" wiki entry at 
https://wiki.contextgarden.net/System_Macros/Branches_and_Decisions 
<https://wiki.contextgarden.net/System_Macros/Branches_and_Decisions>, 
and I saw that ConTeXt has a useful \doifalldefinedelse macro that 
checks a comma-separated list of macro names and proceeds according to 
whether or not all of the macros with those names are defined. I was 
curious as to whether or not there is also a \doifanydefinedelse (or, 
equivalently, a \doifallundefinedelse) macro that would check if /any 
/of the macros with names in the comma-separated list is defined (or, 
equivalently, if all of them are undefined). I don't see any mention of 
such a macro on the wiki page, so I wanted to ask: has something like 
this already been implemented, and if not, is there a simple way to do a 
check like this? This functionality would be useful for performing some 
checks on a key-value assignment, and passing a comma-separated list to 
a macro would be much cleaner than doing a bunch of nested if-else blocks.

i'll add \doifelseallundefined

btw, you don't need to nest if's in lmtx:

\ifdefined\foo
\orelse\ifdefined\ofo
\orelse\ifdefined\oof
\else
\fi

sort of stays on the same level ... makes tex bit more like other 
programming languages (but of course also makes macros less impressive)


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] \doifanydefinedelse, \doifallundefinedelse

2021-11-19 Thread Joey McCollum via ntg-context
I was checking the "Branches and Decisions" wiki entry at
https://wiki.contextgarden.net/System_Macros/Branches_and_Decisions, and I
saw that ConTeXt has a useful \doifalldefinedelse macro that checks a
comma-separated list of macro names and proceeds according to whether or
not all of the macros with those names are defined. I was curious as to
whether or not there is also a \doifanydefinedelse (or, equivalently, a
\doifallundefinedelse) macro that would check if *any *of the macros with
names in the comma-separated list is defined (or, equivalently, if all of
them are undefined). I don't see any mention of such a macro on the wiki
page, so I wanted to ask: has something like this already been implemented,
and if not, is there a simple way to do a check like this? This
functionality would be useful for performing some checks on a key-value
assignment, and passing a comma-separated list to a macro would be much
cleaner than doing a bunch of nested if-else blocks.

Joey
___
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] Math in LMTX and definemathcommand

2021-11-17 Thread Hans Hagen via ntg-context

On 11/17/2021 10:59 PM, Otared Kavian via ntg-context wrote:

Hi Hans,

Thank you for the new upload and the rewriting of the math fonts stuff, thanks 
also to Mikael S. I did several tests on real size math projects and did not 
notice important issues.


you missed the multiple primes issue (a bit too agressive lua code 
reduction, fixed in next upload)



The two issues I noticed, show up mainly with LucidaOT, and are explained in 
the following example:


thanks, mikael collects all that


If $A \subset {\Bbb R}$ is a set, its interior is denoted by $\interior{A}$. 
Can one have the circle over $A$ slightly bigger (probbaly this is font 
dependent)?


in principle we can scale individual glyphs (and when not default users 
can add their own lfg files)

The built-in commands $\liminf$ and $\limsup$ do not work properly with 
LucidaOT (I tried other fonts and there they are fine):


hm .. (in case of lucida, also check cambria and garamond as these have 
staircase kerns too so they are somewhat similar)


mikael is making test (and in the meantime i'm experimenting a bit 
forther with compact fonts because all has to work in that mode too)


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] directsetup vs setups

2021-11-15 Thread Wolfgang Schuster via ntg-context



Rik Kabel schrieb am 15.11.2021 um 22:51:


Wolfgang,

Can you expand on the following statements from your reply?

You can run Hans example with MkIV and the differences should be
even bigger because the check for [] is slower here while in LMTX
it's a engine feature. The main difference in LMTX is a extra
expansion for \setup compared to \directsetup.

there is no difference between \setup and \directsetup

Are you saying:

1. When [] are used with \setup, expansion of the contents is done 
differently than when {} are used.


It doesn't matter which form you use for \setup.

What I'm trying to say is that \setup is slower (or better was slower in 
MkIV) than \directsetup because \setup has to check first if the name is 
passed within brackets or as normal argument in braces.


The code in MkIV would look similar to this:

\def\setup
  {\doifnextcharelse[
 \setup_brackets
 \setup_braces}

\def\setup_brackets[#1]%
  {\directsetup{#1}}

\def\setup_braces#1%
  {\directsetup{#1}}

2. There is no significant processing time difference between \setup 
and \directsetup.




When I run the following example on my machine

\starttext

\startsetups [dummy]
\stopsetups

\testfeatureonce{10}{\setup  {test}} \elapsedtime \par
\testfeatureonce{10}{\directsetup{test}} \elapsedtime \par

\stoptext

I get these times.

# MkIV

\setup   : 0.136s
\directsetup : 0.079s

# LMTX

\setup   : 0.083 seconds
\directsetup : 0.071 seconds

Add additional stuff in the setup environment and the difference between 
\setup and \directsetup doesn't matter anymore.


3. There is additional expansion performed for \setup compared to 
\directsetup.




Although this isn't completely true (but very close) the definition for 
\setup in LMTX is like this:


\def\setup#1{\directsetup{#1}}

4. Under LMTX, because {} and [] handling overhead is so similar, the 
most visible processing time difference to users is from the 
difference in  expansion between \setup and \directsetup.


I think you are saying that 2, 3, and 4 are true, but that 1 is not true.

If that is the case, can you provide an example that demonstrates the 
difference in expansion between \setup and \directsetup?


Also, as far as expansion, is \fastsetup like \setup or like \directsetup?



\setup and \directsetup are similar. \fastsetup is like the name implies 
a faster version which ignores grid mode and doesn't care whether the 
requested environment even exists.


My simple testing shows no difference between setup, directsetup, and 
fastsetup for namespace set and reset. Is it your understanding that 
they all behave the same?




No, \fastsetup behaves different because it leaves \relax\empty in the 
input when you pass the name of a not existing environment.


It shouldn't matter in normal usage but below are two examples.


Example 1:

\starttext

\tex{directsetup}

\scratchcounter 12\directsetup{unknown_a}34

\the\scratchcounter

\tex{fastsetup}

\scratchcounter 12\fastsetup{unknown_b}34

\the\scratchcounter

\stoptext


Example 2:

\starttext

\normalexpanded{\noexpand\firstoftwoarguments\directsetup{unknown_a}xy}

\normalexpanded{\noexpand\firstoftwoarguments\fastsetup{unknown_b}xy}

\stoptext


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] directsetup vs setups

2021-11-15 Thread Wolfgang Schuster via ntg-context

Rik Kabel via ntg-context schrieb am 15.11.2021 um 19:06:

So, some follow-up questions:

1. What do you mean by "only one setup" in the description of 
directsetup and fastsetup? I have examples of using two different 
directsetup in one after key, so it does not seem to mean that.


With \directsetup, \fastsetup and \setup (I'm correcting Hans here) you 
can pass only the name of a single setups-environment as argument, e.g.


    \directsetup{my_fancy_setup}

while \setups allows you to pass a list of names, e.g.

    \setups[custom_setup_a,custom_setup_b,...]

2. What is meant by saying that directsetup supports gridsnapping? Do 
you mean that fastsetup does not? (If that is the case, should a 
module writer not use fastsetup because it might be used in a document 
that requires a grid?)


The \startsetups environment has a optional argument which accepts (at 
the moment) the "grid" keyword to set values which are only used when 
grid snapping (\setuplayout[grid=yes]) is enabled, e.g.


\startsetups [grid] [my_fancy_setup]
    % settings which are used when grid mode is enabled
\stopsetups

\startsetups [my_fancy_setup]
    % settings which are used when grid mode is disabled
    % or when no grid related setups with the same name exist
\stopsetups

When you now use \directsetup{my_fancy_setup} (or \setup[...]) ConTeXt 
checks if grid mode is enabled and selects the right settings but 
\fastsetup never performs this check and always uses the non grid 
settings. The \fastsetup command is even more basic because it doesn't 
even check if there is a setups environment with the given name which is 
done by the other commands.


3. Is the support for {} and [] in setup simply to maintain legacy 
support for {}, or are there reasons to choose one over the other? I 
do see consistently faster times with the curlies.


You can run Hans example with MkIV and the differences should be even 
bigger because the check for [] is slower here while in LMTX it's a 
engine feature. The main difference in LMTX is a extra expansion for 
\setup compared to \directsetup.


4. Are there operations that are supported in directsetup that are not 
supported in setup or fastsetup? Are there operations supported in 
fastsetup that are not supported in setup or directsetup?


There is no difference between \setup and \directsetup but \fastsetup 
should only be used when you can ensure the requested environment exists.


5. Is it fair to say that setup can do the most, directsetup a bit 
less, and fastsetup is the most restrictive? Except for the most 
performance-constrained documents, setup is a safe choice, but when 
constructing modules or performance tuning, the others might be tested?




As I already wrote before there is no difference between \setup and 
\directsetup. When you care about performance \directsetup is the wrong 
start because you won't notice a difference.


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] Paragraph break over pages with hanging float

2021-11-15 Thread Adam Reviczky via ntg-context
Thank Hans,

I thought something along those lines, but thank you for the explanation.
Indeed, I probably should do it differently.

If the "force" option would not break anything then I would like to try
that, otherwise it is all fine as is.
This is not really critical and I will rather change the float in my
document than create more issues.

Regards,
Adam

On Mon, Nov 15, 2021 at 2:00 PM Hans Hagen  wrote:

> On 11/15/2021 6:26 AM, Adam Reviczky via ntg-context wrote:
> > Hi,
> >
> > Is there a way to allow a paragraph to break over two pages (between the
> > paragraph start and the placement of the float) with a hanging float
> > further down the paragraph?
> >
> > MWE:
> >
> > \starttext
> > \input lorem
> > \blank[20*line]
> >
> > % commenting out the hanging float allows paragraph break
> > \startplacefigure[location={right,15*hang}]
> > \framed[width=3cm,height=2cm]{graphic}
> > \stopplacefigure
> >
> > \dorecurse{10}{\input lorem}
> > \stoptext
> >
> > When I remove the hanging float, the paragraph is broken down at the
> > first pagebreak.
> > With the float, the paragraph starts always on the next page, regardless
> > of the space left on the previous page.
> Yes and no ... tex cannot really lookahead here. But thanks to some
> recent new trickery I can provide:
>
>location={right,15*hang,force}
>
> However, it really is up to the user to check of all works out right
> (but i assume that the 15*hang is also soemthing specific for the
> situation). Adapting this already (too) complex mechanism too much is
> asking for issues.
>
> 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] Paragraph break over pages with hanging float

2021-11-15 Thread Hans Hagen via ntg-context

On 11/15/2021 6:26 AM, Adam Reviczky via ntg-context wrote:

Hi,

Is there a way to allow a paragraph to break over two pages (between the 
paragraph start and the placement of the float) with a hanging float 
further down the paragraph?


MWE:

\starttext
\input lorem
\blank[20*line]

% commenting out the hanging float allows paragraph break
\startplacefigure[location={right,15*hang}]
\framed[width=3cm,height=2cm]{graphic}
\stopplacefigure

\dorecurse{10}{\input lorem}
\stoptext

When I remove the hanging float, the paragraph is broken down at the 
first pagebreak.
With the float, the paragraph starts always on the next page, regardless 
of the space left on the previous page.
Yes and no ... tex cannot really lookahead here. But thanks to some 
recent new trickery I can provide:


  location={right,15*hang,force}

However, it really is up to the user to check of all works out right 
(but i assume that the 15*hang is also soemthing specific for the 
situation). Adapting this already (too) complex mechanism too much is 
asking for issues.


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] Emojis showing up in black instead of colours

2021-11-15 Thread Vincent Hennebert via ntg-context
On Fri, 2021-11-12 at 23:00 +0100, Pablo Rodriguez via ntg-context
wrote:
> On 11/12/21 7:08 PM, Vincent Hennebert via ntg-context wrote:
> > Hi there,
> > 
> > freshly upgraded LMTX installation. TwemojiMozilla.ttf downloaded
> > from
> > GitHub [1].
> > [...]
> > gives me pages of emojis, all black. According to what is described
> > on
> > Stackexchange, I should be getting colours. Am I doing something
> > wrong?
> 
> Hi Vincent,
> 
> if you are using Evince, try Okular to check color display.
> 
> I experienced something similar in the past.
> 
> Just in case it helps,

Thanks Pablo (and Hans). I am using Evince indeed and I would never
have thought of checking with another PDF viewer. All is well on the
ConTeXt side, my document displays fine in Firefox.

Thanks again,
Vincent

___
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] Emojis showing up in black instead of colours

2021-11-12 Thread Pablo Rodriguez via ntg-context
On 11/12/21 7:08 PM, Vincent Hennebert via ntg-context wrote:
> Hi there,
>
> freshly upgraded LMTX installation. TwemojiMozilla.ttf downloaded from
> GitHub [1].
> [...]
> gives me pages of emojis, all black. According to what is described on
> Stackexchange, I should be getting colours. Am I doing something wrong?

Hi Vincent,

if you are using Evince, try Okular to check color display.

I experienced something similar in the past.

Just in case 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 / 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] issue importing metadata from PDF

2021-11-12 Thread Pablo Rodriguez via ntg-context
On 11/12/21 8:04 PM, Hans Hagen via ntg-context wrote:
> On 11/12/2021 7:24 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> I’m afraid I don’t know how to extract the real information, I only
>> get:>>
>>table: 0x324279a3400
>
> then you're doing something wrong
> [...]
>  context(tostring(main.Info.ModDate))
>  context(tostring(main.Info.Title))
> [...]
> works quite okay

I think there is an issue with the PDF document, because it’s an issue
only with that PDF file I have. I can read the info from other files
pretty well.

I’m going to ask the author whether I may share the PDF document here,
so you can check it.

>> BTW, how can I use "\enabledirectives[backend.date=2021.02.01]" in Lua?
>
> grep is your friend ... (probably also in the cld manual)
>
> directives.enable('backend.date=2021.02.01')
>
> which of course doesn't mean that each one will work out as expected
> because timing matters

Sorry, I found in some document (or I found out it worked):

  directives.enable(directives.enable("backend.date", "no")

But I never thought that an equal sign could be the way.

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 / 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 Problem

2021-11-10 Thread Bruce Horrocks via ntg-context


> On 10 Nov 2021, at 21:11, skyhorse--- via ntg-context  
> wrote:
> 
> 
> 
> I'm using the linux version which is about a week to two weeks old.
> I've installed in in:
> /opt/context-lmtx
> 
> Which now contains the directories:
>$ ls /opt/context-lmtx
>  -->   bin  context-linux-64.zip  installation.pdf  install.sh  tex
> 
> Does this help in getting closer to solving the font problem for ubuntu that 
> I'm using with the stand alone?

That looks right for the root directory but there's a lot more than that for a 
working install, of course.

In your first email you said you used the command "txrun": I've no idea what 
that is because I've never needed it.

I just use the 'context' command so all you need do to check the install is 
working is (from your home directory) to run the command

  $ context --version

If that gives sensible output (about 6 lines) then do

  $ context my_example.tex

where "my_example.tex" is the name of the file containing your maths expression 
example as plain text. Hopefully you will get a successful run through 
resulting in a 'my_example.pdf' file containing a typeset version of the 
expression.

If after that it's still not working then report back to this mailing list with 
the error details.

Regards,
—
Bruce Horrocks
Hampshire, UK

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

maillist : ntg-context@ntg.nl / 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] Math font tips and tricks

2021-11-07 Thread Wolfgang Schuster via ntg-context

Hans Hagen via ntg-context schrieb am 07.11.2021 um 19:05:

On 11/6/2021 11:23 AM, Alexandre Christe via ntg-context wrote:

Dear all,

I'd like to know how best to work with font features regarding 
adaptations of math fonts.


For example, let's assume I'd like to use Minion Pro also for math 
typesetting. I've referred myself to this page of the Wiki 
https://wiki.contextgarden.net/Command/definefontfallback 
<https://wiki.contextgarden.net/Command/definefontfallback>. I have 
tried the following, but it fails for greek letters in math mode.


\definefallbackfamily
      [mainface] [math] [Minion Pro]
  [range={math:lowercaseitalic,math:uppercaseitalic,math:lowercasenormal,math:uppercasenormal},force=yes] 


\definefallbackfamily
      [mainface] [math] [Minion Pro]
  [range={math:lowercasegreekitalic,math:uppercasegreekitalic,math:lowercasegreeknormal,math:uppercasegreeknormal},force=yes] 


\definefallbackfamily
      [mainface] [math] [Minion Pro]
      [range=math:digitsnormal,features=f:lining,force=yes]
\definefontfamily     [mainface] [math] [Libertinus Math]

Thanks in advance for your support.
Do you get results at all? Hard to check as that math font is a 
commercial one. If it's an otf font, I suppose it can be used directly 
as mainface math.


Libertinus is a free Math font and Minion Pro was available with older 
installations of the Adobe Reader.


To use the Minion font for math you have to create a new fallback for 
each set of characters because you need always a different argument for 
the offset key. To make everything a bit easier the fallbackfamily 
command provides preset list which already set he necessary values for 
range and offset.


% \definefallbackfamily [mainface] [math] [Minion Pro]
%   [range=lowercasenormal]

\definefallbackfamily [mainface] [math] [Minion Pro] 
[preset=math:lowercasenormal]


% \definefallbackfamily [mainface] [math] [Minion Pro]
%   [range=lowercasenormal,offset=lowercaseitalic,tf=style:italic]

\definefallbackfamily [mainface] [math] [Minion Pro] 
[preset=math:lowercaseitalic]


% \definefallbackfamily [mainface] [math] [Minion Pro]
%   [range=digitsnormal,features=f:lining]

\definefallbackfamily [mainface] [math] [Minion Pro] 
[preset=math:digitsnormal]


\definefontfamily [mainface] [math] [Libertinus Math]

\starttext

\startformula
c^2 = a^2 + b^2
\stopformula

\switchtobodyfont[mainface]

\startformula
c^2 = a^2 + b^2
\stopformula

\stoptext

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] Math font tips and tricks

2021-11-07 Thread Hans Hagen via ntg-context

On 11/6/2021 11:23 AM, Alexandre Christe via ntg-context wrote:

Dear all,

I'd like to know how best to work with font features regarding 
adaptations of math fonts.


For example, let's assume I'd like to use Minion Pro also for math 
typesetting. I've referred myself to this page of the Wiki 
https://wiki.contextgarden.net/Command/definefontfallback 
<https://wiki.contextgarden.net/Command/definefontfallback>. I have 
tried the following, but it fails for greek letters in math mode.


\definefallbackfamily
      [mainface] [math] [Minion Pro]
 
  [range={math:lowercaseitalic,math:uppercaseitalic,math:lowercasenormal,math:uppercasenormal},force=yes]

\definefallbackfamily
      [mainface] [math] [Minion Pro]
 
  [range={math:lowercasegreekitalic,math:uppercasegreekitalic,math:lowercasegreeknormal,math:uppercasegreeknormal},force=yes]

\definefallbackfamily
      [mainface] [math] [Minion Pro]
      [range=math:digitsnormal,features=f:lining,force=yes]
\definefontfamily     [mainface] [math] [Libertinus Math]

Thanks in advance for your support.
Do you get results at all? Hard to check as that math font is a 
commercial one. If it's an otf font, I suppose it can be used directly 
as mainface math.


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] Regular online meet-up

2021-11-04 Thread Clyde Johnston via ntg-context
Last time I was at the ConTeXt conference, a few years back, there was talk 
about "monetization" of ConTeXt.  In other words, using ConTeXt to generate 
revenue.  I was wondering if this is still on the agenda.  Perhaps we could 
have a discussion on how to achieve this.  I have one possible idea but I would 
need some feedback from the more experienced members to ascertain its viability.

Clyde


-Original Message-
From: ntg-context [mailto:ntg-context-boun...@ntg.nl] On Behalf Of Henning 
Hraban Ramm via ntg-context
Sent: Tuesday, November 02, 2021 10:41 PM
To: mailing list for ConTeXt users
Cc: Henning Hraban Ramm
Subject: [NTG-context] Regular online meet-up

You’re invited to join next Tuesday, November 9th, 15:00 CET (UTC+1)

at https://lecture.senfcall.de/hen-rbr-rku-oke

ConTeXt users of all levels are welcome!

Hans offered to give a Q session again – please announce subjects you’d like 
to discuss ASAP, so that he can prepare.


From my part:

I will show off the novel that I’m sending to the printshop tomorrow. Typeset 
with extreme HZ...
A first run of these 332 pages needed just 33s on my old Mac – ConTeXt LMTX is 
fast! (In comparison: a first latexmk run of my short DTK article about the 
ConTeXt meeting, using the DTK LaTeX class, needed more than a minute. My 
ConTeXt book though, now at 298 pages and using *all* the features, needs ~8 
min for a first run.)

Also, I’m playing with different SyncTeX parsers for a LaTeX project, maybe 
there’s something to show/discuss next week. (SyncTeX *is* convenient with 
bigger projects! Using MuPDF lib, it should even be possible to combine SyncTeX 
information with PDF annotations to get corrections from PDF into ConTeXt 
sources...)


[Howto]
* No special software installation required; most modern browsers should work 
(WebRTC required).
* Open the above URL, accept the privacy statement,
* enter your name,
* click "join" (or "start" if you’re the first),
* click "with microphone", allow your browser to access it, check the audio.
(Some strings might be different, I see the German interface, you should get 
the main language of your browser.)
* Your microphone is muted if you join. Activate microphone and/or camera with 
the buttons at the bottom.
* Minimize the default presentation with the "screen" button, bottom right.

* If you’d like to share your screen or upload a file, you can make yourself 
the presenter: Click on your user name, change the setting, then you’ll see the 
"screen sharing" button beside the camera button; also there’s now "manage 
presentations" behind the "plus" button. Beware there is only one presenter, so 
don’t kill someone else’s presentation.

[Technical hints]
* Sound is usually better if you use a headset (less noise for everyone).

* Connection problems are mostly due to low bandwidth or high latency on your 
side, e.g. with mobile connections.
* If audio/video doesn’t work for you, you can still use the text chat.
* Screen sharing needs a lot of bandwidth.

* You can also join with a regular telephone (audio only, of course), call 
+49-6151-86275-22 (German landline); then you must enter a PIN that changes 
every time – if you need it, ask me for it via email. Mute/unmute your 
microphone with "0".

[Netiquette]
* Please use a name that we recognize from here. Some feel uncomfortable with 
anonymous lurkers.
* Mute your microphone while you’re not talking.
* It’s nice to show your face at least when you join.
* If there are connection problems, stop camera sharing.
* The room is set to “everyone’s a moderator“, I trust you...

Next time will be December 14th.

See you, 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
___

___
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] \doifinstring: strange characters on the output

2021-11-02 Thread Tomas Hala via ntg-context
Hi Hans,

ok, thank you, lmtx is a good way.

Tomáš 

> I would like to ask what is the cause of this behavior and how to
> use the \doifinstring to prevent the "fbf@" on the output.
partial expansion of a protected macro where one doesn't expect it
before i patch i let wolfgang check it
btw, you can prevent it by using 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
# -

 Tomáš Hála

Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28

http://akela.mendelu.cz/~thala
___
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] Regular online meet-up

2021-11-02 Thread Henning Hraban Ramm via ntg-context
You’re invited to join next Tuesday, November 9th, 15:00 CET (UTC+1)

at https://lecture.senfcall.de/hen-rbr-rku-oke

ConTeXt users of all levels are welcome!

Hans offered to give a Q session again – please announce subjects you’d like 
to discuss ASAP, so that he can prepare.


From my part:

I will show off the novel that I’m sending to the printshop tomorrow. Typeset 
with extreme HZ...
A first run of these 332 pages needed just 33s on my old Mac – ConTeXt LMTX is 
fast! (In comparison: a first latexmk run of my short DTK article about the 
ConTeXt meeting, using the DTK LaTeX class, needed more than a minute. My 
ConTeXt book though, now at 298 pages and using *all* the features, needs ~8 
min for a first run.)

Also, I’m playing with different SyncTeX parsers for a LaTeX project, maybe 
there’s something to show/discuss next week. (SyncTeX *is* convenient with 
bigger projects! Using MuPDF lib, it should even be possible to combine SyncTeX 
information with PDF annotations to get corrections from PDF into ConTeXt 
sources...)


[Howto]
* No special software installation required; most modern browsers should work 
(WebRTC required).
* Open the above URL, accept the privacy statement, 
* enter your name, 
* click "join" (or "start" if you’re the first),
* click "with microphone", allow your browser to access it, check the audio.
(Some strings might be different, I see the German interface, you should get 
the main language of your browser.)
* Your microphone is muted if you join. Activate microphone and/or camera with 
the buttons at the bottom.
* Minimize the default presentation with the "screen" button, bottom right.

* If you’d like to share your screen or upload a file, you can make yourself 
the presenter: Click on your user name, change the setting, then you’ll see the 
"screen sharing" button beside the camera button; also there’s now "manage 
presentations" behind the "plus" button. Beware there is only one presenter, so 
don’t kill someone else’s presentation.

[Technical hints]
* Sound is usually better if you use a headset (less noise for everyone).

* Connection problems are mostly due to low bandwidth or high latency on your 
side, e.g. with mobile connections.
* If audio/video doesn’t work for you, you can still use the text chat.
* Screen sharing needs a lot of bandwidth.

* You can also join with a regular telephone (audio only, of course), call 
+49-6151-86275-22 (German landline); then you must enter a PIN that changes 
every time – if you need it, ask me for it via email. Mute/unmute your 
microphone with "0".

[Netiquette]
* Please use a name that we recognize from here. Some feel uncomfortable with 
anonymous lurkers.
* Mute your microphone while you’re not talking.
* It’s nice to show your face at least when you join.
* If there are connection problems, stop camera sharing.
* The room is set to “everyone’s a moderator“, I trust you...

Next time will be December 14th.

See you, 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] check installed program using Lua

2021-11-02 Thread Pablo Rodriguez via ntg-context
On 11/1/21 5:13 PM, Hans Hagen via ntg-context wrote:
> On 11/1/2021 2:26 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> Is there a way to wrap os.exec() in the sample so that it only runs if
>> "dir" is available?
>>
>> I know that os.name would be an option here, but not in my real world
>> document.
>
> \starttext
>\startluacode
>  if lfs.isfile(tex.jobname .. ".pdf") then
>  context("YES")
>  end
>  if lfs.isfile(file.addsuffix(environment.outputfilename,"pdf")) then
>  context("YES")
>  end
>  if #dir.glob(file.addsuffix(environment.outputfilename,"pdf")) > 0 then
>  context("YES")
>  end
>\stopluacode
> \stoptext

Many thanks for your reply, Hans.

I can see that I explained my question poorly, but your code fits me in
other case.

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] check installed program using Lua

2021-11-02 Thread Pablo Rodriguez via ntg-context
On 11/1/21 3:10 PM, Taco Hoekwater via ntg-context wrote:
>> [...]
>> Is there a way to wrap os.exec() in the sample so that it only runs if
>> "dir" is available?
>
> if os.which(‘dir’) then
>   ...
> end
>
> But note that os.which() may be unreliable in various cases (like it
> will fail for shell/command interpreter builtins, in cron jobs, in
> special scripted environments, and may incorrectly succeed for
> disabled/forbidden commands), as it just runs through the PATH
> environment variable to check for executable file existence.
Many thanks for your reply, Taco.

This is exactly what I needed.

> Often times, it is better to just try to run the command to see if
> that produces satisfactory results.
It makes sense, but I cannot do that on foreign computers.

Many thanks for your help again,

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] \doifinstring: strange characters on the output

2021-11-01 Thread Hans Hagen via ntg-context

On 10/31/2021 11:53 PM, Tomas Hala via ntg-context wrote:

Hi all,

I noticed that \doifinstring produces quite strange output if a command
follows immediately (or with any amount of spaces) after the substring
I am searching for:

-MWE
\starttext
\def\xxx{asdf \bf Z:\bf asdf} % strange
\def\xxx{asdf \bf Z: \bf asdf}% strange
\def\xxx{asdf \bf Z:: \bf asdf}   % OK
\def\xxx{asdf \bf Z: text \bf asdf}   % OK
\def\xxx{asdf \bf Z:{} \bf asdf}  % OK

\doifinstring{Z:}{\xxx}{yes!}
\stoptext
--OUTPUT
fbf@yes!
fbf@yes!
yes!
yes!
yes!


If I insert another character, text or {} between them
(with or without spaces), all is ok.

I would like to ask what is the cause of this behavior and how to
use the \doifinstring to prevent the "fbf@" on the output.

partial expansion of a protected macro where one doesn't expect it

before i patch i let wolfgang check it

-
  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] check installed program using Lua

2021-11-01 Thread Hans Hagen via ntg-context

On 11/1/2021 2:26 PM, Pablo Rodriguez via ntg-context wrote:

Dear list,

is there a way if a program is installed on the computer using Lua.

I have the following sample:

   \starttext
   \startluacode
   filename = tex.jobname .. ".pdf"
   os.exec("dir " .. filename)
   \stopluacode
   \stoptext

Is there a way to wrap os.exec() in the sample so that it only runs if
"dir" is available?

I know that os.name would be an option here, but not in my real world
document.


\starttext
  \startluacode
if lfs.isfile(tex.jobname .. ".pdf") then
context("YES")
end
if lfs.isfile(file.addsuffix(environment.outputfilename,"pdf")) then
context("YES")
end
if #dir.glob(file.addsuffix(environment.outputfilename,"pdf")) > 0 then
context("YES")
end
  \stopluacode
\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] check installed program using Lua

2021-11-01 Thread Taco Hoekwater via ntg-context


> On 1 Nov 2021, at 14:26, Pablo Rodriguez via ntg-context  
> wrote:
> 
> Dear list,
> 
> is there a way if a program is installed on the computer using Lua.
> 
> I have the following sample:
> 
>  \starttext
>  \startluacode
>  filename = tex.jobname .. ".pdf"
>  os.exec("dir " .. filename)
>  \stopluacode
>  \stoptext
> 
> Is there a way to wrap os.exec() in the sample so that it only runs if
> "dir" is available?

if os.which(‘dir’) then
  ...
end

But note that os.which() may be unreliable in various cases (like it will fail 
for shell/command interpreter builtins, in cron jobs, in special scripted 
environments, and may incorrectly succeed for disabled/forbidden commands), as 
it just runs through the PATH environment variable to check for executable file 
existence. 

Often times, it is better to just try to run the command to see if that 
produces satisfactory results.

Best wishes,
taco

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



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

maillist : ntg-context@ntg.nl / 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] check installed program using Lua

2021-11-01 Thread Pablo Rodriguez via ntg-context
Dear list,

is there a way if a program is installed on the computer using Lua.

I have the following sample:

  \starttext
  \startluacode
  filename = tex.jobname .. ".pdf"
  os.exec("dir " .. filename)
  \stopluacode
  \stoptext

Is there a way to wrap os.exec() in the sample so that it only runs if
"dir" is available?

I know that os.name would be an option here, but not in my real world
document.

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] Color profiles (was: Bloody PDF boxes)

2021-11-01 Thread Henning Hraban Ramm via ntg-context

> Am 01.11.2021 um 08:05 schrieb Floris van Manen via ntg-context 
> :
> 
> this document:
>> and also extendedhttps://wiki.contextgarden.net/PDFX  a bit.
> 
> contains a link to the Ghent Workshop that returns a 404
> 
> [here] -> http://www.gwg.org/recommended_ICC_profiles.phtm -> 404

Thank you. The information from 2008 was outdated anyway; GWG’s latest 
recommendations from 2015 don’t contain ICC profiles any more (maybe their 
settings for commercial applications do, didn’t check).

And it seems like GWG is in conflict with the PDF association, at least GWG’s 
recommendations contradict PDF/X.

I’ll try to reflect both...

From my personal experience:

– If you don’t exactly know what you’re doing, you should use sRGB as RGB 
working color space, because most cameras and scanners use it. Yes, parts of 
the color space are outside the printable range, that’s why GWG (used to) 
recommend ECI RGB.

– Don’t use CMYK images, since they’re bigger, and if they’re not in the same 
CMYK color space as the one used by the printshop, the conversion is more lossy 
than any RGB-CMYK conversion.
– You can use DeviceCMYK (i.e. without profile) for graphical elements, that’s 
what GWG recommends, but it’s against PDF/X-3+.

– Use the latest FOGRA (Coated/Uncoated) CMYK profile as output intent, at 
least that’s what German/European printshops use in offset and digital 
printing. If not, your printshop should tell you which profile they use.
– For printing in the USA, use a SWOP CMYK profile as output intent. (SWOP and 
Euroscale CMYK colors are visibly different!)
– I don’t know about printshops in other parts of the world.

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] upload

2021-10-23 Thread Mikael Sundqvist via ntg-context
On Fri, Oct 22, 2021 at 9:22 AM Hans Hagen  wrote:
>
> On 10/21/2021 10:31 PM, Mikael Sundqvist via ntg-context wrote:
>
> > It works very nicely. I played with the test file you sent me, and I
> > find that in the .lfg file, the up parameter set to 0.06 instead of
> > 0.1 looks better to me.
> there are no ssty's for the quadruple prime in that font but if you need
> primes so badly you probably shouldn't use it anyway i guess (there are
> only super-textsize ssty variants for the 1/2/3 and their reverse)
>
> anyway, as you desperately need these quads (why check otherwise),
> adding this to the lfg blob helps:
>
> local four = characters[0x2057]
> if four then
>  local one = characters[okay]
>  local owd = .75*one.width
>  local off = .6*one.height
>  four.width = 4*owd
>  four.commands = {
>  { "offset", 0, off, okay },
>  { "offset",   owd, off, okay },
>  { "offset", 2*owd, off, okay },
>  { "offset", 3*owd, off, okay },
>  }
> else
>  -- we don't add (but we could), just patch, and there's no
>  -- reverse quad either
> end
>
> and no one will notice (unless you wikify al this)
>
> 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
> -

Hi!

As I wrote, I do not use the quadruple primes (I used your file), but
I must confess that I'm impressed that you fix it so quickly. :)

In any case, a big thank you for fixing the primes in the libertinus font!!

/Mikael
___
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] upload

2021-10-22 Thread Hans Hagen via ntg-context

On 10/22/2021 5:50 PM, Michal Vlasák wrote:

Hello,

On Thu Oct 21, 2021 at 8:04 PM CEST, Hans Hagen via ntg-context wrote:

I cleaned up some more backend code. There were some mails about dates
and such and although the date field in setupinteraction works ok a more
drastic overload is doen with directives. The reason is that the fact
that we can set the date (and traler) is only because it permits
generating pdf files that can be compared. No date as a bad idea anyway.

\setupinteraction[title=My Title]
% \enabledirectives[backend.date=2034-06-07]
\enabledirectives[backend.date=no]
\enabledirectives[backend.trailerid=no]


I checked the backend code and some of the related os functions. I put
together a patch that hopefully fixes some stuff and doesn't break
anything. The changes:

1) Dates parsed by ConTeXt (function converters.totime), such as those
that are input to backend.date, now allow specifying seconds and time
zone information. If there is no timezone the datetime is presumed to be
in local time, otherwise the datetime is offset by the local / specified
time zone difference (because ConTeXt outputs these dates as local times
with local timezone). Additionally both "T" and " " are now allowed as
date/time separator characters. Thus dates output by ConTeXt can be also
fed in.


i made the parser a bit more tolerant

"1234-12-30"
"1234/12/30"
"1234-12-30 23:45"
"1234-12-30 23:45:16"
"1234-12-30  23:45:16"
"1234-12-30T23:45:16+01:00"
"1234-12-30 23:45:16-02:00"
"1234-12-30 23:45:16+05:00"
"1234-12-30 23:45:16 05:00"
"1234-12-30  23:45:16  05:00"

(I'll send you the file to check/test)


2) Fix the os.timezone function. Previously, it could be wrong around
midnight, which I discovered only by chance. The trick is lifted from
http://lua-users.org/wiki/TimeZone, which I hope is OK. The before and
after (I am at +02:00):

 os.localtime()  2021-10-22 01:44:24
 os.now()2021-10-21 23:44:24
 os.timezone(true)   -22:00


 os.localtime()  2021-10-22 01:46:23
 os.now()2021-10-21 23:46:23
 os.timezone(true)   +02:00


shouldn't we also offer a -02:00 ? (relative)


I also extended the interface of os.timezone to accommodate 1), but as
this is probably a very public interface, I am not sure if these changes
are OK. If more changes to the interface can be made, I propose to get
rid of the delta parameter, since it seems like a remnant from the past.


maybe later, i need to check other files


Some caching can also be introduced, but I again wasn't sure if this
even would be the final form of the function, so didn't do anything in
that sense, yet.


i'll adapt it to that


3) Don't use %X in time formats. It is specified to be platform
dependent and we want %H:%M:%S everywhere. Also, it would be nice if
lpdf-xmp.lmt would use the os.fulltime() function to format dates (like
back-exp.lmt does), but there are multiple dates with different formats
and purposes and it is probably too late to change now.


(probably not that harmfull on the platforms we support)

the reason for different times is that i never liked the timezone in 
regular date/time (so only the mandate one had it) but in the end i 
don't care that much about times/date i never look at (i admit that i 
never consult any of this pdf meta data)



4) I changed the os.fulltime function, that returns date + time + local
time zone to output the _local_ time instead of UTC time. This is AFAICT
the right way to do times. The PDF spec says:

 If no UT information is specified, the relationship of the specified
 time to UT shall be considered to be GMT. Regardless of whether the
 time zone is specified, the rest of the date shall be specified in
 local time.

 EXAMPLE: For example, December 23, 1998, at 7:52 PM, U.S. Pacific
 Standard Time, is represented by the string D:199812231952-08'00

A test program:


 \enabletrackers[backend.info]
 
 \enabledirectives[backend.date=1234-12-30]% 1234-12-30T00:00:00+02:00

 \enabledirectives[backend.date=1234-12-30 23:45]  % 
1234-12-30T23:45:00+02:00
 \enabledirectives[backend.date=1234-12-30 23:45:16]   % 
1234-12-30T23:45:16+02:00
 \enabledirectives[backend.date=1234-12-30T23:45:16+01:00] % 
1234-12-31T00:45:16+02:00
 \enabledirectives[backend.date=1234-12-30 23:45:16-02:00] % 
1234-12-31T03:45:16+02:00
 \enabledirectives[backend.date=1234-12-30 23:45:16+05:00] % 
1234-12-31T20:45:16+02:00
 
 \starttext

 dummy text
 
 \startluacode

 print("os.timezone(true)", os.timezone(true)) -- +02:00
 print("os.fulltime()", os.fulltime()) -- 2021-10-22 17:38:38+02:00
 print("os.localtime()", os.localtime())   -- 2021-10-22 17:38:38
 print("os.now()", os.now())       -- 2021-1

Re: [NTG-context] upload

2021-10-22 Thread Pablo Rodriguez via ntg-context
On 10/22/21 5:50 PM, Michal Vlasák via ntg-context wrote:
> [...]
> I checked the backend code and some of the related os functions. I put
> together a patch that hopefully fixes some stuff and doesn't break
> anything.
> [...]
>   \enabledirectives[backend.date=1234-12-30T23:45:16+01:00] % 
> 1234-12-31T00:45:16+02:00
>   \enabledirectives[backend.date=1234-12-30 23:45:16-02:00] % 
> 1234-12-31T03:45:16+02:00
>   \enabledirectives[backend.date=1234-12-30 23:45:16+05:00] % 
> 1234-12-31T20:45:16+02:00
> [...]
> Is the timezone stuff what you wanted, Pablo?

Hi Michal,

I haven’t found the time to check this, but this is pretty much what I
wanted: being able to set other timezones than the local one.

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] upload

2021-10-22 Thread Michal Vlasák via ntg-context
Hello,

On Thu Oct 21, 2021 at 8:04 PM CEST, Hans Hagen via ntg-context wrote:
> I cleaned up some more backend code. There were some mails about dates
> and such and although the date field in setupinteraction works ok a more
> drastic overload is doen with directives. The reason is that the fact
> that we can set the date (and traler) is only because it permits
> generating pdf files that can be compared. No date as a bad idea anyway.
>
> \setupinteraction[title=My Title]
> % \enabledirectives[backend.date=2034-06-07]
> \enabledirectives[backend.date=no]
> \enabledirectives[backend.trailerid=no]

I checked the backend code and some of the related os functions. I put
together a patch that hopefully fixes some stuff and doesn't break
anything. The changes:

1) Dates parsed by ConTeXt (function converters.totime), such as those
that are input to backend.date, now allow specifying seconds and time
zone information. If there is no timezone the datetime is presumed to be
in local time, otherwise the datetime is offset by the local / specified
time zone difference (because ConTeXt outputs these dates as local times
with local timezone). Additionally both "T" and " " are now allowed as
date/time separator characters. Thus dates output by ConTeXt can be also
fed in.

2) Fix the os.timezone function. Previously, it could be wrong around
midnight, which I discovered only by chance. The trick is lifted from
http://lua-users.org/wiki/TimeZone, which I hope is OK. The before and
after (I am at +02:00):

os.localtime()  2021-10-22 01:44:24
os.now()2021-10-21 23:44:24
os.timezone(true)   -22:00


os.localtime()  2021-10-22 01:46:23
os.now()2021-10-21 23:46:23
os.timezone(true)   +02:00

I also extended the interface of os.timezone to accommodate 1), but as
this is probably a very public interface, I am not sure if these changes
are OK. If more changes to the interface can be made, I propose to get
rid of the delta parameter, since it seems like a remnant from the past.

Some caching can also be introduced, but I again wasn't sure if this
even would be the final form of the function, so didn't do anything in
that sense, yet.

3) Don't use %X in time formats. It is specified to be platform
dependent and we want %H:%M:%S everywhere. Also, it would be nice if
lpdf-xmp.lmt would use the os.fulltime() function to format dates (like
back-exp.lmt does), but there are multiple dates with different formats
and purposes and it is probably too late to change now.

4) I changed the os.fulltime function, that returns date + time + local
time zone to output the _local_ time instead of UTC time. This is AFAICT
the right way to do times. The PDF spec says:

If no UT information is specified, the relationship of the specified
time to UT shall be considered to be GMT. Regardless of whether the
time zone is specified, the rest of the date shall be specified in
local time.

EXAMPLE: For example, December 23, 1998, at 7:52 PM, U.S. Pacific
Standard Time, is represented by the string D:199812231952-08'00

A test program:


\enabletrackers[backend.info]

\enabledirectives[backend.date=1234-12-30]% 
1234-12-30T00:00:00+02:00
\enabledirectives[backend.date=1234-12-30 23:45]  % 
1234-12-30T23:45:00+02:00
\enabledirectives[backend.date=1234-12-30 23:45:16]   % 
1234-12-30T23:45:16+02:00
\enabledirectives[backend.date=1234-12-30T23:45:16+01:00] % 
1234-12-31T00:45:16+02:00
\enabledirectives[backend.date=1234-12-30 23:45:16-02:00] % 
1234-12-31T03:45:16+02:00
\enabledirectives[backend.date=1234-12-30 23:45:16+05:00] % 
1234-12-31T20:45:16+02:00

\starttext
dummy text

\startluacode
print("os.timezone(true)", os.timezone(true)) -- +02:00
print("os.fulltime()", os.fulltime()) -- 2021-10-22 17:38:38+02:00
print("os.localtime()", os.localtime())   -- 2021-10-22 17:38:38
print("os.now()", os.now())   -- 2021-10-22 15:38:38
\stopluacode
\stoptext

I don't claim to know LPEG so please check my work. I also know nothing
about XMP, so I didn't check that at all, sorry.

Is the timezone stuff what you wanted Pablo?

Full patch temporarily at this URL and also below:

https://github.com/contextgarden/context-mirror/compare/beta...vlasakm:dates

Michal

--- a/tex/context/base/mkiv/core-con.lua
+++ b/tex/context/base/mkiv/core-con.lua
@@ -17,7 +17,7 @@ slower but look nicer this way.
 --ldx]]--
 
 local floor = math.floor
-local osdate, ostime = os.date, os.time
+local osdate, ostime, ostimezone = os.date, os.time, os.timezone
 local concat, insert, reverse = table.concat, table.insert, table.reverse
 local lower, upper, rep, match, gsub = string.lower, string.upper, string.rep, 
string.match, string.gsub
 local utfchar, utfbyte = utf.char, utf.byte
@@ -1972,13 +1972

Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-10-22 Thread Hans Hagen via ntg-context

On 10/22/2021 11:31 AM, Henning Hraban Ramm via ntg-context wrote:



Am 17.07.2021 um 12:45 schrieb Hans Hagen :


\startMPpage
draw lmt_openstreetmap [
filename = "hasselt.osm"
grid = "dots",
] ;
\stopMPpage

The hasselt osm file is sime 12 MB, the colorful hasselt pdf file just below 1 
MB so that's okay (3.7 sec processing time on my machine so if all claims are 
right sub seconds on a fast new apple).


I finally tried this, hoping to replace my Maperitive workflow.

With a Bonn map from https://download.bbbike.org/osm/bbbike/ of 724 MB I 
started it last night (~13 h before), and it still didn’t finish. No messages 
after:

openstreetmap   > processing file '/Users/hraban/Downloads/ConTeXt/Bonn.osm'
openstreetmap   > original size 713811948 bytes, stripped down to 603309215 
bytes

Maybe I should try smaller files ;)


We hit a limti in lpeg that allocates memory by duplicating the size 
which then hits a top and falls back in allocating by + 1 every capture 
which then kind of stalls the xml interpretation. I can hack that to 
work (and need to check that with every lpeg update), but as we enter a 
next stage in th econversion mem starts going virtual anyway and I see 
my SSD being tortured so I aborted. More testing has to wait till I (if 
ever) have a faster machine, with (say) 64GB super fast memory.


On my machine the still ok size is some 200MB.

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] upload

2021-10-22 Thread Hans Hagen via ntg-context

On 10/21/2021 9:13 PM, Pablo Rodriguez via ntg-context wrote:

On 10/21/21 8:04 PM, Hans Hagen via ntg-context wrote:

Hi,

I cleaned up some more backend code.  There were some mails about dates
and such and although the date field in setupinteraction works ok a more
drastic overload is doen with directives. The reason is that the fact
that we can set the date (and traler) is only because it permits
generating pdf files that can be compared. No date as a bad idea anyway.

\setupinteraction[title=My Title]
% \enabledirectives[backend.date=2034-06-07]


Many thanks for the new version, Hans.

Is there a way to add time and timezone in backend.date?


Pablo : transparencies should work again (wrong alias fixed).


Many thanks for this fix too.

Sorry for insisting, but could you check what is wrong with an extra
blank space in rotated imposition
(https://mailman.ntg.nl/pipermail/ntg-context/2021/103909.html)?

.. it was not really a minimal example ...

\showframe

\starttext
\topskip4cm
\rotate[rotation=90] 
{\externalfigure[A3page.pdf][page=1,width=\textheight]}\page


\rotate[rotation=270]{\externalfigure[A3page.pdf][page=2,width=\textheight]}\page
\rotate[rotation=90] 
{\externalfigure[A3page.pdf][page=1,width=\textheight]}\page


\rotate[rotation=270]{\externalfigure[A3page.pdf][page=2,width=\textheight]}\page
\stoptext

so, you need to wrap it, like

\startpagemakeup \rotate[rotation=90] 
{\externalfigure[A3page.pdf][page=1,width=\textheight]}\stoppagemakeup
\startpagemakeup 
\rotate[rotation=270]{\externalfigure[A3page.pdf][page=2,width=\textheight]}\stoppagemakeup
\startpagemakeup \rotate[rotation=90] 
{\externalfigure[A3page.pdf][page=1,width=\textheight]}\stoppagemakeup
\startpagemakeup 
\rotate[rotation=270]{\externalfigure[A3page.pdf][page=2,width=\textheight]}\stoppagemakeup


and not make it 'sort of text that breaks or not across the page'. Now 
it is an interesting question why ... (spoiler: nice animation:)


\starttext
\topskip4cm
\dostepwiserecurse{0}{360}{1}{

\rotate[rotation=#1]{\externalfigure[A3page.pdf][page=1,width=\textheight]}
}
\stoptext

so we probably cross some threshold with some angles and because these 
are basically lines, we then get an interplay woth topskip, maxdepth etc 
(which normally goes unnoticed)


the good news is that you can play with it because rotate is normally 
configured for inline usage (so we get depth and height) you can use the 
location parameter to do otherwise:


% normal default depth fit broad high middle

\starttext
\topskip4cm
\dostepwiserecurse{0}{360}{1}{

\ruledhbox{\rotate[rotation=#1,location=high]{\externalfigure[A3page.pdf][page=1,width=\textheight]}}
}
\stoptext

irr it's actually shown somewhere in a manual but the source also has this

% \dostepwiserecurse{0}{360}{10}
%   {\startlinecorrection[blank]
%\hbox
%  {\expanded{\setuprotate[rotation=\recurselevel]}%
%   \traceboxplacementtrue
%   \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=depth] 
{\ruledhbox{\bfb  (depth)%
%   \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=fit] 
{\ruledhbox{\bfb(fit)%
%   \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=broad] 
{\ruledhbox{\bfb  (broad)%
%   \hbox to 
.2\hsize{\hss\ruledhbox{\rotate[location=normal]{\ruledhbox{\bfb 
(normal)%
%   \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=high] 
{\ruledhbox{\bfb   (high)}

%\stoplinecorrection}

% \def\Test{\ruledhbox{%
% \def\DemoX{\vl\kern.5\emwidth\vl}%
% \kern\emwidth\ruledhpack{\green\rotate[rotation=20] 
{\ruledhpack{\DemoX}}}%
% \kern\emwidth\ruledhpack{\blue \rotate[rotation=0] 
{\ruledhpack{\DemoX}}}%
% \kern\emwidth\ruledhpack{\red  \rotate[rotation=-20] 
{\ruledhpack{\DemoX}}}%
% \kern\emwidth\ruledhpack{\green\rotate[rotation=200] 
{\ruledhpack{\DemoX}}}%
% \kern\emwidth\ruledhpack{\blue \rotate[rotation=180] 
{\ruledhpack{\DemoX}}}%
% \kern\emwidth\ruledhpack{\red 
\rotate[rotation=-200]{\ruledhpack{\DemoX}}}%

% \kern\emwidth}}

% \startTEXpage[offset=10pt,align=middle]
% \setuprotate[location=fit] \Test \par 
{\infofont\setstrut\strut fit} \par
% \setuprotate[location=depth]   \Test \par 
{\infofont\setstrut\strut depth}   \par
% \setuprotate[location=broad]   \Test \par 
{\infofont\setstrut\strut broad}   \par
% \setuprotate[location=high]\Test \par 
{\infofont\setstrut\strut high}\par
% \setuprotate[location=middle]  \Test \par 
{\infofont\setstrut\strut middle}  \par
% \setuprotate[location=default] \Test \par 
{\infofont\setstrut\strut default} \par

% \stopTEXpage

so, not a bug but a features (that code hasn't been touched for ages, 
apart from maybe some lmtx interface adaptation), and if it's not in the 
wiki .. you know what to do now


Hans

-
  Hans Hagen | PRAGMA ADE

Re: [NTG-context] upload

2021-10-22 Thread Hans Hagen via ntg-context

On 10/21/2021 10:31 PM, Mikael Sundqvist via ntg-context wrote:


It works very nicely. I played with the test file you sent me, and I
find that in the .lfg file, the up parameter set to 0.06 instead of
0.1 looks better to me.
there are no ssty's for the quadruple prime in that font but if you need 
primes so badly you probably shouldn't use it anyway i guess (there are 
only super-textsize ssty variants for the 1/2/3 and their reverse)


anyway, as you desperately need these quads (why check otherwise), 
adding this to the lfg blob helps:


local four = characters[0x2057]
if four then
local one = characters[okay]
local owd = .75*one.width
local off = .6*one.height
four.width = 4*owd
four.commands = {
{ "offset", 0, off, okay },
{ "offset",   owd, off, okay },
{ "offset", 2*owd, off, okay },
{ "offset", 3*owd, off, okay },
}
else
-- we don't add (but we could), just patch, and there's no
-- reverse quad either
end

and no one will notice (unless you wikify al this)

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] upload

2021-10-21 Thread Mikael Sundqvist via ntg-context
On Thu, Oct 21, 2021 at 8:04 PM Hans Hagen via ntg-context
 wrote:
>
> Hi,
>
> I cleaned up some more backend code.  There were some mails about dates
> and such and although the date field in setupinteraction works ok a more
> drastic overload is doen with directives. The reason is that the fact
> that we can set the date (and traler) is only because it permits
> generating pdf files that can be compared. No date as a bad idea anyway.
>
> \setupinteraction[title=My Title]
> % \enabledirectives[backend.date=2034-06-07]
> \enabledirectives[backend.date=no]
> \enabledirectives[backend.trailerid=no]
> \starttext
>
> \startTEXpage
>  \blackrule[height=1cm,depth=0cm,width=4cm,color=darkred]
> \stopTEXpage
>
> (there always were command line options for it)
>
> More interesting is asome new experimental code:
>
> \starttext
>
> \dostepwiserecurse{40}{110}{2}{
>  \startTEXpage[offset=4mm,width=#1mm,align={stretch,normal,tolerant}]
>  \showmakeup[penalty]%
>  \orphanpenalties 4 4000 3000 2000 1000\relax
>  \updateparagraphpenalties
>  \samplefile{tufte}
>  \par
>  \stopTEXpage
> }
>
> \stoptext
>
> it's an addendum to the widowpenalties and clubpenalties introduced by
> etex but this time it's horizontal; the orphan penalties will be
> inserted before spaces (aka spaceskip, xspaceskip and zerospaceskip
> glue) so in this case 4000 between the last two 'words' and this
> trickery can be used to make sure that the last line is not too short
>
>  \orphanpenalties 4 4000 3000 -12000 1000\relax
>
> is also intereting
>
> it's work in progress (i need to play more with it and figure out nice
> values for context) .. there might be more such 'simple' useful tricks
>
> Mikael: you can test the math cheat (doesn't make the font nicer).
> Pablo : transparencies should work again (wrong alias fixed).
> Michal: you can check the dates (as for sure i messed up something).
>
> 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
> ___


Hi!

Thank you Hans for the very quick fix on the libertinus font!

It works very nicely. I played with the test file you sent me, and I
find that in the .lfg file, the up parameter set to 0.06 instead of
0.1 looks better to me.

/Mikael

PS I do not use them, but I noticed that the quadruple prime f
still uses small primes.
___
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] upload

2021-10-21 Thread Pablo Rodriguez via ntg-context
On 10/21/21 8:04 PM, Hans Hagen via ntg-context wrote:
> Hi,
>
> I cleaned up some more backend code.  There were some mails about dates
> and such and although the date field in setupinteraction works ok a more
> drastic overload is doen with directives. The reason is that the fact
> that we can set the date (and traler) is only because it permits
> generating pdf files that can be compared. No date as a bad idea anyway.
>
> \setupinteraction[title=My Title]
> % \enabledirectives[backend.date=2034-06-07]

Many thanks for the new version, Hans.

Is there a way to add time and timezone in backend.date?

> Pablo : transparencies should work again (wrong alias fixed).

Many thanks for this fix too.

Sorry for insisting, but could you check what is wrong with an extra
blank space in rotated imposition
(https://mailman.ntg.nl/pipermail/ntg-context/2021/103909.html)?

Many thanks for your help again,

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

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


[NTG-context] upload

2021-10-21 Thread Hans Hagen via ntg-context

Hi,

I cleaned up some more backend code.  There were some mails about dates 
and such and although the date field in setupinteraction works ok a more 
drastic overload is doen with directives. The reason is that the fact 
that we can set the date (and traler) is only because it permits 
generating pdf files that can be compared. No date as a bad idea anyway.


\setupinteraction[title=My Title]
% \enabledirectives[backend.date=2034-06-07]
\enabledirectives[backend.date=no]
\enabledirectives[backend.trailerid=no]
\starttext

\startTEXpage
\blackrule[height=1cm,depth=0cm,width=4cm,color=darkred]
\stopTEXpage

(there always were command line options for it)

More interesting is asome new experimental code:

\starttext

\dostepwiserecurse{40}{110}{2}{
\startTEXpage[offset=4mm,width=#1mm,align={stretch,normal,tolerant}]
\showmakeup[penalty]%
\orphanpenalties 4 4000 3000 2000 1000\relax
\updateparagraphpenalties
\samplefile{tufte}
\par
\stopTEXpage
}

\stoptext

it's an addendum to the widowpenalties and clubpenalties introduced by 
etex but this time it's horizontal; the orphan penalties will be 
inserted before spaces (aka spaceskip, xspaceskip and zerospaceskip 
glue) so in this case 4000 between the last two 'words' and this 
trickery can be used to make sure that the last line is not too short


\orphanpenalties 4 4000 3000 -12000 1000\relax

is also intereting

it's work in progress (i need to play more with it and figure out nice 
values for context) .. there might be more such 'simple' useful tricks


Mikael: you can test the math cheat (doesn't make the font nicer).
Pablo : transparencies should work again (wrong alias fixed).
Michal: you can check the dates (as for sure i messed up something).

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] Bloody PDF boxes and cr*p marks!

2021-10-19 Thread Henning Hraban Ramm via ntg-context

> Am 12.10.2021 um 20:48 schrieb Hans Hagen :
> 
>> Hm, you implemented these boxes only in 2015, there was not much change in 
>> that regard since then.
> 
> Way earlier but it wasn't enabled ... (I'm not going to check ancient tex 
> live dvd's).
> 
>addtopageattributes("CropBox",box) -- mandate for rendering
>addtopageattributes("TrimBox",box) -- mandate for pdf/x
> -- addtopageattributes("BleedBox",box)
> -- addtopageattributes("ArtBox",box)
> 
> I remember discussing it with (I think) Pablo and it definityely came up when 
> we were dealing with these 'standards'.

Ok. I found it in lpdf-mis.lua, maybe I’ll use the Lua function directly.

>>> well, that's an assumption ... who knows what a printer (driver) does ...
>> Who sends PDF files directly to a printer (driver)? I know it only from 
>> automated, professional workflows.
>> Usually printer drivers gets fed by PDF viewers, and I know none that even 
>> *can* print something different than CropBox.
> 
> afaik some printers accept pdf (hard to check) but I the fact that a viewer 
> does something doesn't mean it did years ago (just like at how crippled 
> tounicode has been / is supported over time)

Yes, you can send PDF files to some copiers and other professional printing 
devices. But usually you do this via the manufacturer’s workflow tools – only a 
few admins still know how to (ab)use a prn queue ;)

>>>> Beware, \setupbleeding refers only to stretching of images 
>>>> (\externalfigure)!
>>> 
>>> fwiw, that bleeding options is mostly there to communicate with mp
>> Good to know. I just browsed the Details manual, didn’t try it yet, since I 
>> scale and move my “bleeding” images differently.
> 
> i actually need to pick up that bit ... (some code in my local styles i need 
> to check) because it can be handy for cover pages (but then i also need to 
> check if i don't break something

I’d be interested to see what you’re trying.
I want to create my covers more and more with ConTeXt to avoid manual adaptions 
due to number of pages.

>>> the problem is as usual documentation and indeed we can have some backward 
>>> compatibility issue here ... i honestly have no clue how viewers and 
>>> printers react (so if something would be added/changed it would be option 
>>> driven)
>> I wouldn’t expect printers (office printing devices) to react at all; I hope 
>> that printers (printshop workers) will react positively to correct boxes in 
>> our PDFs ;)
> 
> oh, i'm often surprised about printing houses .. (the best were some comment 
> on a file having rgb bitmaps while it actually had cmyk outlines and 
> validators/fixers inlining xforms while setting lines to 0pt widths) .. and 
> some still use acrobat 4 -)

Yep, last weekend I finally sent the latest issue of our magazine to the 
printshop, of course with correctly set boxes (and markings activated), and 
since the content didn’t need bleed this time, I set the CropBox to TrimBox. 
Everything in perfect order – but they charged me for adding crop marks... 
(Without even asking back.) I’ll teach them PDF basics.

BTW, is there a hook to replace crop marks with my own?
Ah, found page-mrk.mkiv
Can I just replace \startuniqueMPgraphic{print:lines} ?
(Something to play with if I get into MP mode...)


>>> probably spreads need some treatment (imposition)
>> Multiple pages on a sheet are not considered by the PDF specs.
> 
> yes but what of context imposes

Right. IMO, if there’s a BleedBox defined, ConTeXt should use it as “page 
size”, otherwise CropBox.

> remind me in a few months (it's a typical boring winter evening activity with 
> some music blu ray (or movie) running on a second screen)

I’ll never understand how others can work with such distractions ;)


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] SVG not rendering correctly with LMTX and conversion=mp

2021-10-18 Thread Luis Montgomery via ntg-context
In my tests, this conversion works internally with linux.

On windows it fails and stops at

l.63 \ registerctxluafile {data-bin} {}
  % before data-tex
?


El lun, 18 oct 2021 a las 10:49, Jason Ross ()
escribió:

>
>
> On 10/18/21 8:38 AM, Luis Montgomery wrote:
>  > Check that your Inkscape is working properly.
>  >
>  > That proble NOT appear  on my machine...
>  >
>  > Best,
>  >
>  > L. Montgomery
>
> (Sorry Luis, I forgot to cc mailing list)
> Per https://wiki.contextgarden.net/Command/externalfigure,
> in LMTX the conversion is done natively when "conversion=mp" is set.
> Inkscape is not used for the conversion.
>
___
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] SVG not rendering correctly with LMTX and conversion=mp

2021-10-18 Thread Jason Ross via ntg-context



On 10/18/21 8:38 AM, Luis Montgomery wrote:
> Check that your Inkscape is working properly.
>
> That proble NOT appear  on my machine...
>
> Best,
>
> L. Montgomery

(Sorry Luis, I forgot to cc mailing list)
Per https://wiki.contextgarden.net/Command/externalfigure,
in LMTX the conversion is done natively when "conversion=mp" is set.
Inkscape is not used for the conversion.
___
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] SVG not rendering correctly with LMTX and conversion=mp

2021-10-18 Thread Luis Montgomery via ntg-context
Check that your Inkscape is working properly.

That proble NOT appear  on my machine...

Best,

L. Montgomery

El lun., 18 de octubre de 2021 10:15, Jason Ross via ntg-context <
ntg-context@ntg.nl> escribió:

> The following MWE fails to render the text in the attached SVG properly:
>
>
> \starttext
> \externalfigure[test.svg][conversion=mp]
> \stoptext
>
>
> The axis labels, tick labels, and title are all incorrect. This file was
> generated with Matplotlib.
>
> ___
> 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] Update error on Raspberry Pi

2021-10-16 Thread Mojca Miklavec via ntg-context
Hi,

On Sat, 16 Oct 2021 at 22:43, J. Hagen via ntg-context wrote:
>
> Looks like the pi bins and an osx one are behind (mojca then needs to kick 
> those vm's) ... I 'll check it tomorrow.

I'm sorry, the new binaries have been uploaded to the usual place
(Hans probably needs to regenerate the packages before they can be
used out-of-the-box again).

For some completely mysterious reason the new ISP's modem doesn't like
the virtual machine running Debian 10 and I have no clue how to
convince it to get network connectivity back.

(After reading the initial email from Luis I decided to try to connect
the main computer via my phone's hotspot and that worked, but I need
to find a permanent solution. Maybe I'll just set up some hardware
again. It's much slower than the VM, but better than not working at
all.)

Mojca

> Op 16 okt. 2021 15:12 schreef Luis Montgomery via ntg-context 
> :
>
> Hi,
> I try to update LMTX and the script sends me this error:
>
>
> resolvers   > lua > loading file 
> '/home/monty/context/tex/texmf-context/tex/context/base/mkxl/spac-par.lmt' 
> succeeded
> tex error   > tex error on line 41 in file spac-par.mkxl: Undefined 
> control sequence \undefined
>
> 
>   + \shapingpenaltiesfrozenparcode
>
> 
> The control sequence at the end of the top line of your error message was 
> never
> \def'ed. You can just continue as I'll forget about whatever was undefined.
>
> What has changed here?
>
> L. Montgomery
___
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] Update error on Raspberry Pi

2021-10-16 Thread J. Hagen via ntg-context
Looks like the pi bins and an osx one are behind (mojca then needs to kick those vm's) ... I 'll check it tomorrow.Op 16 okt. 2021 15:12 schreef Luis Montgomery via ntg-context :Hi,I try to update LMTX and the script sends me this error:resolvers       > lua > loading file '/home/monty/context/tex/texmf-context/tex/context/base/mkxl/spac-par.lmt' succeededtex error       > tex error on line 41 in file spac-par.mkxl: Undefined control sequence \undefined        + \shapingpenaltiesfrozenparcodeThe control sequence at the end of the top line of your error message was never\def'ed. You can just continue as I'll forget about whatever was undefined.What has changed here?L. Montgomery
___
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] new upload

2021-10-14 Thread Hans Hagen via ntg-context

On 10/13/2021 10:37 PM, jbf via ntg-context wrote:
In fact, Hans, that was going to be my comment after updating yesterday 
to the 10-10-21 version: some of the breaks were a bit overdone. Are 
these changes you indicate as tests actually included in the latest 
upload, or should I wait a bit?
they are in there; but i still need to check multiple notes and spacing 
before the first (we have some trickery in mkiv and lmtx but maybe i can 
still make that better / more reliable in lmtx/luametatex)


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
___


<    1   2   3   4   5   6   7   8   9   10   >