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

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

On 12/4/2021 10:37 PM, Jan-Erik Hägglöf via ntg-context wrote:

I did replace the attached .mkxl files now in the correct directory tree 
together with the rest of all m-xyz.mkxl module files.

The same error message appears and i’m back at square one.

hm, here i did:

- install tikz from ctan
- install curcuitikz from ctan
- copy the m-files to context/base ...

ran mtxrun --generate

there is not much more I can do (esp if it also runs ok at Aditya's place)

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

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

On 12/3/2021 3:17 PM, skrantajanneman via ntg-context wrote:


My thougts on this, if it is a possible alternative, to do such things 
in metafun instead?
i guess so but we needs specs etc and time (nothing wrong with using 
tikz if one likes the syntax, apart from it being a dependency and a 
rather huge load (quite some files) and slower than mp)


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] upload

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

Hi,

a new upload

- some keywords renamed in the engine and therefore more split between 
mkiv and lmtx (hopefully i included all files) .. if something doesn't 
work any more it might be because i missed a rename.


- i finally decied that it does make sense to have native loops at the 
primitive level (after all, metapost as macro language also has them) 
and although much is possible in macros it doesn't mean we have to do it 
the (often ugly and showing-off-by-abusing-side-effects way).


We have just a constructor:

  \unexpandedloop  1 100 1 {.}

and a fully expandable one for e.g. use in \edef:

  \expandedloop1 100 1 {.}

plus an also fully expandable one for anywhere but with potential side 
effects (out of order local loops):


  \localcontrolledloop 1 100 1 {.}

complemented by a few status primitives (integers, use \the or \number 
to serialize them):


  \currentloopiterator
  \currentloopnesting

and a quitter that aborts at the next iteration:

  \quitloop

as usual it's experimental for a while. Among the rationales are 'less 
tracing clutter', 'performance' and 'more natural primitive tex coding' 
(but that one is personal).


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

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

On 12/3/2021 8:54 AM, Jan-Erik Hägglöf via ntg-context wrote:

Dear List!

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

The following test of installation failed, running file

circuitikz-context.tex in ../modules/t-tikz/ directory

% Copyright 2018-2021 by Romano Giannetti
% Copyright 2015-2021 by Stefan Lindner
% Copyright 2013-2021 by Stefan Erhardt
% Copyright 2007-2021 by Massimo Redaelli
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.


\usemodule[circuitikz]

\starttext

A simple example to test the installation.

\startcircuitikz[scale=1.2]
\draw
   (0,2) to[I=1\milli\ampere] (2,2)
 to[R, l_=2\kilo\ohm, *-*] (0,0)
 to[R, l_=2\kilo\ohm] (2,0)
 to[V, v_=2\volt] (2,2)
 to[cspst, l=$t_0$] (4,2) -- (4,1.5)
 to [generic, i=$i_1$, v=$v_1$] (4,-.5) -- (4,-1.5)
   (0,2) -- (0,-1.5) to[V, v_=4\volt] (2,-1.5)
 to [R, l=1\kilo\ohm] (4,-1.5)
   (5,2) node[dipchip, anchor=pin 1]{}
   (5,-2) node[flipflop JK, anchor=pin 1]{};

\stopcircuitikz

\stoptext

with this error message

pgfcircutils.tex|103 error| Undefined control sequence \undefined

i get

tex error   > tex error on line 19 in file ./x.tex: Package tikz 
Error: Giving up on this path. Did you forget a semicolon?


so i suppose i have a different version (i admit that i never use tikz 
so i'm not even sure what to install)


so i updated both tikz and your module and get

fonts   > 'fallback modern-designsize rm 12pt' is loaded
tex error   > tex error on line 24 in file ./x.tex: Package tikz 
Error: Giving up on this path. Did you forget a semicolon?


I get something with:

\pushcatcodetable \setcatcodetable\texcatcodes

\startcircuitikz[scale=1.2]
\draw
(0,2)
% to[I=1] (2,2)
to[R, l_=2, *-*] (0,0)
to[R, l_=2] (2,0)
% to[V, v_=2] (2,2)
to[cspst, l=$t_0$]
(4,2) -- (4,1.5)
% to [generic, i=$i_1$, v=$v_1$]
(4,-.5) -- (4,-1.5)
(0,2) -- (0,-1.5)
%  to[V, v_=4] (2,-1.5)
 to [R, l=1]
(4,-1.5) -- (5,2)
node[dipchip, anchor=pin 1]{}
(5,-2)
node[flipflop JK, anchor=pin 1]{}
  ;
\stopcircuitikz

\popcatcodetable

and leave the rest to others to figure out .. maybe some catcode 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] Font scaling via sa in LMTX

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

On 11/30/2021 9:36 PM, Rik Kabel via ntg-context wrote:

Hello list,

It seems that font scaling to a letter is not working consistently in LMTX.

This example:

\definefont[TitleA][Sans sa a]
\definefont[TitleAB][Sansbold sa a]
\starttext
{\ssa This is ssa \TitleA and this is TitleA}\par
{\ssbf This is ssbf \TitleAB and this is TitleAB}\par
\contextbanner
\stoptext

Produces different relevant output with each engine.

I suppose one could use numeric values instead of defined font size 
letters as a work-around, but that means lack of coordination with 
custom sizes in \definebodyfontenvironment.


fixed in the next upload (which is a bit experimental in the sense that 
some low level consistency renaming happened which always has the danger 
of disabling some 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] xml processing errors after latest upgrade

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

On 12/1/2021 2:03 PM, denis.ma...@unibe.ch wrote:

Sorry for spamming the list, but I was able to narrow it further down:

%
\setupinteraction
[
state=start,
openaction=FitWidth, % comment this out to make it work
]

\starttext

asdf

\stoptext
%

Can anyone confirm this?



-Ursprüngliche Nachricht-
Von: ntg-context  Im Auftrag von Denis Maier
via ntg-context
Gesendet: Mittwoch, 1. Dezember 2021 11:44
An: j.ha...@xs4all.nl; ntg-context@ntg.nl
Cc: Maier, Denis Christian (UB) 
Betreff: Re: [NTG-context] xml processing errors after latest upgrade

Ok, seems unrelated to XML.

This here shows the problem:


% no problems withouth setupinteraction
\setupinteraction [
state=start,
focus=standard,
openaction=FitWidth,
color=,
contrastcolor=,
style=,
]

\starttext

asdf

\stoptext


you can patch this in scrn-ref.lua (and remakle the format)

local expandcurrent = structures.references.expandcurrent or function() end



-
  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] xml processing errors after latest upgrade

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

On 12/1/2021 10:41 AM, Denis Maier via ntg-context wrote:

Not sure what is going wrong. Any hints how I can start debugging? Any 
ideas what could have caused that change?


(Ok, let’s build a MWE..)

a mix of old / new files?


-
  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] new upload

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

On 12/1/2021 9:49 AM, denis.ma...@unibe.ch wrote:

Thank you, Hans!

I don't understand 2, 3, and 4, but I can wikify 1. Just two question: What 
exactly are the limitations? And what is meant by horizontal registers?


% this is a variant of an example on the mailing list

\mainlanguage[es]

\setupbodyfont[dejavu]

\defineregister
  [Russian]
  [n=1,
   command=\Words,
   pagenumber=no,
   language=ru,
   textalternative=horizontal,
   distance=0pt]

\setupregister [Russian] [2] [textstyle=bold,left={, }]
\setupregister [Russian] [3] [textstyle=italic,left={, }]

% word category meaning

\setregisterentry [Russian] [entries:1={исчисление},  entries:2={n. 
neutr.},  entries:3={cálculo}]
\setregisterentry [Russian] [entries:1={исчисление},  entries:2={n. 
neutr.},  entries:3={cálculo}]
\setregisterentry [Russian] [entries:1={вероятность}, entries:2={n. 
fem.},entries:3={probabilidad}]
\setregisterentry [Russian] [entries:1={обозначать},  entries:2={v.}, 
  entries:3={denotar}]
\setregisterentry [Russian] [entries:1={область}, entries:2={n. 
fem}, entries:3={región, área}]
\setregisterentry [Russian] [entries:1={событие}, entries:2={n. 
neutr.},  entries:3={evento}]
\setregisterentry [Russian] [entries:1={определение}, entries:2={n. 
neutr.},  entries:3={definición}]
\setregisterentry [Russian] [entries:1={знание},  entries:2={n. 
neutr,},  entries:3={conocimiento}]
\setregisterentry [Russian] [entries:1={бесконечно},  entries:2={adv.}, 
  entries:3={infinitamente}]
\setregisterentry [Russian] [entries:1={сборник}, entries:2={n. 
masc.},   entries:3={colección, compilación, compendio}]
\setregisterentry [Russian] [entries:1={неравенство}, entries:2={n. 
neutr.},  entries:3={desigualdad}]


\starttext

\starttitle[title=Ruso-español]
\placeRussian
\stoptitle

\stoptext



Regarding the implementation: I've just tried it, and I wondered whether the 
stacking of bars should not happen the other way round. As in
\underbar{\underdot{asdf}}
I would have expected the bar to be below the dot. But maybe that's wrong 
expectations...
that would become rather messy and hard to analyze (this is already a 
runtime consuming feature) and never be consistent, think of


\underbar{%
\underdot{}
x
\underdot{}%
}



-
  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] new upload

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

Hi,

(1) See previous mails on the list (those who requested it have to wikify):

- mixed bars (with limitations)
- horizontal registers (flushing)

(2) As a side effect of reshuffling some code (as well as being complete):

- \boxshift 0 = 10pt
- hbox shift -10pt{...}

These box shifts are what \moveleft, \raise etc use as well as some 
internal constructors like math.


(3) Because there is no reason for a limitation to rules and boxes we 
can now also do:


- x\cleaders \glyph`! \hfill x

where as usual \glyph taking some options.

(4) A few internals that users are unlikely to encounter (unless they 
mess with weird tokens in lua).


Hopefully no bad side effects of all this (and if so, easy to solve).

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] double underbars

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

On 11/30/2021 2:52 PM, Taco Hoekwater via ntg-context wrote:


But the problem is that you have to create an “underbardot" that contains both the 
bar and the dots, to fix the non-nesting problem. It is then quite hard to get that 
definition to align properly with any enclosing “underbar” (I tried something like that a 
while ago and basically gave up. I did not want to spend a whole of time on it so I just 
told the client “computer says no").
a new experience ... taco and giving up ... (probably when you'd told 
the client that it would take a few hours it suddenly became less 
important -)


anyway, attached what happens with two different classes ... i didn't 
even test more than two as it's 'undefined behaviour' and when you need 
that you should revert to old school typewriter typesetting


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
-

b.pdf
Description: Adobe PDF 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] double underbars

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

On 11/30/2021 2:52 PM, Taco Hoekwater via ntg-context wrote:




On 30 Nov 2021, at 14:38, Denis Maier via ntg-context  
wrote:

Thanks, Taco. Good to know. Although it's not what I wanted to hear, of 
course...

I was thinking using mp to draw the combination could be solution, but 
unfortunately I don't know metafun yet.

If my understanding of https://source.contextgarden.net/node-rul.mkiv is 
correct, it should be possible to build upon the defintion of rules:under:dots 
(l. 327) Any hints how I could get this started?


Yes, that is the right part to get started with. You could just copy the whole 
\startuseMPgraphic and rename it for editing (to let’s say 
rules:under:bardots), then do

   \definebar[underbardot][undergraphic][mp=rules:under:bardots]

and play with the mp until you are happy with the output.

But the problem is that you have to create an “underbardot" that contains both the 
bar and the dots, to fix the non-nesting problem. It is then quite hard to get that 
definition to align properly with any enclosing “underbar” (I tried something like that a 
while ago and basically gave up. I did not want to spend a whole of time on it so I just 
told the client “computer says no").



Another question: what do you mean with a dy-shift version?


Nested bars have a parameter ‘dy’ which controls the vertical shifts needed to 
make sure that they do not overlap. Text backgrounds do not have that option at 
all.
i've added that so one can nest the mp driven ones but still within the 
same category ... i'll look into a mix (more complex management wise so 
typically a rainy weekend thing; i know how to do it but ...)


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


Re: [NTG-context] Title for tabulate

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

On 11/28/2021 1:22 PM, denis.ma...@unibe.ch wrote:



-Ursprüngliche Nachricht-
Von: ntg-context  Im Auftrag von Hans Hagen
via ntg-context
Gesendet: Sonntag, 28. November 2021 12:40
An: Denis Maier via ntg-context 
Cc: Hans Hagen 
Betreff: Re: [NTG-context] Title for tabulate

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


A couple of questions :

- Is it possible to have the title be typeset only once? I.e., it
should not repeat on each page.

why not just use

\subsubsubject{}


That sounds like a neat solution. I'll investigate.
Does that play nicely with structurelevels? I mean, let's say I'm somewhere 
higher, e.g. on chapter, the next level would be section. If I now invoke this 
subsubsubject manually, does that break the levels structure?

often it's ok as subjects are unnumbered but you can play safe:

\definehead[myownhead][subsubsubsubsubsubject]

\myownhead

you can then always go lower (more sub) if needed

and using dedicated head commands is also cleaner

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] Title for tabulate

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

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


A couple of questions :

- Is it possible to have the title be typeset only once? I.e., it should 
not repeat on each page.

why not just use

\subsubsubject{}

-
  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] Typographical quotes

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

On 11/28/2021 11:44 AM, Henning Hraban Ramm via ntg-context wrote:

Am 28.11.21 um 11:32 schrieb Hans Hagen via ntg-context:

On 11/27/2021 9:48 PM, Aditya Mahajan via ntg-context wrote:

I am not opposed to remove 8bit TeX hacks. I was simply objecting for 
removing the apostrophe mapping. For example, you used it in the 
sentence above (in “don't”)!
english quotes have hyjacked dutch quotes so long ago i already gave 
up on caring too much ... 


It’s not English vs. Dutch (or any other language) but keyboard layout 
limitations from the typewriter era vs. typography.


" and ' are wrong in English, too.
sure, i know that, but i was more refering to the fact that the visual 
rendering (even publisher specs) became 'use the english ones', shape 
and location wise (high/low) .. the dutch seem to care less about it 
than germans, french, czech etc (same for positioning of quotes)


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-28 Thread Hans Hagen via ntg-context

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] Typographical quotes

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

On 11/27/2021 9:48 PM, Aditya Mahajan via ntg-context wrote:


I am not opposed to remove 8bit TeX hacks. I was simply objecting for removing 
the apostrophe mapping. For example, you used it in the sentence above (in 
“don't”)!
english quotes have hyjacked dutch quotes so long ago i already gave up 
on caring too much ... when keying in i really hate visual ugliness so 
that's why i never did `foo'  or ``foo'' and just 'foo' (lucky me 
programming languages work that way although the new fashion seems to be 
to have tons of ligatures in coding expressions)


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] Typographical quotes

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

