[NTG-context] KeenWrite 2.0

2021-05-09 Thread Thangalin
Happy to announce that invoking ConTeXt from KeenWrite is now possible.

Here's a screenshot showing three different PDFs compiled from the same
plain text document:

https://github.com/DaveJarvis/keenwrite/blob/master/docs/screenshots.md#pdf-themes

Here are the installation instructions for ConTeXt (basically, make sure
that the "context" executable can be found in the system PATH):

https://github.com/DaveJarvis/keenwrite/blob/master/docs/typesetting.md

KeenWrite downloads:

https://github.com/DaveJarvis/keenwrite#download

Stay safe everyone!
___
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 setpath to set the path

2021-05-09 Thread Thangalin
Here's a version that persits the current user's PATH (i.e., not
system-wide):

rem SOF
@echo off
set "OWNPATH=%~dp0"
set "PLATFORM=mswin"

if defined ProgramFiles(x86)set "PLATFORM=win64"
if "%PROCESSOR_ARCHITECTURE%"=="AMD64"  set "PLATFORM=win64"
if exist "%OWNPATH%tex\texmf-mswin\bin\context.exe" set "PLATFORM=mswin"
if exist "%OWNPATH%tex\texmf-win64\bin\context.exe" set "PLATFORM=win64"

set "TeXPath=%OWNPATH%tex\texmf-%PLATFORM%\bin"

echo %PATH% | findstr "texmf-%PLATFORM%" > nul

rem Only update the PATH if not previously updated
if ERRORLEVEL 1 (
  setlocal enabledelayedexpansion
  set "Exists=false"
  set "Key=HKCU\Environment"

  for /F "USEBACKQ tokens=2*" %%A in (`reg query %%Key%% /v PATH 2^>nul`)
do (
if not "%%~B" == "" (
  set "Exists=true"

  rem Preserve the existing PATH
  echo %%B > currpath.txt

  rem Change the PATH environment variable
  setx PATH "%%B;%TeXPath%"
)
  )

  rem The user-defined PATH does not exist, create it
  if "!Exists!" == "false" (
rem Change the user PATH environment variable
setx PATH "%TeXPath%"
  )

  endlocal

  rem Update the current session
  set "PATH=%PATH%;%TeXPath%"
)
rem EOF
___
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] simpleslides gives 'input stack overflow'

2021-05-09 Thread Adam Reviczky
Hi,

Looks like it is a problem with "StartPage" and "StopPage" in metapost.

I get the same error with any MP graphic using those commands.

More minimal example (without simpleslides) as per the wiki:
https://wiki.contextgarden.net/Cover_Pages

colors  > 'rgb' color space is supported
colors  > 'cmyk' color space is supported
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
metapost> initializing instance 'metafun:1' using format 'metafun'
and method 'default'
metapost> loading 'metafun' as
'/usr/share/texmf/metapost/context/base/mpiv/metafun.mpiv' using method
'default'
metapost> initializing number mode 'scaled'
input stack overflow
mtx-context | fatal error: return code: 256

Commenting out "StartPage" and "StopPage" compiles.

mtx-context | current version: 2021.05.09 17:14
This is LuaTeX, Version 1.14.0
Development id: 7438

Adam

On Sun, May 9, 2021 at 9:57 PM Adam Reviczky  wrote:

> Hi,
>
> With the latest luatex change from
> https://github.com/TeX-Live/luatex/commit/1566b63b338abbe38ed839fac9f2022ebbfa7d59
> (and MKIV 2021-05-09 17:14:00) I get an input stack overflow:
>
> simpleslides> loading style Boxed
> system  > command '\NormalHeight' is already defined
> system  > command '\NormalWidth' is already defined
> system  > command '\PictureFrameHeight' is already defined
> system  > command '\PictureFrameWidth' is already defined
> close source> level 4, order 8, name
> '/usr/share/texmf/tex/context/third/simpleslides/s-simpleslides-Boxed.tex'
> close source> level 3, order 8, name
> '/usr/share/texmf/tex/context/third/simpleslides/t-simpleslides.mkiv'
> fonts   > bodyfont '24.0414pt' is defined (can better be done
> global)
> metapost> initializing instance 'metafun:1' using format 'metafun'
> and method 'default'
> metapost> loading 'metafun' as
> '/usr/share/texmf/metapost/context/base/mpiv/metafun.mpiv' using method
> 'default'
> metapost> initializing number mode 'scaled'
> input stack overflow
> mtx-context | fatal error: return code: 256
>
> MWE from the documentation:
> \usemodule[simpleslides][style=Boxed]
> \setupTitle[title={Title of the presentation},author={Name of
> authors},date={Date of presentation}]
> \starttext
> \placeTitle
> \SlideTitle{The first slide}
> Write whatever you want.
> \SlideTitle{The second slide}
> Continue writing.
> \stoptext
>
> Does that mean the simpleslides module has some recursion problems?
> I have tried a couple of themes but getting the same error.
>
> Adam
>
>
___
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] simpleslides gives 'input stack overflow'

