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

2021-11-29 Thread Joey McCollum via ntg-context
After some debugging, the example code I offered above seems to work, with
minor adjustments:

\begingroup
\let\loc\loctextloc
\currentbtxloctext
\btxcomma

\endgroup

Thanks again for all the help!

Joey

On Mon, Nov 29, 2021 at 12:11 PM Joey McCollum 
wrote:

> Okay. So using this example as a template, I'd like to do the following:
>
>- define a general-purpose \loc macro that can be invoked in the main
>text (i.e., outside of citations) in the usual way; this one would
>correspond to \WhateverB above and would not remove punctuation preceding
>the macro.
>- separately define a \loctextloc macro that accepts the same input as
>\loc, but conditionally removes preceding punctuation based on variables
>set outside of this macro during the citation process (e.g.,
>\btxsblshorthandbeforetextloc); this would correspond to \WhateverA above.
>- in the macro for typesetting the loctext btx parameter, redefine
>\loc to do what \loctextloc does, and then invoke \currentbtxloctext so
>that the \loc invocations it contains will be expanded like \loctextloc, as
>follows:
>
> \begingroup
> \def\loc\loctextloc
> \currentbtxloctext
>
> \btxcomma
>
> \endgroup
>
> Is this a ConTeXt-friendly way to do this? I'm attempted this now, but I
> have some errors to debug, and I'd like to know if this is even a feasible
> direction before I continue.
>
> Joey
>
> On Sun, Nov 28, 2021 at 5:39 AM Hans Hagen  wrote:
>
>> On 11/28/2021 2:39 AM, Joey McCollum wrote:
>> > 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  > ...
>>
>> Maybe play with:
>>
>> \starttext
>>
>> \def\WhateverA{\removeunwantedspaces\removepunctuation\space ¶ 1.23}
>> \def\WhateverB{¶ 1.23}
>>
>> foo bar, \WhateverA\ test
>> foo bar, \WhateverB\ test
>>
>> \stoptext
>>
>> so, wrap ¶ into a macro
>>
>> \def\MyParSymbol{\removeunwantedspaces\removepunctuation\space ¶}
>>
>> 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] Math prime issues for some fonts

2021-11-29 Thread Jack Hill via ntg-context
On Fri, 26 Nov 2021 at 11:28, Hans Hagen  wrote:
> 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), which (2) have found their way in unicode, and (3) also in fonts
> due to the way traditional tex does it, and (4) with which we cannot
> deal with in the engine, so (5) we do it our own contexty way, in the
> hope that (6) in the end it all looks good and (7) also gives us some of
> the benefits that i don't even dare to bring up here in order not to
> make it sound more complex.

Thank you for the explanation. It's always interesting to hear about what
goes on under the hood.

> As a note: if you notice suboptional things in math fonts, don't
> hesitate to make a good minimal example and then ask Mikael to look into
> is because he deals with and coordinates the tuning of goodie files.

I have noticed that the top bar of square root signs don't seem to connect
properly with the angled part. This is visible with multiple fonts (some
make it more obvious than others) at various zoom levels (I'm using Okular
on Linux but other pdf viewers show the same - also on Windows). I've no
idea if this is visible in print since I don't print the pdfs. The effect
is also reproducible with the wiki version of context.

\starttext

\starttabulate[|l|c|]
\FL
\BC Font name  \BC Math sqrt   \NR
\ML
\NC Latin Modern Roman \NC\m{\sqrt{x}} \NR
\NC TeX Gyre Termes\NC \switchtobodyfont[termes]  \m{\sqrt{x}} \NR
\NC TeX Gyre Pagella   \NC \switchtobodyfont[pagella] \m{\sqrt{x}} \NR
\NC TeX Gyre Bonum \NC \switchtobodyfont[bonum]   \m{\sqrt{x}} \NR
\NC TeX Gyre Schola\NC \switchtobodyfont[schola]  \m{\sqrt{x}} \NR
\NC STIX Two   \NC \switchtobodyfont[stixtwo] \m{\sqrt{x}} \NR
\BL
\stoptabulate