On 11/27/2021 6:40 PM, Aditya Mahajan via ntg-context wrote:

On Sat, 27 Nov 2021, Wolfgang Schuster via ntg-context wrote:


Jean-Philippe Rey via ntg-context schrieb am 27.11.2021 um 16:21:

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


The option is no longer part of the default feature set.


Personally, I think that that is a bit extreme. An apostrophe is a really 
common construct and I suspect that this change in default will mean that 
almost everyone needs to add tlig in their documents. We may perhaps need a 
'sensible-defaults' module :-)
we entered the unicode world and left ascii space so for instance the 
ugly enter `` '' and expect english double quotes is also a not-done 
now, nor are !` and ?` for the spacing rotated ! and ?; i can't find the 
font right now but there were with interesting space-something ligatures 
that only didn't show up because tex has no space.


anyway, these kind of auto font dependent remappings and ligatures are 
kind of tricky because they depend on the font and as such are a rather 
specific 8 bit tex thing ... also, to some extend


now, there are more tex traditions that context doesn't support; take 
this plain definition (there are many) dedicated to math users:


\mathcode`\^^D="225E % \land

which gives

\starttext
$^^D$
\stoptext

and as it's plain it's documented and in the tex book so users can 
expect it. It's for those who can afford a 
https://www.artlebedev.com/optimus/maximus/ (i don't have one and it's 
no longer for sale, alas).


Anyway, it's easier to enabel a feature that to disable one when side 
effects of font handling kicks in happen.


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 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] Math prime issues for some fonts

2021-11-27 Thread Hans Hagen via ntg-context
h (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.


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.


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] Concerning dictionaries. glossaries and related in ConTeXt

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

Hi,

kind of like this but maybe we need to go setups as we do with lists and 
sections adn such


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
-\pushoverloadmode \unprotect

\newconditional\c_strc_registers_traditional 
\settrue\c_strc_registers_traditional

\permanent\protected\def\startregisterentry#1% todo: level
  {\typo_injectors_check_register
   \begingroup
   \dostarttagged\t!registerentry\empty
   \global\setconstant\c_strc_registers_page_state\zerocount
   \ifconditional\c_strc_registers_traditional
 \hangindent\d_strc_registers_hangindent
 \hangafter \c_strc_registers_hangafter
   \else
 \namedregisterparameter\currentnestedregister\c!left\relax
   \fi
   \typo_injectors_mark_register}

\permanent\protected\def\stopregisterentry
  {\ifconditional\c_strc_registers_traditional
 \endgraf
   \else
 \namedregisterparameter\currentnestedregister\c!right\relax
   \fi
   \global\setconstant\c_strc_registers_page_state\zerocount
   \dostoptagged
   \endgroup}


\permanent\protected\def\usenestedregisterstyleandcolor#1#2% will change
  {\useregisterstyleandcolor#1#2%
   % how about style
   \ifconditional\c_strc_registers_text_interaction
 \ifempty\currentcolorparameter \else
   \resetinteractionparameter\c!color
   \resetinteractionparameter\c!contrastcolor
 \fi
   \fi}

\permanent\protected\def\startregisterentries#1% depth
  {\ifconditional\c_strc_registers_traditional
 \endgraf
   \fi
   \begingroup
   
\c_strc_register_level\ifnum#1>\c_strc_registers_maxlevel\c_strc_registers_maxlevel\else#1\fi\relax
   \dostarttagged\t!registerentries\empty
   \pushmacro\currentregister % bah
   \edef\currentregister{\currentregister:\number\c_strc_register_level}%
   \let\currentnestedregister\currentregister
   \usenestedregisterstyleandcolor\c!textstyle\c!textcolor
   \ifnum\c_strc_register_level>\plusone
 \advance\leftskip\d_strc_registers_distance\relax
   \fi
   \d_strc_registers_hangindent\registerparameter\c!distance\relax
   \c_strc_registers_hangafter \plusone
   \ifconditional\c_strc_registers_traditional
 \blank[\v!samepage]%
   \fi
   \popmacro\currentregister}

\def\c!textalternative{textalternative}

\appendtoks
\doifelse{\registerparameter\c!textalternative}\v!horizontal
  \setfalse\settrue\c_strc_registers_traditional
\to \everysetupregister

\protect \popoverloadmode

\starttext

\mainlanguage[es]
\enableexperiments[fonts.compact]
\setupbodyfont[dejavu] % computer-modern-unicode]
\setuphead[chapter]
  [alternative=middle]
\defineregister[Russian]
\setupregister[Russian]
  [expansion=yes,
   balance=no,
   n=2,
   command=\Words,
   pagenumber=no,
   language=ru]

\def\Ruso[#1]%
  {\begingroup
   \getdummyparameters
 [word=,
  category=,
  meaning=,
  #1]%
   \setregisterentry
 [Russian]
 [keys={\dummyparameter{word}},
  entries:1={\dummyparameter{word}},
  entries:2={\dummyparameter{category}},
  entries:3={\dummyparameter{meaning}}]%
   \endgroup}

\setupregister
  [Russian]
  [textalternative=horizontal,
   distance=0pt]

\setupregister
  [Russian][2]
  [distance=0pt,
   textstyle=bold,
   left={, }]

\setupregister
  [Russian][3]
  [distance=0pt,
   textstyle=italic,
   left={, }]


\starttext

\Ruso
[word=исчисление,
 category=n. neutr.,
 meaning=cálculo]
\Ruso
[word=вероятность,
 category=n. fem.,
 meaning=probabilidad]
\Ruso
[word=обозначать,
 category=v.,
 meaning=denotar]
\Ruso
[word=область,
 category=n. fem,
 meaning={región, área}]
\Ruso
[word=событие,
 category=n. neutr.,
 meaning=evento]
\Ruso
[word=определение,
 category=n. neutr.,
 meaning=definición]
\Ruso
[word=знание,
 category=n. neutr,,
 meaning=conocimiento]
\Ruso
[word=бесконечно,
 category=adv.,
 meaning=infinitamente]
\Ruso
[word=сборник,
 category=n. masc.,
 meaning={colección, compilación, compendio}]
\Ruso
[word=неравенство,
 category=n. neutr.,
 meaning=desigualdad]

\starttitle[title=Ruso-español]
\placeRussian
\stoptitle

\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] font problems

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

On 11/26/2021 12:59 PM, jdh via ntg-context wrote:


Here's my MWE:
Objective is to typeset a Chancery font text in the upper lefthand side 
of a page, and
then do the main body in some normal font.  Then at the very last print 
a sign off in
Chancery.  For some reason I can't get both to print out as Chancery. 
Only one or the
other, but not both.



\definefontfamily [mwetest] [sans] [Liberation Sans]
\setupbodyfont [mwe,ss,12pt]

\definelayer[mwe][repeat=yes, preset=lefttop, hoffset=.125in, voffset=.125in]
\setlayer[mwe]   {  \switchtobodyfont[chancery,8pt] \hskip 5mm Chancery Font 
Here  }
\setupbackgrounds[page][background=mwe]


\starttext

Normal font text goes here. \blank[4*big]

  { \switchtobodyfont[chancery] This should be Chancery here to.  But isn't. }

\blank[2*big]Note that if I comment out the \type{setlayer[mwe]} in the source 
file, then the above will print in Chancery.

\stoptext




I'd like to have the layers in Chancery font and then one last text string in 
the body in Chancery font.  But I can't get them both to be Chancery.  How can 
that be done?

chancery is not really a full bodyfont

\definefont[MyChancery][texgyrechorus-mediumitalic*default sa 1]
\definefont[MyChanceryBold][texgyrechorus-mediumitalic*default,boldened-20 
sa 1]


{\MyChancery test}
{\MyChanceryBold test}



-
  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] Concerning dictionaries. glossaries and related in ConTeXt

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

On 11/26/2021 12:22 PM, Jairo A. del Rio via ntg-context wrote:
Hi, list. I want to know how I should handle alphabetically sorted data 
in ConTeXt. So far, I'm abusing registers in order to get simple 
glossaries, but I prefer to manage data with tools such as JabRef rather 
than manually typing entries inside a document. I attach an example of 
what I achieved:


\unprotect
\mainlanguage[\s!es]
\enableexperiments[fonts.compact]
\setupbodyfont[computer-modern-unicode]
\setuphead[chapter]
   [\c!alternative=\v!middle]
\defineregister[Russian]
\setupregister[Russian]
   [\c!expansion=\v!yes,
    \c!balance=\v!no,
    \c!n=2,
    \c!command=\Words,
    \c!pagenumber=\v!no,
    \c!language=\s!ru]
\def\Ruso[#1]%
   {\begingroup
    \getdummyparameters[word=,category=,meaning=,#1]%
    \Russian[\dummyparameter{word}]%
    {\bold{\dummyparameter{word}}
    \italic{\dummyparameter{category}}
    \dummyparameter{meaning}}%
    \endgroup}
\protect
\Ruso
     [word=исчисление,
      category=n. neutr.,
      meaning=cálculo]
\Ruso
     [word=вероятность,
      category=n. fem.,
      meaning=probabilidad]
\Ruso
     [word=обозначать,
      category=v.,
      meaning=denotar]
\Ruso
     [word=область,
      category=n. fem,
      meaning={región, área}]
\Ruso
     [word=событие,
      category=n. neutr.,
      meaning=evento]
\Ruso
     [word=определение,
      category=n. neutr.,
      meaning=definición]
\Ruso
     [word=знание,
      category=n. neutr,,
      meaning=conocimiento]
\Ruso
     [word=бесконечно,
      category=adv.,
      meaning=infinitamente]
\Ruso
     [word=сборник,
      category=n. masc.,
      meaning={colección, compilación, compendio}]
\Ruso
     [word=неравенство,
      category=n. neutr.,
      meaning=desigualdad]
\starttext
\starttitle[title=Ruso-español]
\placeRussian
\stoptitle
\stoptitle
\stoptext

Reading the manuals, I find that the publication mechanism for 
bibliography kinda fits my needs (using ConTeXt to sort and type data 
generated via external software) but, unlike registers, it doesn't seem 
to include options for alphabetical headers. Is it fine to keep using 
registers in this case? Is there a better mechanism for this task in 
ConTeXt? Thank you in advance.

you can also use:

\setregisterentry
  [Russian]
  [keys={\dummyparameter{word}},
   entries={\bold{\dummyparameter{word}}
\italic{\dummyparameter{category}}
\dummyparameter{meaning}}]%

no need for c! v! s! unless you make a multi-userinterface style

anyway, makes me wonder if we should have a horizontal register variant

\setupregister
  [Russian][2]
  [textstyle=bold]

\setupregister
  [Russian][3]
  [textstyle=italic]

so that we keep stuff on one line

-
  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-11-26 Thread Hans Hagen via ntg-context

On 11/26/2021 11:06 AM, Alain Delmotte via ntg-context wrote:

Hi,

When I run the example below with 2021.11.22 22:32 LMTX fmt: 2021.11.23 
I get errors for \Umathxscale and \setupmathsspacing The control 
sequence [...] was never \def'ed.


which normally means that you should update

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] update lmtx

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

On 11/26/2021 11:10 AM, Alain Delmotte via ntg-context wrote:

Hi!

Le 22/11/2021 à 22:37, Hans Hagen via ntg-context a écrit :

Hi,

We're still working on the math so updated lfg files buit not many 
other things apart from a few fixes.


In the process I ran into another area where ms eems to take the lead:

https://devblogs.microsoft.com/math-in-office/unicode-math-braille-sequences/ 



and although it aims at msword I gave that a go for context so we now 
have a "braille-basic" module (style) that we (can) use (and run as 
demo) for playing with math spacing because we basically have a 
monospace font. If there is any interest in braille as alternative 
output we can extend that. I'm pretty sure that we need to adapt some 
(general spacing related) presets to this situation.


Hans


I remember having contact with people in the braille association in Belgium.
To prepare braille text you need to follow certain rules, it is not just 
using braille symbols.


sure, there are subtle details (leading chars and so) and there's also 
some 'shortcut' system


So it is better to ask braille specialist about the requirements for 
good braille text.

I'll wait and see what demands show up ... at least some basics are there.

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-26 Thread Hans Hagen via ntg-context

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
___


Re: [NTG-context] Backmatter preventing section numbers from appearing

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

On 11/25/2021 10:50 AM, A A via ntg-context wrote:

Dear All,

I've noticed that the mere presence of backmatter prevents my sections 
from being numbered. Consider the following:


/\starttext
\startsection[
   title={Create Serverless Applications},
]
blablabla
\stopsection

%\startbackmatter % comment out
%\stopbackmatter % comment out
\stoptext/
/
/
Uncommenting lines 8 and 9 causes the section numbers to disappear.

Is this normal behavior? Why does the presence of backmatter affect my 
sections like this?
technically there can be many so called sectionblocks in any order and 
as one is chosen and no previous one has been set, all preceding sec 
tions will end up in that first block (kind of fix the structure) .. 
this is needed to get things like bookmarks right


so ... when you use sectionblocks used them consistently i.e. use 
bodymatter wrapping for the preceding sections



-
  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] update lmtx

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

On 11/25/2021 12:22 PM, Alain Delmotte via ntg-context wrote:

Hi,

In the new upload for Windows 10/64 there is a new file "modules.bat".

When I did launch it it went through all my harddisk and most of the 
time there was a line saying:


"File has vanished..." those were about files outside the context-lmtx 
folder. (See the two attached images)


I crashed the action.
afaik there is no modules.bat file and looking at your screen shots i 
see all kind of files that are not in lmtx so something fishy is 
happening on your machine


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] Automatic counting groupsuffix for subfigures

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

On 11/24/2021 10:19 AM, Marco Patzer via ntg-context wrote:

Hi!

I'd like to use subfigure numbering for floats. This works:

\useMPlibrary [dum]
\starttext

\startplacefigure [location=none]
   \startfloatcombination [nx=2]
 \startplacefigure [title=Left, reference=ref:left, group=one, 
groupsuffix=a]
   \externalfigure
 \stopplacefigure
 \startplacefigure [title=Right, reference=ref:right, group=one, 
groupsuffix=b]
   \externalfigure
 \stopplacefigure
   \stopfloatcombination
\stopplacefigure

See \in{image}[ref:right] (right) and \in{image}[ref:left] (left).
\stoptext

The output is correct, but the usage is verbose. I'd like to replace
the manual groupsuffix numbering with something automatic. ConTeXt
uses automatic numbering in many places so it seems strange to
number the subfigures manually.

I have tried using counters and labels, but something is always
messed up and I couldn't get it to work.

How to achieve automatic subfigure numbering without specifying the
groupsuffix manually?
sort of tricky due to multipass and other synchronizations although in 
the end some 20 lines of code can do it ... i'll send you and wolfgang a 
test file with a more native 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
___


[NTG-context] upload

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

Hi,

for those who keep an eye on what is new, the most recent upload 
provides this:


\starttext

$\Umathxscale\textstyle  800 a + b + x + d + e = f $\par
$\Umathxscale\textstyle 1000 a + b + x + d + e = f $\par
$\Umathxscale\textstyle 1200 a + b + x + d + e = f $\blank

$\showboxes\setupmathspacing[narrow] a + b + x + d + e = f $\par
$\showboxes\setupmathspacing[normal] a + b + x + d + e = f $\par
$\showboxes\setupmathspacing[wide]   a + b + x + d + e = f $\blank

$\showboxes\setupmathspacing[tight]  x^2_1$\quad
$\showboxes\setupmathspacing[normal] x^2_1$\quad
$\showboxes\setupmathspacing[loose]  x^2_1$\blank

$\showboxes\setupmathspacing[narrow]\sqrt[2]{x+1}$\quad
$\showboxes\setupmathspacing[normal]\sqrt[2]{x+1}$\quad
$\showboxes\setupmathspacing[wide]  \sqrt[2]{x+1}$\blank

$\showboxes\setupmathspacing[less]  \sqrt[2]{x+1}$\quad
$\showboxes\setupmathspacing[normal]\sqrt[2]{x+1}$\quad
$\showboxes\setupmathspacing[more]  \sqrt[2]{x+1}$\blank

\stoptext

it's still experimental so the predefined values might change

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] update lmtx

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

Hi,

We're still working on the math so updated lfg files buit not many other 
things apart from a few fixes.


In the process I ran into another area where ms eems to take the lead:

https://devblogs.microsoft.com/math-in-office/unicode-math-braille-sequences/

and although it aims at msword I gave that a go for context so we now 
have a "braille-basic" module (style) that we (can) use (and run as 
demo) for playing with math spacing because we basically have a 
monospace font. If there is any interest in braille as alternative 
output we can extend that. I'm pretty sure that we need to adapt some 
(general spacing related) presets to this situation.


Hans

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

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


Re: [NTG-context] Problem with \head inside \itemize

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

On 11/22/2021 2:30 PM, Taco Hoekwater via ntg-context wrote:




On 22 Nov 2021, at 14:15, Jean-Philippe Rey via ntg-context 
 wrote:

Dear list,

The following code worked perfectly well with ConTeXt  ver: 2021.01.05 10:45 
LMTX
but produces an error with the current LMTX version (at least since ConTeXt  
ver: 2021.09.26 17:00 LMTX).
Adding an explicit \par at the end of the \head line allows the example to work.


It seems like the newest LMTX versions don’t handle implicit \par (empty lines) 
as argument
delimiter any more, the argument has to be terminated by the explicit string 
“\par", just
like any other argument delimiter.

This is definitely a change, but I would vote for that change to stay. ;)

there is some experimental stuff involved

\starttext

default: \the\autoparagraphmode \blank

% 0x1 text | 0x2 macro | 0x4 go-on

\autoparagraphmode0 \def\foo#1\par{[#1]} 0: \foo test\par test\par
\autoparagraphmode1 \def\foo#1\par{[#1]} 1: \foo test\par test\par
\autoparagraphmode2 \def\foo#1\par{[#1]} 2: \foo test\par test\par
\autoparagraphmode4 \def\foo#1\par{[#1]} 4: \foo test\par test\par

\starttext

but inceed i'd like to get rid of par delimited commands (afaiks we have 
only two left) and \starthead .. \stophead is the way to go


-
  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] Confusing interaction between \writetolist and bookmarks (bug?)

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

On 11/22/2021 10:49 AM, musa furber via ntg-context wrote:
I am relatively new to ConTeXt and have encountered something that does 
not work as I expected it to based on various documentation and examples.


My book design requires the front matter to contain an abridged table of 
contents just for chapters, and a detailed table of contents in the back 
matter.


Everything worked fine -- including the PDF bookmarks and table of 
contents -- until I started using \writetolist to manually inject 
additional sections and subsections into their respective lists. The 
manually injected entries do show up (as I expected), but their 
corresponding PDF bookmarks get repeated (not what I expected).

you can probably best use

\startsection[title={...},list={...},bookmark={...}]
...
\stopsection

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

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


Re: [NTG-context] Bug in lmt_arrow

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

On 11/20/2021 6:53 AM, Aditya Mahajan via ntg-context wrote:

On Mon, 15 Nov 2021, Hans Hagen wrote:


On 11/15/2021 4:07 AM, Aditya Mahajan wrote:

On Sun, 14 Nov 2021, Aditya Mahajan via ntg-context wrote:


On Sun, 14 Nov 2021, Hans Hagen wrote:



Spoke too soon. Now straight lines don't work:


new attempt (submitted to build)


The following still fails with ver 2021.11.19

 \starttext

 \startMPcode
   newpath p;
   ahfactor := 5;
   p := origin .. (3cm,0);
   draw lmt_arrow
[
  path = p,
  location = "percentage",
  percentage = 50,
  alternative = "curved",
]
withpen pencircle scaled 1bp;
 \stopMPcode
 \stoptext

I get an error:

metafun > log >
metafun > log > error: This can't happen (division by zero)
metafun > log >
bah, cycling between two failing tests ... new bin will be made on the 
farm in a moment


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


Re: [NTG-context] Multiline cell in spreadsheettable

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

On 11/18/2021 5:07 PM, juh via ntg-context wrote:

Am Thu, Nov 18, 2021 at 12:56:33PM +0100 schrieb Hans Hagen:

On 11/18/2021 10:29 AM, juh via ntg-context wrote:

Hi all,

is there a parameter to have multiple lines in a cell in a spreadsheettable?

see end of m-spreadsheet ... they are just natural tables


I found this code on the wiki

% mode=mkiv
\setuppapersize[A5]
\bTABLE
\setupTABLE[c][each][alignmentcharacter={number->.},aligncharacter=yes,align=middle]
\bTABLEhead
\bTR
\bTH Same-Width Prefix \eTH \bTH Varying-Width Prefix \eTH
\bTH Same-Width Suffix \eTH \bTH Varying-Width Suffix \eTH
\eTR
\eTABLEhead
\bTABLEbody
\bTR \bTD  \$1.00 \eTD \bTD\$1.00 \eTD \bTD  1.00\% \eTD \bTD  1.00\%   
\eTD \eTR
\bTR \bTD \$10.00 \eTD \bTD \$\$10.00 \eTD \bTD 10.00\% \eTD \bTD 10.00\%\% 
\eTD \eTR
\bTR \bTD  \$1.0  \eTD \bTD\$1.0  \eTD \bTD  1.0\%  \eTD \bTD  1.0\%
\eTD \eTR
\bTR \bTD \$10.0  \eTD \bTD \$\$10.0  \eTD \bTD 10.0\%  \eTD \bTD 10.0\%\%  
\eTD \eTR
\eTABLEbody
\eTABLE

It sets the text of bTH like p{4cm} in LaTeX in several lines.

maybe something

\setupTABLE[c][1][width=4cm]
\setupTABLE[c][3][width=4cm]

or otherwise more cells with a span (nx=...)


-
      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] Using old fonts

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

On 11/18/2021 5:36 PM, Gérard Milmeister via ntg-context wrote:

Using old fonts

Around 2000 I acquired a collection of fonts, mostly Type 1
and some TrueType. As it appears they are not fully usable
in ConTeXt. The two main issues are:

1. Kerning and ligatures

These features can be only be used, if the GPOS and GSUB
tables are present and adequately filled. Now, the old font
files do not have these tables, but instead use some
obsolete (?) form of kerning table, and ligatures are not
qualified as such, but only trough their Unicode point and
name (most commonly fi and fl). I used fontforge, which
creates the GPOS table automatically, added the liga table
manually, and generated an OTF font file.

Is there a way to automate this (possibly a fontforge
script)? The script should also find the ligatures (there
may also be frac substitutions). Or is there another way
which leaves the files unchanged?


Are you talking type 1 fonts? These should just work, assuming that you 
have the afm files installed. You need to define them with the right 
features enabled (just like opentype fonts).



2. Selecting glyphs from multiple font files

Often there are additional font files which contain small
caps (in place of lowercase characters) and old style
figures (in place of digits), and other variant glyphs and
additional ligatures (usually the font name contains OsF,
SC, Alt, or Exp). Sometimes these are not allocated to a
Unicode point, but only identified by name (e.g.
"threeoldstyle" or "Esmall"). Is it possible to create some
sort of virtual feature (such as onum), that will cause
ConTeXt to take glyphs from another file (but only for
specified Unicode ranges)? I suppose this can be done with a
Lua goody.
The fallback mechanism does that (you can define a collection that way). 
One can also try to make features (there are examples in the te st suite).


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] Multiline cell in spreadsheettable

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

On 11/18/2021 10:29 AM, juh via ntg-context wrote:

Hi all,

is there a parameter to have multiple lines in a cell in a spreadsheettable?

see end of m-spreadsheet ... they are just natural tables


-
  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] Space before/after combinations + centring

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

On 11/17/2021 11:50 PM, Marco Patzer via ntg-context wrote:

On Wed, 17 Nov 2021 20:17:52 +0100
Wolfgang Schuster  wrote:


2. There are no changes to adjust the vertical before and after a
combination environment.


That's unfortunate.


Local patches can also be tricky because ConTeXt tries to freeze
the definitions of many user level commands which means they can't
be redefined when you use a strict overload mode (look at the
lowlevel security manual for this feature).


An overload like mine is probably exactly what the strict overload
mode is supposed to protect against.


The most reliable way to center you combination blocks is to put
them either in a float or put a framedtext environment around it.


The project comprises several hundred source files. That's why I
stayed away from rewriting the sources in the first place. I'll try
to bulk-change the sources.
combinations are really just a way to package things, not meant for 
direct usage in the page flow


\startlinecorrection[blank]
...
\stoplinecorrection

is one way to use them, or in floats; the same is true for natural tables

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 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] Can modes be used for content control?

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

On 11/17/2021 6:56 PM, Aditya Mahajan via ntg-context wrote:

On Tue, 16 Nov 2021, Idris Samawi Hamid ادريس سماوي حامد wrote:


Hi Aditya,

Many thanks; see below:

On Tue, 16 Nov 2021 17:23:59 -0700, Aditya Mahajan via ntg-context
 wrote:


On Tue, 16 Nov 2021, Idris Samawi Hamid ادريس سماوي حامد via ntg-context
wrote:


Dear gang,

For creating/authoring content in ConTeXt: Can modes or the like be used
for content control? For example, someone wants to write at least two
versions of a book managed from a single file. So, e.g., we may have

a) abridged content
b) unabridged content - includes a)
c) abridged content + translation
d) unabridged content + translation
[:]

One can author and organize this in XML - pre-ConteXt - but perhaps one
prefers to write in ConTeXt (take advantage of shortcuts etc.). So maybe

\defineparagraphs[unabridged]
\defineparagraphs[abridged]
\defineparagraphs[translation]

Then one authors the complete work in a single project, but you can
produce a variety of versions, depending on the mode chosen:

\definemode[unabridged]
etc.

Can one do this in context?


Yes!

This is what I do (for solutions in homework assignments):

\definebuffer[solution][local=yes,nested=yes]

\startmode[solution]
\defineenumeration[solution][fancy setup...]
\stopmode

Then, in the main tex file:


\startsolution
...
\stopsolution


By default, gives the version without solution. Compile with --mode=solution
to get the version with solution. The same thing should work in your case by
defining two modes: unabridged and translation. And then use
--mode=unabridged,translate etc to get multiple modes.


Here's a working sample:

===
% \definebuffer[unabridged]
% \definebuffer[abridged]

\setupwhitespace[big]

\starttext
\startmode[unabridged]
\input knuth

\startblockquote
\input ward
\stopblockquote

% \startmode[abridged]
% \input knuth
% \stopmode
\stopmode

\startmode[abridged]
\input knuth
\stopmode

% \startmode[abridged]
% \input zapf
% \stopmode
\stoptext
===

Unfortunately - as pointed out on the wiki - modes cannot be nested.


But you don't have to directly use the modes. The following will work:

\definestartstop[abridged]

% By default, don't show the unabridged text
\definebuffer[unabridged][local=yes, nested=yes]

\startmode[unabridged]
% In the unabridged mode, show the abridged text
\definestartstop[unabridged]
\stopmode

\starttext
\startabridged
\input knuth

\startunabridged
\startblockquote
\input ward
\stopblockquote
\stopunabridged

\input zapf
\stopabridged

Blocks are a better mechanism, but I still prefer modes here because I find the 
\beginblock ... \endblock syntax to be a bit awkward in a context document.
it also depends on usage ... you can have blocks and delay them or reuse 
them or call them up later etc .. so you can code answers with questions 
and then call them up in an appendix



-
  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 macro in a string without expanding it

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

On 11/17/2021 12:36 PM, Henning Hraban Ramm via ntg-context wrote:




Am 16.11.2021 um 22:18 schrieb Hans Hagen via ntg-context :



it's pretty fast and needs no lua magic, only a twisted mind


May I quote you as “ConTeXt needs a twisted mind”? ;D
How about "Context tries to untwist your tex mind". After all this is 
not really user code is 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] Checking for a macro in a string without expanding it

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

On 11/16/2021 11:15 PM, Joey McCollum via ntg-context wrote:
I'm not sure if my mind is twisted enough! I can follow how Jairo's 
answer works, and that does what I need it to, but it's not as clear to 
me what the last two TeX-only approaches are doing at a low level.


Perhaps more importantly, I should clarify that for my purposes, the 
\MyOuter macro is the \currentbtxrighttext macro, which is defined in a 
separate module that I'd prefer not to modify. I want to be able to 
detect and parse the parameters of a \loc macro that a user can specify 
in a citation as follows:


```
\cite[lefttext={See}, righttext={\loc[vol=8,p=223] for further 
details}][clementinehomilies]