2021-05-09 Thread Adam Reviczky
Hi,

With the latest luatex change from
https://github.com/TeX-Live/luatex/commit/1566b63b338abbe38ed839fac9f2022ebbfa7d59
(and MKIV 2021-05-09 17:14:00) I get an input stack overflow:

simpleslides> loading style Boxed
system  > command '\NormalHeight' is already defined
system  > command '\NormalWidth' is already defined
system  > command '\PictureFrameHeight' is already defined
system  > command '\PictureFrameWidth' is already defined
close source> level 4, order 8, name
'/usr/share/texmf/tex/context/third/simpleslides/s-simpleslides-Boxed.tex'
close source> level 3, order 8, name
'/usr/share/texmf/tex/context/third/simpleslides/t-simpleslides.mkiv'
fonts   > bodyfont '24.0414pt' is defined (can better be done
global)
metapost> initializing instance 'metafun:1' using format 'metafun'
and method 'default'
metapost> loading 'metafun' as
'/usr/share/texmf/metapost/context/base/mpiv/metafun.mpiv' using method
'default'
metapost> initializing number mode 'scaled'
input stack overflow
mtx-context | fatal error: return code: 256

MWE from the documentation:
\usemodule[simpleslides][style=Boxed]
\setupTitle[title={Title of the presentation},author={Name of
authors},date={Date of presentation}]
\starttext
\placeTitle
\SlideTitle{The first slide}
Write whatever you want.
\SlideTitle{The second slide}
Continue writing.
\stoptext

Does that mean the simpleslides module has some recursion problems?
I have tried a couple of themes but getting the same error.

Adam
___
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] Update setpath to set the path

2021-05-09 Thread Thangalin
Thoughts on updating the setpath.bat file to persist setting the path?

Here's an updated version that sets the system environment variable while
preserving the existing unexpanded PATH value:

rem SOF
echo off
set OWNPATH=%~dp0
set PLATFORM=mswin

if defined ProgramFiles(x86)set PLATFORM=win64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64"  set PLATFORM=win64
if exist "%OWNPATH%tex\texmf-mswin\bin\context.exe" set PLATFORM=mswin
if exist "%OWNPATH%tex\texmf-win64\bin\context.exe" set PLATFORM=win64

echo %PATH% | findstr "texmf-%PLATFORM%" > nul

rem Only update the PATH if not previously updated
if ERRORLEVEL 1 (
  set Key="HKLM\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment"
  set "CurrPath="
  for /F "USEBACKQ tokens=2*" %%A in (`reg query %%Key%% /v PATH`) do (
if not "%%~B" == "" (
  rem Preserve the existing PATH
  echo %%B > currpath.txt

  rem Update the current session
  set PATH=%PATH%;%OWNPATH%tex\texmf-%PLATFORM%\bin

  rem Change the PATH environment variable
  setx PATH "%%B;%OWNPATH%tex\texmf-%PLATFORM%\bin" /M
)
  )
)
rem EOF

Another possibility would be to define CONTEXT_HOME as an unexpanded value
added to both the system environment variables and  the PATH variable. For
example (haven't tried it):

setx CONTEXT_HOME "%OWNPATH%tex\texmf-%PLATFORM%\bin"
setx PATH "%%B;%%CONTEXT_HOME%%"

The advantage with this pattern is that subsequent updates need only check
for CONTEXT_HOME and change its value without having to worry about PATH
parsing, which can be hairy.

Yet another option to consider is changing the value for only the existing
user, rather than system-wide. Perhaps two different batch files?

The reason for this change is because the Windows installation instructions
(on the wiki) are incomplete: technically, the user must run setpath.bat
for each new session. This implies that any third-party program that wants
to make use of ConTeXt on Windows would have to communicate said fact to
the user, or let the user set the full path to ConTeXt within the
third-party program. Both of these can be avoided by persisting the PATH
setting across sessions.

Thank you!

P.S.
Pasted: https://pastebin.com/qpsqXZNB
___
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] one quick remark about textext.dflt (vs textext.dlft)

