Re: [NTG-context] Set up external figure for particular image type

2022-07-12 Thread Wolfgang Schuster via ntg-context

Thangalin via ntg-context schrieb am 12.07.2022 um 20:11:

Thank you for the suggestion Hraban.

The source comes from Markdown, which is converted to XML, then 
typeset using ConTeXt. There's no Markdown-specific mechanism to 
relate images to a particular external figure definition, 
unfortunately. All images use the same syntax and are treated the same 
way. The only part that differs is the file name extension (and header 
within the file).


One possibility would be something like:
|\setupexternalfigure[ width=1em, height=1em, order={svg,pdf,png,jpg}, 
location={local,default,global}, ] \defineexternalfigure[png][ 
width=\textwidth, height=\textheight, ] \unprotect 
\let\old_externalfigure=\externalfigure 
\tolerant\def\externalfigure[#1]#,[#2]#,[#3]{% 
\doifelseinstring{.png}{#1}{% \old_externalfigure[#1][png][#2]% }{% 
\doifelsefileexists{#1.png}{% \old_externalfigure[#1.png][png][#2]% 
}{% \old_externalfigure[#1][#2][#3]% }% }% } \protect |

See: https://tex.stackexchange.com/a/650221/2148

I was wondering if there was a simpler or a solution that's more the 
ConTeXt-way?


When you use XML as input you can add additional code to the setups block
which uses \externalfigure to load the image.


\setupexternalfigures [location={local,global,default}]

\defineexternalfigure [jpg] [width=4cm]
\defineexternalfigure [png] [width=8cm]

\starttexdefinition includegraphics #1

    \splitfilename{#1}

    \processaction
    [\splitofftype]
    [    jpg=>{\externalfigure[#1][jpg]},
 png=>{\externalfigure[#1][png]},
 default=>{\externalfigure[#1]},
 unknown=>{\externalfigure[#1]}]

\stoptexdefinition

%\starttexdefinition includegraphics #1
%
%    \getfiguredimensions[#1]
%
%    \processaction
%    [\figurefiletype]
%    [    jpg=>{\externalfigure[#1][jpg]},
% png=>{\externalfigure[#1][png]},
% default=>{\externalfigure[#1]},
% unknown=>{\externalfigure[#1]}]
%
%\stoptexdefinition

\starttext

\includegraphics{hacker.jpg}

\includegraphics{mill.png}

\includegraphics{cow.pdf}

\stoptext

Wolfgang

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

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


Re: [NTG-context] Set up external figure for particular image type

2022-07-12 Thread Thangalin via ntg-context
Thank you for the suggestion Hraban.

The source comes from Markdown, which is converted to XML, then typeset
using ConTeXt. There's no Markdown-specific mechanism to relate images to a
particular external figure definition, unfortunately. All images use the
same syntax and are treated the same way. The only part that differs is the
file name extension (and header within the file).

One possibility would be something like:

\setupexternalfigure[
width=1em,
height=1em,
order={svg,pdf,png,jpg},
location={local,default,global},
]
\defineexternalfigure[png][
width=\textwidth,
height=\textheight,
]
\unprotect
\let\old_externalfigure=\externalfigure
\tolerant\def\externalfigure[#1]#,[#2]#,[#3]{%
\doifelseinstring{.png}{#1}{%
\old_externalfigure[#1][png][#2]%
}{%
\doifelsefileexists{#1.png}{%
\old_externalfigure[#1.png][png][#2]%
}{%
\old_externalfigure[#1][#2][#3]%
}%
}%
}\protect

See: https://tex.stackexchange.com/a/650221/2148

I was wondering if there was a simpler or a solution that's more the
ConTeXt-way?

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

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


Re: [NTG-context] upload

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

On 7/9/2022 12:40 AM, Otared Kavian via ntg-context wrote:

I just found that \choose has been replaced with \binom (binomial coefficient):

\starttext
\meaning\choose

\meaning\binom

$\binom{n}{k}$
\stoptext

Sorry for complaining… :-)
no problem ... maybe we should have a wiki page for 'use this instead of 
that'


as you're playing with it ... there is a lot we haven't yet introduced 
but we will do that stepwise .. here's one


inline formulas like $(x + a + 2)$ will break across lines but 
traditionally \left( .. \right) doesn't which is why these \bigg things 
are there : manual solution for breaking inline math


however, in lmtx these do break across lines but there are of course 
still cases where the penalties injected will discourage it; there is 
agranular penalty system in place but current it is configured as 
traditional tex


now, when a formula doesn't break and is somehow wrapped it doesn't play 
that well with linebreaks but you can cheat: formulas can becoem liek 
glue where the inter atom stretch and shrink can play a more prominent 
role ... here's a test:


% turning small inline formulas into leaders to that we don't get overflows
% or excessive spacing

\continuewhenlmtxmode

\startbuffer[threshold-none]
\setupbodyfont[modern]
\setuppapersize[A5]
\setuplayout[tight]
\setupmathematics[threshold=none]
\dorecurse {950} {
test $\darkblue \showboxes x + #1$
test $\darkred  \showboxes x + #1 + z$
}
\stopbuffer

\startbuffer[threshold-small]
\setupbodyfont[modern]
\setuppapersize[A5]
\setuplayout[tight]
\setupmathematics[threshold=small]
\dorecurse {950} {
test $\darkblue \showboxes x + #1$
test $\darkred  \showboxes x + #1 + z$
}
\stopbuffer

\startbuffer[threshold-medium]
\setupbodyfont[modern]
\setuppapersize[A5]
\setuplayout[tight]
\setupmathematics[threshold=medium]
\dorecurse {950} {
test $\darkblue \showboxes x + #1$
test $\darkred  \showboxes x + #1 + z$
}
\stopbuffer

\startbuffer[threshold-big]
\setupbodyfont[modern]
\setuppapersize[A5]
\setuplayout[tight]
\setupmathematics[threshold=big]
\dorecurse {950} {
test $\darkblue \showboxes x + #1$
test $\darkred  \showboxes x + #1 + z$
}
\stopbuffer

\starttext
\dorecurse {10} {
\startcombination[2*2]
{\hbox to .45\textwidth{\typesetbuffer[threshold-none] 
[frame=on,width=.45\textwidth,page=#1]\hss}} {\type {threshold=none}}
{\hbox to .45\textwidth{\typesetbuffer[threshold-small] 
[frame=on,width=.45\textwidth,page=#1]\hss}} {\type {threshold=small}}
{\hbox to 
.45\textwidth{\typesetbuffer[threshold-medium][frame=on,width=.45\textwidth,page=#1]\hss}} 
{\type {threshold=medium}}
{\hbox to .45\textwidth{\typesetbuffer[threshold-big] 
[frame=on,width=.45\textwidth,page=#1]\hss}} {\type {threshold=big}}

\stopcombination
}
\stoptext

There is also a system like widows and orphans in the sense that one can 
set forward and backward penalties, as in:


\setuplayout[width=11cm]

\startbuffer
\dorecurse {50} {
test $\darkblue   a + #1 + b > 2$ %
test $\darkreda + b + #1 + c + d > 2$ %
test $\darkgreen  a + b + c + #1 + d + e + f > 2$ %
}
\stopbuffer

\setuptolerance[verytolerant,stretch]

\starttext
\start
\mathforwardpenalties  0
\mathbackwardpenalties 0
\getbuffer
\par
\stop
\page
\start
\mathforwardpenalties  2 -200 -100
\mathbackwardpenalties 2 -100  -50
\getbuffer
\par
\stop
\page
\start
\mathforwardpenalties  2  200 100
\mathbackwardpenalties 2  100  50
\getbuffer
\par
\stop
\page
\stoptext

but we currently don't have a high level interface for that; it will be 
part of the more general math penalties setup.


These are just a few of the things to play with.

Hans


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

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


Re: [NTG-context] Set up external figure for particular image type

2022-07-08 Thread Henning Hraban Ramm via ntg-context

Am 08.07.22 um 17:46 schrieb Thangalin via ntg-context:

I'd like to change the `maxheight` option for only PNG images, such as:


Define your own figure class with \definexternalfigure:
https://wiki.contextgarden.net/Command/defineexternalfigure

It won’t automatically chose the file format (or maybe it works with 
"order"), but you don’t need to repeat the setting for each instance.


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

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


[NTG-context] Set up external figure for particular image type

2022-07-08 Thread Thangalin via ntg-context
A document has a mix of SVG and PNG images. Changing the parameters for
`\setupexternalfigure` affects both SVG and PNG images. Consider the
following code:

\setupexternalfigures[
  order={svg,pdf,png,jpg},
  location={local,default,global},
  directory={images},
  maxwidth=\textwidth,
  maxheight=0.4\textheight
]

I'd like to change the `maxheight` option for only PNG images, such as:

\setupexternalfigure[
  method=png,
  maxwidth=\textwidth,
  maxheight=\textheight,
]

However, this affects SVG images as well.

How do you apply different external figure setups based on image type?

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

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


Re: [NTG-context] upload

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

On 7/7/2022 3:15 AM, Max Chernoff via ntg-context wrote:

Hi,

With the latest upload, "tex.linebreak" doesn't return an "info" table.

When running this code:

     \startluacode
     function test(head)
     local new_head, info = tex.linebreak(node.copylist(head))

     print(head, type(head), info, type(info))

     if info == nil then
     print "!!! info is nil !!!"
     end

     return head
     end

     nodes.tasks.appendaction("processors", "after", "test")
     \stopluacode

     \starttext
     Hello!
     \stoptext

with the latest upload I get (also note the small typo in "rigthfill"):

     luatex warning  > linebreak: no [ leftinit | rightinit | leftfill | 
rigthfill] expected
        2353 : par vmodepar>  
userdata    nil nil

     !!! info is nil !!!
        2299 : glue userskip> 
userdata    nil nil

     !!! info is nil !!!

but with live.contextgarden.net I get:

     luatex warning  > tex: left parfill skip is gone
     Underfull \hbox (badness 1) in paragraph at lines 20--1
         929 : par vmode_par>    userdata
table: 0x39a050f7000    table
        1561 : glue userskip>    userdata
nil    nil

     !!! info is nil !!!


This is because you need to pass a list that conforms to what the 
builder expects and the callback that you use doesn't do that for you 
(after all, it also gets hbox content).


There is no 'callback sequence handler' for the par builder (currently i 
see no need for it, also given the extra overhead involved) but this 
what what you can do:


\startluacode
function builders.paragraphs.constructors.methods.preroll_a(head)
local result, info = tex.linebreak(head)
tex.prevdepth = info.prevdepth
tex.prevgraf = info.prevgraf
return result
end
function builders.paragraphs.constructors.methods.preroll_b(head)
local result, info = tex.linebreak(nodes.nuts.copylist(head))
inspect(info)
return true
end
\stopluacode

\defineparbuilder[preroll_a]
\defineparbuilder[preroll_b]

\starttext
\setmainparbuilder[default]   \input tufte \par \input tufte \page
\setmainparbuilder[preroll_a] \input tufte \par \input tufte \page
\setmainparbuilder[preroll_b] \input tufte \par \input tufte \page
\stoptext

The tex.linebreak function gets the properly prepared paragraph and can 
handle it then. On the to do is a to add a 'prepare' helper that adds 
the mandate nodes (par fillers etc) but even then one has to be careful 
where linebreak hackery is applied.


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

2022-07-06 Thread Max Chernoff via ntg-context

Hi,

With the latest upload, "tex.linebreak" doesn't return an "info" table.

When running this code:

\startluacode
function test(head)
local new_head, info = tex.linebreak(node.copylist(head))

print(head, type(head), info, type(info))

if info == nil then
print "!!! info is nil !!!"
end

return head
end

nodes.tasks.appendaction("processors", "after", "test")
\stopluacode

\starttext
Hello!
\stoptext

with the latest upload I get (also note the small typo in "rigthfill"):

luatex warning  > linebreak: no [ leftinit | rightinit | leftfill | 
rigthfill] expected
   2353 : par vmodepar>  userdatanil 
nil
!!! info is nil !!!
   2299 : glue userskip> userdatanil 
nil
!!! info is nil !!!

but with live.contextgarden.net I get:

luatex warning  > tex: left parfill skip is gone
Underfull \hbox (badness 1) in paragraph at lines 20--1
929 : par vmode_par> userdata
table: 0x39a050f7000table
   1561 : glue userskip> userdatanil 
nil
!!! info is nil !!!

Thanks,
-- Max
___
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 alegreya typescript

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


\usetypescriptfile[alegreya]

\usebodyfont[alegreya-light]
\usebodyfont[alegreya-medium]

\setupbodyfont[alegreya]

\setuplayout[tight]

\starttext
\switchtobodyfont[alegreya-light]\input tufte \par
\switchtobodyfont[alegreya]  \input tufte \par
\switchtobodyfont[alegreya-medium]   \input tufte \par
\switchtobodyfont[alegreya-light,sans]   \input tufte \par
\switchtobodyfont[alegreya,sans] \input tufte \par
\switchtobodyfont[alegreya-medium,sans]  \input tufte \par
\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
-%D \module
%D   [   file=type-imp-dejavu,
%Dversion=2010.06.21,
%D  title=\CONTEXT\ Typescript Macros,
%D   subtitle=Alegreya fonts,
%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 This is cleaned up ersion of thwe one on the wiki. The font can be fetched 
from:
%D
%D \type {https://www.huertatipografica.com/en/fonts/alegreya-ht-pro}

% \usetypescriptfile[alegreya]
%
% \usebodyfont[alegreya-light]
% \usebodyfont[alegreya-medium]
%
% \setupbodyfont[alegreya]
%
% \setuplayout[tight]
%
% \starttext
% \switchtobodyfont[alegreya-light]\input tufte \par
% \switchtobodyfont[alegreya]  \input tufte \par
% \switchtobodyfont[alegreya-medium]   \input tufte \par
% \switchtobodyfont[alegreya-light,sans]   \input tufte \par
% \switchtobodyfont[alegreya,sans] \input tufte \par
% \switchtobodyfont[alegreya-medium,sans]  \input tufte \par
% \stoptext

\starttypescriptcollection[alegreya]

\usetypescriptfile
  [imp-gentium]

\definefontfallback
  [alegreyagentium-fallback]
  [name:gentium]
  [greekandcoptic,greekextended]

\starttypescript [serif] 
[alegreya-serif,alegreya-light-serif,alegreya-medium-serif] [name]
\setups[font:fallback:serif]
\definefontsynonym[Serif]   [name:alegreyaregular]
[features=default,fallbacks=alegreya-gentium-fallback]
\definefontsynonym[SerifItalic] [name:alegreyaitalic] 
[features=default,fallbacks=alegreya-gentium-fallback]
\definefontsynonym[SerifBold]   [name:alegreyabold]   
[features=default,fallbacks=alegreya-gentium-fallback]
\definefontsynonym[SerifBoldItalic] [name:alegreyabolditalic] 
[features=default,fallbacks=alegreya-gentium-fallback]
\stoptypescript

\starttypescript [sans] [alegreya-sans] [name]
\setups[font:fallback:sans]
\definefontsynonym [Sans]   [name:alegreyasansregular]
[features=default]
\definefontsynonym [SansItalic] [name:alegreyasansitalic] 
[features=default]
\definefontsynonym [SansBold]   [name:alegreyasansbold]   
[features=default]
\definefontsynonym [SansBoldItalic] [name:alegreyasansbolditalic] 
[features=default]
\stoptypescript

\starttypescript [sans] [alegreya-light-sans] [name]
\setups[font:fallback:sans]
\definefontsynonym [Sans]   [name:alegreyasanslight]
[features=default]
\definefontsynonym [SansItalic] [name:alegreyasanslightitalic]  
[features=default]
\definefontsynonym [SansBold]   [name:alegreyasansmedium]   
[features=default]
\definefontsynonym [SansBoldItalic] [name:alegreyasansmediumitalic] 
[features=default]
\stoptypescript

\starttypescript [sans] [alegreya-medium-sans] [name]
\setups[font:fallback:sans]
\definefontsynonym [Sans]   [name:alegreyasansmedium]  
[features=default]
\definefontsynonym [SansItalic] [name:alegreyasansmediumitalic]
[features=default]
\definefontsynonym [SansBold]   [name:alegreyasansextrabold]   
[features=default]
\definefontsynonym [SansBoldItalic] [name:alegreyasansextrabolditalic] 
[features=default]
\stoptypescript

\starttypescript [alegreya,alegreya-light,alegreya-medium]

\definefallbackfamily[alegreya][serif][gentium][range={greekandcoptic,greekextended}]
\definetypeface [\typescriptone] [rm] [serif] [\typescriptone-serif] 
[default]
\definetypeface [\typescriptone] [ss] [sans]  [\typescriptone-sans]  
[default]
\definetypeface [\typescriptone] [tt] [mono]  [modern]   
[default]
\definetypeface [\typescriptone] [mm] [math]  [default]  
[default]
\stoptypescript

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

Re: [NTG-context] Odd behaviour with Plex typescript

2022-06-30 Thread Hans Hagen via ntg-context

On 6/30/2022 10:36 AM, Max Chernoff via ntg-context wrote:

If you load the Plex typescript, a spurious space is added on the first
switch to another font, messing up any alignment. This doesn't happen
with any other fonts; only with Plex.

MWE:

     \setuphead[section][style={\switchtobodyfont[modern]}]
     \setupbodyfont[plex]

     \starttext
     \section{A}
     A
     \stoptext

I was able to fix this by removing the space immediately before the "%"
on line 136 of "type-imp-plex.mkiv", changing it from this (original):

 
\definefontfeature[plexwideneddefault][default][extend=\luaexpr{1/0.85}] 
% An odd floating point number to correct monospace.


to this (fixed):

 
\definefontfeature[plexwideneddefault][default][extend=\luaexpr{1/0.85}]% An 
odd floating point number to correct monospace.


I'm pretty sure that TeX is ignoring spaces at this point, so I have no
idea why this issue exists or why the fix works.
when you trigger modern it will also process a typescript and that can 
itself have spaces introduced


just preload it, as in:

\usebodyfont[modern]

\setupbodyfont[plex]

\setuphead
  [section]
  [style={\switchtobodyfont[modern]}]

\starttext
\section{A}
A
\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
___


[NTG-context] Odd behaviour with Plex typescript

2022-06-30 Thread Max Chernoff via ntg-context

If you load the Plex typescript, a spurious space is added on the first
switch to another font, messing up any alignment. This doesn't happen
with any other fonts; only with Plex.

MWE:

\setuphead[section][style={\switchtobodyfont[modern]}]
\setupbodyfont[plex]

\starttext
\section{A}
A
\stoptext

I was able to fix this by removing the space immediately before the "%"
on line 136 of "type-imp-plex.mkiv", changing it from this (original):


\definefontfeature[plexwideneddefault][default][extend=\luaexpr{1/0.85}] % An 
odd floating point number to correct monospace.

to this (fixed):


\definefontfeature[plexwideneddefault][default][extend=\luaexpr{1/0.85}]% An 
odd floating point number to correct monospace.

I'm pretty sure that TeX is ignoring spaces at this point, so I have no
idea why this issue exists or why the fix works.

-- Max
___
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] Count (and limit) glyphs per line?

2022-06-25 Thread Benjamin Buchmuller via ntg-context
Dear list,

A brief follow-up for (1) itemizations [resolved; but question on ConTeXt hsize 
defaults] and (2) hyphenation [troubles].

(1) To deal with itemizations and other situation where texts are indented such 
as:

   \setuppapersize[landscape,letter]
   \showframe

   \starttext

   \samplefile{knuth}

   \ctxlua{context(tex.dimen["textwidth"])} % 37213340

   \ctxlua{context(tex.dimen["localhsize"])} % 0

   \startitemize[width=5em]

   \item \samplefile{knuth}

   \ctxlua{context(tex.dimen["textwidth"])} % 37213340

   \ctxlua{context(tex.dimen["localhsize"])} % 33283340

   \stopitemize
   
   \stoptext

The following part in the script must be adapted to the local horizontal size, 
I guess: 

if chars >= max_length or width > tex.hsize then

However, tex.localhsize (or tex.dimen["localhsize"]) is 0 when the document is 
initialized. (Maybe a more sensible default would be textwidth rather than 0?)

So, I added:

local localhsize = tex.dimen["textwidth"]
   
if tex.dimen["localhsize"] > 0 then
localhsize = tex.dimen["localhsize"]
end

if chars >= max_length or width > localhsize then

Maybe someone finds this useful in the future.

(2) I'm (now?) running into trouble with hyphenation. With the example above, I 
get

"
The separation of any of these four components would have hurt TEX 
significantly. If I had not partic­-
i-
pated fully in all these activities, literally hundreds of improvements would 
never have been made,
"

In my own document, I also get lines with only a single character or hboxed 
group. I assume, this is because the hyphen is not counted and pushes the 
remainder to a new line where the intended breakpoint again starts another one.

Unfortunately, I don't know what to change; I know a bit about "glyph" and 
"glue", but what is "disc" and would it help here?

Thank you!


Benjamin


> On Jun 25, 2022, at 11:38, Benjamin Buchmuller 
>  wrote:
> 
> Wow, that works like a charm! Thank you, Max! 
> 
> It's also a very insightful example of how to use and inject Lua code in the 
> TeX output routine. Do you mind if I add it to the wiki? (Probably under 
> "Wrapping".)
> 
> Many thanks again!
> 
> 
> Benjamin
> 
>> On Jun 24, 2022, at 01:44, Max Chernoff  wrote:
>> 
>>> I've been confronted with the following 'intriguing' formatting requirement 
>>> for a document:
>> 
>> "Intriguing" is definitely right here. I suspect these guidelines were made 
>> for typewriters and haven't been updated since.
>> 
>>> to limit the number of glyphs per line to 112. 
>> 
>> 112 characters per line sounds much too long anyways.
>> 
>> From "The Elements of Typographic Style":
>>> Anything from 45 to 75 characters is widely regarded as a satisfactory
>>> length of line for a single-column page set in a serifed text face
>>> in a text size. The 66-character line (counting both letters and
>>> spaces) is widely regarded as ideal. For multiple-column work, a
>>> better average is 40 to 50 characters.
>>> 
>>> If the type is well set and printed, lines of 85 or 90 characters
>>> will pose no problem in discontinuous texts, such as bibliographies,
>>> or, with generous leading, in footnotes. But even with generous
>>> leading, a line that averages more than 75 or so characters is likely
>>> to be too long for continuous reading.
>> 
>> If you use something like
>> 
>>   \setuplayout[width=80\averagecharwidth]
>> 
>> then your lines will for sure have fewer than 112 characters and will 
>> probably be more readable too.
>> 
>>> I'm nevertheless curious if there is a Lua/TeX solution to this "problem"?
>> 
>> Option 1: Use a monospaced font. Then 112 characters per line <=> page width 
>> = 112em.
>> 
>> Option 2: A hacky Lua solution
>> 
>>   \startluacode
>>   local max_length = 112
>> 
>>   local glyph_id = node.id "glyph"
>>   local disc_id = node.id "disc"
>>   local glue_id = node.id "glue"
>> 
>>   function userdata.limiter(head)
>>   language.hyphenate(head)
>> 
>>   local chars = 0
>>   local width = 0
>>   local n = head
>>   while n do
>>   if n.id == glyph_id or n.id == glue_id then
>>   chars = chars + 1
>&g

Re: [NTG-context] Count (and limit) glyphs per line?

2022-06-25 Thread Benjamin Buchmuller via ntg-context
Wow, that works like a charm! Thank you, Max! 

It's also a very insightful example of how to use and inject Lua code in the 
TeX output routine. Do you mind if I add it to the wiki? (Probably under 
"Wrapping".)

Many thanks again!


Benjamin

> On Jun 24, 2022, at 01:44, Max Chernoff  wrote:
> 
>> I've been confronted with the following 'intriguing' formatting requirement 
>> for a document:
> 
> "Intriguing" is definitely right here. I suspect these guidelines were made 
> for typewriters and haven't been updated since.
> 
>> to limit the number of glyphs per line to 112. 
> 
> 112 characters per line sounds much too long anyways.
> 
> From "The Elements of Typographic Style":
> > Anything from 45 to 75 characters is widely regarded as a satisfactory
> > length of line for a single-column page set in a serifed text face
> > in a text size. The 66-character line (counting both letters and
> > spaces) is widely regarded as ideal. For multiple-column work, a
> > better average is 40 to 50 characters.
> >
> > If the type is well set and printed, lines of 85 or 90 characters
> > will pose no problem in discontinuous texts, such as bibliographies,
> > or, with generous leading, in footnotes. But even with generous
> > leading, a line that averages more than 75 or so characters is likely
> > to be too long for continuous reading.
> 
> If you use something like
> 
>\setuplayout[width=80\averagecharwidth]
> 
> then your lines will for sure have fewer than 112 characters and will 
> probably be more readable too.
> 
>> I'm nevertheless curious if there is a Lua/TeX solution to this "problem"?
> 
> Option 1: Use a monospaced font. Then 112 characters per line <=> page width 
> = 112em.
> 
> Option 2: A hacky Lua solution
> 
>\startluacode
>local max_length = 112
> 
>local glyph_id = node.id "glyph"
>local disc_id = node.id "disc"
>local glue_id = node.id "glue"
> 
>function userdata.limiter(head)
>language.hyphenate(head)
> 
>local chars = 0
>local width = 0
>local n = head
>while n do
>if n.id == glyph_id or n.id == glue_id then
>chars = chars + 1
>width = width + n.width - (n.shrink or 0)
>end
> 
>if chars >= max_length or width > tex.hsize then
>local back_chars = 0
>local end_disc = nil
> 
>while n do
>if n.id == glue_id then
>local penalty = node.new "penalty"
>penalty.penalty = -1
>node.insertbefore(head, n, penalty)
>break
>end
> 
>if not end_disc and n.id == disc_id then
>end_disc = n
>end
> 
>if end_disc and back_chars >= 5 then
>end_disc.penalty = -1
>break
>end
> 
>if n.id == glyph_id then
>back_chars = back_chars + 1
>end
> 
>n = n.prev
>end
> 
>width = 0
>chars = 0
>end
> 
>n = n.next
>end
> 
>return head
>end
> 
>nodes.tasks.appendaction(
>"processors",
>"before",
>"userdata.limiter"
>)
>\stopluacode
> 
>\setuppapersize[landscape,letter]
>\showframe
> 
>\starttext
>\setupalign[flushleft]
> 
>\setupbodyfont[14pt]
>\samplefile{knuth}
> 
>\setupbodyfont[12pt]
>\samplefile{knuth}
> 
>\setupbodyfont[10pt]
>\samplefile{knuth}
> 
>\page
>\setupalign[normal]
> 
>\setupbodyfont[14pt]
>\samplefile{knuth}
> 
>\setupbodyfont[12pt]
>\samplefile{knuth}
> 
>\setupbodyfont[10pt]
>\samplefile{knuth}
>\stoptext
> 
> This code will ensure that no line ever exceeds "max_length" characters. It 
> uses a greedy algorithm instead of the standard TeX algorithm for line 
> breaking, but it still produces mostly decent results.
> 
> -- Max

___
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] Count (and limit) glyphs per line?

2022-06-24 Thread Hans Hagen via ntg-context

On 6/24/2022 5:15 AM, Benjamin Buchmuller via ntg-context wrote:

Dear list,

I've been confronted with the following 'intriguing' formatting requirement for 
a document:

"
• Type density:  Must be no more than 15 characters per linear inch (including 
characters and spaces).
• Line spacing: Must be no more than six lines per vertical inch.
"

While the line spacing resolves in ConTeXt to

\setupinterlinespace[line=\dimexpr(1in / 6)]

I was wondering if one can limit "type density" as the number of glyphs per 
inch in TeX too? I thought, it is more convenient to rephrase this request (for a 7 in 
textwidth) to limit the number of glyphs per line to 112. (Font must be sans or serif, of 
course ...)

I've tried

\setuplayout[width=112\averagecharwidth]

which, however, results in ~120–130 characters and spaces per line. Pragmatically, I'm 
narrowing the text width to empirically match the requirement, but I'm nevertheless 
curious if there is a Lua/TeX solution to this "problem"?

Just assume the worst case and take the narrowest character:

\showframe

\setupbodyfont[modern] % we need to set the font

\normalexpanded {
\setuplayout
   [textwidth=\the\dimexpr112\fontcharwd\font`.\relax]
}

\starttext
\input tufte
\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] Detailed citation of reference

2022-06-24 Thread Johann Birnick via ntg-context
Works, thanks!

On Fri, 2022-06-24 at 12:44 +0200, Wolfgang Schuster via ntg-context wrote:
> Johann Birnick via ntg-context schrieb am 24.06.2022 um 11:59:
> > Thanks! However, if I type \cite[righttext={, section 2.1}] is doesn't work
> > anymore. Any ideas?
> 
> What happens with
> 
>  \cite[righttext={{, section 2.1}}]
> 
> or
> 
>  \cite[righttext={\textcomma\ section 2.1}]
> 
> Wolfgang
> 
> __
> _
> If your question is of interest to others as well, please add an entry to the
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> __
> _
___
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] Detailed citation of reference

2022-06-24 Thread Wolfgang Schuster via ntg-context

Johann Birnick via ntg-context schrieb am 24.06.2022 um 11:59:

Thanks! However, if I type \cite[righttext={, section 2.1}] is doesn't work
anymore. Any ideas?


What happens with

    \cite[righttext={{, section 2.1}}]

or

    \cite[righttext={\textcomma\ section 2.1}]

Wolfgang

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

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


Re: [NTG-context] Detailed citation of reference

2022-06-24 Thread Johann Birnick via ntg-context
Thanks! However, if I type \cite[righttext={, section 2.1}] is doesn't work
anymore. Any ideas?

Johann

On Fri, 2022-06-24 at 09:24 +0200, Henning Hraban Ramm via ntg-context wrote:
> Am 24.06.22 um 02:09 schrieb Johann Birnick via ntg-context:
> > Hi there,
> > 
> > using \cite[myreference] I will get a result like "[1]", or I could also
> > change
> > the "1" into some more detailed information such as a tag.
> > 
> > However, I want to obtain something like "[1, section 2.1]".
> > 
> > How can I achieve this?
> 
> \cite[righttext={section 2.1}][myreference]
> 
> Hraban
> __
> _
> If your question is of interest to others as well, please add an entry to the
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> __
> _
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Count (and limit) glyphs per line?

2022-06-24 Thread Henning Hraban Ramm via ntg-context

Am 24.06.22 um 05:15 schrieb Benjamin Buchmuller via ntg-context:

• Type density:  Must be no more than 15 characters per linear inch (including 
characters and spaces).


This talks about "type density", not characters per line. This depends 
mostly on the font (and letterspacing). I.e. you should not use a narrow 
font.


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

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


Re: [NTG-context] Count (and limit) glyphs per line?

2022-06-23 Thread Max Chernoff via ntg-context

I've been confronted with the following 'intriguing' formatting requirement for 
a document:


"Intriguing" is definitely right here. I suspect these guidelines were 
made for typewriters and haven't been updated since.


to limit the number of glyphs per line to 112. 


112 characters per line sounds much too long anyways.

From "The Elements of Typographic Style":
> Anything from 45 to 75 characters is widely regarded as a satisfactory
> length of line for a single-column page set in a serifed text face
> in a text size. The 66-character line (counting both letters and
> spaces) is widely regarded as ideal. For multiple-column work, a
> better average is 40 to 50 characters.
>
> If the type is well set and printed, lines of 85 or 90 characters
> will pose no problem in discontinuous texts, such as bibliographies,
> or, with generous leading, in footnotes. But even with generous
> leading, a line that averages more than 75 or so characters is likely
> to be too long for continuous reading.

If you use something like

\setuplayout[width=80\averagecharwidth]

then your lines will for sure have fewer than 112 characters and will 
probably be more readable too.



I'm nevertheless curious if there is a Lua/TeX solution to this "problem"?


Option 1: Use a monospaced font. Then 112 characters per line <=> page 
width = 112em.


Option 2: A hacky Lua solution

\startluacode
local max_length = 112

local glyph_id = node.id "glyph"
local disc_id = node.id "disc"
local glue_id = node.id "glue"

function userdata.limiter(head)
language.hyphenate(head)

local chars = 0
local width = 0
local n = head
while n do
if n.id == glyph_id or n.id == glue_id then
chars = chars + 1
width = width + n.width - (n.shrink or 0)
end

if chars >= max_length or width > tex.hsize then
local back_chars = 0
local end_disc = nil

while n do
if n.id == glue_id then
local penalty = node.new "penalty"
penalty.penalty = -1
node.insertbefore(head, n, penalty)
break
end

if not end_disc and n.id == disc_id then
end_disc = n
end

if end_disc and back_chars >= 5 then
end_disc.penalty = -1
break
end

if n.id == glyph_id then
back_chars = back_chars + 1
end

n = n.prev
end

width = 0
chars = 0
end

n = n.next
end

return head
end

nodes.tasks.appendaction(
"processors",
"before",
"userdata.limiter"
)
\stopluacode

\setuppapersize[landscape,letter]
\showframe

\starttext
\setupalign[flushleft]

\setupbodyfont[14pt]
\samplefile{knuth}

\setupbodyfont[12pt]
\samplefile{knuth}

\setupbodyfont[10pt]
\samplefile{knuth}

\page
\setupalign[normal]

\setupbodyfont[14pt]
\samplefile{knuth}

\setupbodyfont[12pt]
\samplefile{knuth}

\setupbodyfont[10pt]
\samplefile{knuth}
\stoptext

This code will ensure that no line ever exceeds "max_length" characters. 
It uses a greedy algorithm instead of the standard TeX algorithm for 
line breaking, but it still produces mostly decent results.


-- Max
___
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] Count (and limit) glyphs per line?

2022-06-23 Thread Benjamin Buchmuller via ntg-context
Dear list,

I've been confronted with the following 'intriguing' formatting requirement for 
a document:

"
• Type density:  Must be no more than 15 characters per linear inch (including 
characters and spaces).
• Line spacing: Must be no more than six lines per vertical inch.
"

While the line spacing resolves in ConTeXt to

\setupinterlinespace[line=\dimexpr(1in / 6)]

I was wondering if one can limit "type density" as the number of glyphs per 
inch in TeX too? I thought, it is more convenient to rephrase this request (for 
a 7 in textwidth) to limit the number of glyphs per line to 112. (Font must be 
sans or serif, of course ...)

I've tried

\setuplayout[width=112\averagecharwidth] 

which, however, results in ~120–130 characters and spaces per line. 
Pragmatically, I'm narrowing the text width to empirically match the 
requirement, but I'm nevertheless curious if there is a Lua/TeX solution to 
this "problem"?

Thank you!


Benjamin 
___
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] colors and contours in luametafun

2022-06-23 Thread Hans Hagen via ntg-context

On 6/20/2022 6:29 PM, Jacob Kauffmann via ntg-context wrote:

Dear list,


Am 01.09.2021 um 09:54 schrieb Jacob Kauffmann via ntg-context 
:
- color by value in lmt_surface
We want to show a surface plot of a function where the color indicates the 
function value (instead, or in addition to a light source).
The easiest would be to have variable cf for the brightness factor (as it is), 
and in addition variables such as zt, minz, maxz, akin to the color formatter 
for lmt_contour.
This becomes handy when colors are to be aligned with function values (e.g. 
negative = blue, zero = white, positive = red, see MWE attached).


I managed to achieve this by tweaking f_color and mp.lmt_surface_do in 
mlib-cnt.lmt in
ConTeXt  ver: 2022.05.11 11:36 LMTX  fmt: 2022.6.20
a bit.
Please find the diff and a MWE attached.


in next version (next time just send me the file, easier than a diff)


Cheers,
Jacob Kauffmann

--- context/tex/texmf-context/tex/context/base/mkxl/mlib-cnt.lmt   2022-06-20 
18:11:51.0 +0200
+++ mlib-cnt.lmt2022-06-20 18:26:22.0 +0200
@@ -1839,7 +1839,29 @@

  local f_color = formatters [ [[
  local math = math
-return function(f)
+local min  = math.min
+local max  = math.max
+local abs  = math.abs
+local minz = %s
+local maxz = %s
+
+local color_value = 0
+local color_step  = mp.lmt_color_functions.step
+local color_shade = mp.lmt_color_functions.shade
+
+local function step(...)
+return color_step(color_value,n,...)
+end
+local function shade(...)
+return color_shade(color_value,n,...)
+end
+-- local function lin(l)
+-- return l/n
+-- end
+%s
+return function(z, f)
+function_value = z
+brightness_factor = f
  return %s
  end
  ]] ]
@@ -1898,7 +1920,7 @@
  local dy   = (ymax - ymin) / ny
  local xt   = xmin
  --
-local minf, maxf
+local minf, maxf, minz, maxz
  --
  -- similar as contours but no data loop here
  --
@@ -1908,12 +1930,6 @@
  return false -- fatal error
  end
  --
-local ccode = load(f_color(colorcode))
-local color = type(ccode) == "function" and ccode()
-    if type(color) ~= "function" then
-return false -- fatal error
-end
---
  for i=0,nx do
  local yt = ymin
  for j=0,ny do
@@ -1946,7 +1962,16 @@
  maxf = fac
  end
  --
-data[i][j] = { x, y, fac }
+if not minz then
+   minz = z
+   maxz = z
+elseif z < minz then
+   minz = z
+elseif z > maxz then
+   maxz = z
+end
+--
+data[i][j] = { x, y, fac, z }
  --
  yt = yt + dy
  end
@@ -1957,6 +1982,16 @@
  local range   = maxf - minf
  local cl  = linecolor or 1
  local enforce = attributes.colors.model == "cmyk"
+--
+-- local ccode = load(f_color(colorcode))
+report("minz, maxz is (%s,%s)",minz,maxz)
+report("colorcode is %s", colorcode)
+local ccode = load(f_color(minz, maxz, preamble, colorcode))
+local color = type(ccode) == "function" and ccode()
+if type(color) ~= "function" then
+return false -- fatal error
+end
+--
  for i=0,nx-1 do
  for j=0,ny-1 do
  -- points
@@ -1985,12 +2020,13 @@
  local z32 = z3[2]
  local z41 = z4[1]
  local z42 = z4[2]
+local zout = z1[4]
   -- if lines then
   -- -- fill first and draw then, previous shapes can be covered
   -- else
   -- -- fill and draw in one go to prevent artifacts
   -- end
-local cr, cg, cb = color(cf)
+local cr, cg, cb = color(zout, cf)
  if not cr then cr = 0 end
  if not cg then cg = 0 end
  if not cb then cb = 0 end




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

Re: [NTG-context] colors and contours in luametafun

2022-06-20 Thread Jacob Kauffmann via ntg-context
Dear list,

> Am 01.09.2021 um 09:54 schrieb Jacob Kauffmann via ntg-context 
> :
> - color by value in lmt_surface
> We want to show a surface plot of a function where the color indicates the 
> function value (instead, or in addition to a light source).
> The easiest would be to have variable cf for the brightness factor (as it 
> is), and in addition variables such as zt, minz, maxz, akin to the color 
> formatter for lmt_contour.
> This becomes handy when colors are to be aligned with function values (e.g. 
> negative = blue, zero = white, positive = red, see MWE attached).

I managed to achieve this by tweaking f_color and mp.lmt_surface_do in 
mlib-cnt.lmt in
ConTeXt  ver: 2022.05.11 11:36 LMTX  fmt: 2022.6.20
a bit.
Please find the diff and a MWE attached.

Cheers,
Jacob Kauffmann

--- context/tex/texmf-context/tex/context/base/mkxl/mlib-cnt.lmt   2022-06-20 
18:11:51.0 +0200
+++ mlib-cnt.lmt2022-06-20 18:26:22.0 +0200
@@ -1839,7 +1839,29 @@

 local f_color = formatters [ [[
 local math = math
-return function(f)
+local min  = math.min
+local max  = math.max
+local abs  = math.abs
+local minz = %s
+local maxz = %s
+
+local color_value = 0
+local color_step  = mp.lmt_color_functions.step
+local color_shade = mp.lmt_color_functions.shade
+
+local function step(...)
+return color_step(color_value,n,...)
+end
+local function shade(...)
+return color_shade(color_value,n,...)
+end
+-- local function lin(l)
+-- return l/n
+-- end
+%s
+return function(z, f)
+function_value = z
+brightness_factor = f
 return %s
 end
 ]] ]
@@ -1898,7 +1920,7 @@
 local dy   = (ymax - ymin) / ny
 local xt   = xmin
 --
-local minf, maxf
+local minf, maxf, minz, maxz
 --
 -- similar as contours but no data loop here
 --
@@ -1908,12 +1930,6 @@
 return false -- fatal error
 end
 --
-local ccode = load(f_color(colorcode))
-local color = type(ccode) == "function" and ccode()
-if type(color) ~= "function" then
-return false -- fatal error
-end
---
 for i=0,nx do
 local yt = ymin
 for j=0,ny do
@@ -1946,7 +1962,16 @@
 maxf = fac
 end
 --
-data[i][j] = { x, y, fac }
+if not minz then
+   minz = z
+   maxz = z
+elseif z < minz then
+   minz = z
+elseif z > maxz then
+   maxz = z
+end
+--
+data[i][j] = { x, y, fac, z }
 --
 yt = yt + dy
 end
@@ -1957,6 +1982,16 @@
 local range   = maxf - minf
 local cl  = linecolor or 1
 local enforce = attributes.colors.model == "cmyk"
+--
+-- local ccode = load(f_color(colorcode))
+report("minz, maxz is (%s,%s)",minz,maxz)
+report("colorcode is %s", colorcode)
+    local ccode = load(f_color(minz, maxz, preamble, colorcode))
+local color = type(ccode) == "function" and ccode()
+if type(color) ~= "function" then
+return false -- fatal error
+end
+--
 for i=0,nx-1 do
 for j=0,ny-1 do
 -- points
@@ -1985,12 +2020,13 @@
 local z32 = z3[2]
 local z41 = z4[1]
 local z42 = z4[2]
+local zout = z1[4]
  -- if lines then
  -- -- fill first and draw then, previous shapes can be covered
  -- else
  -- -- fill and draw in one go to prevent artifacts
  -- end
-local cr, cg, cb = color(cf)
+local cr, cg, cb = color(zout, cf)
 if not cr then cr = 0 end
 if not cg then cg = 0 end
 if not cb then cb = 0 end



colors_and_surface_in_luametafun.pdf
Description: Adobe PDF document



colors_and_surface_in_luametafun.tex
Description: Binary data


signature.asc
Description: Message signed with OpenPGP
___
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] Problems with MetaFun Transparency Groups

2022-06-13 Thread Stefan Haller via ntg-context
Hi everyone!

I have a question regarding transparency groups in MetaFun. As a toy example, I
want to draw a grid of lines where the whole grid should have an opacity of 25%.

If I draw intersecting lines individually with `withtransparency(1, .25)` the
overlapping parts will have a total opacity of 50%. However, I want to draw the
whole grid as one group and then blend it as a whole so that the whole grid is
evenly colored when blended. According to the MetaFun manual we should be able
to get the desired effect with the `asgroup` operator applied to a picture.
(Actually, the manual says the operator is called `grouped` but the source code
of the graphics above uses the `asgroup` operator [1].)

The `asgroup` does in fact insert a transparency group into the PDF output:

> << /Type /XObject /Subtype /Form /FormType 1 /Group << /S /Transparency /I 
> false /K false

However, the group does not seem to be blended as one group and we can still
see that the overlapping parts are darker than the other parts of the line.
Something seems to be off. Looking at the compiled manual also shows that the
transparency groups are not working (both parts of the arrow, the head and the
tail, are blended independently and not as a group).

When I recreate the graphics in Tikz/PGF everything works. The resulting PDF
output looks similar, at least with my limited understanding of PDF format I am
unable to understand the differences.

The full example is attached below the text of my mail. The Tikz example on the
fifth page shows the desired result.

Do I misunderstand the syntax of transparency groups in MetaFun? Or is there
some other problem? Maybe someone can point me in the right direction.

Thanks in advance!
Stefan Haller

[1]: 
https://source.contextgarden.net/doc/context/sources/general/manuals/metafun/metafun-effects.tex?search=asgroup=yes#l2543



\nopdfcompression
\usemodule[tikz]

\starttext
\startMPdefinitions
  vardef draw_grid =
def withmycolor = withcolor red withtransparency(normaltransparent, .25) 
enddef;
linecap := butt;
u := 10mm;
n := 20;
pickup pencircle scaled 7mm;
for i = 1 upto n:
  draw (0, i) * u -- (n+1, i) * u withmycolor;
  draw (i, 0) * u -- (i, n+1) * u withmycolor;
endfor;
  enddef;
\stopMPdefinitions
\startMPpage
  draw image( draw_grid ) asgroup "";
  addbackground withcolor yellow;
\stopMPpage
\startMPpage
  draw image( draw_grid ) asgroup "isolated";
  addbackground withcolor yellow;
\stopMPpage
\startMPpage
  draw image( draw_grid ) asgroup "knockout";
  addbackground withcolor yellow;
\stopMPpage
\startMPpage
  draw image( draw_grid ) asgroup "isolated,knockout";
  addbackground withcolor yellow;
\stopMPpage
\startTEXpage
\starttikzpicture
  \fill[yellow] (-0.35cm, -0.35cm) rectangle (21.35cm, 21.35cm);
  \startscope[opacity=.25, transparency group]
\startscope[x=10mm, y=10mm, every path/.style={line width=7mm}]
  \foreach \i in {1,...,20}{
\draw[red] (0, \i) -- (21, \i);
\draw[red] (\i, 0) -- (\i, 21);
  };
\stopscope
  \stopscope
\stoptikzpicture
\stopTEXpage
___
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] Problem loading font in LMTX

2022-06-11 Thread Stefan Nedeljkovic via ntg-context
 250 50 25
system  > 
system  >   mem 15 879059 15   100100100  1500   1000  2  1   2920 96   1200320
system  >   all240 879059240   900800100 32  16000  48000  8 16   2920 96  28800  10240
system  > 
system  >   ini2142543 858129  0  45373  0 496387   0  
system  >   ptr  46535  9182  46517521493  0  0  0  0  0  0  4  0  0  7
system  >   top  46536740050 131074   4067 529077209 27  5 12 27378250250 50 10
system  >   ---
system  > 
system  >   current input type: initial
system  > 
system  >   approximate memory: 26048523 (24 MB)
system  > 
system  >   expansion depth   : min: 1, max: 100, set: 1, top: 5
system  > 
system  >   luabytecode registers : 1002
system  >   luabytecode bytes : 16048 (0 MB)
system  >   luastate bytes now: 49785277 (47 MB)
system  >   luastate bytes max: 49785277 (47 MB)
system  > 
system  >   file callbacks: 68
system  >   saved callbacks   : 373
system  >   direct callbacks  : 2
system  >   function callbacks: 1137
system  >   value callbacks   : 1
system  >   message callbacks : 0
system  >   bytecode callbacks: 600
system  > 
system  >   mp instances  : 0
system  >   mp estimated memory   : 0 (0 MB)
system  >   mp file callbacks : 0
system  >   mp text callbacks : 0
system  >   mp script callbacks   : 0
system  >   mp log callbacks  : 0
system  > 
system  >   total callbacks   : 2181
system  >   mp total callbacks: 0
system  >   backend callbacks : 0
system  > 
mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: /home/stefan/context/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.003 seconds, 0 scans with scantime 0.000 seconds, 0 shared scans, 6 found files, scanned paths: 
mkiv lua stats  > stored bytecode data: 502 modules (0.161 sec), 98 tables (0.009 sec), 600 chunks (0.170 sec)
mkiv lua stats  > traced context: maxstack: 1616, freed: 0, unreachable: 1616
mkiv lua stats  > cleaned up reserved nodes: 71 nodes, 9 lists of 435
mkiv lua stats  > node memory usage: 15 attribute, 3 glue, 58 glue_spec, 3 kern, 4 penalty, 2 temp
mkiv lua stats  > node list callback tasks: 12 unique task lists, 8 instances (re)created, 51 calls
mkiv lua stats  > used backend: pdf
mkiv lua stats  > jobdata time: 0.001 seconds saving, 0.000 seconds loading
mkiv lua stats  > callbacks: file: 68, saved: 373, direct: 2, function: 1137, value: 1, message: 0, bytecode: 600, late 0, total: 2181 (2181 per page)
mkiv lua stats  > randomizer: resumed with value 0.92460604724911
mkiv lua stats  > loaded patterns: en::1, load time: 0.000
mkiv lua stats  > font engine: otf 3.119, afm 1.513, tfm 1.000
mkiv lua stats  > body font sizes: defined: 10pt 11pt 12pt 14.4pt 17.3pt 20.7pt 4pt 5pt 6pt 7pt 8pt 9pt, undefined: 28.8pt 36pt 43.2pt
mkiv lua stats  > result saved in file: serbia_map_adresses_text.pdf, compresslevel 1, objectcompresslevel 3
mkiv lua stats  > positions: 4 collected, 0 deltas, 0 shared partials, 0 partial entries
mkiv lua stats  > used platform: linux-64, type: unix, binary subtree: texmf-linux-64
mkiv lua stats  > used engine: luametatex version: 2.0936, functionality level: 20221202, format id: 616, compiler: gcc
mkiv lua stats  > tex properties: 740050 hash slots used of 2097152, 46517 control sequences, approximate memory usage: 24 MB
mkiv lua stats  > lua properties: engine: lua 5.4, used memory: 49 MB, ctx: 47 MB, max: 47 MB, symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 0.214 seconds, 1 processed pages, 1 shipped pages, 4.666 pages/second
___
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] Workshop at FrOSCon

2022-06-09 Thread a badin via ntg-context
> From: juh+ntg-cont...@mailbox.org

> My main problem is that I never used Windows in my life and have no idea
> how to help people with installing lmtx on this platform.
>
> juh

I'm a beginner in context (and not a programmer by profession) and
installing lmtx on windows was very easy for me. the steps are on the
wiki https://wiki.contextgarden.net/Installation and it is as easy as
it is written there. I've been using context thanks to these
installation steps on win 7 and win 10. I'm not sure what the
targetgroup at the conference is, but if the people there ever used a
commandline, they should be good to go. once you install, you open the
commandline using Win+R and then type "cmd". Once in the cmd, you only
need to know the command "cd" (change directory) to navigate to the
folder where the .tex source is, so e.g. "cd c:\users\x\documents\"
and then run "context test.tex". That is the manual way.

I use sublimetext as text editor and made a new build for it, that
when I press Ctrl+B saves all changes in the open file/folder and runs
context on the open file and previews the pdf in mupdf that is zoomed
to be 1:1 paper:print on my dpi. It's a bit like TeXworks, just press
button and see the pdf, because mupdf automatically overwrites the
open pdf without asking.

It's 4 hours by train for me to Bonn and I'm not sure whether I'm a
good candidate to teach people context due to my low skill, but I can
surely teach you how to install lmtx on windows if you like (we could
call or sth).

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

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


Re: [NTG-context] issue with scite module

2022-06-02 Thread Max Chernoff via ntg-context

For the sake of consistency (with buff-imp-xml.lua), I think the patch
should read

> [...]

+local alsoname = lpatterns.utf8two + lpatterns.utf8three +
lpatterns.utf8four


I think that that pattern is a little too broad, since it will match any 
non-ASCII Unicode character. Things like U+202E (xkcd.com/1137), U+00A0 
(no-break space), etc are valid UTF-8 characters, but not valid XML tag 
names. Neither of these two characters are matched by the TeX catcode 
check. This doesn't make any real difference for a syntax highlighter 
though.



+local name = (R("az","AZ","09") + S("_-.") + + alsoname)^1


There's a doubled plus in the middle there. The patch works when I 
remove it.



But I’m afraid I cannot make it work on my computer (Linux64).

On another Win64 computer, both patches worked perfectly fine.


Hmm, that's really weird. Both patches work for me on my main Win64 
computer (after I fixed the extra plus). I also pulled the 
"contextgarden/context:lmtx" Docker image (Debian sid), and both patches 
worked there too. I get this from inside the container:


root@e8d29a32595c:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux bookworm/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="https://www.debian.org/;
SUPPORT_URL="https://www.debian.org/support;
BUG_REPORT_URL="https://bugs.debian.org/;

root@e8d29a32595c:~# locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

root@e8d29a32595c:~# xxd test.tex
: 5c75 7365 6d6f 6475 6c65 5b73 6369 7465  \usemodule[scite
    0010: 5d0a 5c73 7461 7274 7465 7874 0a5c 7374  ].\starttext.\st
0020: 6172 7454 4558 7061 6765 5b6f  7365  artTEXpage[offse
0030: 743d 3165 785d 0a5c 7479 7065 5b6f 7074  t=1ex].\type[opt
0040: 696f 6e3d 786d 6c5d 7b3c 616e 732f 3e7d  ion=xml]{}
0050: 0a5c 7479 7065 5b6f 7074 696f 6e3d 786d  .\type[option=xm
0060: 6c5d 7b3c c3a1 c3b1 c39f 2f3e 7d0a 5c73  l]{<../>}.\s
0070: 746f 7054 4558 7061 6765 0a5c 7374 6f70  topTEXpage.\stop
0080: 7465 7874 0a text

root@e8d29a32595c:~# context --version
mtx-context | ConTeXt Process Management 1.04
mtx-context |
mtx-context | main context file: [snip]
mtx-context | current version: 2022.05.11 11:36
mtx-context | main context file: [snip]
mtx-context | current version: 2022.05.11 11:36

ldd "$(type -p luametatex)"
linux-vdso.so.1 (0x7ffdbe9a5000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x7f4b034d4000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x7f4b034b3000)

libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x7f4b0336f000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7f4b03196000)
/lib64/ld-linux-x86-64.so.2 (0x7f4b03a55000)

Is this perhaps a weird locale or encoding issue? Maybe try compiling with:

LC_ALL=C.UTF-8 LANG=C.UTF-8 context test.tex

or

LC_ALL=POSIX LANG=POSIX context test.tex

I'm surprised Linux is the one not working here, since it's usually 
Windows that has text encoding issues with its weird hybrid of DOS 
codepages and UTF-16+BOM.


The only other thing that I can think of is a weird library issue with 
your distro, but LuaMetaTeX is statically linked. Not sure what else to 
check here.


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

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


Re: [NTG-context] issue with scite module

2022-06-02 Thread Pablo Rodriguez via ntg-context
On 6/1/22 23:58, Max Chernoff via ntg-context wrote:
>> Now, I still don’t understand LPEG and don’t know if there’s a general
>> “character” class that doesn’t need a list...

Many thanks for your reply, Hraban.

> The easiest way that I found was to just cheat and use everything with
> a TeX catcode 11 ("letters"):
>
>   local name = (R("az","AZ","09") + S("_-.") + 
> lpeg.utfchartabletopattern(characters.csletters))^1

Many thanks for your reply, Max,

I’m afraid I cannot make your proposed fix work.

For the sake of consistency (with buff-imp-xml.lua), I think the patch
should read (also attached to the message to avoid wrong line breaking):

--- scite-context-lexer-xml.lua 2022-06-01 17:24:38.625976000 +0200
+++
context/tex/texmf-context/context/data/scite/context/lexers/scite-context-lexer-xml.lua
2022-06-02 16:37:30.112824947 +0200
@@ -13,7 +13,7 @@
 -- todo: parse entities in attributes

 local global, string, table, lpeg = _G, string, table, lpeg
-local P, R, S, C, Cmt, Cp = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cmt,
lpeg.Cp
+local P, R, S, C, Cmt, Cp, lpatterns = lpeg.P, lpeg.R, lpeg.S, lpeg.C,
lpeg.Cmt, lpeg.Cp, lpeg.patterns
 local type = type
 local match, find = string.match, string.find

@@ -41,7 +41,8 @@
 local equal= P("=")
 local ampersand= P("&")

-local name = (R("az","AZ","09") + S("_-."))^1
+local alsoname = lpatterns.utf8two + lpatterns.utf8three +
lpatterns.utf8four
+local name = (R("az","AZ","09") + S("_-.") + + alsoname)^1
 local openbegin= P("<")
 local openend  = P("") + P(">")

But I’m afraid I cannot make it work on my computer (Linux64).

On another Win64 computer, both patches worked perfectly fine.

Both machines run LMTX current latest. So I have an issue on my
installation that I have to fix first.

Many thanks for your help,

Pablo
--- scite-context-lexer-xml.lua	2022-06-01 17:24:38.625976000 +0200
+++ context/tex/texmf-context/context/data/scite/context/lexers/scite-context-lexer-xml.lua	2022-06-02 16:37:30.112824947 +0200
@@ -13,7 +13,7 @@
 -- todo: parse entities in attributes
 
 local global, string, table, lpeg = _G, string, table, lpeg
-local P, R, S, C, Cmt, Cp = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cmt, lpeg.Cp
+local P, R, S, C, Cmt, Cp, lpatterns = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cmt, lpeg.Cp, lpeg.patterns
 local type = type
 local match, find = string.match, string.find
 
@@ -41,7 +41,8 @@
 local equal= P("=")
 local ampersand= P("&")
 
-local name = (R("az","AZ","09") + S("_-."))^1
+local alsoname = lpatterns.utf8two + lpatterns.utf8three + lpatterns.utf8four
+local name = (R("az","AZ","09") + S("_-.") + + alsoname)^1
 local openbegin= P("<")
 local openend  = P("") + P(">")
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] issue with scite module

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

Am 01.06.22 um 18:47 schrieb Pablo Rodriguez via ntg-context:

Dear list,

I have the following sample:

   \usemodule[scite]
   \starttext
   \startTEXpage[offset=1ex]
   \type[option=xml]{}
   \type[option=xml]{<áñß/>}
   \stopTEXpage
   \stoptext

Using scite, I don’t get the second element right.

Without scite, both elements are displayed right.

In both Geany and Notepad++ (which use Scintilla internally), the two
elements are displayed right.

Could anyone confirm the issue?


Hi Pablo,

with LMTX version 2022.05.11, both elements are displayed, but the first 
in blue, the second in red. Apparently the scite highlighter doesn’t 
like non-ASCII characters in elements.


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

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


[NTG-context] issue with scite module

2022-06-01 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \usemodule[scite]
  \starttext
  \startTEXpage[offset=1ex]
  \type[option=xml]{}
  \type[option=xml]{<áñß/>}
  \stopTEXpage
  \stoptext

Using scite, I don’t get the second element right.

Without scite, both elements are displayed right.

In both Geany and Notepad++ (which use Scintilla internally), the two
elements are displayed right.

Could anyone confirm the issue?

Many thanks for your help,

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

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


Re: [NTG-context] Callbacks (and nodes) in LuaMetaTeX

2022-05-25 Thread Max Chernoff via ntg-context

Hi list,

I haven't had any luck solving any of the issues from my previous email:

[NTG-context] Callbacks in LuaMetaTeX
https://mailman.ntg.nl/pipermail/ntg-context/2022/105566.html

Admittedly, my problems are fairly obscure (and likely self-inflicted), 
but any suggestions would be greatly appreciated. I've updated my 
ConTeXt installation to the latest version (mkxl 2022.05.11 11:36), but 
this doesn't seem to have changed anything.


Further to the previous email, I have one (semi-related) additional 
question:


6. The LuaTeX manual says that the subtype of "ins" nodes is a number
   corresponding to the insert class. This appears to work correctly.
   The LuaMetaTeX manual says the same thing about "insert" nodes;
   however, the subtype of "insert" nodes appears to always be zero.

   Using this code:

   \startluacode
   local traverse_id = node.traverse_id or node.traverseid
   local insert = node.id"insert" or node.id"ins"

   function test(head)
   for n in traverse_id(insert, head) do
   inspect(n)
   print(n.subtype)
   end

   return head
   end

   nodes.tasks.appendaction("finalizers", "after", "test")
   \stopluacode

   \starttext
   One \footnote{Two} \insert123{Three} Four.
   \stoptext

   In MkIV I get:

  1917 : ins 132>={
["attr"]="",
["cost"]=0,
["depth"]=221327,
["head"]="",
    ["height"]=790454,
["next"]="nil : ins 123>",
["prev"]="   1842 : hlist 1>",
["subtype"]=132,
["type"]="ins",
   }
   132
   nil : ins 123>={
["attr"]="",
["cost"]=0,
["depth"]=1073741823,
["head"]="",
["height"]=553344,
["prev"]="   1923 : glue 13>",
["subtype"]=123,
["type"]="ins",
   }
   123

   but in MkXL I get:

  3385 : insert 0>={
["attr"]="",
["depth"]=221327,
["height"]=790454,
["id"]="insert",
["list"]="nil : hlist line>",
["next"]="",
   }
   0
   nil : insert 0>={
["attr"]="",
["height"]=553344,
["id"]="insert",
["list"]="nil : hlist line>",
   }
   0

   Is there any way to get an insert's class from its node in MkXL?

Please let me know if you have any ideas for this or any of the earlier 
questions.


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

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


Re: [NTG-context] Issue with interactive checkboxes[solved]

2022-05-24 Thread Jan-Erik Hägglöf via ntg-context
I’ve tested on my Mac OS Monterey 12.3.1 and the same phenomena as firefox it 
also is on google chrome.



> 24 maj 2022 kl. 10:18 skrev Jan-Erik Hägglöf :
> 
> HI Again!
> 
> I discovered what went wrong, such a silly syntax error, here comes a working 
> code:
> 
> \setupinteraction[state=start]
> 
> \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}]
> \definesymbol[no][]
> 
> \newcount\chk
> \def\checkmark{%
> \global\advance\chk by 1
> \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, 
> corner=round, framecolor=red]%
> \definefield[checkme\the\chk][check][setup1][yes,no][no]%
> \field[checkme\the\chk]%
> }
> 
> \starttext
> 
> \checkmark\
> 
> \checkmark\
> 
> \checkmark\
> 
> \stoptext
> 
> Sorry to bother the list but maybe it is helpful for someone.
> 
> Regards
> 
> /Jan-Erik
> 
>> 24 maj 2022 kl. 08:08 skrev Jan-Erik Hägglöf > <mailto:skrantajanne...@gmail.com>>:
>> 
>> I’ve tried this
>> 
>> \setupinteraction[state=start]
>> 
>> \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}]
>> \definesymbol[no][]
>> 
>> \newcount\chk
>> \def\chk{%
>> \global \advance \chk by 1
>> \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, 
>> corner=round, framecolor=red]%
>> \definefield[checkme\the\chk][check][setup1][yes,no][no]%
>> \field[checkme\the\chk]%
>> }
>> 
>> \starttext
>> 
>> \chk
>> 
>> \chk
>> 
>> \chk
>> 
>> \stoptext
>> 
>> But it gives the error ” You can’t use \global after \advance”
>> 
>> But this example works fine
>> 
>> \setupinteraction[state=start]
>> 
>> \newcount\clozecount
>> \def\mycloze{%
>>   \global \advance \clozecount by 1
>>   \definefield[uniqcloze\the\clozecount][line]%
>>   \field[uniqcloze\the\clozecount]%
>> }
>> 
>> \starttext
>> 
>> Frogs have four \mycloze\ and two eyes.
>> Frogs have four \mycloze\ and two eyes.
>> Frogs have four \mycloze\ and two eyes.
>> Frogs have four \mycloze\ and two eyes.
>> 
>> \stoptext
>> 
>> From 
>> 
>> https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in
>>  
>> <https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in>
>> 
>>> 24 maj 2022 kl. 07:44 skrev Jan-Erik Hägglöf >> <mailto:skrantajanne...@gmail.com>>:
>>> 
>>> Thank you, unfortunately it has no effect. Even if I make a macro, still it 
>>> is the same field.
>>> 
>>>> 23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context 
>>>> mailto:ntg-context@ntg.nl>>:
>>>> 
>>>> On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote:
>>>>> HI!
>>>>> 
>>>>> Tried to make a checklist in an interactive document.
>>>>> 
>>>>> The problem seems to be that all checks/uncecks in same click, not each
>>>>> individually.
>>>>> 
>>>>> Is there something wrong with my code?
>>>> 
>>>> Hi Jan-Erik,
>>>> 
>>>> you basically put the same field twice.
>>>> 
>>>> Add something like:
>>>> 
>>>> \definefield [check-you] [check] [setup 3] [yes,no] [no]
>>>> 
>>>> \define\chka{\field[check-you]}
>>>> 
>>>> \chka
>>>> 
>>>> Checks will be different then.
>>>> 
>>>> I hope it helps,
>>>> 
>>>> Pablo
>>>> ___
>>>> If your question is of interest to others as well, please add an entry to 
>>>> the Wiki!
>>>> 
>>>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
>>>> http://www.ntg.nl/mailman/listinfo/ntg-context 
>>>> <http://www.ntg.nl/mailman/listinfo/ntg-context>
>>>> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
>>>> http://context.aanhet.net <http://context.aanhet.net/>
>>>> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
>>>> <https://bitbucket.org/phg/context-mirror/commits/>
>>>> wiki : http://contextgarden.net <http://contextgarden.net/>
>>>> ___
>>> 
>> 
> 

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

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


Re: [NTG-context] Issue with interactive checkboxes[solved]

2022-05-24 Thread Jan-Erik Hägglöf via ntg-context
HI Again!

I discovered what went wrong, such a silly syntax error, here comes a working 
code:

\setupinteraction[state=start]

\definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}]
\definesymbol[no][]

\newcount\chk
\def\checkmark{%
\global\advance\chk by 1
\setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, corner=round, 
framecolor=red]%
\definefield[checkme\the\chk][check][setup1][yes,no][no]%
\field[checkme\the\chk]%
}

\starttext

\checkmark\

\checkmark\

\checkmark\

\stoptext

Sorry to bother the list but maybe it is helpful for someone.

Regards

/Jan-Erik

> 24 maj 2022 kl. 08:08 skrev Jan-Erik Hägglöf :
> 
> I’ve tried this
> 
> \setupinteraction[state=start]
> 
> \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}]
> \definesymbol[no][]
> 
> \newcount\chk
> \def\chk{%
> \global \advance \chk by 1
> \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, 
> corner=round, framecolor=red]%
> \definefield[checkme\the\chk][check][setup1][yes,no][no]%
> \field[checkme\the\chk]%
> }
> 
> \starttext
> 
> \chk
> 
> \chk
> 
> \chk
> 
> \stoptext
> 
> But it gives the error ” You can’t use \global after \advance”
> 
> But this example works fine
> 
> \setupinteraction[state=start]
> 
> \newcount\clozecount
> \def\mycloze{%
>   \global \advance \clozecount by 1
>   \definefield[uniqcloze\the\clozecount][line]%
>   \field[uniqcloze\the\clozecount]%
> }
> 
> \starttext
> 
> Frogs have four \mycloze\ and two eyes.
> Frogs have four \mycloze\ and two eyes.
> Frogs have four \mycloze\ and two eyes.
> Frogs have four \mycloze\ and two eyes.
> 
> \stoptext
> 
> From 
> 
> https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in
>  
> <https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in>
> 
>> 24 maj 2022 kl. 07:44 skrev Jan-Erik Hägglöf > <mailto:skrantajanne...@gmail.com>>:
>> 
>> Thank you, unfortunately it has no effect. Even if I make a macro, still it 
>> is the same field.
>> 
>>> 23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context 
>>> mailto:ntg-context@ntg.nl>>:
>>> 
>>> On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote:
>>>> HI!
>>>> 
>>>> Tried to make a checklist in an interactive document.
>>>> 
>>>> The problem seems to be that all checks/uncecks in same click, not each
>>>> individually.
>>>> 
>>>> Is there something wrong with my code?
>>> 
>>> Hi Jan-Erik,
>>> 
>>> you basically put the same field twice.
>>> 
>>> Add something like:
>>> 
>>> \definefield [check-you] [check] [setup 3] [yes,no] [no]
>>> 
>>> \define\chka{\field[check-you]}
>>> 
>>> \chka
>>> 
>>> Checks will be different then.
>>> 
>>> I hope it helps,
>>> 
>>> Pablo
>>> ___
>>> If your question is of interest to others as well, please add an entry to 
>>> the Wiki!
>>> 
>>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
>>> http://www.ntg.nl/mailman/listinfo/ntg-context 
>>> <http://www.ntg.nl/mailman/listinfo/ntg-context>
>>> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
>>> http://context.aanhet.net <http://context.aanhet.net/>
>>> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
>>> <https://bitbucket.org/phg/context-mirror/commits/>
>>> wiki : http://contextgarden.net <http://contextgarden.net/>
>>> ___
>> 
> 

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

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


Re: [NTG-context] Issue with interactive checkboxes

2022-05-24 Thread Jan-Erik Hägglöf via ntg-context
I’ve tried this

\setupinteraction[state=start]

\definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}]
\definesymbol[no][]

\newcount\chk
\def\chk{%
\global \advance \chk by 1
\setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, corner=round, 
framecolor=red]%
\definefield[checkme\the\chk][check][setup1][yes,no][no]%
\field[checkme\the\chk]%
}

\starttext

\chk

\chk

\chk

\stoptext

But it gives the error ” You can’t use \global after \advance”

But this example works fine

\setupinteraction[state=start]

\newcount\clozecount
\def\mycloze{%
  \global \advance \clozecount by 1
  \definefield[uniqcloze\the\clozecount][line]%
  \field[uniqcloze\the\clozecount]%
}

\starttext

Frogs have four \mycloze\ and two eyes.
Frogs have four \mycloze\ and two eyes.
Frogs have four \mycloze\ and two eyes.
Frogs have four \mycloze\ and two eyes.

\stoptext

From 

https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in

> 24 maj 2022 kl. 07:44 skrev Jan-Erik Hägglöf :
> 
> Thank you, unfortunately it has no effect. Even if I make a macro, still it 
> is the same field.
> 
>> 23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context 
>> :
>> 
>> On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote:
>>> HI!
>>> 
>>> Tried to make a checklist in an interactive document.
>>> 
>>> The problem seems to be that all checks/uncecks in same click, not each
>>> individually.
>>> 
>>> Is there something wrong with my code?
>> 
>> Hi Jan-Erik,
>> 
>> you basically put the same field twice.
>> 
>> Add something like:
>> 
>> \definefield [check-you] [check] [setup 3] [yes,no] [no]
>> 
>> \define\chka{\field[check-you]}
>> 
>> \chka
>> 
>> Checks will be different then.
>> 
>> I hope it helps,
>> 
>> Pablo
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl / 
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>> ___
> 

___
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] PDF/A-3, XMP and Factur-X

2022-05-18 Thread Henning Hraban Ramm via ntg-context

Hi again,

I’m looking into extending my ConTeXt-made invoices with embedded XML 
data according to the DE/FR Factur-X standard (in Germany also known as 
ZUGFeRD).


Does anyone have some experience with that?

For that, I need PDF/A-3(a) compliant documents – current documentation 
is only on PDF/A-1(a), but that doesn’t seem to be the problem.


Now I’m supposed to put additional information into the XMP metadata.
I found lpdf-xmp.lua; but it seems like I can’t just use

\startluacode
lpdf.addtoinfo("TEST","Hraban was here!")
lpdf.addxmpinfo("UStID","123456")
\stopluacode

Would I need to add my tags to the mapping table of lpdf-xmp.lua?

Or circumvent it after a look at the function concerned:

function lpdf.addxmpinfo(tag,value,check)
local pattern = permitdetail(tag)
if type(pattern) == "string" then
xmlfillin(xmp or valid_xmp(),pattern,value,check)
end
end

If I try to use xml.fillin, I apparently need the name of the current 
xml file, but valid_xmp is a local function. If just use the default...


xml.fillin("lpdf-pdx.xml","metadata","UStID","123456")

... at least I find no traces of that key in the extended metadata 
dialog of Acrobat Pro 9. I also tried different values like "xmp" 
instead of metadata. Clearly I don’t understand what I’m doing here ;)


Is there a check against some schema involved?

It looks like I should include an additional XMP schema for Factur-X 
with the URI "urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#", 
prefix "fx". How can I do that?


This is the example from the docs:


INVOICE
factur-x.xml
1.0
EXTENDED


Then I’d use \attachment to include my "factur-x.xml" invoice (that I 
must generate from my Lua invoice code), but that’s a task for another 
day ;)


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

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


Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread Ross via ntg-context
I found a way to wrap everything before \startdocument, so I think this
looks like a template more or less:

In case anyone is interested, here's the MWE:

\definenote[address]
\setupnote[address][rule=off,location=text]


\setupnotation[footnote][numberconversion=numerals]

\definenote[putjustmark]
\setupnote[putjustmark][location=none]
\setupnotation[putjustmark][numberconversion=set 2]


\definenote[putjustnote][footnote]
\setupnote[putjustnote][textcommand=\gobbleoneargument]
\setupnotation[putjustnote][numberconversion=set 2]

\newif\ifnoteintitle
\newtoks\titlefootnotes

\titlefootnotes\emptytoks


\def\thanks#1{\noteintitletrue\putjustmark{#1}\doglobal\appendtoks
\putjustnote{#1} \to \titlefootnotes}
\def\email#1{\noteintitletrue\putjustmark{#1}\doglobal\appendtoks
\putjustnote{#1} \to \titlefootnotes}

\def\unskipfunnylines{\ifnoteintitle\endgraf\kern-2\lineheight\fi}


\definenamespace
   [addr]
   [type=module,
name=address,
command=yes,
setup=list,
parent=addr,
  ]

\define[1]\useaddress
{\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}



\setupaddress[style=italic]
\defineaddress[fst][name={Name of Institute or Affiliation, City, Country}]
\defineaddress[snd][name={Name of Secondary Institute or Affiliation, City,
Country}]
\defineaddress[thd][name={Name of Third Institute or Affiliation, City,
Country}]

\processcommacommand[fst,snd,thd]\useaddress



\startsetups [document:start]
The Title\dorecurse{10}{\expanded{\thanks{Work supported by fund
\recurselevel.}}}
\endgraf

Me\dorecurse{10}{\expanded{\email{\tt my.name@mailbox.\recurselevel.com
}}\high{,}}\note[address][fst]\high{,}\note[address][snd]\high{,}\note[address][thd]
\endgraf

\placenotes[address]

\blank[medium]
  \startcolumns\hyphenpenalty1000

  \the\titlefootnotes\relax

  \setcounter[footnote][0]

  \unskipfunnylines

\stopsetups

\startsetups [document:stop]
  \stopcolumns
\stopsetups



\startdocument


test\footnote{test}

\input knuth

\input knuth

\input knuth

\input knuth

\stopdocument



On Wed, May 18, 2022 at 10:02 PM Ross  wrote:

> After some visualisations, I found that my token \titlefootnotes will
> ALWAYS generate two lines if there is/are any non-zero number of footnotes
> there. Interesting. So I need a \newif that each time a \thanks or \email
> is invoked, it'll set to true and I'll unskip the 2\lineheight afterwards.
>
> I still don't know why this \kern macro won't have any effect if it's
> inside a token or a \startsetup.
>
> On Wed, May 18, 2022 at 4:56 PM Ross  wrote:
>
>> Hi Massi,
>>
>> You are a champion!
>>
>> On Wed, May 18, 2022 at 4:41 PM mf  wrote:
>>
>>> I hope I got the point now:
>>>
>>> ...
>>> \startcolumns
>>>
>>> \the\titlefootnotes
>>>
>>> \kern-\rawcountervalue[address]\lineheight % dirty trick
>>>
>>> test\footnote{test}
>>>
>>> \input knuth
>>>
>>> \stopcolumns
>>> ...
>>>
>>> Massi
>>>
>>> Il 18/05/22 10:07, Ross ha scritto:
>>> > Dear Massi,
>>> >
>>> > Thanks for your solution. But the thing may be related to the
>>> > \appendtoks macro. It doesn't work to put just \setnotetext there.
>>> > \note works fine, so that's the reason I need the "full functional
>>> macro".
>>> >
>>> > Maybe I didn't get the point, so if it's not too much to ask, could
>>> you
>>> > do it on my MWE?
>>> >
>>> > PS: sorry I have to use another email account because my institute
>>> > mailbox took forever to get the message before my government (China)
>>> > finishes auditing it.
>>> >
>>> > Best wishes,
>>> > Zhichu
>>> >
>>> > On Wed, May 18, 2022 at 3:36 PM mf via ntg-context >> > <mailto:ntg-context@ntg.nl>> wrote:
>>> >
>>> > Is this what you mean?
>>> >
>>> > \starttext
>>> > Hello\footnotetext{Footnote without mark}.
>>> > \stoptext
>>> >
>>> > Kind regards,
>>> > Massi
>>> >
>>> > Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:
>>> >  > Hi everybody,
>>> >  >
>>> >  >
>>> >  > After some attempts to put footnotes in a mixed 1&2 columns
>>> > layout, I
>>> >  > decide to put marks in the one-column environment and flush them
>>> > when
>>> >  > entering the two-column environment.
>>> >  >
>>> >  >
>>> >  > The code

Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread Ross via ntg-context
After some visualisations, I found that my token \titlefootnotes will
ALWAYS generate two lines if there is/are any non-zero number of footnotes
there. Interesting. So I need a \newif that each time a \thanks or \email
is invoked, it'll set to true and I'll unskip the 2\lineheight afterwards.

I still don't know why this \kern macro won't have any effect if it's
inside a token or a \startsetup.

On Wed, May 18, 2022 at 4:56 PM Ross  wrote:

> Hi Massi,
>
> You are a champion!
>
> On Wed, May 18, 2022 at 4:41 PM mf  wrote:
>
>> I hope I got the point now:
>>
>> ...
>> \startcolumns
>>
>> \the\titlefootnotes
>>
>> \kern-\rawcountervalue[address]\lineheight % dirty trick
>>
>> test\footnote{test}
>>
>> \input knuth
>>
>> \stopcolumns
>> ...
>>
>> Massi
>>
>> Il 18/05/22 10:07, Ross ha scritto:
>> > Dear Massi,
>> >
>> > Thanks for your solution. But the thing may be related to the
>> > \appendtoks macro. It doesn't work to put just \setnotetext there.
>> > \note works fine, so that's the reason I need the "full functional
>> macro".
>> >
>> > Maybe I didn't get the point, so if it's not too much to ask, could you
>> > do it on my MWE?
>> >
>> > PS: sorry I have to use another email account because my institute
>> > mailbox took forever to get the message before my government (China)
>> > finishes auditing it.
>> >
>> > Best wishes,
>> > Zhichu
>> >
>> > On Wed, May 18, 2022 at 3:36 PM mf via ntg-context > > <mailto:ntg-context@ntg.nl>> wrote:
>> >
>> > Is this what you mean?
>> >
>> > \starttext
>> > Hello\footnotetext{Footnote without mark}.
>> > \stoptext
>> >
>> > Kind regards,
>> > Massi
>> >
>> > Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:
>> >  > Hi everybody,
>> >  >
>> >  >
>> >  > After some attempts to put footnotes in a mixed 1&2 columns
>> > layout, I
>> >  > decide to put marks in the one-column environment and flush them
>> > when
>> >  > entering the two-column environment.
>> >  >
>> >  >
>> >  > The code is ugly but the result is acceptable. Except that the
>> > invisible
>> >  > footnote marks do generate something in the main text, so
>> there's a
>> >  > blank line for each footnote.
>> >  >
>> >  >
>> >  > Here's an MWE:
>> >  >
>> >  >
>> >  > =
>> >  >
>> >  > \definenote[address]
>> >  > \setupnote[address][rule=off,location=text]
>> >  >
>> >  >
>> >  >
>> >  > \definenote[putjustmark]
>> >  > \setupnote[putjustmark][location=none]
>> >  > \setupnotation[putjustmark][numberconversion=set 2]
>> >  >
>> >  >
>> >  > \definenote[putjustnote]%[footnote] % if footnotes need to be
>> > grouped,
>> >  > uncomment the second argument and the line after
>> \the\titlefootnotes
>> >  > \setupnote[putjustnote][textcommand=\gobbleoneargument]
>> >  > \setupnotation[putjustnote][numberconversion=set 2]
>> >  >
>> >  >
>> >  > \newtoks\titlefootnotes
>> >  >
>> >  >
>> >  > \def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
>> >  > \titlefootnotes}
>> >  > \def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
>> >  > \titlefootnotes}
>> >  >
>> >  >
>> >  > \appendtoks
>> >  >\setcounter[footnote][0] % this looks stupid because it has no
>> > effect
>> >  >%\setupnotation[footnote][numberconversion=numerals]
>> >  > \to \titlefootnotes
>> >  >
>> >  > \definenamespace
>> >  > [addr]
>> >  > [type=module,
>> >  >  name=address,
>> >  >  command=yes,
>> >  >  setup=list,
>> >  >  parent=addr,
>> >  >]
>> >  >
>> >  > \define[1]\use

Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread Ross via ntg-context
Hi Massi,

You are a champion!

On Wed, May 18, 2022 at 4:41 PM mf  wrote:

> I hope I got the point now:
>
> ...
> \startcolumns
>
> \the\titlefootnotes
>
> \kern-\rawcountervalue[address]\lineheight % dirty trick
>
> test\footnote{test}
>
> \input knuth
>
> \stopcolumns
> ...
>
> Massi
>
> Il 18/05/22 10:07, Ross ha scritto:
> > Dear Massi,
> >
> > Thanks for your solution. But the thing may be related to the
> > \appendtoks macro. It doesn't work to put just \setnotetext there.
> > \note works fine, so that's the reason I need the "full functional
> macro".
> >
> > Maybe I didn't get the point, so if it's not too much to ask, could you
> > do it on my MWE?
> >
> > PS: sorry I have to use another email account because my institute
> > mailbox took forever to get the message before my government (China)
> > finishes auditing it.
> >
> > Best wishes,
> > Zhichu
> >
> > On Wed, May 18, 2022 at 3:36 PM mf via ntg-context  > <mailto:ntg-context@ntg.nl>> wrote:
> >
> > Is this what you mean?
> >
> > \starttext
> > Hello\footnotetext{Footnote without mark}.
> > \stoptext
> >
> > Kind regards,
> > Massi
> >
> > Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:
> >  > Hi everybody,
> >  >
> >  >
> >  > After some attempts to put footnotes in a mixed 1&2 columns
> > layout, I
> >  > decide to put marks in the one-column environment and flush them
> > when
> >  > entering the two-column environment.
> >  >
> >  >
> >  > The code is ugly but the result is acceptable. Except that the
> > invisible
> >  > footnote marks do generate something in the main text, so there's
> a
> >  > blank line for each footnote.
> >  >
> >  >
> >  > Here's an MWE:
> >  >
> >  >
> >  > =
> >  >
> >  > \definenote[address]
> >  > \setupnote[address][rule=off,location=text]
> >  >
> >  >
> >  >
> >  > \definenote[putjustmark]
> >  > \setupnote[putjustmark][location=none]
> >  > \setupnotation[putjustmark][numberconversion=set 2]
> >  >
> >  >
> >  > \definenote[putjustnote]%[footnote] % if footnotes need to be
> > grouped,
> >  > uncomment the second argument and the line after
> \the\titlefootnotes
> >  > \setupnote[putjustnote][textcommand=\gobbleoneargument]
> >  > \setupnotation[putjustnote][numberconversion=set 2]
> >  >
> >  >
> >  > \newtoks\titlefootnotes
> >  >
> >  >
> >  > \def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
> >  > \titlefootnotes}
> >  > \def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
> >  > \titlefootnotes}
> >  >
> >  >
> >  > \appendtoks
> >  >\setcounter[footnote][0] % this looks stupid because it has no
> > effect
> >  >%\setupnotation[footnote][numberconversion=numerals]
> >  > \to \titlefootnotes
> >  >
> >  > \definenamespace
> >  > [addr]
> >  > [type=module,
> >  >  name=address,
> >  >  command=yes,
> >  >  setup=list,
> >  >  parent=addr,
> >  >]
> >  >
> >  > \define[1]\useaddress
> >  >  {\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}
> >  >
> >  >
> >  > \starttext
> >  >
> >  >
> >  >
> >  > \defineaddress[fst][name={Name of Institute or Affiliation, City,
> > Country}]
> >  > \defineaddress[snd][name={Name of Secondary Institute or
> > Affiliation,
> >  > City, Country}]
> >  >
> >  > \processcommacommand[fst,snd]\useaddress
> >  >
> >  >
> >  > The Title\thanks{Work supported by somebody.}
> >  >
> >  >
> > Me\email{myemail@some.where
> }\high{,}\note[address][fst]\high{,}\note[address][snd]
> >
> >  >
> >  >
> >  >
> >  > \placenotes[address]
> >  >
> >  

Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread Ross via ntg-context
Dear Massi,

Thanks for your solution. But the thing may be related to the \appendtoks
macro. It doesn't work to put just \setnotetext there.
\note works fine, so that's the reason I need the "full functional macro".

Maybe I didn't get the point, so if it's not too much to ask, could you do
it on my MWE?

PS: sorry I have to use another email account because my institute mailbox
took forever to get the message before my government (China) finishes
auditing it.

Best wishes,
Zhichu

On Wed, May 18, 2022 at 3:36 PM mf via ntg-context 
wrote:

> Is this what you mean?
>
> \starttext
> Hello\footnotetext{Footnote without mark}.
> \stoptext
>
> Kind regards,
> Massi
>
> Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:
> > Hi everybody,
> >
> >
> > After some attempts to put footnotes in a mixed 1&2 columns layout, I
> > decide to put marks in the one-column environment and flush them when
> > entering the two-column environment.
> >
> >
> > The code is ugly but the result is acceptable. Except that the invisible
> > footnote marks do generate something in the main text, so there's a
> > blank line for each footnote.
> >
> >
> > Here's an MWE:
> >
> >
> > =
> >
> > \definenote[address]
> > \setupnote[address][rule=off,location=text]
> >
> >
> >
> > \definenote[putjustmark]
> > \setupnote[putjustmark][location=none]
> > \setupnotation[putjustmark][numberconversion=set 2]
> >
> >
> > \definenote[putjustnote]%[footnote] % if footnotes need to be grouped,
> > uncomment the second argument and the line after \the\titlefootnotes
> > \setupnote[putjustnote][textcommand=\gobbleoneargument]
> > \setupnotation[putjustnote][numberconversion=set 2]
> >
> >
> > \newtoks\titlefootnotes
> >
> >
> > \def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
> > \titlefootnotes}
> > \def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
> > \titlefootnotes}
> >
> >
> > \appendtoks
> >\setcounter[footnote][0] % this looks stupid because it has no effect
> >%\setupnotation[footnote][numberconversion=numerals]
> > \to \titlefootnotes
> >
> > \definenamespace
> > [addr]
> > [type=module,
> >  name=address,
> >  command=yes,
> >  setup=list,
> >  parent=addr,
> >]
> >
> > \define[1]\useaddress
> >  {\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}
> >
> >
> > \starttext
> >
> >
> >
> > \defineaddress[fst][name={Name of Institute or Affiliation, City,
> Country}]
> > \defineaddress[snd][name={Name of Secondary Institute or Affiliation,
> > City, Country}]
> >
> > \processcommacommand[fst,snd]\useaddress
> >
> >
> > The Title\thanks{Work supported by somebody.}
> >
> > Me\email{myemail@some.where}\high{,}\note[address][fst]\high{,}\note[address][snd]
>
> >
> >
> >
> > \placenotes[address]
> >
> > \blank[medium]
> >
> > \startcolumns
> >
> >
> > \the\titlefootnotes
> >
> > %\setcounter[footnote][0] % why it's necessary to set the counter
> > outside the token if I define [putjustnote] as [footnote]?
> >
> >
> > test\footnote{test}
> >
> > \input knuth
> >
> >
> >
> > \stopcolumns
> >
> > \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
> >
> ___
>
> >
>
> ___
> 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
>
> ___
>


-- 
Best Regards
Chen
___
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 I just put a footnote without marking in the main text?

2022-05-18 Thread mf via ntg-context

Is this what you mean?

\starttext
Hello\footnotetext{Footnote without mark}.
\stoptext

Kind regards,
Massi

Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:

Hi everybody,


After some attempts to put footnotes in a mixed 1&2 columns layout, I 
decide to put marks in the one-column environment and flush them when 
entering the two-column environment.



The code is ugly but the result is acceptable. Except that the invisible 
footnote marks do generate something in the main text, so there's a 
blank line for each footnote.



Here's an MWE:


=

\definenote[address]
\setupnote[address][rule=off,location=text]



\definenote[putjustmark]
\setupnote[putjustmark][location=none]
\setupnotation[putjustmark][numberconversion=set 2]


\definenote[putjustnote]%[footnote] % if footnotes need to be grouped, 
uncomment the second argument and the line after \the\titlefootnotes

\setupnote[putjustnote][textcommand=\gobbleoneargument]
\setupnotation[putjustnote][numberconversion=set 2]


\newtoks\titlefootnotes


\def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to 
\titlefootnotes}
\def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to 
\titlefootnotes}



\appendtoks
   \setcounter[footnote][0] % this looks stupid because it has no effect
   %\setupnotation[footnote][numberconversion=numerals]
\to \titlefootnotes

\definenamespace
    [addr]
    [type=module,
     name=address,
     command=yes,
     setup=list,
     parent=addr,
   ]

\define[1]\useaddress
     {\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}


\starttext



\defineaddress[fst][name={Name of Institute or Affiliation, City, Country}]
\defineaddress[snd][name={Name of Secondary Institute or Affiliation, 
City, Country}]


\processcommacommand[fst,snd]\useaddress


The Title\thanks{Work supported by somebody.}

Me\email{myemail@some.where}\high{,}\note[address][fst]\high{,}\note[address][snd] 




\placenotes[address]

\blank[medium]

\startcolumns


\the\titlefootnotes

%\setcounter[footnote][0] % why it's necessary to set the counter 
outside the token if I define [putjustnote] as [footnote]?



test\footnote{test}

\input knuth



\stopcolumns

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


___
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] Can I just put a footnote without marking in the main text?

2022-05-17 Thread Zhichu Chen via ntg-context

Hi everybody,


After some attempts to put footnotes in a mixed 1&2 columns layout, I 
decide to put marks in the one-column environment and flush them when 
entering the two-column environment.



The code is ugly but the result is acceptable. Except that the invisible 
footnote marks do generate something in the main text, so there's a 
blank line for each footnote.



Here's an MWE:


=

\definenote[address]
\setupnote[address][rule=off,location=text]



\definenote[putjustmark]
\setupnote[putjustmark][location=none]
\setupnotation[putjustmark][numberconversion=set 2]


\definenote[putjustnote]%[footnote] % if footnotes need to be grouped, 
uncomment the second argument and the line after \the\titlefootnotes

\setupnote[putjustnote][textcommand=\gobbleoneargument]
\setupnotation[putjustnote][numberconversion=set 2]


\newtoks\titlefootnotes


\def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to 
\titlefootnotes}
\def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to 
\titlefootnotes}



\appendtoks
  \setcounter[footnote][0] % this looks stupid because it has no effect
  %\setupnotation[footnote][numberconversion=numerals]
\to \titlefootnotes

\definenamespace
   [addr]
   [type=module,
    name=address,
    command=yes,
    setup=list,
    parent=addr,
  ]

\define[1]\useaddress
    {\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}


\starttext



\defineaddress[fst][name={Name of Institute or Affiliation, City, Country}]
\defineaddress[snd][name={Name of Secondary Institute or Affiliation, 
City, Country}]


\processcommacommand[fst,snd]\useaddress


The Title\thanks{Work supported by somebody.}

Me\email{myemail@some.where}\high{,}\note[address][fst]\high{,}\note[address][snd] 




\placenotes[address]

\blank[medium]

\startcolumns


\the\titlefootnotes

%\setcounter[footnote][0] % why it's necessary to set the counter 
outside the token if I define [putjustnote] as [footnote]?



test\footnote{test}

\input knuth



\stopcolumns

\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] List of publications…

2022-05-17 Thread śrīrāma via ntg-context
On 5/18/22 12:02 AM Damien Thiriet via ntg-context wrote:
> Unfortunately, commenting out all occurrences of those two lines
> didn't make the job for me.
> And using lowercase characters is unfortunately a no-op as far as
> I'm concerned: my bib files have been filled with CamelCase for years,
> and are loaded by dozens of other files…
> 
> is there something I missed?
> current version: 2022.05.02 16:19

That's strange: I have LMTX 2022.05.11 11:36 and have no issues with this 
'patch'. I too have thousands of references across documents, so could not 
convert the tags to lowercase, and this patch works for me. 
I am attaching a diff here. I hope you made the format (context --make) after 
applying the changes.

  Sreeram--- publ-ini-1.lua	2022-05-04 08:07:01.410444702 +0530
+++ publ-ini.lua	2022-04-24 09:28:56.499009761 +0530
@@ -22,7 +22,7 @@
 -- gain is not that large anyway because not much publication stuff is flushed.
 
 local next, rawget, type, tostring, tonumber = next, rawget, type, tostring, tonumber
-local match, find, gsub, lower = string.match, string.find, string.gsub, string.lower
+local match, find, gsub = string.match, string.find, string.gsub
 local concat, sort, tohash = table.concat, table.sort, table.tohash
 local mod = math.mod
 local formatters = string.formatters
@@ -1316,12 +1316,6 @@
 local typesetters= { }
 publications.typesetters = typesetters
 
-local lowered = setmetatableindex(function(t,k)
-k = lower(k)
-t[k] = k
-return k
-end)
-
 local function defaulttypesetter(field,value,manipulator)
 if value and value ~= "" then
 value = tostring(value)
@@ -1428,8 +1422,6 @@
 local function get(dataset,tag,field,what,check,catspec) -- somewhat more extensive
 local current = rawget(datasets,dataset)
 if current then
-tag   = lowered[tag]
-field = lowered[field]
 local data = current.luadata[tag]
 if data then
 local category = data.category
@@ -1479,8 +1471,6 @@
 local function btxflush(name,tag,field)
 local dataset = rawget(datasets,name)
 if dataset then
-tag   = lowered[tag]
-field = lowered[field]
 local fields = dataset.luadata[tag]
 if fields then
 local manipulator, field = splitmanipulation(field)
@@ -1507,8 +1497,6 @@
 local function btxfield(name,tag,field)
 local dataset = rawget(datasets,name)
 if dataset then
-tag   = lowered[tag]
-field = lowered[field]
 local fields = dataset.luadata[tag]
 if fields then
 local category = fields.category
@@ -1534,8 +1522,6 @@
 local function btxdetail(name,tag,field)
 local dataset = rawget(datasets,name)
 if dataset then
-tag   = lowered[tag]
-field = lowered[field]
 local fields = dataset.luadata[tag]
 if fields then
 local details = dataset.details[tag]
@@ -1566,11 +1552,8 @@
 local function btxdirect(name,tag,field)
 local dataset = rawget(datasets,name)
 if dataset then
-tag   = lowered[tag]
-field = lowered[field]
 local fields = dataset.luadata[tag]
 if fields then
-field = lowered[field]
 local manipulator, field = splitmanipulation(field)
 local value = fields[field]
 if value then
@@ -1589,8 +1572,6 @@
 local function okay(name,tag,field)
 local dataset = rawget(datasets,name)
 if dataset then
-tag   = lowered[tag]
-field = lowered[field]
 local fields = dataset.luadata[tag]
 if fields then
 local category = fields.category
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] issue with two recently added PDF manuals

2022-05-15 Thread Günter Kolousek via ntg-context


Same here!

❯ qpdfview onandon.pdf 
documents/general/manuals

"Error: Couldn't find trailer dictionary"
"Error: Couldn't find trailer dictionary"
"Error: Couldn't read xref table"
❯


❯ qpdfview columnsets.pdf 
documents/general/manuals

"Error (4194333): Illegal character '}'"
"Error (4194339): Illegal character '>'"
"Error (4194333): Illegal character '}'"
"Error (4194339): Illegal character '>'"
"Error: Kid object (page 38) is wrong type (null)"
"Error (4194333): Illegal character '}'"
"Error (4194339): Illegal character '>'"
"Error: Kid object (page 38) is wrong type (null)"
"Error (4194333): Illegal character '}'"
"Error (4194339): Illegal character '>'"
"Error: Kid object (page 38) is wrong type (null)"
"Error (4194333): Illegal character '}'"
"Error (4194339): Illegal character '>'"
"Error: Kid object (page 38) is wrong type (null)"
"Error (4194333): Illegal character '}'"
"Error (4194339): Illegal character '>'"
"Error: Kid object (page 38) is wrong type (null)"
No page 43 was found in document at "columnsets.pdf"
❯


Pablo Rodriguez via ntg-context @ 2022-05-15 10:36 +02:


Dear list,

I’m experiencing issues to open the following documents added in 
one of

the recent latests.

Now I’m on Linux 64bit with current latest (2022.05.11 11:36) 
and

mupdf-gl-1.20.0.rc1.

  $ mupdf-gl onandon.pdf
  error: cannot find startxref
  warning: trying to repair broken xref
  warning: repairing PDF document
  warning: object missing 'endobj' token
  error: cannot find page tree

  $ mupdf-gl columnsets.pdf
  error: expected object number
  warning: repairing PDF document
  error: object is not a stream
  warning: cannot load object (730 0 R) into cache
  error: cannot find XObject resource 'Im92'
  error: cannot find XObject resource 'Im93'
  error: cannot find XObject resource 'Im94'
  error: cannot find XObject resource 'Im95'
  error: cannot find XObject resource 'Im92'
  error: cannot find XObject resource 'Im93'
  error: cannot find XObject resource 'Im94'
  error: cannot find XObject resource 'Im95'
  warning: non-page object in page tree ()
  warning: ... repeated 11 times...
  warning: content stream is not a stream (1045 0 R)
  warning: ... repeated 2 times...
  warning: non-page object in page tree ()
  warning: ... repeated 2 times...
  warning: content stream is not a stream (1048 0 R)
  warning: ... repeated 2 times...
  warning: non-page object in page tree ()
  warning: ... repeated 2 times...
  warning: content stream is not a stream (1055 0 R)
  warning: ... repeated 2 times...
  warning: non-page object in page tree ()
  warning: ... repeated 6 times...

Latest Acrobat Reader DC in Windows isn’t able to open 
onandon.pdf and

it has problems to display all contents from columnsets.pdf.

Would anyone be so kind to confirm the issue?
___
If your question is of interest to others as well, please add an 
entry to the Wiki!


maillist : ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context

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

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

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


Re: [NTG-context] Table breaks incorrectly between pages

2022-05-15 Thread Bruce Horrocks via ntg-context
Too slow!!

I'd already added https://wiki.contextgarden.net/TABLE#Tables_in_page_headers.

> On 15 May 2022, at 12:00, śrīrāma via ntg-context  wrote:
> 
> On 5/15/22 2:20 PM Wolfgang Schuster via ntg-context wrote:
>> Use the TABLEnested environment in your document header which was added
>> to avoid problems like in your example.
>> 
>> \startsetups headertext
>> \bTABLEnested[setups=headertable,option=stretch]
>> ...
>> \eTABLEnested
>> \stopsetups
> 
> Splendid (as always)! Definitely a better solution for Stefan's document.
> 
> I added a section in the wiki making a note of this:
>  https://wiki.contextgarden.net/TABLE#Headers_with_TABLEs
> 
> Thanks Wolfgang! Until now, I did not even know of the 'nested' type for 
> TABLE.
> 
>  Sreeram
> 

—
Bruce Horrocks
Hampshire, UK

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

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


Re: [NTG-context] Table breaks incorrectly between pages

2022-05-15 Thread śrīrāma via ntg-context
On 5/15/22 2:20 PM Wolfgang Schuster via ntg-context wrote:
> Use the TABLEnested environment in your document header which was added
> to avoid problems like in your example.
> 
> \startsetups headertext
> \bTABLEnested[setups=headertable,option=stretch]
> ...
> \eTABLEnested
> \stopsetups

Splendid (as always)! Definitely a better solution for Stefan's document.

I added a section in the wiki making a note of this:
  https://wiki.contextgarden.net/TABLE#Headers_with_TABLEs

Thanks Wolfgang! Until now, I did not even know of the 'nested' type for 
TABLE.

  Sreeram


___
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] Custom type-imp file creating empty lines

2022-05-11 Thread Alexandre Christe via ntg-context
Hi Pablo,

Thank you so much. That was indeed the issue!

Le mer. 11 mai 2022 à 19:14, Pablo Rodriguez via ntg-context <
ntg-context@ntg.nl> a écrit :

> On 5/11/22 18:42, Alexandre Christe via ntg-context wrote:
> > Dear list,
> >
> > I've played a bit with a custom type-imp file (partly inspired from the
> > wiki https://wiki.contextgarden.net/Alegreya_Typescript
> > <https://wiki.contextgarden.net/Alegreya_Typescript>). However, the file
> > I ended up with seems to create some empty lines at the beginning of the
> > document (if I use the default or another font this vanishes, so it
> > really comes from that file). Could anyone enlighten me?
>
> Hi Alex,
>
> you added an extra option group here:
>
>   \definefallbackfamily [alegreya] [math] [Alegreya]
> [superscriptsandsubscripts] [force=yes]
>
> I think this may read:
>
>   \definefallbackfamily [alegreya] [math] [Alegreya]
> [range=superscriptsandsubscripts, force=yes]
>
> Just in case it might help,
>
> Pablo
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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] Custom type-imp file creating empty lines

2022-05-11 Thread Pablo Rodriguez via ntg-context
On 5/11/22 18:42, Alexandre Christe via ntg-context wrote:
> Dear list,
>
> I've played a bit with a custom type-imp file (partly inspired from the
> wiki https://wiki.contextgarden.net/Alegreya_Typescript
> <https://wiki.contextgarden.net/Alegreya_Typescript>). However, the file
> I ended up with seems to create some empty lines at the beginning of the
> document (if I use the default or another font this vanishes, so it
> really comes from that file). Could anyone enlighten me?

Hi Alex,

you added an extra option group here:

  \definefallbackfamily [alegreya] [math] [Alegreya]
[superscriptsandsubscripts] [force=yes]

I think this may read:

  \definefallbackfamily [alegreya] [math] [Alegreya]
[range=superscriptsandsubscripts, force=yes]

Just in case it might help,

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

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


[NTG-context] Custom type-imp file creating empty lines

2022-05-11 Thread Alexandre Christe via ntg-context
Dear list,

I've played a bit with a custom type-imp file (partly inspired from the
wiki https://wiki.contextgarden.net/Alegreya_Typescript). However, the file
I ended up with seems to create some empty lines at the beginning of the
document (if I use the default or another font this vanishes, so it really
comes from that file). Could anyone enlighten me?

The file is attached.

BR,
Alex


type-imp-alegreya.mkiv
Description: Binary data
___
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] \placenotes ends up in wrong place when mixing one- and two- column layouts.

2022-05-10 Thread Zhichu Chen via ntg-context

Thanks Hans, works perfectly.


Sorry for the late reply. Still working on the template and got another 
one. Again, sorry.



The journal is in two-column form and the title, authors, and addresses 
are spanned to


the full width. Very common. But the title may acknowledge to some 
fund(s) and the


authors may have email addresses. If I use \note[thanks] and 
\note[email] to do that,


only the markers are shown. That's expected. So I tried to put 
\postponenotes before


the title and insert\placenotes[thanks] and \placenotes[email] after 
\startcolumns. The


notes did show up but in wrong position.


I hope there's another magic switch, or I have to put the marks in the 
title head and


put "real" but invisible notes in the two-column texts.



Thanks again, Hans.


Yours,

Zhichu


MWE (not that minimal):

===

\definenote[address]
\setupnote[address][rule=off,location=text]

\definenote[thanks]
\setupnote[thanks][location=firstcolumn]
\setupnotation[thanks][numberconversion=set 2]
\definenote[email][thanks]


\definenamespace
   [addr]
   [type=module,
    name=address,
    command=yes,
    setup=list,
    parent=addr,
  ]

\define[1]\useaddress
    {\edef\currentaddress{#1}%
 {\setnotetext[address][#1]{\addressparameter{name}}}%
    \endgraf
    }

\starttext


\setupaddress[style=italic]
\defineaddress[fst][name={Name of Institute or Affiliation, City, Country}]
\defineaddress[snd][name={Name of Secondary Institute or Affiliation, 
City, Country}]


\processcommacommand[fst,snd]\useaddress

\postponenotes

The Title\thanks{Work supported by somebody.}

%\startlocalnotes[address]
Me\email{myemail@some.where}\high{,}\note[address][fst]\high{,}\note[address][snd]
%\placelocalnotes[address]
%\stoplocalnotes

\placenotes[address]

\startcolumns

\placenotes[thanks]
\placenotes[email]


\input knuth
\stopcolumns

\stoptext

===


On 5/8/22 17:20, Hans Hagen via ntg-context wrote:

On 5/8/2022 6:55 AM, Zhichu via ntg-context wrote:

Hi,

I am going to convince the Board of a journal to consider ConTeXt as 
an additional option.
I want to make a module before I say anything. Right now I have this 
title problem.


The journal requires the titles to be CAPITALISED, except for the 
acronyms. I'm currently
using backticks`...`to wrap it and replace it with\egroup 
...\WORD\bgroup{} with
lpeg. This kinda works, but that's so ugly. Besides, the actual story 
is that I also want to

add markdown as an option, so the backticks actually have meanings.

I also checked thetypo-cap.luafile to get a clue. But I used to use 
TeX exclusively

and I have to admit that it's so overwhelming for a newbie.

I really like the way wherebibtextreats words enclosed in curly 
braces are ignored.
Or are there something that's less aggressive than\WORDso the LaTeX 
trick works:

\def\NoCaseChange#1{\noexpand\NoCaseChange{\noexpand#1}}

\starttext

\protected\def\casing[#1]{\groupedcommand{\setcharactercasing[#1]}{}}
    \protected\def\nocasing 
{\groupedcommand{\setcharactercasing[reset]}{}}


    \setuphead[chapter][textstyle=\WORD]

    \chapter{some \nocasing{kept} text or \casing[Word]{more} text}

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


___
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 choose a font variant "book" / LMTX

2022-05-04 Thread Heinrich Paeßens via ntg-context
Yes … that is embarrassing simple … and actually I do not need anything else 
(since no other family is involved)

Many thanks Mikael

Best regards,
Heinrich

> On 4. May 2022, at 19:16, Mikael Sundqvist via ntg-context 
>  wrote:
> 
> On Wed, May 4, 2022 at 6:44 PM Heinrich Paeßens via ntg-context
>  wrote:
>> 
>> Hi there
>> I have a quick question:
>> 
>> I was successful to install and use a new font in LMTX (New Computer 
>> Modern). All good except that I’d like to use the »Book« variant instead of 
>> the »Regular« variant (NewCM10-Book.otf vs NewCM10-Regular.otf). Trying many 
>> ways but the right one.
>> 
>> please advise,
>> can I define something similar like \bf for bold — maybe \bk for book?
>> 
>> … all I get is
>> 
>> hp@mbp16 ~ % pdffonts page1.pdf
>> name type  encoding emb 
>> sub uni object ID
>> ---- -  --- 
>> --- --- -
>> CRBMBE+NewCM10-Regular   CID Type 0C   Identity-H   yes 
>> yes yes  1  0
>> 
>> my definitions are:
>> 
>> \definefontfamily [newCM] [rm] [newcomputermodern10]
>> \definefontfamily [newCM] [ss] [newcomputermodernsans10]
>> \definefontfamily [newCM] [tt] [newcomputermodernmono10] [scale=0.85, 
>> features=none]
>> \definefontfamily [newCM] [mm] [newcomputermodernmath]
>> \setupbodyfont[newCM, rm, 10pt]
>> 
>> Many thanks
>> Heinrich
> 
> Hi!
> 
> \setupbodyfont[newcomputermodern-book,10pt]
> 
> works here.
> 
> /Mikael
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
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 choose a font variant "book" / LMTX

2022-05-04 Thread Mikael Sundqvist via ntg-context
On Wed, May 4, 2022 at 6:44 PM Heinrich Paeßens via ntg-context
 wrote:
>
> Hi there
> I have a quick question:
>
> I was successful to install and use a new font in LMTX (New Computer Modern). 
> All good except that I’d like to use the »Book« variant instead of the 
> »Regular« variant (NewCM10-Book.otf vs NewCM10-Regular.otf). Trying many ways 
> but the right one.
>
> please advise,
> can I define something similar like \bf for bold — maybe \bk for book?
>
> … all I get is
>
> hp@mbp16 ~ % pdffonts page1.pdf
> name type  encoding emb 
> sub uni object ID
>  -  --- 
> --- --- -
> CRBMBE+NewCM10-Regular   CID Type 0C   Identity-H   yes 
> yes yes  1  0
>
> my definitions are:
>
> \definefontfamily [newCM] [rm] [newcomputermodern10]
> \definefontfamily [newCM] [ss] [newcomputermodernsans10]
> \definefontfamily [newCM] [tt] [newcomputermodernmono10] [scale=0.85, 
> features=none]
> \definefontfamily [newCM] [mm] [newcomputermodernmath]
> \setupbodyfont[newCM, rm, 10pt]
>
> Many thanks
> Heinrich

Hi!

\setupbodyfont[newcomputermodern-book,10pt]

works here.

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

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


Re: [NTG-context] how to choose a font variant "book" / LMTX

2022-05-04 Thread Heinrich Paeßens via ntg-context
'both' would be the way to go, how can I set this up?

I don’t use typescripts just the definefontfamily and I suppose the book 
variant belongs to the family but is maybe an unloved relative ...

> On 4. May 2022, at 18:51, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> Do I understand correctly that you want the "Book" variant as regular? Or do 
> you need both?
> 
> Have a look into typescripts, e.g. 
> https://wiki.contextgarden.net/Alegreya_Typescript
> You probably won’t need the features.
> 
> Hraban
> 
> Am 04.05.22 um 18:44 schrieb Heinrich Paeßens via ntg-context:
>> Hi there
>> I have a quick question:
>> I was successful to install and use a new font in LMTX (New Computer 
>> Modern). All good except that I’d like to use the »Book« variant instead of 
>> the »Regular« variant (NewCM10-Book.otf vs NewCM10-Regular.otf). Trying many 
>> ways but the right one.
>> please advise,
>> can I define something similar like \bf for bold — maybe \bk for book?
>> … all I get is
>> hp@mbp16 ~ % pdffonts page1.pdf
>> name type  encoding emb 
>> sub uni object ID
>> ---- -  --- 
>> --- --- -
>> CRBMBE+NewCM10-Regular   CID Type 0C   Identity-H   yes 
>> yes yes  1  0
>> my definitions are:
>> \definefontfamily [newCM] [rm] [newcomputermodern10]
>> \definefontfamily [newCM] [ss] [newcomputermodernsans10]
>> \definefontfamily [newCM] [tt] [newcomputermodernmono10] [scale=0.85, 
>> features=none]
>> \definefontfamily [newCM] [mm] [newcomputermodernmath]
>> \setupbodyfont[newCM, rm, 10pt]
>> Many thanks
>> Heinrich
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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

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


Re: [NTG-context] how to choose a font variant "book" / LMTX

2022-05-04 Thread Henning Hraban Ramm via ntg-context
Do I understand correctly that you want the "Book" variant as regular? 
Or do you need both?


Have a look into typescripts, e.g. 
https://wiki.contextgarden.net/Alegreya_Typescript

You probably won’t need the features.

Hraban

Am 04.05.22 um 18:44 schrieb Heinrich Paeßens via ntg-context:

Hi there
I have a quick question:

I was successful to install and use a new font in LMTX (New Computer 
Modern). All good except that I’d like to use the »Book« variant instead 
of the »Regular« variant (NewCM10-Book.otf vs NewCM10-Regular.otf). 
Trying many ways but the right one.


please advise,
can I define something similar like \bf for bold — maybe \bk for book?

… all I get is

hp@mbp16 ~ % pdffonts page1.pdf
name                                 type              encoding 
emb sub uni object ID
 -  
--- --- --- -
CRBMBE+NewCM10-Regular               CID Type 0C       Identity-H   
yes yes yes      1  0


my definitions are:

\definefontfamily [newCM] [rm] [newcomputermodern10]
\definefontfamily [newCM] [ss] [newcomputermodernsans10]
\definefontfamily [newCM] [tt] [newcomputermodernmono10] [scale=0.85, 
features=none]

\definefontfamily [newCM] [mm] [newcomputermodernmath]
\setupbodyfont[newCM, rm, 10pt]

Many thanks
Heinrich

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

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


[NTG-context] how to choose a font variant "book" / LMTX

2022-05-04 Thread Heinrich Paeßens via ntg-context
Hi there 
I have a quick question: 

I was successful to install and use a new font in LMTX (New Computer Modern). 
All good except that I’d like to use the »Book« variant instead of the 
»Regular« variant (NewCM10-Book.otf vs NewCM10-Regular.otf). Trying many ways 
but the right one. 

please advise, 
can I define something similar like \bf for bold — maybe \bk for book?

… all I get is

hp@mbp16 ~ % pdffonts page1.pdf 
name type  encoding emb sub 
uni object ID
 -  --- --- 
--- -
CRBMBE+NewCM10-Regular   CID Type 0C   Identity-H   yes yes 
yes  1  0

my definitions are:

\definefontfamily [newCM] [rm] [newcomputermodern10]
\definefontfamily [newCM] [ss] [newcomputermodernsans10]
\definefontfamily [newCM] [tt] [newcomputermodernmono10] [scale=0.85, 
features=none]
\definefontfamily [newCM] [mm] [newcomputermodernmath]
\setupbodyfont[newCM, rm, 10pt]

Many thanks
Heinrich___
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] Issue in btx rendering

2022-05-04 Thread śrīrāma via ntg-context
Hi,

[my current version: 2022.05.02 16:19]
With the past two-or-so uploads, btx output seems to be broken in some cases. 
Compiling the below example

  \usebtxdataset[refs.bib]
  \usebtxdefinitions[aps]

  \starttext
  This reference has a tag which is in camel-case:
  \cite[Nielsen2011_ChernoffInformationExponentialFamilies]

  On the other hand this reference has a tag which is lower-case:
  \cite[vaart1998_asymptoticstatistics]

  \placelistofpublications
  \stoptext

along with the bibtex file (refs.bib attached here), only the second citation 
entry has a properly rendered bibliography entry while the first one does not. 
Notably, any bibtex entries whose tags are not all lowercase (ASCII) are not 
rendered correctly. Instead, in the log I get

publications > unknown tag 'nielsen2011_chernoffinformationexponentialfamilies' 
in dataset 'default'

Almost all my entries in bib files are in camel-case since I find that to be 
easier to read and it gives me a better clue of what the item is. With some 
recent uploads I noticed that in publ-ini.lua 'tag' and 'field' entries were 
string.lowered(). Upon removing those statements, I am able to get the proper 
output.

I also have certain bib files where the entries are not at all in ASCII (so I 
am not sure what the code might do there, I did not check in detail). I hope I 
can continue to use camel case for the tags (if its not too much to ask): is 
there some additional setting that I should change to allow this so that the 
output is rendered correctly?

Thanks,
  Sreeram@article{Nielsen2013_InformationGeometricCharacterizationChernoff,
	author= {Nielsen, Frank},
	doi   = {10.1109/LSP.2013.2243726},
	issn  = {1070-9908},
	journal   = {IEEE Signal Processing Letters},
	localfile = {Nielsen2013_InformationGeometricCharacterizationChernoff.pdf},
	month = {March},
	number= {3},
	pages = {269--272},
	title = {An Information-Geometric Characterization of Chernoff Information},
	volume= {20},
	year  = {2013},
}

@article{Nielsen2011_ChernoffInformationExponentialFamilies,
	author= {Nielsen, Frank},
	journal   = {CoRR},
	localfile = {Nielsen2011_ChernoffInformationExponentialFamilies.pdf},
	title = {Chernoff information of exponential families},
	url   = {http://arxiv.org/abs/1102.2684; https://dblp.org/rec/bib/journals/corr/abs-1102-2684},
	volume= {abs/1102.2684},
	year  = {2011},
}

@book{vaart1998_asymptoticstatistics,
	author = {Vaart, A. W. van der},
	collection = {Cambridge Series in Statistical and Probabilistic Mathematics},
	doi= {10.1017/CBO9780511802256},
	localfile  = {Vaart1998_AsymptoticStatistics.pdf},
	place  = {Cambridge},
	publisher  = {Cambridge University Press},
	series = {Cambridge Series in Statistical and Probabilistic Mathematics},
	title  = {Asymptotic Statistics},
	year   = {1998},
}

@article{Muller1997_IntegralProbabilityMetricsGeneratingClass,
	author  = {M{\"u}ller, Alfred},
	doi = {10.2307/1428011},
	issn= {0001-8678, 1475-6064},
	journal = {Advances in Applied Probability},
	month   = {Jun},
	number  = {2},
	pages   = {429--443},
	title   = {Integral Probability Metrics and Their Generating Classes of Functions},
	url = {https://www.cambridge.org/core/product/identifier/S000186780002807X/type/journal_article},
	volume  = {29},
	year= {1997},
}
___
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] process list items differently depending on position in list

2022-05-02 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Hans Hagen
> via ntg-context
> Gesendet: Montag, 2. Mai 2022 12:34
> An: Denis Maier via ntg-context 
> Cc: Hans Hagen 
> Betreff: Re: [NTG-context] process list items differently depending on
> position in list
> 
> On 5/2/2022 12:09 PM, Denis Maier via ntg-context wrote:
> 
> > But, it’d still love to hear whether there is a solution on the tex side.
> \processtokens {[before]} {[between]} {[after]} {[space]} {{one}{two}{three}}
> 
> \def\whatever{a,b,c,d}
> 
> \getcommacommandsize[\whatever]
> \scratchcounterone \zerocount
> \scratchcountertwo \commalistsize
> 
> \processcommacommand[\whatever]
>{\advance\scratchcounterone\plusone
> \ifnum\scratchcounterone=\scratchcountertwo
>   \space and\space
> \orelse\ifnum\scratchcounterone>\plusone
>   ,\space
> \fi
> \commalistelement}

Thanks.

> 
> but ... there's also:
> 
> \startlines
> \commalistsentence[aap,noot,mies]
> \commalistsentence[aap,noot]
> \commalistsentence[aap]
> \commalistsentence[a,b,c]
> \commalistsentence[a,b,c][{ \& },{ and }] \commalistsentence[a,b,c][+,-]
> \stoplines
> 
> which uses presets like
> 
> \setuplabeltext [nl] [and-1={{, }}, and-2={{ en }}]   % 1, 2 en 3
> \setuplabeltext [en] [and-1={{, }}, and-2={{, }}] % 1, 2, 3
> \setuplabeltext [de] [and-1={{, }}, and-2={{ und }}]  % 1, 2 und 3
> \setuplabeltext [hr] [and-1={{, }}, and-2={{ i }}]% 1, 2 i 3
> 
> maybe wikify

I've just checked, \commalistsentence is already on the wiki, but you have to 
know it exists. (I'll check whether I can link to that page from somewhere.)

But there's no (high-level) way to apply certain commands to this list 
elements, right? 
Background: My real use case is a bit more complex. I use comma separated lists 
to store author lists, but the authors themselves are saved in structured 
variables. So, I'll need to reassemble the different name parts first.
So, nothing like 
\commalistprocessandmakesentence[a,b,c]\commandforfirst\commandforinbetween\commandforlast
Probably to specific, right?


\startbuffer[test]


This is the title

Doe
John


Smith
Jane

This is a first sentence

\stopbuffer

\startxmlsetups xml:setup
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{document|p}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:setup}

\startxmlsetups xml:document
  \xmlfilter{#1}{/title/command(xml:title)}
  \xmlfilter{#1}{/author/command(xml:author)}
  \startdocument
  \xmlflush{#1}
  \stopdocument
\stopxmlsetups

\startxmlsetups xml:title
  \setupdocument[title={\xmlflush{#1}},author={\AuthorList}]
\stopxmlsetups

\startxmlsetups xml:author:family-name
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:author:given-name
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:author
  
\defineauthor[\xmlfilter{#1}{/family-name/command(xml:author:family-name)}\xmlfilter{#1}{/given-name/command(xml:author:given-name)}][family-name={\xmlfilter{#1}{/family-name/command(xml:author:family-name)}},given-name={\xmlfilter{#1}{/given-name/command(xml:author:given-name)}}]
  \addtocommalist 
{\xmlfilter{#1}{/family-name/command(xml:author:family-name)}\xmlfilter{#1}{/given-name/command(xml:author:given-name)}}
 \AuthorList
\stopxmlsetups

\startxmlsetups xml:p
  \xmlflush{#1}\par
\stopxmlsetups

\definenamespace
   [documentauthor] % name of internal varialbles
   [type=module,
name=author, 
command=yes, % Create \defineauthor
style=yes, % Create \useauthorstyleandcolor 
setup=list, % Create \setupauthor
parent=documentauthor,
  ]
  
\def\AuthorList{}

\define[1]\useauthor
{\edef\currentauthor{#1}%
{\authorparameter{given-name}
 \space
  \authorparameter{family-name}}}

\startsetups document:start
\documentvariable{title}\endgraf
\blank[medium]
\processcommacommand[\documentvariable{author}]\useauthor
\endgraf
\stopsetups

\xmlprocessbuffer{main}{test}{}




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

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


Re: [NTG-context] context module t-account in LMTX

2022-04-28 Thread Heinrich Paeßens via ntg-context
Many thanks Wolfgang, I can see the 'values' in a table like form, nothing but the values — how can I switch on the 'lines' of the table?Best regards, HeinrichI took your file t-taccount.mkxland——% !TEX program = lmtx\usemodule[t][taccount]\startTEXpage[offset=5pt]\starttaccount[title=Bilanz,lefttext=Aktiva,righttext=Passiva]    \startdebits        \debit{Gebäude}  {1.800}        \debit{Maschinen}{1.200}        \debit{Fuhrpark}   {500}        \debit{Rohstoffe}  {100}        \debittotal      {3.600}    \stopdebits    \startcredits        \credit{Eigenkapital}{1.400}        \credit{Schulden}    {2.200}        \credittotal         {3.600}    \stopcredits\stoptaccount\stopTEXpage——

tst-taccount.pdf
Description: Adobe PDF document
the log——resolvers       | formats | executing runner 'run luametatex format': /Users/hp/Library/context-osx-64/tex/texmf-osx-64/bin/luametatex --jobname="./tst-taccount.tex" --fmt=/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt --lua=/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui  --c:autopdf --c:currentrun=1 --c:directives="system.showerror" --c:fulljobname="./tst-taccount.tex" --c:input="./tst-taccount.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:purgeall --c:texmfbinpath="/Users/hp/Library/context-osx-64/tex/texmf-osx-64/bin"system          > system          > ConTeXt  ver: 2022.04.15 20:20 LMTX  fmt: 2022.4.17  int: english/englishsystem          > system          > 'cont-new.mkxl' loadedopen source     > level 1, order 1, name '/Users/hp/Library/context-osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'system          > beware: some patches loaded from cont-new.mkivclose source    > level 1, order 1, name '/Users/hp/Library/context-osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'system          > files > jobname './tst-taccount', input './tst-taccount.tex', result './tst-taccount'fonts           > latin modern fonts are not preloadedlanguages       > language 'en' is activeopen source     > level 1, order 2, name './tst-taccount.tex'modules         > 'taccount' is loadedopen source     > level 2, order 3, name 't-taccount.mkxl'loading         > Context User Module / Miscellaneousclose source    > level 2, order 3, name 't-taccount.mkxl'system          > auto \starttext ... \stoptextfonts           > preloading latin modern fonts (second stage)fonts           > 'fallback modern-designsize rm 12pt' is loadedbackend         > xmp > using file '/Users/hp/Library/context-osx-64/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'pages           > flushing realpage 1, userpage 1, subpage 1close source    > level 1, order 3, name './tst-taccount.tex'mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.luamkiv lua stats  > used cache path: /Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32emkiv lua stats  > resource resolver: loadtime 0.010 seconds, 0 scans with scantime 0.000 seconds, 0 shared scans, 10 found files, scanned paths: mkiv lua stats  > stored bytecode data: 504 modules (0.406 sec), 98 tables (0.020 sec), 602 chunks (0.426 sec)mkiv lua stats  > traced context: maxstack: 1627, freed: 0, unreachable: 1627mkiv lua stats  > cleaned up reserved nodes: 72 nodes, 11 lists of 439mkiv lua stats  > node memory usage: 15 attribute, 3 glue, 67 gluespec, 3 kern, 582 mathspec, 4 penalty, 2 tempmkiv lua stats  > node list callback tasks: 12 unique task lists, 9 instances (re)created, 59 callsmkiv lua stats  > used backend: pdfmkiv lua stats  > jobdata time: 0.002 seconds saving, 0.000 seconds loadingmkiv lua stats  > callbacks: file: 390, saved: 270, direct: 2, function: 1102, value: 2, message: 0, bytecode: 602, late 0, total: 2368 (0 per page)mkiv lua stats  > randomizer: initialized with value 0.56777543833852mkiv lua stats  > loaded tex modules: 1 requested, all found (t-taccount)mkiv lua stats  > loaded patterns: en::1, load time: 0.000mkiv lua stats  > loaded fonts: 2 files: latinmodern-math.otf, lmroman12-regular.otfmkiv lua stats  > font engine: otf 3.120, afm 1.513, tfm 1.000, 7 instances, 3 shared in backend, 3 common vectors, 0 common hashes, load time 0.237 seconds mkiv lua stats  > font embedding time: 0.004 seconds, 1 fontsmkiv lua stats  > result saved in file: tst-taccount.pdf, compresslevel 1, objectcompresslevel 3mkiv lua stats  > positions: 4 collected, 0 deltas, 0 shared partials, 0 partial entriesmkiv lua stats  > used platform: osx-64, type: unix, binary subtree: texmf-osx-64mkiv lua stats  > used engine: luametatex version: 2.0946, functionality level: 20220405, format id: 647, compiler: clangmkiv lua stats  &

[NTG-context] $\sin \theta$ behave differently in metafun

2022-04-15 Thread Jeong Dal via ntg-context
Dear all,

I use $\sin \theta$ and $\cos \theta$ behave differently in text and in metafun.
It works well sometime before but it doesn’t  in metafun now.
What is wrong in my example?

Thank you for reading.
Best regards,

Dalyoung

Here is a MWE.

\startbuffer[pointCircle]
numeric u; u:=1cm;
pair A,B,C;
draw fullcircle scaled 4u;
A := dir(25)*2u; 
label.top(textext("$P=(\cos\theta, \sin\theta)$"), A);
B := dir(-25)*2u;
label.bot(textext("$Q=(\cos(-\theta), \sin(-\theta))$"), B);
C := (xpart A, 0); label.lrt(textext("$A$"), C);
label(textext("$O$"), origin);
\stopbuffer
\starttext
I'd like use $\sin$ and $\cos$ in the metafun. But it shows strange text 
instead of $\sin$ and $\cos$. 

\processMPbuffer[pointCircle]

\stoptext


> 2022. 4. 13. 오전 11:09, ntg-context-requ...@ntg.nl 작성:
> 
> Send ntg-context mailing list submissions to
>   ntg-context@ntg.nl
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   https://mailman.ntg.nl/mailman/listinfo/ntg-context
> or, via email, send a message with subject or body 'help' to
>   ntg-context-requ...@ntg.nl
> 
> You can reach the person managing the list at
>   ntg-context-ow...@ntg.nl
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ntg-context digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: Setting up zint on a mac with macOS Montery Version
>  12.3.1 (Keith McKay)
>   2. Re: fatal error in LMTX (Bruce Horrocks)
>   3. Re: Setting up zint on a mac with macOS Montery Version
>  12.3.1 (Bruce Horrocks)
>   4. Re: Proper formatting of itemized bullets in ConTeXt (śrīrāma)
>   5. Re: Proper formatting of itemized bullets in ConTeXt (śrīrāma)
> 
> 
> --
> 
> Message: 1
> Date: Tue, 12 Apr 2022 21:04:50 +0100
> From: Keith McKay 
> To: Bruce Horrocks , mailing list for ConTeXt users
>   , monty.l...@gmail.com
> Subject: Re: [NTG-context] Setting up zint on a mac with macOS Montery
>   Version 12.3.1
> Message-ID: <475d96e6-0905-7d2d-a51d-84b06d340...@gmail.com>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
> 
> Hi All
> 
> I created the symbolic link as suggested by Bruce and Luis and still got the 
> error message
> 
> optional> unable to locate library 'libzint'
> 
> in my text editor. I use TeXworks. However, I thought I would try running 
> from the Terminal app and it worked. It found libzint and output the pdf with 
> both barcodes and the qrcode. I have no idea why it works in the Terminal and 
> not TexWorks, I'm guessing I have a path issue which I need to investigate.
> 
> Notes
> 1) My machine is a mac-mini-M1 with macos Monterey and I'm running the latest 
> ConTeXt version
> 2) Bruce noted that my Homebrew was installed in a non-standard location so I 
> checked on the Hombrew website and it is installed in opt/homebrew for Apple 
> Silicon i.e the M1 chip. Maybe Bruce's homebrew was installed on an earlier 
> version.
> 
> Thanks to Luis and Bruce for their suggestions.
> Best Wishes
> Keith McKay
> 
> On 10/04/2022 22:26, Bruce Horrocks wrote:
>> Hi Keith,
>> 
>>> On 10 Apr 2022, at 14:49, Keith McKay via ntg-context  
>>> wrote:
>>> 
>>> Hi All
>>> 
>>> I have been struggling today trying to setup and use the Barcode module 
>>> zint in ConTeXt and failed. I have followed the instructions on the wiki 
>>> (https://wiki.contextgarden.net/Barcodes  ) but with some changes as 
>>> follows. Which maybe why I failed.
>>> 
>>> 1) I downloaded Zint using Homebrew since I'm using macOS, and installed it 
>>> according to the instructions.
>>> 
>>> 
>>> 2) Since I'm using LMTX I looked for the file libzint.dylib and found it in 
>>> /opt/homebrew/Cellar/zint/2.10.0/lib . This is different from the path 
>>> given on the wiki. The directory contained three files, two of which were 
>>> aliases,  libzint.2.10.dylib and libzint.dylib, and an exe file 
>>> libzint.2.10.0.0.dylib
>> You have Hombrew installed in a non-standard location. Mine is in 
>> /usr/local/Cellar with the executables linked into /usr/local/bin.
>> 
>> But, assuming other Homebrew commands work when run from Terminal then you 
>> might still be okay.
>> 
>>> 3) I created the path $TEXROOT/tex/texmf-osx-64/bin/lib/luametatex/zint and 
>>> copied libzint.2.10.0.0.dylib into but replaced dylib with 'so' as 
>>> suggested on the wiki instructions. So I basically added  
>>> lib/luametatex

Re: [NTG-context] modify kern between two glyphs

2022-04-05 Thread mf via ntg-context
There's a problem with oldstyle glyphs, because they have different 
codes inside a font.


I used fontforge to find the "four.oldstyle" glyph, whose code is 0xf734.
But then I discovered that the 'four.oldstyle' key works the same in the 
lua table.


This is the updated MWE, suitable for oldstyle glyphs too.

--
\mainlanguage[it]

% modified from http://www.pragma-ade.com/context/latest/cont-tst.zip
% file: doc/context/tests/mkiv/fonts/extensions-001.tex

\startluacode
fonts.handlers.otf.addfeature {
name = "ktest",
type = "kern",
data = {
[ '’' ] = {
  [ '4' ] = -100,
  [ 0xf734 ] = -150, -- four.oldstyle code
  -- [ 'four.oldstyle' ] = -150, -- this is the same as the 
previous line

},
}
}
\stopluacode
\definefontfeature[ktest][ktest=yes]
\definefontfeature[onum][onum=yes]

\starttext
Default: «Questo è successo nel ’48».

Desired: «Questo è successo nel ’\kern-.1em 48».

Solved: \feature[+][ktest]«Questo è successo nel ’48».

Onum: \feature[+][onum]«Questo è successo nel ’48».

\stoptext
--

Massi
___
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] modify kern between two glyphs

2022-04-05 Thread mf via ntg-context

Il 05/04/22 13:54, Hans Hagen via ntg-context ha scritto:

On 4/5/2022 1:45 PM, mf via ntg-context wrote:

It's defined in typo-fkr.lua, but I can't understand what parameters 
to pass and whether it's the right macro. It looks like it's not.
look at the extension examples in the test suite: you can define a kern 
pair positioning feature than you enable for just that font




Thanks Hans, here's the working MWE:

---
\mainlanguage[it]

% from http://www.pragma-ade.com/context/latest/cont-tst.zip
% file doc/context/tests/mkiv/fonts/extensions-001.tex
\startluacode
fonts.handlers.otf.addfeature {
name = "ktest",
    type = "kern",
data = {
[ '’' ] = { [ '4' ] = -100 },
}
}
\stopluacode
\definefontfeature[ktest][ktest=yes]

\starttext

Default: «Questo è successo nel ’48».

Desired: «Questo è successo nel ’\kern-.1em 48».

Solved: \feature[+][ktest]«Questo è successo nel ’48».

\stoptext
--

Massi
___
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] Spellchecking for ConTeXt user on a Windows platform

2022-04-02 Thread A A via ntg-context
Hi Alain,

Yes that's what I mean, spellchecking any content which is not a control
sequence. That should include things like section titles and footnotes.
Though I'm afraid that might be asking for too much.

I'd rather not make it part of my editor (I use vim) and have it as an
extra step which I can add to something like a Makefile.

Do I need to install all of Libreoffice to gain access to the files you
mention or is there an easier way?

Amine

On Sat, 2 Apr 2022, 13:42 Alain Delmotte via ntg-context, <
ntg-context@ntg.nl> wrote:

> Hi Amine!
>
> Do you mean spellchecking the content of your document (not the ConTeXt
> commands)?
>
> This depends on your editor!
> I use TeXworks and there is spellchecking using the dictionaries of
> LibreOffice. You should copy the .aff and .dicfiles from "C:\Program
> Files\LibreOffice\share\extensions\..." subdirectories to the 
> "C:\Users\\AppData\Roaming\TUG\TeXworks\dictionaries"
> folder (created when installing TeXworks), (I think not in subfolders for
> the different languages).
> You can then ask for spellchecking when you type or not.
>
> I hope this help,
>
> Alain
> Le 2/04/2022 à 09:23, A A via ntg-context a écrit :
>
> Dear All,
>
> I'm currently using ConTeXt on a windows machine. I'd like to incorporate
> some sort of automated spell-checking in my workflow. I've seen that there
> are two options:
>
>1. spell check the .tex source file
>2. spell check the resulting pdf
>
> For the first option many resources online seem to suggest using *aspell.
> aspell* is however not maintained for windows and therefore hopelessly
> out of date. Furthermore many resources online seem to suggest skipping TeX
> and LaTeX control sequences does not always succeed. So I can only imagine
> how poorly it deals with ConTeXt control sequences.
>
> The second option as shown on this StackExchange
> <https://tex.stackexchange.com/questions/42843/is-there-a-spell-check-package-for-latex>
>  post
> suggests using *\loadspellchecklist. *However, on of the arguments to
> this command includes a text file listing - and brace yourself - *all of
> the correctly spelled words*. I find this both an amusing and tragic
> proposition, since I basically need to spellcheck based on *every word in
> a given language.*
>
> What options are out there for someone who would like to do serious
> spellchecking using ConTeXt on Windows platform, using Powershell as my
> command line?
>
> Regards,
>
> Amine
>
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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] Spellchecking for ConTeXt user on a Windows platform

2022-04-02 Thread Alain Delmotte via ntg-context

  
  
Hi Amine!
Do you mean spellchecking the content
of your document (not the ConTeXt commands)?
This depends on your editor! 
I use TeXworks and there is spellchecking using the dictionaries
of LibreOffice. You should copy the .aff and .dicfiles from
"C:\Program Files\LibreOffice\share\extensions\..."
subdirectories to the "C:\Users\\AppData\Roaming\TUG\TeXworks\dictionaries"
folder (created when installing TeXworks), (I think not in
subfolders for the different languages).
You can then ask for spellchecking when you type or not.
I hope this help,
Alain
  
Le 2/04/2022 à 09:23, A A via
  ntg-context a écrit :


  
  Dear All,


I'm currently using ConTeXt on a windows machine. I'd like
  to incorporate some sort of automated spell-checking in my
  workflow. I've seen that there are two options:

  
spell check the .tex source file
spell check the resulting pdf
  
  For the first option many resources online seem to
suggest using aspell. aspell is however not
maintained for windows and therefore hopelessly out of date.
Furthermore many resources online seem to suggest skipping
TeX and LaTeX control sequences does not always succeed. So
I can only imagine how poorly it deals with ConTeXt control
sequences.
  
  
  The second option as shown on this StackExchange post suggests
using \loadspellchecklist. However, on of the
arguments to this command includes a text file listing - and
brace yourself - all of the correctly spelled words.
I find this both an amusing and tragic proposition, since I
basically need to spellcheck based on every word in a
  given language.


  
What options are out there for someone who would like to do
  serious spellchecking using ConTeXt on Windows platform, using
  Powershell as my command line?


Regards,


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

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


  

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

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


[NTG-context] Fwd: command line arguments to specify output directory

2022-03-30 Thread A A via ntg-context
Thanks Wolfgang. I have two remarks:

   - That option is not documented and cannot be found when I type *context
   *into my command line and press enter. Do you know why this is?
   - I tried the following *context --runpath=test test/test.tex * but it
   still dumps all the output (.log, .pdf and .tuc) into my current directory.
   I would like for it to get dumped inside the *test *directory...


On Wed, 30 Mar 2022 at 18:39, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> wrote:

> A A via ntg-context schrieb am 30.03.2022 um 18:24:
> > Dear All,
> >
> > I would like to ask whether there exists a command line option to the
> > context executable which would allow me to specify the directory in
> > which I would like my output to be dumped.
> >
> > I have noticed that if I call the executable outside the directory in
> > which the .tex file resides, my supporting files (and resulting pdf)
> > are dumped outside the directory in which the .tex file is located.
>
> context --runpath=... filename
>
> Wolfgang
>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] upload

2022-03-30 Thread Otared Kavian via ntg-context
Hi Aditya and Mikael,

Indeed in some situations it is useful to number each equation appearing in 
formulas grouped with \startcases, and one can construct a structure allowing 
this, as in the example below which is not satisfactory. I am sure Hans can 
find a better solution…

Here is a working example:

% begin math-cases-numbered.tex
\definemathmatrix[alignedcases]
[align={1:right,2:left,3:left},
distance=3pt,
left={\left\{},
right={\right.},
style=\displaystyle]
\definereferenceformat[informula]  [left=(,right=),text=]
\def\eqref#1{\informula[eq:#1]} 

\starttext

Using \type{\startmathfenced} and \type{\startalign} we can number each 
equation, but the left brace is too far from the formula:
\startplaceformula
\startformula
\startmathfenced[cases]
\startalign[n=3,align={1:right,2:left,3:left}]
\NC \partial_{tt} u - \Delta u + q(x) u \NC = 0 \NC \quad\text{in }\; 
(0,T)\times\Omega \NR[+]
\NC u \NC = 0 \NC \quad\text{on }\; [0,T]\times\partial\Omega \NR[eq:Dirichlet]
\NC u(0,x) \NC = u_{0} \NC \quad\text{in }\; \Omega \NR[+]
\NC \partial_{t}u(0,x) \NC = v_{0} \NC \quad\text{in }\; \Omega \NR[+]
\stopalign
\stopmathfenced
\stopformula
\stopplaceformula
In some situations it is useful to number each equation, for example when we 
want to say:

Indeed we could study the above wave equation with Neumann boundary conditions, 
that is when \eqref{Dirichlet} is replaced with
\startplaceformula[eq:Neumann]
\startformula
{\partial u \over \partial {\bi n} } = 0 \quad \text{on }\; 
[0,T]\times\partial\Omega.
\stopformula
\stopplaceformula

Using \type{\startalignedcases} we cannot number each equation\dots
\startplaceformula
\startformula
\startalignedcases 
\NC \partial_{tt} u - \Delta u + q(x) u \NC = 0 \NC \quad\text{in }\; 
(0,T)\times\Omega \NR
\NC u \NC = 0 \NC \quad\text{in }\; [0,T]\times\partial\Omega \NR
\NC u(0,x) \NC = u_{0} \NC \quad\text{in }\; \Omega \NR
\NC \partial_{t}u(0,x) \NC = v_{0} \NC \quad\text{in }\; \Omega \NR
\stopalignedcases
\stopformula
\stopplaceformula
\stoptext
% end math-cases-numbered.tex

Best regards: Otared

> On 29 Mar 2022, at 18:08, Aditya Mahajan via ntg-context  
> wrote:
> 
> On Tue, 29 Mar 2022, Mikael Sundqvist via ntg-context wrote:
> 
>> On Tue, Mar 29, 2022 at 6:37 AM Otared Kavian  wrote:
>>> 
>>> Hi Mikael,
>> 
>> Hi Otared,
>> 
>>> 
>>> Thanks for your explanation and the example you sent about 
>>> \definemathsimplealign (I didn’t get immediately that « sesac » in the 
>>> command \startmathfenced[sesac] means « cases » in reverse or mirrored… I 
>>> guess this is a wise and humourous choice by Hans :-) ).
>> 
>> I guess so too :)
>> 
>>> 
>>> Regarding \startcases, it seems that it is still not possible to number 
>>> each equation, but I may be overlooking something. I’ll try a few examples 
>>> and will let you know, as well as Hans.
>> 
>> Hm, but a cases environment does not provide several formulas. This is
>> just one formula:
>> 
>> \startformula
>> |x|=
>> \startcases
>> \NC x \NC x>0\NR
>> \NC 0 \NC x=0\NR
>> \NC -x \NC x<0\NR
>> \stopcases
>> \stopformula
>> 
>> and as such should have (at most) one equation number, right?
> 
> However, some sub-disciplines like to number each case (for example, if you 
> want to refer to one of them in the future).
> 
>> Only Hans knows if it is (easily) doable to add the possibility to add
>> numbers to each three lines.
> 
> In the old implementation, this was tricky (the equation without the equation 
> number should be centered, and the equation number should be flush right). 
> But I think that this should be possible with the new low-level box alignment 
> macros. 
> 
> Aditya___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
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

2022-03-28 Thread Otared Kavian via ntg-context
Hi Mikael,

Thanks for your explanation and the example you sent about 
\definemathsimplealign (I didn’t get immediately that « sesac » in the command 
\startmathfenced[sesac] means « cases » in reverse or mirrored… I guess this is 
a wise and humourous choice by Hans :-) ).

Regarding \startcases, it seems that it is still not possible to number each 
equation, but I may be overlooking something. I’ll try a few examples and will 
let you know, as well as Hans.

Best regards: Otared

> On 28 Mar 2022, at 23:54, Mikael Sundqvist  wrote:
> 
> On Mon, Mar 28, 2022 at 11:23 PM Otared Kavian  wrote:
>> 
>> Hi Hans,
>> 
>> Thank you for the new upload and the improvements you mention about the 
>> handling of math stuff. Thanks also to Mikael for the follow up of these 
>> matters.
>> 
>> I noticed that in math mode the command \cal does not work anymore and one 
>> has to use \mathcal.
>> However in almost all of my documents I use Lucida Bright OT, and in some 
>> occasions I replace its calligraphic letters by the slots from Asana Math 
>> with the following definitions:
>> 
>> \definefallbackfamily[myfont][math][Asana Math]
>>[range={uppercasescript,lowercasescript}]
>> 
>> % lucida font
>> \definefontfamily[myfont][serif][Lucida Bright OT]
>> \definefontfamily[myfont][math][LucidaBrightMathOT]
>> \definefontfamily[myfont][sans][LucidaSansOT]
>> \definefontfamily[myfont][mono][LucidaSansTypewriterOT]
>> 
>> \setupbodyfont[myfont,9pt]
>> 
>> It seems that with the changes made recently the above definitions must be 
>> modified in order to have Asana Math show up.
>> 
>> So, I am asking for help from Mikael in this regard…
> 
> Hi Otared,
> 
> At the moment I don't know how one can use the fallback system with
> calligraphic/script fonts. Let me explain in a few sentences what we
> changed. Now we have \mathcal and \mathscr. If the font has both a
> chancery alphabet and a roundhand alphabet, the goodie file is coded
> so that \mathcal points to chancery and \mathscr to roundhand. This is
> the case for Lucida. So, maybe you could try to do
> \setupbodyfont[lucidadk] and then try \mathscr out. Other fonts that
> have both variants are stixtwo and xits. The rest have only either
> chancery style or roundhand style, and there you will get what it has.
> About \cal I don't know.
> 
>> 
>> Also, it would be nice to have a few explanations about the new stuff in 
>> math alignments.
> 
> I think the new math alignments are still work in progress. One thing
> that happens will probably go unnoticed, and that is the spacing. Hans
> is playing a lot with the new atoms, and right now he is playing(?)
> with construction atoms, ghosts and fences. There is one new type of
> alignments, called simplealignments. We can use them for example to
> collect some equations with a brace (and give the collection one
> number).
> 
> /Mikael
> 
> \setupbodyfont[lucidadk]
> 
> \definemathsimplealign[collecteqequations][
> left={\startmathfenced[sesac]},
> right=\stopmathfenced,
> align={1:right,2:left},
> ]
> 
> \starttext
> %\showmakeup[mathglue]
> ${\mathcal ABC}$ and ${\mathscr ABC}$
> 
> \placeformula
> \startformula
> \startcollecteqequations
> \NC x \NC = r\sin\theta\cos\phi\NR
> \NC y \NC = r\sin\theta\sin\phi \NR
> \NC z \NC = r\cos\theta \NR
> \stopcollecteqequations
> \stopformula
> 
> \stoptext
> <220328-5.pdf>

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

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


Re: [NTG-context] upload

2022-03-28 Thread Mikael Sundqvist via ntg-context
On Mon, Mar 28, 2022 at 11:23 PM Otared Kavian  wrote:
>
> Hi Hans,
>
> Thank you for the new upload and the improvements you mention about the 
> handling of math stuff. Thanks also to Mikael for the follow up of these 
> matters.
>
> I noticed that in math mode the command \cal does not work anymore and one 
> has to use \mathcal.
> However in almost all of my documents I use Lucida Bright OT, and in some 
> occasions I replace its calligraphic letters by the slots from Asana Math 
> with the following definitions:
>
> \definefallbackfamily[myfont][math][Asana Math]
> [range={uppercasescript,lowercasescript}]
>
> % lucida font
> \definefontfamily[myfont][serif][Lucida Bright OT]
> \definefontfamily[myfont][math][LucidaBrightMathOT]
> \definefontfamily[myfont][sans][LucidaSansOT]
> \definefontfamily[myfont][mono][LucidaSansTypewriterOT]
>
> \setupbodyfont[myfont,9pt]
>
> It seems that with the changes made recently the above definitions must be 
> modified in order to have Asana Math show up.
>
> So, I am asking for help from Mikael in this regard…

Hi Otared,

At the moment I don't know how one can use the fallback system with
calligraphic/script fonts. Let me explain in a few sentences what we
changed. Now we have \mathcal and \mathscr. If the font has both a
chancery alphabet and a roundhand alphabet, the goodie file is coded
so that \mathcal points to chancery and \mathscr to roundhand. This is
the case for Lucida. So, maybe you could try to do
\setupbodyfont[lucidadk] and then try \mathscr out. Other fonts that
have both variants are stixtwo and xits. The rest have only either
chancery style or roundhand style, and there you will get what it has.
About \cal I don't know.

>
> Also, it would be nice to have a few explanations about the new stuff in math 
> alignments.

I think the new math alignments are still work in progress. One thing
that happens will probably go unnoticed, and that is the spacing. Hans
is playing a lot with the new atoms, and right now he is playing(?)
with construction atoms, ghosts and fences. There is one new type of
alignments, called simplealignments. We can use them for example to
collect some equations with a brace (and give the collection one
number).

/Mikael

\setupbodyfont[lucidadk]

\definemathsimplealign[collecteqequations][
left={\startmathfenced[sesac]},
right=\stopmathfenced,
align={1:right,2:left},
]

\starttext
%\showmakeup[mathglue]
${\mathcal ABC}$ and ${\mathscr ABC}$

\placeformula
\startformula
\startcollecteqequations
\NC x \NC = r\sin\theta\cos\phi\NR
\NC y \NC = r\sin\theta\sin\phi \NR
\NC z \NC = r\cos\theta \NR
\stopcollecteqequations
\stopformula

\stoptext


220328-5.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] Trying to get a simple bibliography

2022-03-26 Thread Denis Maier via ntg-context
I think you've done that already ...




Von: ntg-context  im Auftrag von Thomas A. Schmitz 
via ntg-context 
Gesendet: Samstag, 26. März 2022 16:37:03
An: mailing list for ConTeXt users
Cc: Thomas A. Schmitz
Betreff: Re: [NTG-context] Trying to get a simple bibliography

Hi Amine,

The bibliography subsystem is rather complex, and Alan, who has worked with 
Hans on support for APS and APA, wants to do things the right way, which means 
he wants to code for all corner cases. From my own experience: it is difficult 
to just copy and modify the existing publ-imp-XXX files; they define a number 
of clever macros that allow code reuse and consistency, but are not the most 
straightforward way for a non-programmer (like myself) to proceed. I have found 
it easier to start from scratch by writing my own publ-imp-custom.{mkiv,lua} 
files and then add whatever I need, one entry type at a time. That also allows 
you to understand the ways in which the system works. But of course, it’s less 
convenient than just changing APA to MLA, as you can in biblatex. ConTeXt has a 
much smaller user base, so we take somewhat longer. Maybe I should add a wiki 
article on a basic way to start one’s own custom definitions...

Best

Thomas

> On 26. Mar 2022, at 15:34, A A via ntg-context  wrote:
>
> Hi Thomas,
>
> Yes, I was able to find the appropriate section in the manual, thanks. Please 
> see my answer at SE.
>
> I don't think reading the docs is far-fetched by the way. But I think asking 
> on here is also fine.
>
> I'll consider making a contribution once I get a better grip of how the 
> ConTeXt system is put together.
>
> Again thanks for your response.
>
> Regards,
>
> Amine

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Trying to get a simple bibliography

2022-03-26 Thread Thomas A. Schmitz via ntg-context
Hi Amine,

The bibliography subsystem is rather complex, and Alan, who has worked with 
Hans on support for APS and APA, wants to do things the right way, which means 
he wants to code for all corner cases. From my own experience: it is difficult 
to just copy and modify the existing publ-imp-XXX files; they define a number 
of clever macros that allow code reuse and consistency, but are not the most 
straightforward way for a non-programmer (like myself) to proceed. I have found 
it easier to start from scratch by writing my own publ-imp-custom.{mkiv,lua} 
files and then add whatever I need, one entry type at a time. That also allows 
you to understand the ways in which the system works. But of course, it’s less 
convenient than just changing APA to MLA, as you can in biblatex. ConTeXt has a 
much smaller user base, so we take somewhat longer. Maybe I should add a wiki 
article on a basic way to start one’s own custom definitions...

Best

Thomas

> On 26. Mar 2022, at 15:34, A A via ntg-context  wrote:
> 
> Hi Thomas,
> 
> Yes, I was able to find the appropriate section in the manual, thanks. Please 
> see my answer at SE. 
> 
> I don't think reading the docs is far-fetched by the way. But I think asking 
> on here is also fine.
> 
> I'll consider making a contribution once I get a better grip of how the 
> ConTeXt system is put together.
> 
> Again thanks for your response.
> 
> Regards,
> 
> Amine

___
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] embedding tex and lua code in

2022-03-24 Thread mf via ntg-context

The attached MWE shows how to:

- embed tex code in  or <script 
</tt><tt>type="text/vnd.lmtx"> HTML elements to be run by ConTeXt
</tt><pre style="margin: 0em;">

- embed lua code in <script type="text/x-lua"> elements to be run by ConTeXt

- redefine xmlsetups from the HTML document itself

Massi

Il 22/03/22 17:07, mf via ntg-context ha scritto:
</pre><blockquote style="border-left: #EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;">
I've added a <script type="text/x-lua"> in the <head> element (BTW,
"text/x-lua" is the mimetype proposed by freedesktop.org for lua scripts.

That element is managed by this code:

--
   if mimetype and mimetype == "text/x-lua" then
     local code = xml.text(s)
     context( "\\startluacode " .. code .. " \\stopluacode" )
   end
--

s is the table representing the script element.
That works, but it has a problem with one-line comments:

--
   <script type="text/x-lua">
     -- comment
     context.setuppapersize{ "A7" }
   
--

The code above is considered a long comment as if it were written as
--
   
     -- comment   context.setuppapersize{ "A7" }
   
--

so the context.setuppapersize function call is ignored.

The workaround is:
--
   
     --[[ comment --]]
     context.setuppapersize{ "A7" }
   
--

A lua analogous of \xmlcontext (line-wise) would be great.




Hans prompted me to use xml.content() instead of xml.text(). The first 
one preserves newlines, so short comments don't extend to the next line.




*  *  *

Here's another problem related to space in  elements.
This code:

--
   <script type="text/vnd.context">
     % default setup for paragraphs
     \startxmlsetups myHtml:p
   \dontleavehmode\red\xmlflush{#1}\par
     \stopxmlsetups

     % default setup for italic inlines
     \startxmlsetups myHtml:i
   {\it\blue\xmlflush{#1}}% <-- problem here
     \stopxmlsetups
   
--

adds a space after an  element.
A solution could be this:

--
   \startxmlsetups myHtml:i
     {\it\blue\xmlflush{#1}}\stopxmlsetups
--

I prefer this one:

--
   \startxmlsetups myHtml:i
     {\it\blue\xmlflush{#1}}\relax
   \stopxmlsetups
--

You need to end the line with a macro eating up all the trailing spaces 
(newlines included).


Massi

Il 22/03/22 15:23, mf via ntg-context ha scritto:

I found the solution I was looking for. The command to run is still

context --environment=nested-xmlsetup.tex --forcexml 
nested-xmlsetup.xhtml


In the  element there's some tex code, which redefines the 
</tt><tt>xmlsetups for <p> and <i> elements, coloring the first ones in red and 
</tt><tt>the second ones in blue.
</tt><pre style="margin: 0em;">

The key command is

\xmlsetsetup{\xmldocument}{p|i}{myHtml:*}

</pre><tt>where \xmldocument instead of #1 applies the myHtml:* setups to the 
</tt><tt>whole XHTML document and not only to the <script> element identified 
</tt><tt>by #1.
</tt><pre style="margin: 0em;">

</pre><tt>I tried also this, to prevent redefining the setups of <html>, <head>, 
</tt><tt><script> elements:
</tt><pre style="margin: 0em;">

\xmlsetsetup{\xmlfirst{\xmldocument}{body}}{p|i}{myHtml:*}

</pre><tt>but it doesn't work, since \xmldocument seems to be the actual 
</tt><tt>document instead of an id pointing to its root element.
</tt><pre style="margin: 0em;">

Massi

Il 10/03/22 17:52, Hans Hagen ha scritto:
</pre><blockquote style="border-left: #EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;">
On 3/10/2022 4:59 PM, mf via ntg-context wrote:
</pre><blockquote style="border-left: #EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;">
Hello,
</pre><tt>I'm trying to add new templates (xmlsetups) from the XML document 
</tt><tt>itself.
</tt><pre style="margin: 0em;">

See the attached MWE.

- the XML document is a simple XHTML file

</pre><tt>- in the "head" element there's a "script" element with the "type" 
</tt><tt>attribute set to "text/vnd.context",

Re: [NTG-context] redefining xmlsetups inside a XML document

2022-03-22 Thread mf via ntg-context

I've added a  in the <head> element (BTW,
"text/x-lua" is the mimetype proposed by freedesktop.org for lua scripts.

That element is managed by this code:

--
  if mimetype and mimetype == "text/x-lua" then
local code = xml.text(s)
context( "\\startluacode " .. code .. " \\stopluacode" )
  end
--

s is the table representing the script element.
That works, but it has a problem with one-line comments:

--
  <script type="text/x-lua">
-- comment
context.setuppapersize{ "A7" }
  
--

The code above is considered a long comment as if it were written as
--
  
-- comment   context.setuppapersize{ "A7" }
  
--

so the context.setuppapersize function call is ignored.

The workaround is:
--
  
--[[ comment --]]
context.setuppapersize{ "A7" }
  
--

A lua analogous of \xmlcontext (line-wise) would be great.

*  *  *

Here's another problem related to space in  elements.
This code:

--
  <script type="text/vnd.context">
% default setup for paragraphs
\startxmlsetups myHtml:p
  \dontleavehmode\red\xmlflush{#1}\par
\stopxmlsetups

% default setup for italic inlines
\startxmlsetups myHtml:i
  {\it\blue\xmlflush{#1}}% <-- problem here
\stopxmlsetups
  
--

adds a space after an  element.
A solution could be this:

--
  \startxmlsetups myHtml:i
{\it\blue\xmlflush{#1}}\stopxmlsetups
--

I prefer this one:

--
  \startxmlsetups myHtml:i
{\it\blue\xmlflush{#1}}\relax
  \stopxmlsetups
--

You need to end the line with a macro eating up all the trailing spaces 
(newlines included).


Massi

Il 22/03/22 15:23, mf via ntg-context ha scritto:

I found the solution I was looking for. The command to run is still

context --environment=nested-xmlsetup.tex --forcexml nested-xmlsetup.xhtml

In the  element there's some tex code, which redefines the 
</tt><tt>xmlsetups for <p> and <i> elements, coloring the first ones in red and 
</tt><tt>the second ones in blue.
</tt><pre style="margin: 0em;">

The key command is

\xmlsetsetup{\xmldocument}{p|i}{myHtml:*}

</pre><tt>where \xmldocument instead of #1 applies the myHtml:* setups to the 
</tt><tt>whole XHTML document and not only to the <script> element identified by #1.
</tt><pre style="margin: 0em;">

</pre><tt>I tried also this, to prevent redefining the setups of <html>, <head>, 
</tt><tt><script> elements:
</tt><pre style="margin: 0em;">

\xmlsetsetup{\xmlfirst{\xmldocument}{body}}{p|i}{myHtml:*}

</pre><tt>but it doesn't work, since \xmldocument seems to be the actual document 
</tt><tt>instead of an id pointing to its root element.
</tt><pre style="margin: 0em;">

Massi

Il 10/03/22 17:52, Hans Hagen ha scritto:
</pre><blockquote style="border-left: #EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;">
On 3/10/2022 4:59 PM, mf via ntg-context wrote:
</pre><blockquote style="border-left: #EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;">
Hello,
</pre><tt>I'm trying to add new templates (xmlsetups) from the XML document 
</tt><tt>itself.
</tt><pre style="margin: 0em;">

See the attached MWE.

- the XML document is a simple XHTML file

</pre><tt>- in the "head" element there's a "script" element with the "type" 
</tt><tt>attribute set to "text/vnd.context", whose contents are then passed 
</tt><tt>to \xmlcontext
</tt><pre style="margin: 0em;">

</pre><tt>- the "body" element has a "data-xmlsetups" attribute whose value 
</tt><tt>should tell which xmlsetups is to be applied on the body contents 
</tt><tt>(it's defined in the "script" element above)
</tt><pre style="margin: 0em;">

</pre><tt>If it worked, the resulting PDF should show the body element, 
</tt><tt>followed by a "Hello world!" paragraph written in red.
</tt><tt>But it does not work, because there's something I'm missing in the 
</tt><tt>redefinition and application of xmlsetups.
</tt><pre style="margin: 0em;"

Re: [NTG-context] redefining xmlsetups inside a XML document

2022-03-22 Thread mf via ntg-context

I found the solution I was looking for. The command to run is still

context --environment=nested-xmlsetup.tex --forcexml nested-xmlsetup.xhtml

In the  element there's some tex code, which redefines the 
</tt><tt>xmlsetups for <p> and <i> elements, coloring the first ones in red and 
</tt><tt>the second ones in blue.
</tt><pre style="margin: 0em;">

The key command is

\xmlsetsetup{\xmldocument}{p|i}{myHtml:*}

</pre><tt>where \xmldocument instead of #1 applies the myHtml:* setups to the 
</tt><tt>whole XHTML document and not only to the <script> element identified by #1.
</tt><pre style="margin: 0em;">

</pre><tt>I tried also this, to prevent redefining the setups of <html>, <head>, 
</tt><tt><script> elements:
</tt><pre style="margin: 0em;">

\xmlsetsetup{\xmlfirst{\xmldocument}{body}}{p|i}{myHtml:*}

</pre><tt>but it doesn't work, since \xmldocument seems to be the actual document 
</tt><tt>instead of an id pointing to its root element.
</tt><pre style="margin: 0em;">

Massi

Il 10/03/22 17:52, Hans Hagen ha scritto:
</pre><blockquote style="border-left: #EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;">
On 3/10/2022 4:59 PM, mf via ntg-context wrote:
</pre><blockquote style="border-left: #EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;">
Hello,
I'm trying to add new templates (xmlsetups) from the XML document itself.

See the attached MWE.

- the XML document is a simple XHTML file

</pre><tt>- in the "head" element there's a "script" element with the "type" 
</tt><tt>attribute set to "text/vnd.context", whose contents are then passed to 
</tt><tt>\xmlcontext
</tt><pre style="margin: 0em;">

</pre><tt>- the "body" element has a "data-xmlsetups" attribute whose value 
</tt><tt>should tell which xmlsetups is to be applied on the body contents 
</tt><tt>(it's defined in the "script" element above)
</tt><pre style="margin: 0em;">

</pre><tt>If it worked, the resulting PDF should show the body element, followed 
</tt><tt>by a "Hello world!" paragraph written in red.
</tt><tt>But it does not work, because there's something I'm missing in the 
</tt><tt>redefinition and application of xmlsetups.
</tt><pre style="margin: 0em;">

To try the MWE, type:

</pre><tt>context --environment=nested-xmlsetup.tex --forcexml 
</tt><tt>nested-xmlsetup.xhtml
</tt></blockquote><pre style="margin: 0em;">
     <script type="text/vnd.context">
   \startxmlsetups myHtml
    \xmlsetsetup{#1}{p}{myHtml:p}
    % you're missing this
    \xmlsetup{#1}{xml:process}
    % which is
    %  \xmlregistereddocumentsetups{#1}{#1}
    %  \xmlmain{#1}
   \stopxmlsetups

   \startxmlsetups myHtml:p
  \dontleavehmode\red\xmlflush{#1}\par
   \stopxmlsetups
     


nested-xmlsetup.xhtml
Description: application/xhtml
\startxmlsetups html
  \xmlsetsetup{#1}{{html|head}}{html:flush}
  \xmlsetsetup{#1}{{html head script}}{html:script:context}
  \xmlsetsetup{#1}{{html body}}{html:body}
  \xmlsetsetup{#1}{p|i}{html:*}
\stopxmlsetups

\startxmlsetups html:flush
  \xmlflush{#1}
\stopxmlsetups

\startluacode
function xml.functions.parseScript(s)
  local mimetype = s and s.at and s.at.type
  if mimetype and mimetype == "text/vnd.context" then
lxml.context(s)
  end
end
\stopluacode

\startxmlsetups html:script:context
  \xmlfunction{#1}{parseScript}
\stopxmlsetups

\startxmlsetups html:body
  \starttext
\xmlflush{#1}
  \stoptext
\stopxmlsetups

% default setup for paragraphs
\startxmlsetups html:p
  \dontleavehmode\xmlflush{#1}\par
\stopxmlsetups

% default setup for italic inlines
\startxmlsetups html:i
  {\it\xmlflush{#1}}%
\stopxmlsetups

\xmlregistersetup{html}
___
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] Make footnote/endnote number not superscript?

2022-03-20 Thread Rik Kabel via ntg-context


On 2022-03-20 17:07, Wolfgang Schuster via ntg-context wrote:

Bruce Horrocks via ntg-context schrieb am 20.03.2022 um 21:10:
I'm editing a book that will be printed, however the authors have 
included URLs which will no doubt suffer from "bit rot" in no time at 
all. I think it will make the main text cleaner if I use endnotes 
rather than include the URL in-line in the text or as a (distracting) 
footnote. So when the author writes "See my video at URL>" I will print "See my video at link 1". At the back of the book, 
in an appendix somewhere, I then use \placenotes to display a table 
of the actual URLs for any readers that want to type them in.


I want the "link 1" bit to be normal text rather than superscript so 
it's more visible. Using the \setupnote[textstyle=...] command I can 
change the style of the number but not the superscript placing.


Is there a way to remove the superscript placing, please?


\starttext

First\footnote{Footnote one}

\setupnote[footnote][textcommand=]

First\footnote{Footnote two}

\stoptext

Wolfgang

You might want to define a separate set of notes, for example, 
linknotes, defined as Wolfgang suggests, so


   \setupnote[linknote][textcommand=]

so that they are a separate sequence. These would be used exclusively 
for the url links you describe and regular footnotes would continue to 
be superscript (or however else you choose to treat them). You can 
define multiple streams of footnotes and endnotes.


--
Rik
___
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] Make footnote/endnote number not superscript?

2022-03-20 Thread Wolfgang Schuster via ntg-context

Bruce Horrocks via ntg-context schrieb am 20.03.2022 um 21:10:

I'm editing a book that will be printed, however the authors have included URLs which will no doubt suffer from 
"bit rot" in no time at all. I think it will make the main text cleaner if I use endnotes rather than 
include the URL in-line in the text or as a (distracting) footnote. So when the author writes "See my video at 
" I will print "See my video at link 1". At the back of the book, in an 
appendix somewhere, I then use \placenotes to display a table of the actual URLs for any readers that want to type 
them in.

I want the "link 1" bit to be normal text rather than superscript so it's more 
visible. Using the \setupnote[textstyle=...] command I can change the style of the number 
but not the superscript placing.

Is there a way to remove the superscript placing, please?


\starttext

First\footnote{Footnote one}

\setupnote[footnote][textcommand=]

First\footnote{Footnote two}

\stoptext

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

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


Re: [NTG-context] Make footnote/endnote number not superscript?

2022-03-20 Thread jbf via ntg-context
Bruce, I suppose one way to achieve your aim, if there is no easy way to 
prevent superscript, would be to put your reference in parentheses: (See 
my video at link 1), followed by the normal superscript number for 
footnote anchors. You can still go with the endnotes.


The other thing, and I know this because I am often having to deal with 
long URLs, is to remember to use \hyphenatedurl{}, and you can determine 
separately where the breaks occur if the default is not to your liking.


I know it is not quite what you were looking for, but it would be a 
simple solution and not to distracting.


Julian

On 21/3/22 07:10, Bruce Horrocks via ntg-context wrote:

I'm editing a book that will be printed, however the authors have included URLs which will no doubt suffer from 
"bit rot" in no time at all. I think it will make the main text cleaner if I use endnotes rather than 
include the URL in-line in the text or as a (distracting) footnote. So when the author writes "See my video at 
" I will print "See my video at link 1". At the back of the book, in an 
appendix somewhere, I then use \placenotes to display a table of the actual URLs for any readers that want to type 
them in.

I want the "link 1" bit to be normal text rather than superscript so it's more 
visible. Using the \setupnote[textstyle=...] command I can change the style of the number 
but not the superscript placing.

Is there a way to remove the superscript placing, please?

Alternative solutions welcome: the URLs printed in the book will be mirrored on 
a web page associated with the book for as long as possible so that content 
that vanishes over time can be replaced with Internet Archive links as they are 
discovered. However the order of the book isn't finalised yet so I'd like the 
numbering to be sequential regardless of whether I move a chapter around later 
on. This is partly the reason for using \endnote because I can use a reference 
elsewhere in the text if necessary.

Thanks in advance.
—
Bruce Horrocks
Hampshire, UK

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

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

___
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] Make footnote/endnote number not superscript?

2022-03-20 Thread Bruce Horrocks via ntg-context
I'm editing a book that will be printed, however the authors have included URLs 
which will no doubt suffer from "bit rot" in no time at all. I think it will 
make the main text cleaner if I use endnotes rather than include the URL 
in-line in the text or as a (distracting) footnote. So when the author writes 
"See my video at " I will print "See my video at link 1". At 
the back of the book, in an appendix somewhere, I then use \placenotes to 
display a table of the actual URLs for any readers that want to type them in. 

I want the "link 1" bit to be normal text rather than superscript so it's more 
visible. Using the \setupnote[textstyle=...] command I can change the style of 
the number but not the superscript placing.

Is there a way to remove the superscript placing, please?

Alternative solutions welcome: the URLs printed in the book will be mirrored on 
a web page associated with the book for as long as possible so that content 
that vanishes over time can be replaced with Internet Archive links as they are 
discovered. However the order of the book isn't finalised yet so I'd like the 
numbering to be sequential regardless of whether I move a chapter around later 
on. This is partly the reason for using \endnote because I can use a reference 
elsewhere in the text if necessary.

Thanks in advance.
—
Bruce Horrocks
Hampshire, UK

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

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


Re: [NTG-context] new upload

2022-03-13 Thread Rik Kabel via ntg-context


On 2022-03-11 18:16, Hans Hagen via ntg-context wrote:

Hi,

It has been a while since there was an updaste but there it is. The 
most significant 'changes' are:


- more automatic adaption to double sided page properties in metafun 
(lmtx) ... blame sreeram and me for messing up


- more extensibve support for indic fonts which sreeram has documented 
on the wiki (fonts, translutaration etc)


and

- improved math rendering to be documented by by mikael in an upcoming 
manual ... it tooks a couple of months so it is supposed to have some 
impact.


before we move on the the structural compoments and see what can be 
done beter there, we decided to release the first stage that deals with:


= fixing font properties; we don't expect fonts to be improved so 
that's the route we follow


= extensive inter atom spacing (we have many more math classes, some 
in the engine, some in context) and everything can be controlled (the 
old pairwise spacing primitives have been replaced by a more general 
mechanism, including support for fast setup of categories and 
inhertance from other classes)


= idem for inter class penalties, including granular control over line 
breaks using a system of (in/de)creasing penalties


= auto-fenced inline material across lines and linebreaks in molecules 
(read: complex atoms)


= taking stretch and shrink in encapsulated atoms into account in 
linbreaks (using some new box related mechanism that is also available 
in text and will be explained later)


= spacing at the edges that should not be there but always was there 
as side effect of the engine is now removed; as with other new 
features this can be controlled (we have rulesets for atoms to which 
we can add more in the future)


= more detailed control over (skewed) fractions, (flattened) accents, 
(sized) fences, radicals ... there was already a lot there but it now 
combines with mentioned spacing (when relevant the context macros have 
been adapted to control this which is a bit cleaner)


= we have a new built in muskip (tiny) but as we have an inheritance 
system as well as binding to variables one can set up extensive 
spacing models register and constant binding; the currently set values 
are based on math typesetting references; in the future we might have 
additional ones


= although we did handle primes already rather transparent in mkiv / 
lmtx, inconsistency in fonts made us decide to make primes first class 
properties of atoms and molecules which means that we now have: pre 
super/subscripts, post super/subscripts and primes; this permits nicer 
anchoring under parameter control


= there are more font parameters to control matters (they are not in 
open type but we sort of assume they are); the options that we had to 
control how the engine deals with fonts are now driving the process 
(without them being set not much is applied) and we basically assume 
open type fonts (where one can enable engine options for those kind of 
fonts but also for traditional); some experimental options for testing 
are gone


= in the process tracing for what is done in math by the engine has 
been extended (mostly for ourselves)


= instead of auto patching math fonts most is now under control of the 
goodie files; user can (as usual) make their own, but also ask Mikael 
to add missing bits and pieces (wrt dimensions)


= most known math fonts are dealt with but there are a few exceptions: 
we no longer consider asana to be useful (it doesn't pass our qa and 
needs too much patching); erewhon is also troublesome (dimensions, 
missing shaped) as is concrete (idem) so we decided not to waste too 
much time on them now


= we probably need to freeze math fonts in the distribution and only 
update when we know what has been changed


= we got rid of quite some artifacts that normally go unnoticed (like 
tiny added spaces that result from always applied spacing even if not 
needed and/or to compensate for glyph features like too much or little 
side bearing): by fixing inconsistencies in fonts we could get rid of 
all and therefore inter atom spacing is what does the job; once you 
know it, you see it and there is no going back


= because we zoom in we notice these things but much went unnoticed 
(or was just accepted) for years; it means that we think some of the 
things we did qualify as math micro typography (like it or not) and it 
does mean that documents can render differently (unlikely for display, 
propably also for inline unless you have plenty of math in a paragraph)


== our objective has been to make it easier for users and to get rid 
of explicit spacing; for that we also introduced commands for 
differentials (that have their own class), imaginary numbers (also 
have their class) and we added exponential as class; fwiw, digits and 
factorial are classes too so again spacing has been optimized for them


= whatever i forgot in the meantime mikael will add to this list

There is a rough description in the 'ontarget

[NTG-context] new upload

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

Hi,

It has been a while since there was an updaste but there it is. The most 
significant 'changes' are:


- more automatic adaption to double sided page properties in metafun 
(lmtx) ... blame sreeram and me for messing up


- more extensibve support for indic fonts which sreeram has documented 
on the wiki (fonts, translutaration etc)


and

- improved math rendering to be documented by by mikael in an upcoming 
manual ... it tooks a couple of months so it is supposed to have some 
impact.


before we move on the the structural compoments and see what can be done 
beter there, we decided to release the first stage that deals with:


= fixing font properties; we don't expect fonts to be improved so that's 
the route we follow


= extensive inter atom spacing (we have many more math classes, some in 
the engine, some in context) and everything can be controlled (the old 
pairwise spacing primitives have been replaced by a more general 
mechanism, including support for fast setup of categories and inhertance 
from other classes)


= idem for inter class penalties, including granular control over line 
breaks using a system of (in/de)creasing penalties


= auto-fenced inline material across lines and linebreaks in molecules 
(read: complex atoms)


= taking stretch and shrink in encapsulated atoms into account in 
linbreaks (using some new box related mechanism that is also available 
in text and will be explained later)


= spacing at the edges that should not be there but always was there as 
side effect of the engine is now removed; as with other new features 
this can be controlled (we have rulesets for atoms to which we can add 
more in the future)


= more detailed control over (skewed) fractions, (flattened) accents, 
(sized) fences, radicals ... there was already a lot there but it now 
combines with mentioned spacing (when relevant the context macros have 
been adapted to control this which is a bit cleaner)


= we have a new built in muskip (tiny) but as we have an inheritance 
system as well as binding to variables one can set up extensive spacing 
models register and constant binding; the currently set values are based 
on math typesetting references; in the future we might have additional ones


= although we did handle primes already rather transparent in mkiv / 
lmtx, inconsistency in fonts made us decide to make primes first class 
properties of atoms and molecules which means that we now have: pre 
super/subscripts, post super/subscripts and primes; this permits nicer 
anchoring under parameter control


= there are more font parameters to control matters (they are not in 
open type but we sort of assume they are); the options that we had to 
control how the engine deals with fonts are now driving the process 
(without them being set not much is applied) and we basically assume 
open type fonts (where one can enable engine options for those kind of 
fonts but also for traditional); some experimental options for testing 
are gone


= in the process tracing for what is done in math by the engine has been 
extended (mostly for ourselves)


= instead of auto patching math fonts most is now under control of the 
goodie files; user can (as usual) make their own, but also ask Mikael to 
add missing bits and pieces (wrt dimensions)


= most known math fonts are dealt with but there are a few exceptions: 
we no longer consider asana to be useful (it doesn't pass our qa and 
needs too much patching); erewhon is also troublesome (dimensions, 
missing shaped) as is concrete (idem) so we decided not to waste too 
much time on them now


= we probably need to freeze math fonts in the distribution and only 
update when we know what has been changed


= we got rid of quite some artifacts that normally go unnoticed (like 
tiny added spaces that result from always applied spacing even if not 
needed and/or to compensate for glyph features like too much or little 
side bearing): by fixing inconsistencies in fonts we could get rid of 
all and therefore inter atom spacing is what does the job; once you know 
it, you see it and there is no going back


= because we zoom in we notice these things but much went unnoticed (or 
was just accepted) for years; it means that we think some of the things 
we did qualify as math micro typography (like it or not) and it does 
mean that documents can render differently (unlikely for display, 
propably also for inline unless you have plenty of math in a paragraph)


== our objective has been to make it easier for users and to get rid of 
explicit spacing; for that we also introduced commands for differentials 
(that have their own class), imaginary numbers (also have their class) 
and we added exponential as class; fwiw, digits and factorial are 
classes too so again spacing has been optimized for them


= whatever i forgot in the meantime mikael will add to this list

There is a rough description in the 'ontarget' document. We hope you 
enjoy it, at least we did (and so

Re: [NTG-context] redefining xmlsetups inside a XML document

2022-03-10 Thread Hans Hagen via ntg-context

On 3/10/2022 4:59 PM, mf via ntg-context wrote:

Hello,
I'm trying to add new templates (xmlsetups) from the XML document itself.

See the attached MWE.

- the XML document is a simple XHTML file

- in the "head" element there's a "script" element with the "type" 
attribute set to "text/vnd.context", whose contents are then passed to 
\xmlcontext


- the "body" element has a "data-xmlsetups" attribute whose value should 
tell which xmlsetups is to be applied on the body contents (it's defined 
in the "script" element above)


If it worked, the resulting PDF should show the body element, followed 
by a "Hello world!" paragraph written in red.
But it does not work, because there's something I'm missing in the 
redefinition and application of xmlsetups.


To try the MWE, type:

context --environment=nested-xmlsetup.tex --forcexml nested-xmlsetup.xhtml


  \startxmlsetups myHtml
   \xmlsetsetup{#1}{p}{myHtml:p}
   % you're missing this
   \xmlsetup{#1}{xml:process}
   % which is
   %  \xmlregistereddocumentsetups{#1}{#1}
   %  \xmlmain{#1}
  \stopxmlsetups

  \startxmlsetups myHtml:p
 \dontleavehmode\red\xmlflush{#1}\par
  \stopxmlsetups



-
  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] redefining xmlsetups inside a XML document

2022-03-10 Thread mf via ntg-context

Hello,
I'm trying to add new templates (xmlsetups) from the XML document itself.

See the attached MWE.

- the XML document is a simple XHTML file

- in the "head" element there's a "script" element with the "type" 
attribute set to "text/vnd.context", whose contents are then passed to 
\xmlcontext


- the "body" element has a "data-xmlsetups" attribute whose value should 
tell which xmlsetups is to be applied on the body contents (it's defined 
in the "script" element above)


If it worked, the resulting PDF should show the body element, followed 
by a "Hello world!" paragraph written in red.
But it does not work, because there's something I'm missing in the 
redefinition and application of xmlsetups.


To try the MWE, type:

context --environment=nested-xmlsetup.tex --forcexml nested-xmlsetup.xhtml

Massi\startxmlsetups html
  \xmlsetsetup{#1}{{html|head}}{html:flush}
  \xmlsetsetup{#1}{{html head script}}{html:script:context}
  \xmlsetsetup{#1}{{html body}}{html:body}
  \xmlsetsetup{#1}{p}{html:p}
\stopxmlsetups

\startxmlsetups html:flush
  \xmlflush{#1}
\stopxmlsetups

\startluacode
function xml.functions.parseScript(s)
  local mimetype = s and s.at and s.at.type
  if mimetype and mimetype == "text/vnd.context" then
lxml.context(s)
  end
end
function xml.functions.flushBody(b)
  local xmlsetups = b and b.at and b.at["data-xmlsetups"]
  if xmlsetups then
lxml.tobuffer(b, ".", "body")
context("\\typebuffer[body]")
context.xmlprocessbuffer("body", "body", xmlsetups)
  else
lxml.flush(b)
  end
end
\stopluacode

\startxmlsetups html:script:context
  \xmlfunction{#1}{parseScript}
\stopxmlsetups

\startxmlsetups html:body
  \starttext
\xmlfunction{#1}{flushBody}
  \stoptext
\stopxmlsetups

\startxmlsetups html:p
  \dontleavehmode\xmlflush{#1}\par
\stopxmlsetups

\xmlregistersetup{html}


nested-xmlsetup.xhtml
Description: application/xhtml
___
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] Cyrillic alternate form in Neacademia

2022-02-22 Thread Stefan Nedeljkovic via ntg-context
Hans,

Thank you for your suggestion. I tried disabling all otf features except
besub, but it didn't work. I presume that prepend should be added like this:

\startluacode
fonts.handlers.otf.addfeature {
name = "besub",
type = "substitution",
prepend = true,
data = {
["uni0431"] = "uni0431.SRB.alt"
}
}
\stopluacode

BTW, I'm using LMTX Context version 2022.01.21 20:13. Should I send you
some files for diagnostics?

On Wed, Feb 23, 2022 at 12:00 AM Hans Hagen via ntg-context <
ntg-context@ntg.nl> wrote:

> On 2/19/2022 4:59 PM, Stefan Nedeljkovic via ntg-context wrote:
> > Dear list,
> >
> > I'm using the typeface Neacademia Text, and I'm trying to configure it
> > to the specifics of the Serbian language. I want to replace the usual
> > form of the lowercase cyrillic letter BE with the traditional Serbian
> > form. I opened the font file in Font Forge and looked up the glyph info.
> > Here is what I tried and what failed:
> >
> > \startluacode
> > fonts.handlers.otf.addfeature {
> > name = "besub",
> > type = "substitution",
> > data = {
> > ["uni0431"] = "uni0431.SRB.alt"
> > }
> > }
> > \stopluacode
> >
> > \definefontfeature[default]
> >[mode=node,kern=yes,
> >liga=yes,dlig=yes,
> >calt=yes,ss03=yes,
> >case=yes,ccmp=yes,
> >locl=yes,script=cyrl,language=srb,
> >besub=yes]
> >
> > No luck using hex codes either:
> >
> > \startluacode
> > fonts.handlers.otf.addfeature {
> > name = "besub",
> > type = "substitution",
> > data = {
> > [0x1ab] = 0x3f8
> > }
> > }
> > \stopluacode"uni0431"
> >
> > Interestingly the single substitutions from page 175 of the fonts manual
> > seem to work just fine.
> > Any help is appreciated.
> hard to say but you enabel quite some features so probably uni0431 is
> already replaced .. maybe
>
>  prepend = true,
>
> helps
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Cyrillic alternate form in Neacademia

2022-02-22 Thread Hans Hagen via ntg-context

On 2/19/2022 4:59 PM, Stefan Nedeljkovic via ntg-context wrote:

Dear list,

I'm using the typeface Neacademia Text, and I'm trying to configure it 
to the specifics of the Serbian language. I want to replace the usual 
form of the lowercase cyrillic letter BE with the traditional Serbian 
form. I opened the font file in Font Forge and looked up the glyph info. 
Here is what I tried and what failed:


\startluacode
fonts.handlers.otf.addfeature {
name = "besub",
type = "substitution",
data = {
["uni0431"] = "uni0431.SRB.alt"
}
}
\stopluacode

\definefontfeature[default]
   [mode=node,kern=yes,
   liga=yes,dlig=yes,
   calt=yes,ss03=yes,
   case=yes,ccmp=yes,
   locl=yes,script=cyrl,language=srb,
   besub=yes]

No luck using hex codes either:

\startluacode
fonts.handlers.otf.addfeature {
name = "besub",
type = "substitution",
data = {
[0x1ab] = 0x3f8
}
}
\stopluacode"uni0431"

Interestingly the single substitutions from page 175 of the fonts manual 
seem to work just fine.

Any help is appreciated.
hard to say but you enabel quite some features so probably uni0431 is 
already replaced .. maybe


prepend = true,

helps

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

2022-02-22 Thread Willi Egger via ntg-context
Hi all,I have a rather old project which involves a bibbliography of about 60 entries. — Now I tried to use the publications environment after reading the manual. — I must say environment this is impressive!However I struggle with getting it working.1. When using my dataset, which is encoded as a ‘bbl’ type file I get a list of publications but the entries are uncomplete. enclosed files: publist-test.tex, test-literaturliste.bbl, publist-test.pdf2. When I use a buffer for testing, I do not get \cite reference nor a publication list: publist-buffer-test,texCan someone advise?Kind regardsWilli

test-literaturliste.bbl
Description: Binary data


publist-buffer-test.tex
Description: Binary data


publist-buffer-test.pdf
Description: Adobe PDF document


publist-test.tex
Description: Binary data


publist-test.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
___


[NTG-context] Cyrillic alternate form in Neacademia

2022-02-20 Thread Stefan Nedeljkovic via ntg-context
Dear list,

I'm using the typeface Neacademia Text, and I'm trying to configure it to
the specifics of the Serbian language. I want to replace the usual form of
the lowercase cyrillic letter BE with the traditional Serbian form. I
opened the font file in Font Forge and looked up the glyph info. Here is
what I tried and what failed:

\startluacode
fonts.handlers.otf.addfeature {
name = "besub",
type = "substitution",
data = {
["uni0431"] = "uni0431.SRB.alt"
}
}
\stopluacode

\definefontfeature[default]
  [mode=node,kern=yes,
  liga=yes,dlig=yes,
  calt=yes,ss03=yes,
  case=yes,ccmp=yes,
  locl=yes,script=cyrl,language=srb,
  besub=yes]

No luck using hex codes either:

\startluacode
fonts.handlers.otf.addfeature {
name = "besub",
type = "substitution",
data = {
[0x1ab] = 0x3f8
}
}
\stopluacode"uni0431"

Interestingly the single substitutions from page 175 of the fonts manual
seem to work just fine.
Any help is appreciated.

Sincerely,
Stefan
___
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] \installpagearrangement doublesided stickers

2022-02-11 Thread Jigé via ntg-context
 Thanks a lot Willi,

Sorry for the late reply. Actually, for a while I couldn't make it work.
But It seems it was just my \dosetuparrangement that was wrong.

Now it works. Here it is, cleaned-up:

\installpagearrangement 2*5*double*2*5
{\dosetuparrangement{2}{5}{10}{3}{6}
 % number of pages on the x axis,
 % number of pages on the y axis,
 % total (?),
 % number of cutmarks on the x axis,
 % number of cutmarks on the y axis,
 \pusharrangedpageTWOFIVEDOUBLESIDED\poparrangedpagesAB\relax}
\def\pusharrangedpageTWOFIVEDOUBLESIDED#1%
{\advancearrangedpageN
\reportarrangedpage\arrangedpageN
\ifcase\arrangedpageN
\or \handlearrangedpageXandY{#1}000\arrangedpageA % 1
 % Numbers starting from 0:
 % rotation state,
 % horizontal placement,
 % vertical placement.
\\or \handlearrangedpageXandY{#1}010\arrangedpageB % 2
\or \handlearrangedpageXandY{#1}010\arrangedpageA % 3
\or \handlearrangedpageXandY{#1}000\arrangedpageB % 4
\or \handlearrangedpageXandY{#1}001\arrangedpageA % 5
\or \handlearrangedpageXandY{#1}011\arrangedpageB % 6
\or \handlearrangedpageXandY{#1}011\arrangedpageA % 7
\or \handlearrangedpageXandY{#1}001\arrangedpageB % 8
\or \handlearrangedpageXandY{#1}002\arrangedpageA % 9
\or \handlearrangedpageXandY{#1}012\arrangedpageB % 10
\or \handlearrangedpageXandY{#1}012\arrangedpageA % ...
\or \handlearrangedpageXandY{#1}002\arrangedpageB %
\or \handlearrangedpageXandY{#1}003\arrangedpageA %
\or \handlearrangedpageXandY{#1}013\arrangedpageB %
\or \handlearrangedpageXandY{#1}013\arrangedpageA %
\or \handlearrangedpageXandY{#1}003\arrangedpageB %
\or \handlearrangedpageXandY{#1}004\arrangedpageA %
\or \handlearrangedpageXandY{#1}014\arrangedpageB %
\or \handlearrangedpageXandY{#1}014\arrangedpageA %
\or \handlearrangedpageXandY{#1}004\arrangedpageB %
 \poparrangedpages
\fi}

\definepapersize[Vignette][width=80.0mm,height=50.0mm]
\setuppapersize [Vignette][A4]
\setuparranging [2*5*double*2*5]
\setuplayout
 [margin=0pt,
 location=middle,
 marking=on]

\showframe
\starttext
\dorecurse{20}{\vbox to \textheight{\vfill\midaligned{\tfd ABC}\vfill}\page}
\stoptext


My aim is to have something as plain as possible
so I can modify it quickly to print double-sided cards, more likely from an 
image,
instead of using some clumsy wysiwyg editor.
Next thing is to find a sensible name for the layout. I'm not sure about the 
2*5*double*2*5 name.
Thanks again.



> Date: Sat, 22 Jan 2022 22:20:36 +0100
> From: Willi Egger 
> To: mailing list for ConTeXt users 
> Subject: Re: [NTG-context] \installpagearrangement doublesided
>     stickers
> Message-ID: <6a631259-75dc-4b7f-be10-a0584908b...@boede.nl>
> Content-Type: text/plain;    charset=utf-8
> 
> Hello Jigé,
> 
> Adapt your layout to the following and it works.
> 
> \setuplayout
> [%]
> margin=0mm,
> topspace=0mm,
> backspace=1mm,
> width=80mm,
> height=50mm,
> nx=2,
> ny=5,
> dx=0mm,
> dy=0mm,
> location=middle,
> marking=on,
> ]
> 
> Kind regards
> Willi
> 
>> On 16 Jan 2022, at 15:18, Jigé via ntg-context  wrote:
>>
>> Greetings everyone.
>>
>> Well, it's not exactly about double-sided stickers but sort of. Imagine 
>> printing a double-sided sheet and using a so-called plastifying device to 
>> make tokens.
>> I began with the File Card and Labels examples from the wiki, then tried to 
>> change the \installpagearrangement example from the 'imposition' wiki page.
>>
>> My question is:
>> how to position everything in the middle of the sheet, so that double-siding 
>> actually works?
>> As is, it's all in the top left corner. Changing the location argument for 
>> "location=middle" in \setuplayout doesn't work here. What should it be?
>>
>> By the way, I'm not sure about the 3rd, 4th and 6th arguments in the 
>> dosetuparrangement command.
>>
>> Thanks a lot!
>>
>> Here it is:
>>
>> \installpagearrangement 2*5*double*2*5
>> {\dosetuparrangement{5}{2}{10}{3}{6}% X,Y,Total,hcutmarks,vcutmarks
>>      \pusharrangedpageTWOFIVEDOUBLESIDED\poparrangedpagesAB\relax}
>>
>> \def\pusharrangedpageTWOFIVEDOUBLESIDED#1%
>> {\advancearrangedpageN
>> \reportarrangedpage\arrangedpageN
>> \ifcase\arrangedpageN
>> \or \handlearrangedpageXandY{#1}000\arrangedpageA %  1 rot,hskip,vskip
>> \or \handlearrangedpageXandY{#1}010\arrangedpageB %  2
>> \or \handlearrangedpageXandY{#1}010\arrangedpageA %  3
>> \or \handlearrangedpageXandY{#1}000\arrangedpageB %  4
>> \or \handlearrangedpageXandY{#1}001\arrangedpageA %  5
>> \or \handlearrangedpageXandY{#1}011\arrangedpageB %  6
>> \or \handlearrangedpageXandY{#1}011\arrangedpageA %  7
>> \or \handlearrangedpageXandY{#1}001\arrangedpageB %  8
>> \or \handlearrangedpageXandY{#1}002\arrangedpage

Re: [NTG-context] XMP metadata schema yields invalid PDF/A

2022-02-05 Thread Karl Pettersson via ntg-context
On Sat, Feb 05, 2022 at 03:18:08PM +0100, luigi scarso wrote:
>
> 
> Following
> https://www.pdfa.org/wp-content/until2016_uploads/2011/08/pdfa_metadata-2b.pdf
> I think we should replace
> Text
> with
>  Lang Alt
> 
> -- 
> luigi

Yes, if a custom schema is needed at all (from what I can see, the XML
does not embed any type definition for dc:title, for example).

-- 
Karl Pettersson
Uppsala, Sweden

https://static-dust.klpn.se/
___
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] XMP metadata schema yields invalid PDF/A

2022-02-05 Thread Karl Pettersson via ntg-context
On Sat, Feb 05, 2022 at 09:59:44AM +0100, luigi scarso wrote:
 
> it's not redefined -- it's dropped. And this is ok.
> You can also check with
>   FOO
>   
> 
>   TITLE
> 
>   
> and again it's valid.
> But
> https://www.iso.org/obp/ui/#iso:std:iso:19005:-1:ed-1:v2:cor:1:v1:en
> and
> https://www.iso.org/obp/ui/#iso:std:iso:19005:-1:ed-1:v2:cor:2:v1:en:tab:1
> suggest that dc:description and dc:title are of the same type,
> which is coherent with
> XMPSpecificationPart1.pdf
> as in
> https://github.com/adobe/XMP-Toolkit-SDK/tree/main/docs
> 
> I.e. these are correct   --  but Subject must agree with dc:description
>   
> 
>   
> 
>   
>   
> 
>   TITLE
> 
>   
> 
> At least, this is what I understand.
>

>From what I understand, ConTeXt applies a custom Dublin Core schema
containing just a redefinition of dc:description, which is not coherent
with how dc:description is written by the application.

This patch to lpdf-pda.xml removes the validation error.

> -- 
> luigi

-- 
Karl Pettersson, Sweden
Uppsala

https://static-dust.klpn.se/
79a80,97
> 
> http://purl.org/dc/elements/1.1/
> pdf
> Dubline Core 
> Schema
> 
> 
> 
> 
> internal
> Subject in 
> Document Properties
> 
> description
> 
> Text
> 
> 
> 
> 
> 
> 
> 
> 
___
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] XMP metadata schema yields invalid PDF/A

2022-02-05 Thread luigi scarso via ntg-context
On Sat, Feb 5, 2022 at 9:48 AM Karl Pettersson 
wrote:

>
> Attach metadata xml for the non-validating and validating example
> (extraced with `pdfinfo -meta | xmllint format -`) in the
> Github issue.
>
> Here is a reference to the description element. Note that only
> description seems to be redefined, not title.
>


it's not redefined -- it's dropped. And this is ok.
You can also check with
  FOO
  

  TITLE

  
and again it's valid.
But
https://www.iso.org/obp/ui/#iso:std:iso:19005:-1:ed-1:v2:cor:1:v1:en
and
https://www.iso.org/obp/ui/#iso:std:iso:19005:-1:ed-1:v2:cor:2:v1:en:tab:1
suggest that dc:description and dc:title are of the same type,
which is coherent with
XMPSpecificationPart1.pdf
as in
https://github.com/adobe/XMP-Toolkit-SDK/tree/main/docs

I.e. these are correct   --  but Subject must agree with dc:description
  

  

  
  

  TITLE

  

At least, this is what I understand.

-- 
luigi
___
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] XMP metadata schema yields invalid PDF/A

2022-02-05 Thread Karl Pettersson via ntg-context
On Sat, Feb 05, 2022 at 12:37:44AM +0100, luigi scarso via ntg-context wrote:
> On Fri, Feb 4, 2022 at 11:11 PM Karl Pettersson via ntg-context <
> ntg-context@ntg.nl> wrote:
> 
> > On Fri, Feb 04, 2022 at 10:25:27PM +0100, Hans Hagen via ntg-context wrote:
> > > On 2/4/2022 7:29 PM, Karl Pettersson via ntg-context wrote:
> > > > Hi
> > > >
> > > > PDF/A files generated using ConTeXt fail validation with veraPDF, and
> > > > the reason seems to be that the dc:description metadata is defined with
> > > > the wrong type in the embedded XMP extension schema.
> > > >
> > > >
> > https://tex.stackexchange.com/questions/632380/generate-pdf-a-with-context
> > > >
> > > > https://github.com/veraPDF/veraPDF-library/issues/1224
> > > >
> > > > I can reproduce the problem using TeX Live 2021 (MkIV 2021.03.05). The
> > > > definition seems to be controlled by this code.
> > > >
> > > >
> > https://source.contextgarden.net/tex/context/base/mkiv/lpdf-pua.xml?search=rdf#l81
> > > so "dc:description" is not permitted? it is mentioned in
> > >
> > >
> > https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/elements/1.1/description
> > >
> > > (btw it never failed before)
> >
> > The description element is permitted, but the problem seems to be that
> > its valueType is defined as Text in the embedded schema, while the
> > metadata element in the PDF has an embedded  > xml:lang="x-default"> structure.
> >
> >
> > https://github.com/veraPDF/veraPDF-library/issues/1224#issuecomment-1029932963
> >
> > (I suppose the reference to "title" in the issue comment should be
> > "description".)
> >
> > Validating with veraPDF <1.20 does not raise the error. The validation
> > seems to have changed for redefined types in that version.
> >
> >
> > https://github.com/veraPDF/veraPDF-library/blob/integration/RELEASENOTES.md#validation
> 
> 
> I am missing something here... true
> FOO
> makes a valid pdf 3a with verapdf 1.20.1.
> But dc:description is like dc:title, so where we are redefining
> dc:description as Text ?
> 
> -- 
> luigi

Attach metadata xml for the non-validating and validating example
(extraced with `pdfinfo -meta | xmllint format -`) in the
Github issue.

Here is a reference to the description element. Note that only
description seems to be redefined, not title.

https://source.contextgarden.net/tex/context/base/mkiv/lpdf-pua.xml#l81

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


-- 
Karl Pettersson
Uppsala, Sweden

https://static-dust.klpn.se/



  
  http://www.w3.org/1999/02/22-rdf-syntax-ns#;>
http://purl.org/dc/elements/1.1/; rdf:about="">
  application/pdf
  

  AUTHOR

  
  

  

  
  

  TITLE

  

http://ns.adobe.com/pdfx/1.3/; rdf:about="">
  out | 2022-02-02T21:34:48+01:00
  out
  2022-02-02 21:34
  www.pragma-ade.com
  contextgarden.net
  2019.03.21 21:39
  
  tug.org
  1.10
  7127
  5.3
  linux-64

http://ns.adobe.com/xap/1.0/; rdf:about="">
  2022-02-02T21:34:48+01:00
  LuaTeX 1.10 7127 + ConTeXt MkIV 2019.03.21 21:39
  2022-02-02T21:34:48+01:00
  2022-02-02T21:34:48+01:00

http://ns.adobe.com/pdf/1.3/; rdf:about="">
  
  LuaTeX-1.10
  False

http://ns.adobe.com/xap/1.0/mm/; rdf:about="">
  uuid:77baf08a-41c6-87cb-47d0-807f764f5064
  uuid:fe6c773e-42b0-864d-4c63-da5c57ec1a40

http://www.aiim.org/pdfa/ns/extension/; xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#; xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#; rdf:about="">
  

  
http://ns.adobe.com/pdf/1.3/
pdf
Adobe PDF Schema

  

  internal
  A name object indicating whether the document has been modified to include trapping information
  

Re: [NTG-context] XMP metadata schema yields invalid PDF/A

2022-02-04 Thread luigi scarso via ntg-context
On Fri, Feb 4, 2022 at 11:11 PM Karl Pettersson via ntg-context <
ntg-context@ntg.nl> wrote:

> On Fri, Feb 04, 2022 at 10:25:27PM +0100, Hans Hagen via ntg-context wrote:
> > On 2/4/2022 7:29 PM, Karl Pettersson via ntg-context wrote:
> > > Hi
> > >
> > > PDF/A files generated using ConTeXt fail validation with veraPDF, and
> > > the reason seems to be that the dc:description metadata is defined with
> > > the wrong type in the embedded XMP extension schema.
> > >
> > >
> https://tex.stackexchange.com/questions/632380/generate-pdf-a-with-context
> > >
> > > https://github.com/veraPDF/veraPDF-library/issues/1224
> > >
> > > I can reproduce the problem using TeX Live 2021 (MkIV 2021.03.05). The
> > > definition seems to be controlled by this code.
> > >
> > >
> https://source.contextgarden.net/tex/context/base/mkiv/lpdf-pua.xml?search=rdf#l81
> > so "dc:description" is not permitted? it is mentioned in
> >
> >
> https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/elements/1.1/description
> >
> > (btw it never failed before)
>
> The description element is permitted, but the problem seems to be that
> its valueType is defined as Text in the embedded schema, while the
> metadata element in the PDF has an embedded  xml:lang="x-default"> structure.
>
>
> https://github.com/veraPDF/veraPDF-library/issues/1224#issuecomment-1029932963
>
> (I suppose the reference to "title" in the issue comment should be
> "description".)
>
> Validating with veraPDF <1.20 does not raise the error. The validation
> seems to have changed for redefined types in that version.
>
>
> https://github.com/veraPDF/veraPDF-library/blob/integration/RELEASENOTES.md#validation


I am missing something here... true
FOO
makes a valid pdf 3a with verapdf 1.20.1.
But dc:description is like dc:title, so where we are redefining
dc:description as Text ?

-- 
luigi
___
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] XMP metadata schema yields invalid PDF/A

2022-02-04 Thread Karl Pettersson via ntg-context
On Fri, Feb 04, 2022 at 10:25:27PM +0100, Hans Hagen via ntg-context wrote:
> On 2/4/2022 7:29 PM, Karl Pettersson via ntg-context wrote:
> > Hi
> > 
> > PDF/A files generated using ConTeXt fail validation with veraPDF, and
> > the reason seems to be that the dc:description metadata is defined with
> > the wrong type in the embedded XMP extension schema.
> > 
> > https://tex.stackexchange.com/questions/632380/generate-pdf-a-with-context
> > 
> > https://github.com/veraPDF/veraPDF-library/issues/1224
> > 
> > I can reproduce the problem using TeX Live 2021 (MkIV 2021.03.05). The
> > definition seems to be controlled by this code.
> > 
> > https://source.contextgarden.net/tex/context/base/mkiv/lpdf-pua.xml?search=rdf#l81
> so "dc:description" is not permitted? it is mentioned in
> 
> https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/elements/1.1/description
> 
> (btw it never failed before)

The description element is permitted, but the problem seems to be that
its valueType is defined as Text in the embedded schema, while the
metadata element in the PDF has an embedded  structure.

https://github.com/veraPDF/veraPDF-library/issues/1224#issuecomment-1029932963

(I suppose the reference to "title" in the issue comment should be 
"description".)

Validating with veraPDF <1.20 does not raise the error. The validation
seems to have changed for redefined types in that version.

https://github.com/veraPDF/veraPDF-library/blob/integration/RELEASENOTES.md#validation

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

-- 
Karl Pettersson
Uppsala, Sweden

https://static-dust.klpn.se/
___
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] XMP metadata schema yields invalid PDF/A

2022-02-04 Thread luigi scarso via ntg-context
On Fri, Feb 4, 2022 at 10:26 PM Hans Hagen via ntg-context <
ntg-context@ntg.nl> wrote:

> On 2/4/2022 7:29 PM, Karl Pettersson via ntg-context wrote:
> > Hi
> >
> > PDF/A files generated using ConTeXt fail validation with veraPDF, and
> > the reason seems to be that the dc:description metadata is defined with
> > the wrong type in the embedded XMP extension schema.
> >
> >
> https://tex.stackexchange.com/questions/632380/generate-pdf-a-with-context
> >
> > https://github.com/veraPDF/veraPDF-library/issues/1224
> >
> > I can reproduce the problem using TeX Live 2021 (MkIV 2021.03.05). The
> > definition seems to be controlled by this code.
> >
> >
> https://source.contextgarden.net/tex/context/base/mkiv/lpdf-pua.xml?search=rdf#l81



>
> so "dc:description" is not permitted? it is mentioned in
>
>
> https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/elements/1.1/description
>
>

and also in XMPSpecificationPart1.pdf

https://github.com/adobe/XMP-Toolkit-SDK/tree/main/docs

 dc:description

Language
Alternative

DCMI definition: An account of the resource.
XMP addition: XMP usage is a list of textual descriptions of the content of
the
resource, given in various languages.


--
luigi
___
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] XMP metadata schema yields invalid PDF/A

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

On 2/4/2022 7:29 PM, Karl Pettersson via ntg-context wrote:

Hi

PDF/A files generated using ConTeXt fail validation with veraPDF, and
the reason seems to be that the dc:description metadata is defined with
the wrong type in the embedded XMP extension schema.

https://tex.stackexchange.com/questions/632380/generate-pdf-a-with-context

https://github.com/veraPDF/veraPDF-library/issues/1224

I can reproduce the problem using TeX Live 2021 (MkIV 2021.03.05). The
definition seems to be controlled by this code.

https://source.contextgarden.net/tex/context/base/mkiv/lpdf-pua.xml?search=rdf#l81

so "dc:description" is not permitted? it is mentioned in

https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/elements/1.1/description

(btw it never failed before)

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] XMP metadata schema yields invalid PDF/A

2022-02-04 Thread Karl Pettersson via ntg-context
Hi

PDF/A files generated using ConTeXt fail validation with veraPDF, and
the reason seems to be that the dc:description metadata is defined with
the wrong type in the embedded XMP extension schema.

https://tex.stackexchange.com/questions/632380/generate-pdf-a-with-context

https://github.com/veraPDF/veraPDF-library/issues/1224

I can reproduce the problem using TeX Live 2021 (MkIV 2021.03.05). The
definition seems to be controlled by this code.

https://source.contextgarden.net/tex/context/base/mkiv/lpdf-pua.xml?search=rdf#l81

Regards

-- 
Karl Pettersson
Uppsala, Sweden

https://static-dust.klpn.se/
___
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] Suggestions for more math classes?

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

On 1/27/2022 9:36 AM, Mikael Sundqvist via ntg-context wrote:

Dear all,

While discussing spacing in math with Hans, we have come to the
conclusion that to have better control and cleaner code there might be
a good idea to have more math classes than the usual ones in TeX (ord,
op, bin, rel, open, close, punct, inner (and some that we need not to
think about)).

So far, Hans has implemented frac and rad for fractions and radicals.
The fractions has been a funny construction, being put inside empty
delimiters, and so surrounded by the \nulldelimiterspace (which has
been set to 1.2pt, independent of font size). Now we have better
control of the spacing around fractions.

Hans has opened up (even in the code) for the addition of more
classes. The overall aim is to have a more coherent and logical way of
typing math, without manual adding of (arbitrary) spaces every now and
then. For example, we have always written \int f(x)\, dx to have a
thin space between the closing parenthesis and the d in integrals.
There will (most likely) be a differential class. Since the d might
occur in other places in a formula with integrals, one cannot just
simply give the letter d the differential class, and we are currently
discussing the correct way for the user to type it. If you have
suggestions, please let us hear!

Some further suggestions by Hans are (see below for two more)

13 imaginary
14 differential
15 exponential
16 function

Q1: Do you have any further suggestions on new classes (or comments on
these)? It might be good to think about situations where you have felt
that you need to insert manual spaces such as \, or \! to obtain a
better result.

I give one contribution: I asked a colleague to look in his TeX files
for manual spaces, and he came up with several \, (usually before the
d in integrals) but also with \!. This \! occurred mostly in fencing
situations to have the exponent come a bit closer to the closing
parenthesis.

\left( \frac{x}{2} \right)^{\! k+2n}

I have seen this in many places before, so no originality is claimed.

Two more classes that we thought of are under and over. Say that we
have a\overbar{bc}d. Should the spacing between a and the \overbar{bc}
and the spacing between \overbar{bc} and d always be tight? If so,
these might just be ord, and no new class needed (although one could
argue for adding the classes now, set them up as ord, and thus being
able to configure them according to taste/need).

Q2: Do you have any real examples of constructions with \overbar,
\underbar, \overbrace, ... or if you have any strong opinion, please
raise your voice!

Here is a teaser:

\starttext

% in context we put digits in their own class, the next is the default:

\letmathspacing \mathdigitcode \mathordinarycode \mathordinarycode 
\mathordinarycode \mathordinarycode


% but we can adapt the inter digit spacing (\mathdigitcode == 20 in 
context, \mathordinarycode is one fo the traditional class codes):


\setmathspacing \mathdigitcode \mathdigitcode \allmathstyles = 2mu

% and also change it when needed

\startTEXpage[offset=10pt]
$ x = 1234 = z $\par
\begingroup
\setmathspacing \mathdigitcode \mathdigitcode \allmathstyles = 4mu
$ x = 1234 = z $\par
\endgroup
$ x = 1234 = z $\par
\stopTEXpage

\stoptext

The result is attached. So maybe Mikaels explanation above and this 
example will trigger demand.


One of the possibilities is that users define their own classes and put 
characters in it. (this can be domain specific and domains is something 
that has been on the todo for quite a while.)


For that reason we might bump the current number of classes (we have 32 
classes compared to the 8 that regular tex has) to 64 (which is possible 
when we bring down the number of families to 64 (currently 128 compared 
to 256 in luatex and 16 in regular tex) which is still plenty and way 
more than we ever need (so if needed we can borrow bits for the math 
unicode range which is now limited to 0xF; it was already limited 
anyway).


This move also makes it possible to remove some other hacks (with the 
usual 'a pity to throw nice code away syndrome' side effect) and can 
have some 'initialization of old school ascii' side effects (neglectable 
because we can set it up via the emacro package).


For the record: the \Umathspacing primitives have been 
dropped but can be emulated easily (in the end it saves hundreds of 
primitives).


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
-

math.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] Suggestions for more math classes?

2022-01-27 Thread Mikael Sundqvist via ntg-context
Dear all,

While discussing spacing in math with Hans, we have come to the
conclusion that to have better control and cleaner code there might be
a good idea to have more math classes than the usual ones in TeX (ord,
op, bin, rel, open, close, punct, inner (and some that we need not to
think about)).

So far, Hans has implemented frac and rad for fractions and radicals.
The fractions has been a funny construction, being put inside empty
delimiters, and so surrounded by the \nulldelimiterspace (which has
been set to 1.2pt, independent of font size). Now we have better
control of the spacing around fractions.

Hans has opened up (even in the code) for the addition of more
classes. The overall aim is to have a more coherent and logical way of
typing math, without manual adding of (arbitrary) spaces every now and
then. For example, we have always written \int f(x)\, dx to have a
thin space between the closing parenthesis and the d in integrals.
There will (most likely) be a differential class. Since the d might
occur in other places in a formula with integrals, one cannot just
simply give the letter d the differential class, and we are currently
discussing the correct way for the user to type it. If you have
suggestions, please let us hear!

Some further suggestions by Hans are (see below for two more)

13 imaginary
14 differential
15 exponential
16 function

Q1: Do you have any further suggestions on new classes (or comments on
these)? It might be good to think about situations where you have felt
that you need to insert manual spaces such as \, or \! to obtain a
better result.

I give one contribution: I asked a colleague to look in his TeX files
for manual spaces, and he came up with several \, (usually before the
d in integrals) but also with \!. This \! occurred mostly in fencing
situations to have the exponent come a bit closer to the closing
parenthesis.

\left( \frac{x}{2} \right)^{\! k+2n}

I have seen this in many places before, so no originality is claimed.

Two more classes that we thought of are under and over. Say that we
have a\overbar{bc}d. Should the spacing between a and the \overbar{bc}
and the spacing between \overbar{bc} and d always be tight? If so,
these might just be ord, and no new class needed (although one could
argue for adding the classes now, set them up as ord, and thus being
able to configure them according to taste/need).

Q2: Do you have any real examples of constructions with \overbar,
\underbar, \overbrace, ... or if you have any strong opinion, please
raise your voice!

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

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


Re: [NTG-context] OT world history: other measuring systems?

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

On 1/25/2022 8:41 PM, Henning Hraban Ramm via ntg-context wrote:

Am 25.01.22 um 18:45 schrieb Hans Hagen via ntg-context:

On 1/25/2022 6:27 PM, Aditya Mahajan via ntg-context wrote:

Some of the units, particularly for measurement of land area, are 
still in use as they are effectively codified in the land records. 
Wikipedia has some summary of the ancient and medieval systems in India.

https://en.wikipedia.org/wiki/Indian_units_of_measurement


the same in nl ... for instance farmers still use old measures (e.g. 
when selling or buying land), also because for instance lots are 
defined that way


I don’t think that farmers (in Germany) still use them, but “Morgen” 
(morning) and “Tagwerk” (a day’s work) were usual measures for areas, 
depending on the region and the type of work (farming, viniculture, 
fresco painting...)

a 'bunder' land is one still used and a 'mud' potatoes

(taking a 'sip' of water now ... and i bet that this is not the same 
wverywhere)



-
  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] OT world history: other measuring systems?

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

Am 25.01.22 um 18:45 schrieb Hans Hagen via ntg-context:

On 1/25/2022 6:27 PM, Aditya Mahajan via ntg-context wrote:

Some of the units, particularly for measurement of land area, are 
still in use as they are effectively codified in the land records. 
Wikipedia has some summary of the ancient and medieval systems in India.

https://en.wikipedia.org/wiki/Indian_units_of_measurement


the same in nl ... for instance farmers still use old measures (e.g. 
when selling or buying land), also because for instance lots are defined 
that way


I don’t think that farmers (in Germany) still use them, but “Morgen” 
(morning) and “Tagwerk” (a day’s work) were usual measures for areas, 
depending on the region and the type of work (farming, viniculture, 
fresco painting...)


According to https://de.wikipedia.org/wiki/Tagewerk, only the kingdom of 
Bavaria had a proper definition:

1 Tagwerk = 100 Dezimal = 400 Quadratruten = 40.000 Quadratfuß

I don’t know if Michael Ende made that up, but apparently some bible 
exegetors said, paradise must have had the size of 6 “Tagwerk”... (But 
then probably YHW’s tagwerk is something else than a mortal farmer’s – 
similar to the time of the Devas in India.)


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

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


Re: [NTG-context] What is the proper way to define many different list types in a document?

2022-01-24 Thread Aditya Mahajan via ntg-context
On Tue, 25 Jan 2022, Joel via ntg-context wrote:

> I have about several different types of list that reoccur multiple times in 
> my documents. Though I tried to keep things simple, by just defining the type 
> when it appears, strange glitches appear. For instance, I have one that uses 
> the ☞ (pointing hand) logo, and sometimes that randomly appears in the wrong 
> lists, for reasons I cannot understand.
> 
> Below is how I'm defining my lists. I have about a dozen more, this is a 
> sample. Is there some more robust and consistent manner in which I should be 
> defining them, so the settings from one type don't spill over into the other 
> types?
> --Joel
> 
> %prompt
> 
> \definesymbol[bighand][{{☞}}]
> 
> \define[1]\prompt{%
>     \setupitemize[symbol=bighand]
>     \startitemize
>         {\it #1}
>     \stopitemize
> }%

This is a global definition. So, once this macro is used, symbol=bighand for 
all itemize. What you can use instead is:

\define[1]\prompt{%
    \startitemize[symbol=bighand]
        {\it #1}
    \stopitemize
}%


or even better:

\defineitemgroup[prompt][symbol=bighand,style=italic]

...

\startprompt
  \item
\stopprompt

> %written answer (produces some lines after the question for writing an answer)
> 
> \define[1]\writingbox{%
>     \dorecurse{#1}{%
>         \hairline%
>     }
> }

There is also: https://wiki.contextgarden.net/Command/fillinrules

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

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


[NTG-context] What is the proper way to define many different list types in a document?

2022-01-24 Thread Joel via ntg-context
I have about several different types of list that reoccur multiple times in my 
documents. Though I tried to keep things simple, by just defining the type when 
it appears, strange glitches appear. For instance, I have one that uses the ☞ 
(pointing hand) logo, and sometimes that randomly appears in the wrong lists, 
for reasons I cannot understand.

Below is how I'm defining my lists. I have about a dozen more, this is a 
sample. Is there some more robust and consistent manner in which I should be 
defining them, so the settings from one type don't spill over into the other 
types?
--Joel

%prompt

\definesymbol[bighand][{{☞}}]

\define[1]\prompt{%
    \setupitemize[symbol=bighand]
    \startitemize
        {\it #1}
    \stopitemize
}%

\prompt{What did you learn about today?}

%vocabulary

\startcolumns[n=3]\startitemize[n]
\item word1
\item word2
\item word3
\stopitemize\stopcolumns

%nested outline

\startitemize[1]
    \item some text
    \startitemize[2]
    \item some text
    \startitemize[3]
  \item some text
    \stopitemize
    \stopitemize
\stopitemize

%written answer (produces some lines after the question for writing an answer)

\define[1]\writingbox{%
    \dorecurse{#1}{%
        \hairline%
    }
}

\startitemize[n]
\item Which planet is closest to Earth? \writingbox{4}
\item What is the moon made of? \writingbox{4}
\stopitemize

%materials list

\startcolumns[n=3]\startitemize
\item crayons
\item scissors
\item glue
\stopitemize\stopcolumns

%word search clues (should be simple, but strangely this keeps getting the ☞ 
logo added instead of showing numbers)
\startitemize[n]
\item a type of hat worn
\item a cold season
\stopitemize
___
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

2022-01-23 Thread hanneder--- via ntg-context
(it is a bit of a pity that support for indic scripts is such a  
weird mix of font technology and
engine dependent reshuffling ... probably also driven by limitations  
of open type at that time)>


When using these fonts regularly, one notices very erratic formatting  
phenomena that must have to
do with the Devanagarī font, or its interaction with (Xe)TeX. Perhaps  
this is the same phenomenon

seen from the user side.

In my case things improved when I switched to Adishila (in XeTeX):

\newfontfamily\sanskritfont[Script=Devanagari,Mapping=RomDev,Scale=1.45]{AdishilaSan}

This is, to my taste, the nicest Sanskrit font, but it is difficult to  
decide between Adishila and

Shobhika.

The Murty font is also quite good, but it is commercial and cannot be  
used for book production. I
asked whether there was a way to get a licence, but at the time this  
was impossible. But the font
team there recommended ``Sanskrit Text'' (Sansk.ttf) which is one of  
their products that made it
into a Microsoft Windows Standard font (I am not using Windows). It is  
also very good, but Adishila

works better for me.

I cannot say how thrilled I am about the Indic support, thanks a lot  
to Kaushika!


Best
Jürgen


- Nachricht von kauśika via ntg-context  -
 Datum: Sat, 22 Jan 2022 16:08:10 +0530
   Von: kauśika via ntg-context 
Antwort an: mailing list for ConTeXt users 
   Betreff: Re: [NTG-context] new upload
An: mailing list for ConTeXt users 
Cc: kauśika 


On Saturday, January 22, 2022 3:55:12 PM IST Hans Hagen via  
ntg-context wrote:

Is there a font out there that supports all these scripts in one font?


Shobhika font is a free font that has some of the largest number of glyphs
(i.e has many conjuncts) for the Devanagari script.
https://github.com/Sandhi-IITBombay/Shobhika

The font also has a good Latin component based on PT Serif. This Latin part
has good support for the roman (IAST) transliteration for Sanskrit. But
strictly only the IAST spec character for Sanskrit are available.

It also has glyphs for some commonly used mathematical symbols.

Noto Serif Devanagari is also decent for just Devanagari (not sure  
of the IAST

part).

As for Sans typefaces, Mukta Devanagari is a free font:
https://github.com/EkType/Mukta

Of these, Shobhika has the best conjunct coverage. I will shortly update the
wiki with a much more exhaustive list and report here.

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
___



- Ende der Nachricht von kauśika via ntg-context  
 -




---

Prof. Dr. Juergen Hanneder
Philipps-Universitaet Marburg
FG Indologie u. Tibetologie
Deutschhausstr.12
35032 Marburg
Germany
Tel. 0049-6421-28-24930
hanne...@staff.uni-marburg.de

___
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

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

On 1/22/2022 8:21 AM, kauśika via ntg-context wrote:

On Saturday, January 22, 2022 11:36:57 AM IST Aditya Mahajan via ntg-context
wrote:

I finally thought that I'd try out how typesetting Hindi works with ConTeXt,
but I don't get the correct output.

Input: आदित्य (See complete attached file)

Output: See attached.

Note that ि  "vowel sign I" should be attached to  द "letter  da" but it is
attached to  य "letter ya". Do I need to enable a particular feature?


Unfortunately some fonts don't work properly in ConTeXt. Noto Sans Devanagari
is one of them. The accompanying serif font (Noto Serif Devanagari) works just
fine (mostly, there are problems with that as well).

In this specific case, there does not seem to be any fix (at least that I could
find).

I am trying to test many fonts and come up with a list of fonts which work,
partially work, don't work, etc. and fixes wherever possible.
Side note: we tested a lot and could find some hacks around font issues 
but in the end decided that adding some heuristics for (maybe whatever 
historic issues) makes no sense because eventually one ends up fighting 
heuristics. So, in the end we removed these fixing features and instead 
just do as announced above: tell what works and not with what fonts (and 
as some fonts are in development we can just wait till things work).


(it is a bit of a pity that support for indic scripts is such a weird 
mix of font technology and engine dependent reshuffling ... probably 
also driven by limitations of open type at that time)


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] definemathcommand and Lucida OT

2022-01-18 Thread Otared Kavian via ntg-context
Hi Hans,

Some time ago I reported about an issue with \definemathcommand, and the issue 
is still present, as one can see with following example.

Best regards: Otared
% begin liminf-Argmin.tex

\setupbodyfont[lucidaot]
%\setupbodyfont[termes]

\definemathcommand [Argmin]  [limop] {\mfunctionlabeltext{ArgMin}}
\definemathcommand [liminfbar]  [limop] {\underline{\mfunctionlabeltext{lim}}}
\definemathcommand [limsupbar]  [limop] {\overline{\mfunctionlabeltext{lim}}}

\starttext
The built-in commands \type{\liminf}, yielding $\liminf$, and \type{\limsup}, 
yielding $\limsup$ do not work properly with LucidaOT:
\startformula
x_{n} := (-1)^n, \quad\mbox{then} \quad \liminf_{n \geq 0}x_{n} = -1, \quad 
\limsup_{n\geq 0} x_{n}= +1.
\stopformula

The user defined commands \type{\liminfbar} and \type{\limsupbar} behave 
correctly:
\startformula
x_{n} := (-1)^n, \quad\mbox{then} \quad \liminfbar_{n \geq 0}x_{n} = -1, \quad 
\limsupbar_{n\geq 0}x_{n} = +1,
\stopformula
but not the command \type{\Argmin}
\startformula
\Argmin_{x\in {\Bbb R}} (x^2 - x + 1) = {1 \over 2}.
\stopformula

\stoptext

% end liminf-Argmin.tex



liminf-Argmin.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
___


<    1   2   3   4   5   6   7   8   9   10   >