\stoptext
___
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-29 Thread Joey McCollum via ntg-context
Okay. So using this example as a template, I'd like to do the following:

   - define a general-purpose \loc macro that can be invoked in the main
   text (i.e., outside of citations) in the usual way; this one would
   correspond to \WhateverB above and would not remove punctuation preceding
   the macro.
   - separately define a \loctextloc macro that accepts the same input as
   \loc, but conditionally removes preceding punctuation based on variables
   set outside of this macro during the citation process (e.g.,
   \btxsblshorthandbeforetextloc); this would correspond to \WhateverA above.
   - in the macro for typesetting the loctext btx parameter, redefine \loc
   to do what \loctextloc does, and then invoke \currentbtxloctext so that the
   \loc invocations it contains will be expanded like \loctextloc, as follows:

\begingroup
\def\loc\loctextloc
\currentbtxloctext

\btxcomma

\endgroup

Is this a ConTeXt-friendly way to do this? I'm attempted this now, but I
have some errors to debug, and I'd like to know if this is even a feasible
direction before I continue.

Joey

On Sun, Nov 28, 2021 at 5:39 AM Hans Hagen  wrote:

> On 11/28/2021 2:39 AM, Joey McCollum wrote:
> > 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
> > ...
>
> Maybe play with:
>
> \starttext
>
> \def\WhateverA{\removeunwantedspaces\removepunctuation\space ¶ 1.23}
> \def\WhateverB{¶ 1.23}
>
> foo bar, \WhateverA\ test
> foo bar, \WhateverB\ test
>
> \stoptext
>
> so, wrap ¶ into a macro
>
> \def\MyParSymbol{\removeunwantedspaces\removepunctuation\space ¶}
>
> 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] ConTeXt support in LTEX

2021-11-29 Thread Saša Janiška via ntg-context
On Mon, Nov 29, 2021 at 10:02:34AM +0100, Saša Janiška via ntg-context wrote:

> didn't have time to (properly) test, but you might be interested to hear
> that since 15.2.0 release - hot from the owen - there is now support for
> ConTeXt as well.

I apologize for forgetting to include any link:

https://valentjn.github.io/ltex/

https://github.com/valentjn/ltex-ls/issues/120

> Sincerely,
> Gour

-- 
What is night for all beings is the time of awakening
for the self-controlled; and the time of awakening for
all beings is night for the introspective sage.

___
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] Bad linebreak in figure caption

2021-11-29 Thread Marco Patzer via ntg-context
Hi!

The caption "FOO" runs into the right figure's caption:

\setuplayout [width=18.4cm]
\setuptolerance [verytolerant, stretch]  %% even with stretch

\starttext
  \startplacefigure
\startfloatcombination
  \startplacefigure [title=Unexpectedly unnecessary FOO-BAR whatever]
\framed[width=.4\textwidth]{}
  \stopplacefigure
  \startplacefigure [title={Lorem ipsum dolor siit amet}]
\framed[width=.4\textwidth]{}
  \stopplacefigure
\stopfloatcombination
  \stopplacefigure
\stoptext

Why does ConTeXt not break the line between "unnecessary" and "FOO"?
How to kindly persuade it to do so?

Marco

LMTX 2021.11.26 11:38
___
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] Blocks inside a conditional mode.

2021-11-29 Thread Fabrice L via ntg-context
Dear Hans,

> Le 29 nov. 2021 à 03:54, Hans Hagen  a écrit :
> 
> On 11/29/2021 2:54 AM, Fabrice L via ntg-context wrote:
> 
>> The only inconvenient of this solution if that I have to define 15 blocks 
>> (one for each week of the term): ComplementOne, ComplementTwo, 
> \defineblock[example]
> 
> \starttext
> 
>   \beginexample[Two]
>   Last course, we have seen A.
>   \endexample
> 
>   \beginexample[Three]
>   Last course, we have seen B….
>   \endexample
> 
>   \beginexample[Three]
>   Last course, we have seen C….
>   \endexample
> 
>\useblocks[example][Two]
> % \useblocks[example][Three]
> 
> \stoptext
> 
> %


Thanks (again). ConTeXt is always full of ressource ! I did not know we could 
do this, even if I realized now that there is a similar example in the wiki. 

For the list, in case in the future this would be useful for another user, 
below is the complete minimal example using this approach.


% - Minimal working example :

\setuppapersize[S5][S5]
\enablemode[Professor]