2021-05-09 Thread Garulfo

Hi all,

one remark, I was expecting to be allowed to use textext.dlft
but finally the appropriate command appears to be textext.dflt
which require to switch F and L letters.

Is it on purpose ?
would it make sense to have a dlft version to match  LeFT ?




___
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] underscore hyphenation not working

2021-05-09 Thread Hans Hagen

On 5/9/2021 6:09 PM, Pablo Rodriguez wrote:

On 5/9/21 4:40 PM, Hans Hagen wrote:

On 5/8/2021 7:55 PM, Pablo Rodriguez wrote:


I wonder whether this might be caused by a bug or the code should be
adapted to current latest.

hm, i'll check it ... looks like some lua closure side effect


Many thanks for your ultra-fast fix, Hans.

Current latest from 2021.05.09 17:14 fixes the issue.

Many thanks for your help,

you can also retest the advance

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] underscore hyphenation not working

2021-05-09 Thread Pablo Rodriguez
On 5/9/21 4:40 PM, Hans Hagen wrote:
> On 5/8/2021 7:55 PM, Pablo Rodriguez wrote:
>
>> I wonder whether this might be caused by a bug or the code should be
>> adapted to current latest.
> hm, i'll check it ... looks like some lua closure side effect

Many thanks for your ultra-fast fix, Hans.

Current latest from 2021.05.09 17:14 fixes the issue.

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] underscore hyphenation not working

2021-05-09 Thread Hans Hagen

On 5/8/2021 7:55 PM, Pablo Rodriguez wrote:


I wonder whether this might be caused by a bug or the code should be
adapted to current latest.

hm, i'll check it ... looks like some lua closure side effect

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] What is the ConTeXt way to handle this \vbox trick?

2021-05-09 Thread Hans Hagen

On 5/8/2021 10:05 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:

Dear gang,

Consider the following MWE (for a sequential multiple-choice exam), 
using some old and ugly TeX code:


===
\setupbodyfont[schola]
\noheaderandfooterlines
\setupwhitespace[big]

\def\CHOICE#1#2{\leavevmode\vbox{\tabskip=0pt\everycr={}
     \halign{\strut\hfil##\hfil\cr#1\cr#2\cr}}}

\starttext
(Religion * Biology * Cosmology * Physics) is part of the subject matter 
of World Philosophies.


(Religion * Biology * Cosmology * Physics) is part of the subject matter 
of World Philosophies.


(\CHOICE{1}{Religion}\ * \CHOICE{X}{Biology} *
\CHOICE{2}{Cosmology}\ * \CHOICE{X}{Physics}) is part of the subject 
matter of World Philosophies.

\stoptext
===

Result is attached. Question:

What is the most elegant ConTeXt way to get the same result as the above 
code, with equal or better control? Thank you in advance.

you can use some old, probaly never really used,  mechanism ...

\defineruby[auto]  [align=auto,color=darkred]
\defineruby[left]  [align=flushleft,color=darkred]
\defineruby[right] [align=flushright,color=darkred]
\defineruby[spread][stretch=yes]

\setupinterlinespace[22pt]

\starttext

\startbuffer
\dorecurse{20}{\ruby{XYZ}{a|bc|d} }\par
\dorecurse{20}{\ruby{PQR}{p|q|r} }\par
\dorecurse{20}{\ruby{XYZ}{1|22|333} }\par
\dorecurse{20}{\ruby{XYZ}{111|222|333} }\par
\dorecurse{20}{\ruby{XYZ}{foobar} }\par
\dorecurse{20}{\ruby{XYZ}{fooledbar} }\par
\dorecurse{20}{\ruby[spread]{XYZ}{fooledbar} }\par
\dorecurse{20}{\ruby{extremely}{wide} }\par
\dorecurse{20}{\ruby{wide}{extremely} }\par
 stopbuffer

\testfeatureonce{1}{\start \setupinterlinespace[16pt] 
\setupruby[location=none]   \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[16pt] 
\setupruby[location=right]  \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=auto,color=darkred]\getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=flushleft,color=darkgreen] \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=flushright,color=darkblue] \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=middle,color=darkyellow]   \getbuffer \stop \page}


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