```

Because the locator parameters may need to be parenthesized or formatted 
differently depending on the category of the bibliography entry, they 
should be typeset separately from the plain part of the righttext. This 
is why I'd like to be able to parse the parameters and then expand the 
\loc macro itself as empty when the righttext is typeset.
in that case: just redefine \loc on the fly depending on where it's used 
and/or use keys


\cite[lefttext={See},volume=8,page=223]

or so .. imo parsing content is not really a good solution and probably 
also not reliable


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] Can modes be used for content control?

2021-11-16 Thread Hans Hagen via ntg-context
On 11/17/2021 12:25 AM, Idris Samawi Hamid ادريس سماوي حامد via 
ntg-context wrote:

Dear gang,

For creating/authoring content in ConTeXt: Can modes or the like be used 
for content control? For example, someone wants to write at least two 
versions of a book managed from a single file. So, e.g., we may have


a) abridged content
b) unabridged content - includes a)
c) abridged content + translation
d) unabridged content + translation
[:]

One can author and organize this in XML - pre-ConteXt - but perhaps one 
prefers to write in ConTeXt (take advantage of shortcuts etc.). So maybe


\defineparagraphs[unabridged]
\defineparagraphs[abridged]
\defineparagraphs[translation]

Then one authors the complete work in a single project, but you can 
produce a variety of versions, depending on the mode chosen:


\definemode[unabridged]
etc.

Can one do this in context? If so, does anyone have some working example 
of how to do it? Might even be worth a MyWay if not too unwieldy.. Thank 
you in advance!
see tests files in blocks path of test suite ... one of the oldest 
mechanisms in context (as we needed it for on source multiple output in 
educational documents)


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 macro in a string without expanding it

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

On 11/16/2021 9:09 PM, Jairo A. del Rio via ntg-context wrote:

If I understand it correctly, you may need something like this...?

% Protection is key
\protected\def\inner[#1]{\empty}
% \outer is (or was) already defined in \CONTEXT
% Please use another name
\def\Outer{\inner[123] and \inner[some text] etc.}
\startluacode
local implement = interfaces.implement
local argument = tokens.scanners.argument
local function parseinner()
   local r = {}
   local str = argument()
   str = str:gsub("\\inner%s*(%b[])",function(s)r[#r+1] = s:sub(2,#s-1)end)
   context(table.concat(r," ")) -- Change " " by another spacer if needed
end
implement{name = "parseinner", public = true, actions = parseinner}
\stopluacode
\starttext
\parseinner{\Outer}
\stoptext

However, this will only work with very simple cases (no nesting, etc.). 
Hope this helps.

well, if we start talking weird code ...

\starttext

\tolerant\def\MyInnerOuter#1\MyInner[#2]#3\MyDone\ignorearguments{#2}

\def\MyOuter#1{\MyInnerOuter#1\MyDone\ignorearguments}

whatever: \MyOuter{\MyInner[oeps]}\par
whatever: \MyOuter{\InnerMy[oeps]}\par

\edef\ItWorksA{\MyOuter{\MyInner[oeps]}}
\edef\ItWorksB{\MyOuter{\InnerMy[oeps]}}

whatever: \meaningless\ItWorksA\par
whatever: \meaningless\ItWorksB\par

\stoptext

(1) we're tolerant so no problem when no match
(2) the ignore hack quits scanning because tex will keep looking

it's pretty fast and needs no lua magic, only a twisted mind

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 macro in a string without expanding it

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

On 11/16/2021 8:22 PM, Joey McCollum via ntg-context wrote:
As the subject of this question suggests, this is really more of a 
question about expansion control (a topic that is still a bit obscure to 
me). Suppose I have a macro \inner that expects a single argument or an 
assignment of parameters in brackets. For my purposes, I don't want this 
macro to do anything when it is typeset, so I'll just define it as empty:


```
\def\inner[#1]\empty
```

Now suppose I have another macro \outer that invokes this macro with 
some specific input and sets some plain text after it:


```
\def\outer{\inner[123] etc.}
```

What I'd like to do is parse the argument of \inner in \outer. I was 
hoping that a string search in Lua would work, but I'm not having any 
luck. A minimal (non)-working example is included below:


```

\def\inner[#1]\empty

\def\outer{\inner[123] etc.}


\startluacode

local userdata = userdata or {}

function userdata.parseinner(str)

local innerparams = ""

     if string.find(str, "\\inner(%b[])") then

       i, j = string.find(str, "\\inner(%b[])")

       innerparams = string.sub(str, i+1, j-1) -- we just want the 
content inside the brackets


     end

     context(innerparams)

     return

end

\stopluacode

\def\parseinner#1{\ctxlua{userdata.parseinner([==[#1]==])}}


\starttext

Testing:\blank

\parseinner{\outer}

\stoptext

```

My problem is that when I pass \outer to the \parseinner macro, it gets 
fully expanded, so there isn't anything left to match "\\inner%b[]". Is 
there a way to expand \outer when I pass it to the \parseinner macro 
without also expanding the \inner macro inside it? Or is there some 
other preferred way of doing this?


One can always abuse native tex:

\starttext

\def\MyOuter#1%
  {\beginlocalcontrol % hides the next
   \let\Indeed\empty
   \def\MyInner[##1]{\gdef\Indeed{##1}}%
   \setbox\scratchbox\hpack{#1}%
   \endlocalcontrol  % but only if needed
   \Indeed}

whatever: \MyOuter{\MyInner[oeps]}%

\edef\ItWorks{\MyOuter{\MyInner[oeps]}}

whatever: \meaningless\ItWorks

\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] new upload, new trickery

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

On 11/16/2021 2:52 PM, Marcus Vinicius Mesquita via ntg-context wrote:

Hi, Hans

I tried to run your first example, but ConTeXt throws an error and 
complains that \resetleftparbox was never defined.

Using version: 2021.11.13


it evolved a bit (see low level manual) or typo-lbx

\resetlocalbox[left]

etc as we have installable boxes (that can individually be set and reset)

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] space handling in \type

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

On 11/16/2021 10:53 AM, Henning Hraban Ramm via ntg-context wrote:

Hi,

\starttext
\quotation{\type{\CONTEXT\ }}
\stoptext

gives

“\CONTEXT \”

i.e. the space moved. Why? Bug?
no, side effect of catcodes ... when you use \type it will change 
catcodes (sort of) and when tex serializes a \cs it will add a space 
(ok, it could remove it as it progresses but that's now how tex works)


when you pass \type as argument there is no catcode juggling but you can 
cheat


\def\foo#1{#1}

\foo{\type[compact=all]{\test\test\test}}

should work but i noticesd only for simple cases so i'll adapt it a bit
(after all, it's off by default)

naybe when i'm bored i'll cook up something else (at the engine level 
that is)


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 Hans Hagen via ntg-context

On 11/15/2021 7:06 PM, Rik Kabel via ntg-context wrote:

On your empty performance test, I get around 0.10, .11, .08 for direct, 
and 0.4 for fast. With the grouped styling, those balloon to 0.50, 0.56, 
0.48, and 0.44.

just for the record, here with lmtx i get (on a 2013 laptop):

0.128 0.130 0.114 0.057
0.686 0.674 0.660 0.602

while mkiv does:

0.211 0.224 0.131 0.055
0.763 0.767 0.677 0.597

(normally one will use at least a million tests because th elast digot 
is kind of meaningless; also the used compiler matters)


but i bet that on an average job our machines don't perform too 
different (simple tests like these are happily using the cpu cache)


it's not that easy to make tex jobs run faster but also not that hard to 
make them run slower, which i try to avoid -)


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] Bug in lmt_arrow

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

On 11/15/2021 4:07 AM, Aditya Mahajan wrote:

On Sun, 14 Nov 2021, Aditya Mahajan via ntg-context wrote:


On Sun, 14 Nov 2021, Hans Hagen wrote:


On 11/14/2021 4:33 AM, Aditya Mahajan via ntg-context wrote:

Hi,

There is a bug in lmt_arrow. If given a "non-cycle" path, lmt_arrow
completes the cycle.

  \starttext

  \startMPcode
newpath p;
ahfactor := 5;
p := origin .. (1cm, 1cm) .. (2cm, 0);
draw lmt_arrow
 [
   path = p,
   location = "percentage",
   percentage = 50,
   alternative = "curved",
 ]
 withpen pencircle scaled 1bp;
  \stopMPcode
  \stoptext

With 2021.11.11, I get the attached file. Note that lmt_arrow has drawn the
"cycle" version of the path, even though p does not have a cycle.

I have looked at the code and cannot figure out why this is happening.


it happens in the 'direct' variant (metapost.registerdirect) where a boolean
is passed as signal and that boolean then is also picked up by the (shared)
path injector as (old school) signal that a path is closed while it should
instead consutl the closed field in a path table (sounds more complex than it
is)

so in the end it is a nasty side effect of the fast inject code path (shared
function with different stack values; i'll probably have to ditch a "low level
backward compatibility feature no one uses anyway" some day)

i uploaded a fix that you can test when the bins are compiled at

https://build.contextgarden.net/#/waterfall?tags=c.luametatex

new bins then in:

https://dl.contextgarden.net/build/luametatex/

(fyi: in the mp code you see that the path p is 'get' from the lua end where
it got passed to by parameter)


Thanks! Works perfectly here.


Spoke too soon. Now straight lines don't work:


new attempt (submitted to build)


-----
  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 Hans Hagen via ntg-context

On 11/15/2021 6:24 AM, Rik Kabel via ntg-context wrote:

Hello list,

Can anyone provide a description of, or a point to a description of, the 
differences between setups= and directsetup= for including setups? I 
searched the list archive and the documents and found nothing. (That may 
indicate my level of search foo, but nonetheless I am in need of help 
with this.)

\setup  : takes a list ({...} or [...])
\directsetup: supports gridsnapping, only one setup
\fastsetup  : the fastest, only one setup

concerning performance, i wonder if you'll notice it

\starttext
\startsetups test
\stopsetups

\testfeatureonce{10}{\setup  {test}} \elapsedtime \par
\testfeatureonce{10}{\setup  [test]} \elapsedtime \par
\testfeatureonce{10}{\directsetup{test}} \elapsedtime \par
\testfeatureonce{10}{\fastsetup  {test}} \elapsedtime \par
\stoptext

because often what's done in the setup is taking the time, just test

\startsetups test
{\bf}
\stopsetups

you can volunteer to wikify it

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] minimum working example plus (output)

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

On 11/14/2021 12:26 AM, skyhorse--- via ntg-context wrote:


Here is the minium not-working example which I took from the Wikigarden a few 
minutes ago.


\def\T#1{%
   \startitemize[#1,joinedup]
 \item This is a bullet of type #1.
   \stopitemize
}

\starttext
   \dorecurse{9}{\T\recurselevel}
\stoptext



Compiling this into a pdf file with context produces an error.
I've pasted the complete context typesetting run to show the error, in hopes 
that it will shed some light on what's wrong with my setup.   I have a feeling 
that the stand along install is missing some vital part of the installation 
regarding fonts, and that it's not noticed by the majority of you since those 
items are still on your system from legacy versions.
nornally it means that you have no math font loaded (i.e. you do 
something before \starttext


Hans



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

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


Re: [NTG-context] Bug in lmt_arrow

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

On 11/14/2021 4:33 AM, Aditya Mahajan via ntg-context wrote:

Hi,

There is a bug in lmt_arrow. If given a "non-cycle" path, lmt_arrow completes 
the cycle.

 \starttext

 \startMPcode
   newpath p;
   ahfactor := 5;
   p := origin .. (1cm, 1cm) .. (2cm, 0);
   draw lmt_arrow
[
  path = p,
  location = "percentage",
  percentage = 50,
  alternative = "curved",
]
withpen pencircle scaled 1bp;
 \stopMPcode
 \stoptext

With 2021.11.11, I get the attached file. Note that lmt_arrow has drawn the 
"cycle" version of the path, even though p does not have a cycle.

I have looked at the code and cannot figure out why this is happening.


it happens in the 'direct' variant (metapost.registerdirect) where a 
boolean is passed as signal and that boolean then is also picked up by 
the (shared) path injector as (old school) signal that a path is closed 
while it should instead consutl the closed field in a path table (sounds 
more complex than it is)


so in the end it is a nasty side effect of the fast inject code path 
(shared function with different stack values; i'll probably have to 
ditch a "low level backward compatibility feature no one uses anyway" 
some day)


i uploaded a fix that you can test when the bins are compiled at

https://build.contextgarden.net/#/waterfall?tags=c.luametatex

new bins then in:

https://dl.contextgarden.net/build/luametatex/

(fyi: in the mp code you see that the path p is 'get' from the lua end 
where it got passed to by parameter)


(interesting that it didn't show up sooner, maybe most users have closed 
paths and/or most lmt_ features used closed paths)


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] new upload

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

Hi,

I uploaded a new lmtx versions. It mostly concerns new math lfg file 
functionality (and control) that Mikael Sundqvist and I are currently 
working on so there might be subtle differences in math, which is, 
unless there are bugs, intentional and for the best. At some point there 
will be additional test files in the distribution and a chapter on fonts 
in the math manual (the deadline is next years ctx meeting).


If you have wishes wrt fonts you can tell us and we'll take them into 
account (if possible) but we need proper (real) minimal examples, and 
not for only one font as we're looking at:


cambria (the reference font, very little tweaking needed)
modern  (which has some properties different from other gyre fonts)
modernlatin (the boldened aka bachotex version)
dejavu  (a gyre font but different from other gyre fonts)
pagella (a gyre font, all have subtle differences)
schola  (a gyre font, all have subtle differences)
termes  (a gyre font, all have subtle differences)
bonum   (a gyre font, all have subtle differences)
lucida  (commercial but rather cheap from tug)
xits(is that one still used?)
libertinus  (a mixed bag)
stix-two(a mixed bag)
asana   (we might drop it because of quality reasons)
ebgaramond  (this one is quite cambria conforming)
minion  (tricky because commercial and not generally available)

Maybe later the newlatin modern will get a lfg too but it's beta and we 
'modernlatin' anyway which uses our normal lm lgf file as it's A runtime 
derived font and therefore fully compatible.


The bold (heavy) math fonts also are dealt with automagically.

For practical reasons we might freeze fonts in the distribution and only 
update when explicitly checked for changes (and/or I might cook up 
version support in the lfg file assuming version checking is doable as 
often version strings are somewhat messy). We're not that bound to 
conventions (in the perspective of tex usage) and can "fix" them once 
and for all (read: we can divert from how these fonts are currently 
tuned for usage and expectations in e.g. latex and plain tex) so feel 
free to suggest esthetical pleasing options. If needed we can add 
variants (for which we can extend the lfg format). We also have plenty 
of yet unused (detailed) control in the engine. We can for instance have 
specific parameter sets / finetuning defined in the lfg files too but I 
don't know how useful and in demand that is (Mikael is looking into that).


(I'm sure Aditya has some wishes. We'll deal with Euler later as that's 
a virtual mix and virtual opentype might be redone later because we can 
simply matters a bit due to the fact that we have some more and better 
trickery wrt virtual fonts now.)


More in due time (as it's a tedious and somewhat boring job that demands 
lots of testing and investigation),


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] issue importing metadata from PDF

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

On 11/12/2021 7:24 PM, Pablo Rodriguez via ntg-context wrote:

On 11/12/21 7:14 PM, Hans Hagen via ntg-context wrote:

They are tables because in lua objects are like tables. Doesn't

 context(tostring(main_doc.Info.ModDate))

work?


Many thanks for your reply, Hans.

I’m afraid I don’t know how to extract the real information, I only get:

   table: 0x324279a3400


then you're doing something wrong

\startluacode
local main = lpdf.epdf.load("ar.pdf")
context(tostring(main.Info.ModDate))
context(tostring(main.Info.Title))
local crap1 = tostring(main.Info.ModDate)
local crap2 = tostring(main.Info.Title)
context(crap1)
context(crap2)
\stopluacode

works quite okay


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


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-12 Thread Hans Hagen via ntg-context

On 11/12/2021 7:08 PM, Vincent Hennebert via ntg-context wrote:

Hi there,

freshly upgraded LMTX installation. TwemojiMozilla.ttf downloaded from
GitHub [1].

The following:
 \usemodule[fonts-emoji]
 
 \definefontfeature

   [overlay]
   [default]
   [ccmp=yes,
colr=yes,
dist=yes]
 
 \starttext
 
 {\definedfont[name:twemojimozilla*overlay] \ShowEmoji}
 
 \stoptext


gives me pages of emojis, all black. According to what is described on
Stackexchange, I should be getting colours. Am I doing something wrong?

Works here; what if you wipe the font cache?

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] issue importing metadata from PDF

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

On 11/12/2021 6:53 PM, Pablo Rodriguez via ntg-context wrote:

Hans,

I have a PDF document (which I didn’t generate) and it contains the
following objects:

   1 0 obj
   <<
 /Title 272 0 R
 /Producer 273 0 R
 /Creator 274 0 R
 /CreationDate 275 0 R
 /ModDate 275 0 R
   >>
   endobj

   272 0 obj
   (This is an important title)
   endobj

   273 0 obj
   (Mac OS X 10.12.1 Quartz PDFContext)
   endobj

   274 0 obj
   (Keynote)
   endobj

   275 0 obj
   (D:20161108071428Z00'00')
   endobj

I cannot import these objects, since they are tables instead of strings,
after checking that with:

   \startluacode
   function document.transfer_metadata(name)
 local main_doc = lpdf.epdf.load(name)
 context(type(main_doc.Info.ModDate))
 context(type(main_doc.Info.Title))
   end
   \stopluacode

Would it be possible that LMTX can deal with these objects and import
them as strings?


They are tables because in lua objects are like tables. Doesn't

   context(tostring(main_doc.Info.ModDate))

work?

-
      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] spreadsheet product of two cells in current row

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

On 11/12/2021 4:56 PM, juh via ntg-context wrote:

Am Fri, Nov 12, 2021 at 02:42:13PM +0100 schrieb Hans Hagen:

educational tip:

\starttext

\startluacode
 context("%M",1234567.89)
 context.par()
 context("%m",1234567.89)
\stopluacode

\stoptext


Nice, so I can use that instead:

\startcell[align=flushright] @ "0.2M €" 70 \stopcell

I was looking for the formatting strings, but could not find them. I
guess this is a lua thing? String formatting in lua?


a context thing (in cld manual)


-
  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] spreadsheet product of two cells in current row

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

On 11/12/2021 5:15 PM, juh via ntg-context wrote:

Am Fri, Nov 12, 2021 at 04:56:51PM +0100 schrieb juh via ntg-context:

Am Fri, Nov 12, 2021 at 02:42:13PM +0100 schrieb Hans Hagen:

educational tip:

\starttext

\startluacode
 context("%M",1234567.89)
 context.par()
 context("%m",1234567.89)
\stopluacode

\stoptext


Nice, so I can use that instead:

\startcell[align=flushright] @ "0.2M €" 70 \stopcell



Ok. This shot was too fast. I give up. ;-)

M or m depending on what you want to achieve

-
  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] spreadsheet product of two cells in current row

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

On 11/12/2021 2:27 PM, juh via ntg-context wrote:

Once again me,

I set this

\setupspreadsheet
   [
 period={,},
 comma={.},
 split=yes,
   ]

to get german numbers in my invoice like: 10.000,00 EUR.

educational tip:

\starttext

\startluacode
context("%M",1234567.89)
context.par()
context("%m",1234567.89)
\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] Synonyms feature request

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

On 11/12/2021 4:22 AM, Rik Kabel via ntg-context wrote:

Hello developers,

Is it possible to get a mechanism to reset and setup synonyms by way 
(page, part, chapter, section, ...)?


This is not a high-priority request.

I currently accomplish this in the after key of chapter setuphead 
definitions. However, it seems cleaner to define it when the synonym 
list is defined instead of adding a resetshownsynonyms and setsynonyms 
to the chapter definition for every new synonym list.

I'll send you something to test (these are the relative easy things ...)


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] Concerning \installparameterhashhandler and family

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

On 11/9/2021 8:01 PM, Jairo A. del Rio via ntg-context wrote:
Hi. Reading at mult-aux.mkxl, I've seen command handlers define, among 
others,  \installparameterhashhandler, However, in files such as those 
related with symbol management, only \installparameterhandler and 
\installsetuphandler are. When writing basic modules, sometimes only the 
"raw" macros above are actually needed. So, what are "parameterset", 
"hashhander", "rootparameterhandler", etc. for? Where would they ease 
module writing? Thank you a lot and sorry for the long question.
The ones you mention are the lowest level ones and mechanisms that use 
them are oned that don't really have much to manage (like symbols and 
languages and fonts and so, these are core mechanisms on their own and 
need additional interfaces. There's also the matter of performance: 
anything key/value driven can have a performance hit so the more one 
wraps the worse it can get. (The mkii and mkiv/lmtx methods differe 
fundamentally, where in principle the mkii approach is faster but in 
practice mkiv/lmtx works out better. A typical case where usage in the 
end determines performance more than the implementation.)


For modules: don't go too low level. Not all helpers in modules like 
mult-aux are meant for usage outside well known situations. Just like 
some low level helpers in syst-aux stay around for compatibility.


In fact, one of the ideas behind luametatex/lmtx is to get rid of 
"complex" middle layers where the language itself can do it, so:


\protected\def\foo[#1]{\dosingleempty\dofoo}

\def\dofoo[#1]{...}

in mkii/mkiv can now be:

\tolerant\protected\def\foo[#1]{...}

(1) less code
(2) somewhat faster
(3) looks nicer (for me much is about looks)

but I guess that you already know that,

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] on luatex.wrapup

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

On 11/7/2021 11:18 PM, Pablo Rodriguez via ntg-context wrote:

Hi Hans,

I would like to use luatex.wrapup to remove media files that I don’t
need anymore once the PDF document is generated.

I have realized that luatex.wrapup works at the very end of the PDF
generation, but in each run.

Is there no way to have a luatex.final_wrapup, when no other run will
take place?


a run doesn't know it's the last one, only the context runner knows and 
then it doesn't call tex (which is why --purge and --result work)


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 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] adding module to ConTeXt basic installation

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

On 11/6/2021 11:55 AM, A A via ntg-context wrote:

Dear All,

I installed ConTeXt on my windows machine using the instructions 
provided here:


  - https://wiki.contextgarden.net/Installation 
<https://wiki.contextgarden.net/Installation>


I would like to now render some python code in my pdf. For this I need 
to install this module: https://github.com/adityam/filter 
<https://github.com/adityam/filter>


How do I add this module to my current installation? Thanks for your 
consideration.
normally they can be put in the texmf-modules tree btu you can also put 
them in texmf-local


just make sure they are in tex/context/modules/... or so amd run 
"context --generate" to update the file database


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] Any initial thoughts on luau?

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

On 11/6/2021 5:19 PM, Michal Vlasák wrote:

On Fri Nov 5, 2021 at 9:14 PM CET, Hans Hagen via ntg-context wrote:

On 11/5/2021 6:23 PM, Ramkumar KB via ntg-context wrote:

Hello,

Yesterday, Roblox announced - Luau - https://luau-lang.org/why
<https://luau-lang.org/why> - mainly adding linting and
type-checking features.

Being compatible with Lua 5.1 is probably a bummer but nonetheless
would be interesting to hear about this from this community.



for sure i need more than an email to give a real answer (and some can
be read between the lines of the history documents / articles that we
ship); that said:

the main reasons for choosing lua for luatex has been that it is
relatively small, has no dependencies, doesn't need tons of libraries
to make it useful, is made for embeded usage, evolves in a proper
academic setting, has long-term dedicated (nice) developers, is not
part of some religious programming language war/competition, reminds
me (in a positive way of pascal and modula), is pretty fast, ... so,
no regrest and no need for something else

[...]

to start with typing: i suppose that a more explicit integer / float
separation can give better performance, although on modern cpu's one
can wonder (personally i don't see the current mix of integer / float
as a benefit over all numbers being floats - which had some charm due
to the consistency - but who an i to complain; at least we now have
bitwise operators (for a specific application like roblox it makes
sense but using a dedicated / patched / extended lua machinery in
luatex doesn't); there are articles by the lua authors about typing
but these are behind publisher firewalls

[...]

jitting also costs time and for a single pass process like tex there
is no gain (we established that long ago alreadY); the only reason why
luajittex is faster than luatex for a tex run is that the vm is faster
due to some limitations (that one can actually hit but in context we
got around it) ... jitting also is cpu dependent and therefore more
fragile futurw wise (more and more complex code too)

[...]

if better performance is an objective: there are probably spots in the
current code that are candidates and one can see from updates that
occasionally optimizations happen (keep in mind that lua has to run on
a wide range of hardware: small embedded to fast single core)

so, I'm pretty okay with lua as it is now (but any influx from spin
off languages / engines can be interesting, but i think the authors
are aware of all that) ... and ... who knows what (side effects)
pallene will bring

(also about performance: i know pretty well how to write fast lua code
but no one ever comes around asking so that means everyone is
satisfied)

Hans


After Ramkumar's initial e-mail, I reread some of the manuals describing
Lua 5.1 / 5. 2 / 5.3 / 5.4 / LuaJIT evolution and evaluation.

As I learned more about Lua and LuaTeX I realized that they share (or
contrast in) some core concepts (e.g. TeX's hash table vs Lua tables,
LuaTeX's sparse arrays vs Lua tables, custom allocation strategies -
huge mem array and custom management vs garbage collection).

Recently I discovered some of the things LuaJIT does (and it is in many
ways incredible piece of software).

So the idea of implementing LuaTeX in LuaJIT struck me. The reason why
LuaJIT doesn't bring that many benefits for LuaTeX specifically (apart
from the faster interpeter, is that LuaTeX heavily uses Lua C API (which
is AFAIK slow in LuaJIT since it can't (couldn't?)be JIT compiled and
there is the overhead of the API itself - the stack nature). Wile FFI in
LuaJIT is fast. And I don't necessarilly mean calling external C
functions via FFI, just defining the structures (in C syntax) and using
them transparently in LuaJIT (like "specialized and fast tables").


sure, it's a nice piece of software


I wonder how possible and usable would a LuaTeX implementation in pure
(LuaJIT specific) Lua code would be, if it tried to offer the same API
as currently described in the LuaTeX manual (hence being compatible).


personally i would never gamble on that, just as i never gambled on 
luajittex for the long run ... it's nice to have around as long as it 
works but just as the ffilib used in luatex is 'abandoned by where it 
came from', luajit is also stuck in 5.2 and there was even a moment that 
it looked like being quit ... for me, anything that depends on low level 
cpu specific code at compile time is not worth the effort (it's also why 
i discarded libs in luametatex that have cpu specific optimizations that 
then in turn demand running scripts to generate files for compilation 
... all not worth the trouble)


now, keep in mind that (lua)jit involves some runtime analysis and that 
is why we don't gain (we did quite some experiments at that time)


also, often the runtime is not where one thinks (many jit performance 
tests are doing math and we hardly do that); also in luatex we had to 
patch the string hasher that 

Re: [NTG-context] To prepare the online meeting of Tuesday

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

On 11/6/2021 12:37 PM, Alain Delmotte via ntg-context wrote:

Hi,

I asked to discuss or have some suggestions about installing and using 
Scite for ConTeXt.


If it is possible OK, but it is not urgent.

To give some background:
I use Windows 10 and lmtx (in its own folder).
I installed Scite in c:\wscite and copied there the scite\context 
folder; I added the folder to the PATH.


If I comment the line (import context/scite-context-user) at the end of 
SciteGlobalproperties I can load .lua, .tex, .py files and I get the 
colours highlighting.


But if I uncomment: first I have Scite opening full screen, which is 
annoying, and the colour highlighting for .lua, and .tex disappears, but 
I have the context/scite.xxx.properties listed in Options!!!


And I still need to configure to be able to compile and...
Did you use the cont-sci-zip file from thre website? There are two files 
in the binary subpath there. It's just scite but with two patches (1) 
the lua-editor interface - this one will be in upcoming scites - and (2) 
a lua lpeg library as part of the main lua instance - i hope that one 
that that will be in stock scite. So, we're using standard built in 
methods (which is more reliable) combined with lpeg lexers (which sort 
of reverted back to what a had in context already before we had them for 
scite). The properties etc files are for those binaries. This also 
permits some future additions (one thing already in place is 
autocompletion of commands).


The lexers that currently ship with context assume these binaries being 
used. I know that there are still some issues. There is some tricky 
synchronization involved which I will sort out in due time (it has to do 
with some to-be-reliable optimizations for huge files); afer all I use 
scite myself so it better work ok.


If you don't see colors, you can always select language from teh pull 
down menu to have a lexing run.


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] Any initial thoughts on luau?

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

On 11/5/2021 6:23 PM, Ramkumar KB via ntg-context wrote:

Hello,

Yesterday, Roblox announced - Luau - https://luau-lang.org/why 
<https://luau-lang.org/why> - mainly adding linting and type-checking 
features.


Being compatible with Lua 5.1 is probably a bummer but nonetheless would 
be interesting to hear about this from this community.
for sure i need more than an email to give a real answer (and some can 
be read between the lines of the history documents / articles that we 
ship); that said:


the main reasons for choosing lua for luatex has been that it is 
relatively small, has no dependencies, doesn't need tons of libraries to 
make it useful, is made for embeded usage, evolves in a proper academic 
setting, has long-term dedicated (nice) developers, is not part of some 
religious programming language war/competition, reminds me (in a 
positive way of pascal and modula), is pretty fast, ... so, no regrest 
and no need for something else


now, the link you point at mentions 'typing', 'multipass bytecode 
generation', 'possible jit'


to start with typing: i suppose that a more explicit integer / float 
separation can give better performance, although on modern cpu's one can 
wonder (personally i don't see the current mix of integer / float as a 
benefit over all numbers being floats  - which had some charm due to the 
consistency - but who an i to complain; at least we now have bitwise 
operators (for a specific application like roblox it makes sense but 
using a dedicated / patched / extended lua machinery in luatex doesn't); 
there are articles by the lua authors about typing but these are behind 
publisher firewalls


multipass compiling costs time and would actually not be that 
benificial: in luatex we rely a lot on instant and frequent compilation 
(\directlua, \latelua) which is real fast; i bet that there are some 
optimizations possible in the vm but at the cost of more granularity and 
therefore it could bring limitations too (unless one goes wider memory 
wise) .. i think many lua applications actually assume fast realtime 
compilation; we simply don't stay long enough in a run to have an 
advantage (apart maybe from embedded bytecode for which an optional 
bytecode optimizer could make sense and i actually have been thinking 
about that)


jitting also costs time and for a single pass process like tex there is 
no gain (we established that long ago alreadY); the only reason why 
luajittex is faster than luatex for a tex run is that the vm is faster 
due to some limitations (that one can actually hit but in context we got 
around it) ... jitting also is cpu dependent and therefore more fragile 
futurw wise (more and more complex code too)


i'd read about the roblox vm project some time ago and was curious how 
it would work with the latest lua but then, but for good reason they 
stick to 5.1; if you look at the lua vm code i guess that some gain can 
come from less type-checking (maybe the  prefix in 5.4 is some 
indication that there are thoughts about this but currently that has no 
significant gain)


if better performance is an objective: there are probably spots in the 
current code that are candidates and one can see from updates that 
occasionally optimizations happen (keep in mind that lua has to run on a 
wide range of hardware: small embedded to fast single core)


so, I'm pretty okay with lua as it is now (but any influx from spin off 
languages / engines can be interesting, but i think the authors are 
aware of all that) ... and ... who knows what (side effects) pallene 
will bring


(also about performance: i know pretty well how to write fast lua code 
but no one ever comes around asking so that means everyone is satisfied)


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] Strange result with the new upload

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

On 11/5/2021 5:45 PM, Alain Delmotte via ntg-context wrote:

Hi,

If I take the last piece of code from Hans' message 28/10/2021 11:24, 
and run it with the new upload I get clean paragraphs with the red ans 
the blue colour, but for the paragraphs with the green colour, the text 
in colour ("keyword") is overwritten by the normal text in black.


I don't remember that before.
the localboxes interface changed a bit ... see the new lowlevel manual 
for details (i added 'middle' boxes so that we can do better margin 
trickery and there are predefined handlers for l/r margin text and nline 
numbers now


(local boxes are still kind of work in progress, the old (luatex) 
interfaces were not that usefui / interesting anyway, and we can do more 
now)


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] new upload

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

Hi,

The latest lmtx upload has this:

\starttext

\dorecurse{10} {
\dorecurse{20}{test #1 }
\dorecurse{10}{\insertlinebefore{BEFORE 1/#1}}
\dorecurse{20}{test #1 }
\blank
}

\page

\dorecurse{10} {
\dorecurse{20}{test #1 }
\insertlinebefore{BEFORE 1a}
\insertlinebefore{BEFORE 1b}
\insertlineafter {AFTER  1}
\dorecurse{20}{test #1 \hbox{\hbox{\hbox{\footnote{!}
\dorecurse{20}{test #1 }
\insertlinebefore{BEFORE 2}
\insertlineafter {AFTER  2}
\dorecurse{20}{test #1 }
\blank
}

\page

\dorecurse{20}{before #1 }
\insertblankbefore[big]%
\insertlinebefore{\bf patch starts here}%
\insertblankbefore[2*big]%
\dorecurse{20}{between #1 }
\insertblankafter[2*big]%
\insertlineafter{\bf and ends here}%
\insertblankafter[big]%
\dorecurse{20}{after #1 }

\stoptext

so, some experimental injection mechanism (using some upgraded low level 
\vadjust related trickery).


(now back to the math font mess with Mikael ... so if math lovers have 
test cases ... it's about time to deal with persistent issues as I don't 
see/expect math fonts being made more consistent than they are now so we 
can add tweaks to the goodie files as we go)


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] can typesetbuffer use the same engine?

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

On 11/5/2021 3:19 PM, Rik Kabel via ntg-context wrote:

Hello brain trust,

How can \typesetbuffer be instructed to use the same engine as the 
document which contains it?


With the following example:


\startbuffer[Buffer]
   \startTEXpage \contextmark \stopTEXpage
\stopbuffer
\starttext
   \contextmark\
   \typesetbuffer[Buffer]
\stoptext

I get "MKIV LMTX" when it is processed with context --luatex. I want the 
buffer to be processed as MkIV.

Does patching line 691 in buff-ini.lua

template = (jit and "--jit --engine=luajittex" or 
"--engine=luatex") .. " --purgeall %?path: --path=%path% ?% %filename%",


work okay? Run "context --make" after patching.

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] escape io.fileseparator in Windows

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

On 11/3/2021 7:49 PM, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following sample:

   \starttext
   \startluacode
   main_file = document.files[1]

   if file.pathpart(main_file) == "" then
 main_filename = file.nameonly(main_file)
 main_filename_win = main_filename
   else
 main_filename = file.pathpart(main_file):gsub(io.fileseparator, "/")
.. "/" .. file.nameonly(main_file)
 docx_file = main_filename .. "-file.docx"
 epub_file = main_filename .. "-file.epub"
 if os.name == "windows" then
   main_filename_win = file.pathpart(main_file) .. io.fileseparator
 .. file.nameonly(main_file)
   docx_file_win = main_filename_win .. "-file.docx"
   epub_file_win = main_filename_win .. "-file.epub"
 end
   end

   if os.name=="windows" then
 context(docx_file_win)
 os.execute("copy " .. docx_file_win .. " aeae")
   else
 context(docx_file)
   end
   \stopluacode
   \stoptext

If I run it on Windows, context(docx_file_win) cannot deal with the
backslash, so I get:

   .document-file.docx

So it is impossible that os.execute may work with copy.

Running it with Linux, I get "./document-file.docx".

How can I get the io.fileseparator or escape the backslash in
main_filename_win above?

(there are helpers for splitting names and combining paths)

- use locals
- wrap names in "" and use / : dir "c:/data"
- just use file.copy (with forward slashes), is faster too

so in the end there is no need to test for windows

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] new upload

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

On 11/2/2021 7:02 PM, Luis Montgomery via ntg-context wrote:
Maybe because a  requires , for example, 0003. See line 1506 in 
file /context/tex/texmf-context/tex/context/base/mkiv/syst-aux.mkiv

indeed. a hack for Tomas (only affects mkiv)

i'll do a new upload tomorrow

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] new upload

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

On 11/2/2021 5:58 PM, Rik Kabel via ntg-context wrote:


On 11/2/2021 05:43, Hans Hagen via ntg-context wrote:

Hi,

I uploaded a new lmtx. There is a new low level manual 
(lowlevel-localboxes) that describes the extended local boxes 
interface as well as a layer on top. New is that we have classes which 
makes this (engine) mechanism more useable. It definitely is some low 
level mechanism but you can for instance use if for high performance 
efficient maginal notes and line numbering in controlled situations. 
(There is some room fro optimization in the engien but I deal with 
that later.)


Hans



On the first run of MkIV (context --luatex) after updating my 
installation on Win11-x64, I get a complaint just after loading 
.../base/mkiv/syst-mac-lua :


open source > level 1, order 11, name
'C:/ConTeXt_LMTX/tex/texmf-context/tex/context/base/mkiv/syst-aux.mkiv'
resolvers   > lua > loading file
'C:/ConTeXt_LMTX/tex/texmf-context/tex/context/base/mkiv/syst-aux.lua'
succeeded
resolvers   > lua > loading file
'C:/ConTeXt_LMTX/tex/texmf-context/tex/context/base/mkiv/syst-mac.lua'
succeeded
!  needs four hex digits.
l.1506 {\unless\ifx##2^
       ^^^3}%
?

If I let the build proceed, all seems to be well.


should be 3


-
      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] new upload

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

Hi,

I uploaded a new lmtx. There is a new low level manual 
(lowlevel-localboxes) that describes the extended local boxes interface 
as well as a layer on top. New is that we have classes which makes this 
(engine) mechanism more useable. It definitely is some low level 
mechanism but you can for instance use if for high performance efficient 
maginal notes and line numbering in controlled situations. (There is 
some room fro optimization in the engien but I deal with that later.)


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] SyncTeX setup

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

On 10/31/2021 11:31 AM, Henning Hraban Ramm via ntg-context wrote:

Hi,
has anyone a working SyncTeX setup with ConTeXt LMTX for anything else than 
TeXshop?

With LaTeX, it works for me with Skim (+ Atom/Textadept/TeXworks) and 
TeXstudio. And in TeXshop we got our own parser. But can we expect others to 
adapt to our “superior” SyncTeX format? (I don’t understand the format yet and 
can’t tell what’s the difference.)
There are two synctex formats, we support the second one (for as far as 
i can tell). There is no context synctex format (it's just less bloated 
and redundant than what an engine outputs). So, if an editor uses the 
old synctex format you're toast.


The nice thing about texshop is that it delegates interperting the 
synctex file to an external script (in this can mtx-synctex) which 
removed the dependency on a specific version of the library. After all, 
the editor (and viewer iif one goes two ways) only needs to know a 
position in the document of pdf. It's the macro package that needs to be 
in sync and this is one way to guarantee it. Another advantage is that 
we avoid the somewhat latex specific syntac parsing (probably making 
some assumptions about the way pages are constructed).


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] \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:


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.

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
-
___
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] Cannot access Lua function

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

On 10/31/2021 5:35 AM, kauśika cittūr wrote:

On Saturday, October 30, 2021 9:16:15 PM IST Hans Hagen wrote:

cf the pdf speca:

Creator: If the document was converted to PDF from another format,
the name of the PDF processor that created the original document from
which it was converted.

Producer: If the document was converted to PDF from another format,
the name of the PDF processor that converted it to PDF.

so changing that is kind of cheating.

Hans


Dear Hans,

Thanks for the reference. Just to clarify, I only do this for VERY FEW
documents I make, not all.

In some cases, I need to keep the author of the document unidentifiable for
purposes of security, since otherwise, people who know how to look for
metadata can easily identify that I am the author given the small # of people
using ConTeXt. In my department at university I am the only one using it as
far as I know. The 'IKTS-VTR' values above are just an abbreviation for my
lab/course.


I bet that clever students can trace that down -)


Anyway, since it is not good practice, I will try to make do without this.
in that case you probably need to hide more .. (when you process with 
\nopdfcompression at the top you can look in the pdf, i.e. compression 
is not encryption


one thing you can do is make a copy of lpdf-xmp.lmt and wipe all tricky 
values and then use that to make a format


but if security is important, maybe better is to use "qpdf" to encrypt 
the file (you can then also prevent editing for instance)


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] Cannot access Lua function

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

On 10/30/2021 2:29 PM, kauśika cittūr wrote:

On Saturday, October 30, 2021 4:57:07 PM IST Hans Hagen wrote:

that function was only meant for internal (inter-lua-module
communication) usage (also because there are some expectations abotu
what is in there)

what do you want change?


Dear Hans,

I want to (/used to) set the creator and producer in the following manner

\startluacode
local metadata = lpdf.getmetadata();
metadata['producer']='IKTS-VTR';
metadata['creator']='IKTS-VTR';
\stopluacode

I was not able to do this using \setupinteraction, which I use to setup the
title, subtitle and author.

cf the pdf speca:

Creator: If the document was converted to PDF from another format,
the name of the PDF processor that created the original document from
which it was converted.

Producer: If the document was converted to PDF from another format,
the name of the PDF processor that converted it to PDF.

so changing that is kind of cheating.

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] Cannot access Lua function

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

On 10/30/2021 8:25 AM, kauśika cittūr via ntg-context wrote:

Dear list,

In one of my documents I have this lua block –
\startluacode
local metadata = lpdf.getmetadata();
⋮
\stopluacode
to modify some metadata fields.

The file compiles with the latest LMTX (2021.10.28) without any errors but no
PDF is produced. In the log, the following line is present :

backend > blocked > function 'getmetadata' is not accessible

I recall that this was working just fine some days back.

Please advise.
that function was only meant for internal (inter-lua-module 
communication) usage (also because there are some expectations abotu 
what is in there)


what do you want change?

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] new upload, new trickery

2021-10-28 Thread Hans Hagen via ntg-context
 the provided line number:

% \def\LineNumberL{\the\localboxlinenumber}
% \def\LineNumberR{\the\localboxlinenumber}

% using a tex counter

% \newcount\MyLineNumberL
% \newcount\MyLineNumberR
% \def\LineNumberL{\global\advance\MyLineNumberL\plusone\the\MyLineNumberL}
% \def\LineNumberR{\global\advance\MyLineNumberR\plusone\the\MyLineNumberR}

% using proper counters

\definecounter[MyLineNumberL]
\definecounter[MyLineNumberR]

\setupcounter[MyLineNumberL][numberconversion=characters]
\setupcounter[MyLineNumberR][numberconversion=romannumerals]

\def\LineNumberL{\incrementcounter[MyLineNumberL]\convertedcounter[MyLineNumberL]}
\def\LineNumberR{\incrementcounter[MyLineNumberR]\convertedcounter[MyLineNumberR]}

\protected\def\LeftNumber {\hbox to 
\localboxesparameter{width}{\strut(\LineNumberL\hss)}}
\protected\def\RightNumber{\hbox to 
\localboxesparameter{width}{\strut(\hss\LineNumberR)}}


\protected\def\LeftText #1{#1\quad}
\protected\def\RightText#1{\quad#1}

\showframe

\starttext

\start
\localbox[linenumber]{}%
\localbox[linenumbertwo]{}%
\localbox[linetext]{L}%
\startlocalbox[linetexttwo]
R
\stoplocalbox
\dorecurse{100}{
\samplefile{tufte}
\par
}
\stop

If you play a bit with these low level mechanism the luametatex / 
context combination now permits weird applications (which for sure some 
of you will (ab)use). The above example shows how to implement line 
numbers (there are drawbacks compared to the existing mechanisms) and 
other stuff in the margins and text edges but the most important aspect 
is that when the content in these boxes has width, it will be taken into 
account in the par builder because that is what this is about: these 
local boxes are taken into acount when breaking lines. When the handlers 
kick in, you have


\localboxattribute : more for internal use
\localboxlinenumber: as the par builder sees it
\localboxwidth : the local box width
\localboxoffset: the total distance to the edge
\localboxleftskip  : the effective leftskip
\localboxrightskip : the effective rightskip
\localboxlefthang  : the current shape related value
\localboxrighthang : the current shape related value
\localboxindent: only first line
\localboxparfillleftskip   : effective value (onky last line)
\localboxparfillrightskip  : effective value (only last line)
\localboxovershoot : overfull compensation

most of these relate to normalized lines and as such there is plenty to 
play with. Others can be seen in the examples.


I might add some more control to both these 'injection' mechanism 
because directly out of the (pdftex/omega/luatex) they are not that 
useful (which is probably also why we don't use them.) These are cheap 
extensions so they don't really influence runtime much, so .. when not 
used ... no harm done. I really have no clue how useful this is.


I need to ponder this usage:

\definelocalboxes
  [linetextA]
  [command=\LeftTextA,
   location=lefttext,
   style=\bs,
   color=darkblue]

\protected\def\LeftTextA#1{\llap{#1}\quad}

\definelocalboxes
  [linetextB]
  [command=\LeftTextB,
   location=left,
   style=\bs,
   color=darkgreen]

\protected\def\LeftTextB{\llap{\unhbox\localboxcontentbox}\quad}

\starttext

\dorecurse{10}{some text #1 }
\leftparbox {\red \bf keyword}HERE\leftparbox{}
\dorecurse{10}{some text #1 }
\blank

{\dorecurse{10}{some text #1 }
\leftparbox {\red \bf keyword}test
\dorecurse{10}{some text #1 }}
\blank

{\dorecurse{10}{some text #1 }
\localbox[linetextA]{keyword}HERE
\dorecurse{10}{some text #1 }}

{\dorecurse{10}{some text #1 }
\localbox[linetextB]{keyword}HERE
\dorecurse{10}{some text #1 }}

{\dorecurse{10}{some text #1 }
\localbox[linetextB]{keyword 1}HERE1
\dorecurse{10}{some text #1 }
\localbox[linetextB]{keyword 2}HERE2
\dorecurse{10}{some text #1 }}

\stoptext

so there's always so echallenge left.

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] Convertnumber with \ref[number] fails in MkIV, works in LMTX

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

On 10/28/2021 4:58 AM, Rik Kabel via ntg-context wrote:
Following up on my own note, I see that this fails under LMTX if 
compiled in a clean directory, but succeeds if first compiled with the 
troublesome line removed, and then, restoring the line, compiled a 
second time. It also works by placing a .tuc file from an older version 
of the document into the directory before compiling. Very strange 
indeed. The expected output, from one of those successful compilations:


So. I am clearly doing something wrong, but sometimes LMTX is letting me 
get away with it.


--
Rik

On 10/27/2021 21:47, Rik Kabel via ntg-context wrote:


Hello list,

The following fails with ConTeXt  ver: 2021.10.24 21:45 MKIV but works 
with the companion LMTX. The error message is:tex error   > tex 
error on line 6 in file G:/TestConTeXt/convert.tex: ! Incompatible 
glue units , pointing to the second \convertnumber line.


\definelabel[XX]%[text=,before=,after=,alternative=inright]
\startTEXpage[offset=2em]
 abc\XX[xx]\par
 \ref[number][xx] ·
 \convertnumber{r}{1} ·
 \convertnumber{R}{\ref[number][xx]}
\stopTEXpage

In this case I am trying to display with roman numerals the number 
generated in the label created through \definelabel.


Suggestions welcomed.

the conmversion is (partly) done in lua so at some point the

  \ref[number][xx]

gets scanned which is more robust in lmtx than in mkiv

normally one does the conversion differently:

\definelabel[XX][numberconversion=R]
\definelabel[YY][XX][numberconversion=A]

\startTEXpage[offset=2em]
1: \XX[xx]\par 2: \YY[xx]
\stopTEXpage

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] getting number from context.figurewidth

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

On 10/27/2021 9:20 PM, Pablo Rodriguez via ntg-context wrote:

On 10/26/21 6:31 PM, Pablo Rodriguez via ntg-context wrote:

[...]
Is there a way that I can get a number from context.figureheight, such
as I get it from tex.dimen.paperheight?


Sorry for insisting, I need it for a Lua script that in the relevant
line reads:

   loader_times:write('.box placeholder width=' .. context.figurewidth
  .. ' height=' .. context.figureheight)

I cannot concatenate string and function (and I need the number, not the
unit).

Is there no way of doing it?

i'm pretty sure this has been asked before

\ctxlua{local f = figures.getinfo("cow.pdf") print(f and f.used and 
f.used.width)}


so .. time to wikify it

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] XML-processing: Error with hyphenatedurl

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

On 10/27/2021 5:37 PM, Denis Maier via ntg-context wrote:


Oh, actually that leads to a similar problem as in my original question where 
Wolfgang suggested using \expandUx: if the URL is broken across lines, the link 
content is also broken. Interestingly, the plain

\startxmlsetups xml:ext-link-var-var
\goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})]
\stopxmlsetups

seems to work now correctly.
it depends abit on what gets flushed, in those cases a low level flush 
has to be used


\xmltext
\xmltextonly
\xmlraw

to get the raw data .. depends on content

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] Failure to compile with new date code

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

On 10/25/2021 10:31 PM, Rik Kabel wrote:
This has been part of my setup interaction for a couple of years. 
Documents all pass verapdf pdf3a testing.


On Oct 25, 2021 15:54, Hans Hagen via ntg-context  
wrote:


On 10/25/2021 7:54 PM, Pablo Rodriguez via ntg-context wrote:
 > On 10/25/21 4:45 PM, Rik Kabel via ntg-context wrote:
 >> Hello all,
 >>
 >> The example below continues to work with MkIV, but now fails
with the
 >> most recent (ConTeXt  ver: 2021.10.24 21:45) LMTX:
 >>
 >>  \define\DraftOf   {Draft of \date}
 >>  \setupinteraction [date={\DraftOf}]
 >
 > Hi Rik,
 >
 > \setupinteraction[date=***] only accepts a date as input.
 >
 > Would it be possible that it was subtitle or title any of the options
 > you used?

we can of course accept anything but because these dates end up in
different spots it gets hairy ... also it can invalidate a pdf


next upload:

system  > invalid time specification 'Draft of October 25, 2021'
 -----
  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] Failure to compile with new date code

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

On 10/25/2021 10:31 PM, Rik Kabel wrote:
This has been part of my setup interaction for a couple of years. 
Documents all pass verapdf pdf3a testing.


the date only ended up in some places but now we try to be consistent on 
all places


On Oct 25, 2021 15:54, Hans Hagen via ntg-context  
wrote:


On 10/25/2021 7:54 PM, Pablo Rodriguez via ntg-context wrote:
 > On 10/25/21 4:45 PM, Rik Kabel via ntg-context wrote:
 >> Hello all,
 >>
 >> The example below continues to work with MkIV, but now fails
with the
 >> most recent (ConTeXt  ver: 2021.10.24 21:45) LMTX:
 >>
 >>  \define\DraftOf   {Draft of \date}
 >>  \setupinteraction [date={\DraftOf}]
 >
 > Hi Rik,
 >
 > \setupinteraction[date=***] only accepts a date as input.
 >
 > Would it be possible that it was subtitle or title any of the options
 > you used?

we can of course accept anything but because these dates end up in
different spots it gets hairy ... also it can invalidate a pdf

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

___





--

-----
  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] Failure to compile with new date code

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

On 10/25/2021 7:54 PM, Pablo Rodriguez via ntg-context wrote:

On 10/25/21 4:45 PM, Rik Kabel via ntg-context wrote:

Hello all,

The example below continues to work with MkIV, but now fails with the
most recent (ConTeXt  ver: 2021.10.24 21:45) LMTX:

 \define\DraftOf   {Draft of \date}
 \setupinteraction [date={\DraftOf}]


Hi Rik,

\setupinteraction[date=***] only accepts a date as input.

Would it be possible that it was subtitle or title any of the options
you used?


we can of course accept anything but because these dates end up in 
different spots it gets hairy ... also it can invalidate a pdf


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] Line breaks, \wordright and hyphenation

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

On 10/24/2021 1:08 PM, Benjamin Buchmuller via ntg-context wrote:

Maybe

\hfill author


It's anyway nicer to use

% \definenarrower
%   [amnata]
%   [left=\measure{amnatamargin},
%right=\measure{amnatamargin},
%default={left,right}]

\definenarrower
  [amnata]
  [middle=\measure{amnatamargin}]

but then them, the fact that we get something hyphenated interferes .. 
tricky



On 24. Oct 2021, at 04:12, kauśika cittūr  wrote:

Dear list,

In short, my question is: why does \wordright cause a line-break when the line
preceding it breaks with hyphenation and does not otherwise? How to avoid it
(if at all possible)?

I have this delimitedtext instance called 'amnata' defined as below:

\definemeasure[amnatamargin][3cm]
\definedelimitedtext
  [amnata]
\setupdelimitedtext
  [amnata]
  [
left=,
right=,
leftmargin={\measure{amnatamargin}},
rightmargin={\measure{amnatamargin}},
  ]

I am using this to quote paragraph(s) of other authors.
Since, I also want to indicate where the quote is from, I use this as follows:

\startamnata
  ⋮
\wordright{author}
\stopamnata

so that the author's name appears at the right-edge of the block.

When the penultimate line inside the block breaks without hyphenation, then
argument of \wordright is typeset as expected (i.e. in the same line).

On the other hand, when the penultimate line inside this block breaks with
hyphenation, the argument of \wordright is pushed to the next line even when
there is enough space for it on the same line.

Here is a sample illustrating this:

\startamnata
A quote from another author : Suppose that thereisalongwordhere.
\wordright{– author}
\stopamnata

\startamnata
A quote from another author : Here, the text does not cause
hyphenation in the first line.
\wordright{– author}
\stopamnata

[I have attached the output here as an image]

How do I ensure that this does not happen, if that is possible at all? I
suppose this is expected behaviour but I am not able to understand why.

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




--

-
  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] resetting setuphyphenatedurl...

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

On 10/23/2021 4:53 AM, Rik Kabel via ntg-context wrote:

Hello List,

As demonstrated in the following example, it does not seem possible to 
reset \setuphyphenatedurlbefore, after, or normal once changed from 
default. That is, the first change appears to be global and unchangeable.


If this is the case, can someone suggest a workaround?


in lmtx i can add support for grouping (in mkiv it would be a fragile 
hack; these settings happen in lua not in tex)


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 enable the use of the blackboard font in modern ConTeXt

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

On 10/23/2021 3:31 PM, Wolfgang Schuster via ntg-context wrote:

Gerben Wierda via ntg-context schrieb am 23.10.2021 um 15:24:
On 23 Oct 2021, at 15:15, Pablo Rodriguez via ntg-context 
mailto:ntg-context@ntg.nl>> wrote:


On 10/23/21 3:00 PM, Gerben Wierda via ntg-context wrote:

By the way, neither does \blackboard{Q} work. But \rationals works in
the case of the letter Q.


Hi Gerben,

it only seems to work inside math:

 \starttext
 \dorecurse{26}{$\blackboard\characters{\recurselevel}
 \Characters{\recurselevel}$}
 \stoptext

I hope it helps,


Yes, the new \blackboard command works, so $\blackboard{Q}$ works. Thanks.


The \blackboard command is a switch like \it, to keep it local to a 
single character put the left brace before the command.


     $Q {\blackboard Q} Q$

also, it is an math alphabet switch (one of the math alphabets)

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/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] another svg conversion=mp question

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

On 10/22/2021 3:58 PM, juh via ntg-context wrote:

Hi,

I include images with a variable via pandoc in a externalfigure
directive.

These images can be jpgs, pngs, pdfs and svgs.

Can I do any harm if I do:

\setupexternalfigures[conversion=mp]


probably not unless there is an mp conversion for the other formats

-
  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] vertical align in combination

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

On 10/22/2021 5:20 PM, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following sample:

   \starttext
   \setupexternalfigure[location=default]
   \startcombination[nx=3, ny=2, location={middle}]
   {\externalfigure[mill.png][width=.25\textwidth]}
   {\externalfigure[cow.pdf][width=.25\textwidth]}
   {\externalfigure[cow.pdf][width=.25\textwidth]}
   {\externalfigure[spider.eps][width=.25\textwidth]}
   {\externalfigure[hacker.png][width=.25\textwidth]}
   {\externalfigure[mill.png][width=.25\textwidth]}
   \stopcombination
   \stoptext

The first line has the images vertically centered, but the second line
has them aligned to the top. Using "align=middle" made no difference.

How could I get all lines with images vertically centered?


maybe by using the command the right way ...

  \setupexternalfigure[location=default]
  \startcombination[nx=3, ny=2, location={middle}]
  {\externalfigure[mill.png][width=.25\textwidth]}  {}
  {\externalfigure[cow.pdf][width=.25\textwidth]}   {}
  {\externalfigure[cow.pdf][width=.25\textwidth]}   {}
  {\externalfigure[spider.eps][width=.25\textwidth]}{}
  {\externalfigure[hacker.png][width=.25\textwidth]}{}
  {\externalfigure[mill.png][width=.25\textwidth]}  {}
  \stopcombination



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
___




--

-
  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] another svg conversion=mp question

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

On 10/22/2021 3:58 PM, juh via ntg-context wrote:

Hi,

I include images with a variable via pandoc in a externalfigure
directive.

These images can be jpgs, pngs, pdfs and svgs.

Can I do any harm if I do:

\setupexternalfigures[conversion=mp]

unrelated to svg

\startMPcode
fill fullcircle scaled 1cm withcolor 1;
\stopMPcode

a missing return in line 295 of mlib-pps.lmt:

return checked_color_pair(f_gray,s,s)



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