\defineblock[Complement]
\setupblock[Complement][

before={\page[yes]\setuppagenumber[state=stop]\setupheadertexts[]\setupbackgrounds[page][background=color,backgroundcolor=red]},
after={\page[yes]\setuppagenumber[state=start]}]

\starttext

% Let's process the summaries  ;
\beginComplement[Two]
Last course, we have seen A.
\endComplement

\beginComplement[Three]
Last course, we have seen B….
\endComplement

\beginComplement[Three]
Last course, we have seen C….
\endComplementThree

\beginComplement[Four]
Last course, we have seen D….
\endComplementFour
\beginComplement
and E !
\endComplementFour
%  summaries: end   ;

Let's begin course 1. 
This is course 1 : a lot of pages here about A! 
\page[yes]

Let's begin course 2. 
\doifmode{Professor} {
\useblocks[Complement][Two]
}

This is course 2 : a lot of pages here about B and C! 

\page[yes]
Let's begin course 3. 
\doifmode{Professor} {
\useblocks[Complement][Three]
}   

This is course 3 : a lot of pages here about D... ! 
\doifmode{Professor} {
\useblocks[Complement][Four]
}   

The course 4 ! 
\stoptext

% - Minimal working example  : end 


Fabrice.

___
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-29 Thread Nicola via ntg-context
On 2021-11-26, Clint Grady via ntg-context  wrote:
> I'd be very happy to try the new version of the plugin. I'm also happy
> to work on porting it to NeoVim.

If my email is not visible through the mailing list (yours is not to
me), you may find it in the source code of the ConTeXt plugin in Vim
($VIMRUNTIME/ftplugin/context.vim).

Drop me a line and I will happily send you the pre-release version.

Nicola

___
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] Influence location of luametatex-cache

2021-11-29 Thread Marco Patzer via ntg-context
On Mon, 29 Nov 2021 12:07:51 +0100
Henning Hraban Ramm via ntg-context  wrote:

> > How to influence the location of the cache directory?  
> 
> Try to set TEXMFCACHE

That's it. Thanks Peter and Henning.

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] Influence location of luametatex-cache

2021-11-29 Thread Peter Münster via ntg-context
On Mon, Nov 29 2021, Marco Patzer via ntg-context wrote:

> How to influence the location of the cache directory?

Hi,

I have the line "export TEXMFCACHE=~/.cache" in my ~/.profile and then
context creates the directory ~/.cache/luametatex-cache.

Cheers,
-- 
   Peter
___
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] Influence location of luametatex-cache

2021-11-29 Thread Henning Hraban Ramm via ntg-context

Am 29.11.21 um 11:16 schrieb Marco Patzer via ntg-context:

Hi!

when LMTX is installed in a read-only location (e.g. /opt) it
creates a directory "luametatex-cache" in $HOME.

How to influence the location of the cache directory?


Try to set TEXMFCACHE

see also: mtxrun --variables

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] Influence location of luametatex-cache

2021-11-29 Thread Marco Patzer via ntg-context
Hi!

when LMTX is installed in a read-only location (e.g. /opt) it
creates a directory "luametatex-cache" in $HOME.

How to influence the location of the cache directory?

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
___


[NTG-context] ConTeXt support in LTEX

2021-11-29 Thread Saša Janiška via ntg-context
Hello,

didn't have time to (properly) test, but you might be interested to hear
that since 15.2.0 release - hot from the owen - there is now support for
ConTeXt as well.


Sincerely,
Gour

-- 
Bewildered by the modes of material nature, the ignorant fully
engage themselves in material activities and become attached. But
the wise should not unsettle them, although these duties are inferior
due to the performers' lack of knowledge.

___
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] Blocks inside a conditional mode.

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

On 11/29/2021 2:54 AM, Fabrice L via ntg-context wrote:

The only inconvenient of this solution if that I have to define 15 
blocks (one for each week of the term): ComplementOne, ComplementTwo, 

\defineblock[example]

\starttext

\beginexample[Two]
Last course, we have seen A.
\endexample

\beginexample[Three]
Last course, we have seen B….
\endexample

\beginexample[Three]
Last course, we have seen C….
\endexample

\useblocks[example][Two]
% \useblocks[example][Three]

\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
___