Re: [NTG-context] Software upgrade for ntg and contextgarden server 6 April

2023-04-14 Thread mf via ntg-context

Hello,

the github repo at https://github.com/contextgarden/context-mirror
is not updated since March 20th.

I don't know whether it's related to the server update, but maybe you know.

BTW thank you Taco, Jules and Robbert for your work.

Massi

Il 11/04/23 22:42, Taco Hoekwater via ntg-context ha scritto:

Hi,

So … the server now runs Ubuntu 22.04. Jay!

This was a much harder upgrade though. Various things were wrong, and are 
likely still a bit wrong in places. Robbert had to rescue the network 
configuration that went missing completely after the upgrade (requiring a trip 
to the data center). Various packages have been discontinued by our linux 
distribution, including the version of the mailing list software that we use 
(so that had to be installed manually). The new version of php is much stricter 
than the old version (so some website hacks were also needed). Et cetera. It 
has been a “process” ...

The basic functionality appears to be back online, although the web interface 
to the mailing lists does not work yet (we will try to fix that tomorrow). But 
there are likely to be small problems with other services still. Please *do* 
let me know if you notice something odd!

In any case, today was the last of the big software update procedures (at least 
for the next year or so).

Best wishes,
Taco and Jules and Robbert


___
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] \setupparagraphs - can they run over two pages?

2023-02-27 Thread mf via ntg-context

I would try \setuptabulate, \starttabulate ... \stoptabulate.

It has some limitations (though Hans added some features recently), but 
it should work.


Massi

Il 24/02/23 06:41, jbf via ntg-context ha scritto:

I have the following setup for side-by-side paras.

\defineparagraphs[Two][n=2]

\setupparagraphs[Two][1][width=.1\textwidth,style=\bfx,align=tolerant]

\setupparagraphs[Two][2][width=.9\textwidth,style=normal,align=tolerant]

My difficulty is that while there is only ever just a couple of numbers 
in the left-hand 'column', the right-hand 'column' may have several 
lengthy paragraphs. If I have one relatively short \startTwo followed by 
one that is much longer, it will be forced to start on the next page, 
leaving too much empty space on the previous page.


It is probable that getting this environment to split across pages is 
not possible. I can try very different approaches (columns, tables) to 
solve my problem, but I thought I would at least ask first.


Julian


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

___
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] Can ConTeXt display a simple itemized list as a comma-separated list?

2023-02-27 Thread mf via ntg-context

\setupitemgroup
[fooditems]
[each]
[none,text]
[textseparator={,}]

Comma is used to separate options; if you don't use braces, it means 
that the textseparator is set to the empty string.


Massi

Il 27/02/23 12:33, Jan-Erik Hägglöf via ntg-context ha scritto:

I tested the code and the separator didn’t show up

\mainlanguage[sv]

\setupbodyfont[12pt]

\defineitemgroup
   [fooditems]

\setupitemgroup
   [fooditems]
   [each]
   [none,text]
   [textseparator=,]

\starttext

\startfooditems
     \item fish
     \item eggs
     \item milk
\stopfooditems

\stoptext




26 feb. 2023 kl. 11:55 skrev Hans Hagen via ntg-context 
mailto:ntg-context@ntg.nl>>:


On 2/25/2023 5:01 PM, Joel via ntg-context wrote:

I have a list like this:
\startitemize[1]
\item fish
\item eggs
\item milk
\stopitemize
Is there any command in ConTeXt to make this display the items as a 
comma-separated list, like this:

fish, eggs, milk
Or a semi-colon-separated list?
fish; eggs; milk

In the next update you can set a textseparator.

\starttext

\startitemize[none,text][textseparator=;]
   \item fish
   \item eggs
   \item milk
\stopitemize

\defineitemgroup
 [fooditems]

\setupitemgroup
 [fooditems]
 [each]
 [none,text]
 [textseparator=;]

\blank[2*line]

\startfooditems
   \item fish
   \item eggs
   \item milk
\stopfooditems

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



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

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

2022-12-18 Thread mf via ntg-context

Il 18/12/22 14:49, Hans Hagen via ntg-context ha scritto:

On 12/18/2022 2:14 PM, mf via ntg-context wrote:

> ...

So we gained a lot in the meantime.

mkiv lua stats  > loaded fonts: 27 files: lmmono10-regular.otf, 
texgyrepagella-math.otf, dejavusansmono.ttf, gfsneohellenic.otf, 
firasans-bolditalic.otf, firasans-regular.otf, 
firasans-regularitalic.otf, firasanscondensed-bold.otf, 
firasanscondensed-regular.otf, garamondpremrpro-bdit.otf, 
garamondpremrpro-med.otf, garamondpremrpro-medcapt.otf, 
garamondpremrpro-meddisp.otf, garamondpremrpro-medit.otf, 
garamondpremrpro-meditcapt.otf, garamondpremrpro-medsubh.otf, 
garamondpremrpro-smbdit.otf, myriadpro-bold.otf, 
myriadpro-boldcond.otf, myriadpro-boldcondit.otf, myriadpro-cond.otf, 
myriadpro-condit.otf, myriadpro-it.otf, myriadpro-regular.otf, 
myriadpro-semiboldit.otf, quivira.otf, sileot.ttf
mkiv lua stats  > font engine: otf 3.131, afm 1.513, tfm 1.000, 533 
instances, 501 shared in backend, 6 common vectors, 495 common 
hashes, load time 0.196 seconds

How does that report with compact font mode?


mkiv lua stats  > resource resolver: loadtime 0.005 seconds, 0 scans 
with scantime 0.000 seconds, 0 shared scans, 107 found files, scanned 
paths: 
mkiv lua stats  > stored bytecode data: 507 modules (0.285 sec), 106 
tables (0.017 sec), 613 chunks (0.302 sec)
mkiv lua stats  > traced context: maxstack: 1923, freed: 246, 
unreachable: 1677

mkiv lua stats  > cleaned up reserved nodes: 76 nodes, 9 lists of 504
mkiv lua stats  > node memory usage: 1684 attribute, 110 fontspec, 419 
glue, 87 gluespec, 3 kern, 647 mathspec, 4 penalty, 2 temp, 591 whatsit
mkiv lua stats  > node list callback tasks: 13 unique task lists, 17 
instances (re)created, 325895 calls

mkiv lua stats  > h-node processing time: 10.654 seconds including kernel
mkiv lua stats  > attribute processing time: 2.810 seconds front- and 
backend

mkiv lua stats  > driver time: 11.714 seconds
mkiv lua stats  > used backend: pdf
mkiv lua stats  > jobdata time: 0.810 seconds saving, 0.194 seconds loading
mkiv lua stats  > callbacks: file: 5439, saved: 644924, direct: 1386, 
function: 534140, value: 1033, message: 0, bytecode: 613, late 0, total: 
1187535 (1151 per page)

mkiv lua stats  > randomizer: resumed with value 0.58701179146283
mkiv lua stats  > v-node processing time: 1.480 seconds
mkiv lua stats  > loaded patterns: en::1 it::66, load time: 0.000
mkiv lua stats  > xml load time: 0.444 seconds, 1 files, 1 converted
mkiv lua stats  > lxml preparation time: 26.359 seconds, 47936 nodes, 
24702 lpath calls, 24331 cached calls

mkiv lua stats  > interactive elements: 9327 references, 12951 destinations
mkiv lua stats  > margin data: 6 entries, 0 pending
mkiv lua stats  > loaded fonts: 27 files: lmmono10-regular.otf, 
texgyrepagella-math.otf, dejavusansmono.ttf, gfsneohellenic.otf, 
firasans-bolditalic.otf, firasans-regular.otf, 
firasans-regularitalic.otf, firasanscondensed-bold.otf, 
firasanscondensed-regular.otf, garamondpremrpro-bdit.otf, 
garamondpremrpro-med.otf, garamondpremrpro-medcapt.otf, 
garamondpremrpro-meddisp.otf, garamondpremrpro-medit.otf, 
garamondpremrpro-meditcapt.otf, garamondpremrpro-medsubh.otf, 
garamondpremrpro-smbdit.otf, myriadpro-bold.otf, myriadpro-boldcond.otf, 
myriadpro-boldcondit.otf, myriadpro-cond.otf, myriadpro-condit.otf, 
myriadpro-it.otf, myriadpro-regular.otf, myriadpro-semiboldit.otf, 
quivira.otf, sileot.ttf
mkiv lua stats  > font engine: otf 3.131, afm 1.513, tfm 1.000, 46 
instances, 16 shared in backend, 4 common vectors, 12 common hashes, 
load time 0.148 seconds

mkiv lua stats  > text directions: 5.911 seconds
mkiv lua stats  > metapost: 1.180 seconds, loading: 0.083, execution: 
1.109, n: 1039, average: 0.002, instances: 2, luacalls: 46885 (file: 
34713, text: 0, script: 5932, log: 6240), memory: 8.995 M

mkiv lua stats  > math tweaking time: 0.462 seconds, 8 math goodie tables
mkiv lua stats  > math processing time: 0.211 seconds
mkiv lua stats  > pdf annotations: 9327 links (9316 unique), 0 special
mkiv lua stats  > font embedding time: 0.104 seconds, 23 fonts
mkiv lua stats  > result saved in file: v32.pdf, compresslevel 0, 
objectcompresslevel 0
mkiv lua stats  > positions: 8572 collected, 4774 deltas, 8565 shared 
partials, 305 partial entries
mkiv lua stats  > used platform: linux-64, type: unix, binary subtree: 
texmf-linux-64
mkiv lua stats  > used engine: luametatex version: 2.1004, functionality 
level: 20221214, format id: 679, compiler: gcc
mkiv lua stats  > tex properties: 740852 hash slots used of 2097152, 
93821 control sequences, approximate memory usage: 65 MB
mkiv lua stats  > lua properties: engine: lua 5.4, used memory: 338 MB, 
ctx: 266 MB, max: 415 MB, symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 114.917 seconds, 1032 processed pages, 1032 
shipped pages, 8.980 pages/second


It's better, but the 

Re: [NTG-context] bottlenecks

2022-12-18 Thread mf via ntg-context

The old version is 2020.04.26 19:53, not 2020-04-22

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

2022-12-18 Thread mf via ntg-context

latest ConTeXt 2022.12.15 18:12:

mkiv lua stats  > resource resolver: loadtime 0.009 seconds, 0 scans 
with scantime 0.000 seconds, 0 shared scans, 107 found files, scanned 
paths: 


mkiv lua stats  > stored bytecode data: 507 modules (0.346 sec), 106 
tables (0.023 sec), 613 chunks (0.369 sec)
mkiv lua stats  > traced context: maxstack: 1923, freed: 246, 
unreachable: 1677

mkiv lua stats  > cleaned up reserved nodes: 76 nodes, 9 lists of 504
mkiv lua stats  > node memory usage: 1684 attribute, 419 glue, 87 
gluespec, 3 kern, 647 mathspec, 4 penalty, 2 temp, 591 whatsit
mkiv lua stats  > node list callback tasks: 13 unique task lists, 17 
instances (re)created, 325602 calls

mkiv lua stats  > h-node processing time: 10.442 seconds including kernel
mkiv lua stats  > attribute processing time: 2.783 seconds front- and 
backend

mkiv lua stats  > driver time: 11.187 seconds
mkiv lua stats  > used backend: pdf
mkiv lua stats  > jobdata time: 0.747 seconds saving, 0.195 seconds loading
mkiv lua stats  > callbacks: file: 5438, saved: 644352, direct: 1374, 
function: 540269, value: 1027, message: 0, bytecode: 613, late 0, total: 
1193073 (1163 per page)

mkiv lua stats  > randomizer: resumed with value 0.58701179146283
mkiv lua stats  > v-node processing time: 1.955 seconds
mkiv lua stats  > loaded patterns: en::1 it::66, load time: 0.000
mkiv lua stats  > xml load time: 0.416 seconds, 1 files, 1 converted
mkiv lua stats  > lxml preparation time: 29.478 seconds, 47936 nodes, 
24702 lpath calls, 24331 cached calls

mkiv lua stats  > interactive elements: 9336 references, 12951 destinations
mkiv lua stats  > margin data: 6 entries, 0 pending
mkiv lua stats  > loaded fonts: 27 files: lmmono10-regular.otf, 
texgyrepagella-math.otf, dejavusansmono.ttf, gfsneohellenic.otf, 
firasans-bolditalic.otf, firasans-regular.otf, 
firasans-regularitalic.otf, firasanscondensed-bold.otf, 
firasanscondensed-regular.otf, garamondpremrpro-bdit.otf, 
garamondpremrpro-med.otf, garamondpremrpro-medcapt.otf, 
garamondpremrpro-meddisp.otf, garamondpremrpro-medit.otf, 
garamondpremrpro-meditcapt.otf, garamondpremrpro-medsubh.otf, 
garamondpremrpro-smbdit.otf, myriadpro-bold.otf, myriadpro-boldcond.otf, 
myriadpro-boldcondit.otf, myriadpro-cond.otf, myriadpro-condit.otf, 
myriadpro-it.otf, myriadpro-regular.otf, myriadpro-semiboldit.otf, 
quivira.otf, sileot.ttf
mkiv lua stats  > font engine: otf 3.131, afm 1.513, tfm 1.000, 533 
instances, 501 shared in backend, 6 common vectors, 495 common hashes, 
load time 0.196 seconds

mkiv lua stats  > text directions: 5.754 seconds
mkiv lua stats  > metapost: 1.182 seconds, loading: 0.129, execution: 
1.112, n: 1033, average: 0.002, instances: 2, luacalls: 46777 (file: 
34671, text: 0, script: 5902, log: 6204), memory: 8.992 M

mkiv lua stats  > math tweaking time: 5.640 seconds, 126 math goodie tables
mkiv lua stats  > math processing time: 0.251 seconds
mkiv lua stats  > pdf annotations: 9336 links (9326 unique), 0 special
mkiv lua stats  > font embedding time: 0.049 seconds, 23 fonts
mkiv lua stats  > result saved in file: v32.pdf, compresslevel 0, 
objectcompresslevel 0
mkiv lua stats  > positions: 8563 collected, 4775 deltas, 8556 shared 
partials, 304 partial entries
mkiv lua stats  > used platform: linux-64, type: unix, binary subtree: 
texmf-linux-64
mkiv lua stats  > used engine: luametatex version: 2.1004, functionality 
level: 20221214, format id: 679, compiler: gcc
mkiv lua stats  > tex properties: 740852 hash slots used of 2097152, 
94301 control sequences, approximate memory usage: 385 MB
mkiv lua stats  > lua properties: engine: lua 5.4, used memory: 1527 MB, 
ctx: 1436 MB, max: 1585 MB, symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 130.080 seconds, 1026 processed pages, 1026 
shipped pages, 7.887 pages/second


system  | total runtime: 130.269 seconds of 130.342 seconds


ConTeXt 2020-04-22:

mkiv lua stats  > resource resolver: loadtime 0.005 seconds, 0 scans 
with scantime 0.000 seconds, 0 shared scans, 124 found files, scanned 
paths: 
mkiv lua stats  > stored bytecode data: 468 modules (0.349 sec), 93 
tables (0.030 sec), 561 chunks (0.378 sec)
mkiv lua stats  > traced context: maxstack: 2799, freed: 246, 
unreachable: 2553

mkiv lua stats  > cleaned up reserved nodes: 61 nodes, 11 lists of 512
mkiv lua stats  > node memory usage: 200320 attribute, 23928 
attribute_list, 419 glue, 368 glue_spec, 27234 glyph, 3 kern, 4 penalty, 
2 temp, 1159 whatsit
mkiv lua stats  > node list callback tasks: 8 unique task lists, 14 
instances (re)created, 236679 calls

mkiv lua stats  > h-node processing time: 13.188 seconds including kernel
mkiv lua stats  > attribute processing time: 5.444 seconds front- and 
backend

mkiv lua stats  > driver time: 12.650 seconds
mkiv lua stats  > used backend: lmtx version 0.10, pdf (backend for 
directly generating pdf output)

mkiv lua stats  > jobdata time: 2.286 seconds saving, 0.297 seconds loading
mkiv lua stats  > callbacks: internal: 

Re: [NTG-context] Xml filtering in Lua

2022-11-16 Thread mf via ntg-context

This works:

local metadata = xml.filter (t, '../../topics/topic[@t:id=="' .. ch_id 
.. '"]')


also this:

local lpath = string.format('../../topics/topic[@t:id=="%s"]', ch_id)

local metadata = xml.filter (t, lpath)


It looks like xml.filter supports only 2 arguments (see lxml-tex.lua), 
and so it doesn't let you use string formatting patterns like the 
"context" command does.


You can write:

context('the value of @t:id is "%s"', ch_id)

but you can't write:

xml.filter (t, '../../topics/topic[@t:id=="%s"]', ch_id)


Best wishes,

Massi

___
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] Xml filtering in Lua

2022-11-16 Thread mf via ntg-context

Il 16/11/22 18:33, Thomas A. Schmitz via ntg-context ha scritto:

\startbuffer[test]

   
  
This is the first test
22/11/16
  
  
This is the second test
22/11/17
  
   
   
  

  This will be the content of the first chapter.

  
  
 
  This will be the content of the second chapter.
 
  
   

\stopbuffer

\startxmlsetups xml:testsetups
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{document|chapters|chapter|content|emph}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:document
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:chapters
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:chapter
\xmlfunction {#1} {chapter}
 \xmlflush {#1} 
\stopxmlsetups

\startxmlsetups xml:chapter:content
\xmltext {#1} {content}
\stopxmlsetups

\startxmlsetups xml:emph
   {\em \xmlflush {#1}}
\stopxmlsetups

\startluacode
function xml.functions.chapter (t)
 local ch_id = t.at.ch:id



local ch_id = t.at["ch:id"]



local metadata = xml.filter (t, 
'../../topics/topic[@t:id=="%s"]', ch_id)
print (inspect(metadata))
lxml.command(t, ".", "xml:chapter:content")
context.par ()
context (ch_id)
context.par ()
end
\stopluacode


Best wishes,

Massi

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


Re: [NTG-context] ignore not closed tags in XML input

2022-05-16 Thread mf via ntg-context

See HTML-tidy,

https://www.html-tidy.org/

it could help you pre-processing your HTML files.

Massi

Il 16/05/22 17:08, Pablo Rodriguez via ntg-context ha scritto:

Dear list,

I would like to feed
https://seumasjeltzz.github.io/LinguaeGraecaePerSeIllustrata/001.html as
XML input for ConTeXt.

The problem is that (as many other XML files that I haven’t generated
myself) some  and  tags aren’t closed, such as in:

   
   https://fonts/css?greek; rel="stylesheet">
   

So, all that I get is the following message:

   invalid xml file - parsed text

Unsuccessfully I have tried the following:

   \xmlsetsetup{#1}{html/head/(meta|link)}{-}

Is there no way to make ConTeXt more tolerant, so that it is able to
ignore those tags?

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

2022-05-09 Thread mf via ntg-context

I'm downloading it and I see a lot of mkii files and even some Ruby files.

It looks like some old material got into the update. Is everything right?

Massi

Il 09/05/22 17:41, Hans Hagen via ntg-context ha scritto:

Hi,

I uploaded a new version of lmtx (also because some users have to test 
some new metapost functionality). In the next upload metafun will use 
'double' mode (and scaledfun will be the traditional one). The advantage 
is less dager for overflows and in the meantime running in double mode 
is often also faster.



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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Wiki update: create a .vsix extension package for VisualStudio Code (or VSCodium)

2022-05-05 Thread mf via ntg-context

Hello list,

I just added some instructions to the WIKI to build an extension file 
for VSCode, starting from the code you find in the LMTX installation at


tex/texmf-context/context/data/vscode/extensions/context

You find them at

https://wiki.contextgarden.net/VSCode

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

2022-04-05 Thread mf via ntg-context

Il 05/04/22 13:15, Thomas A. Schmitz via ntg-context ha scritto:




On 5. Apr 2022, at 13:02, mf via ntg-context  wrote:

Is it possible to solve it globally and only for a single font?

Thanks,
Massi


Have you looked at chapter 5.4 “Goodies” of fonts-mkiv.pdf? That should get you 
started.


Thanks Thomas,
there seems to be nothing for that in the "Goodies" chapter.

I'd already found \setextrafontkerns at "8.12 Extra font kerns" of the 
same manual.
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.


I'm expecting there's a lua font table with glyph pairs kerning to update.

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
___


[NTG-context] modify kern between two glyphs

2022-04-05 Thread mf via ntg-context

Hello list,

I need to modify the kern between two glyphs.

This is a MWE where the problem is solved manually:

--
\mainlanguage[it]
\starttext

Default: «Questo è successo nel ’48».

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

\stoptext
--

Is it possible to solve it globally and only for a single font?

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


[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] definedfont vs switchtobodyfont (was "shrink inter-line space")

2021-12-20 Thread mf via ntg-context

Il 18/12/21 13:00, Wolfgang Schuster ha scritto:

\definefontfeature [tightlines] [dimensions={*,0,0}]

\starttext

\samplefile{ward}\par

\blank

\start
     \setupinterlinespace[line=5pt]
     \definedfont[Normal*default,tightlines]
     \samplefile{ward}\par
\stop

\stoptext



Thanks Wolfgang.

I tried this:

\definefontfeature [tightlines] [dimensions={*,0,0}]

\starttext

\samplefile{ward}\par

\blank

\start
\setupinterlinespace[line=5pt]
\feature[+][tightlines]
\samplefile{ward}\par
\stop

\stoptext

but it doesn't add the feature to the current font.
I understand I need a font switch.
Usually I use \switchtobodyfont. How is \definedfont different?

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] shrink inter-line space

2021-12-18 Thread mf via ntg-context

Il 17/12/21 20:17, Wolfgang Schuster ha scritto:> \starttext
>
> \samplefile{ward}\par
>
> \blank
>
> \start \setupinterlinespace[line=12pt]
> \samplefile{ward}\par
> \stop
>
> \stoptext
Yes, but you can't say \setupinterlinespace[line=6pt] and make lines 
overlap. At a certain point baselines don't get closer any more.


--
\starttext

\samplefile{ward}\par

\blank

\start \setupinterlinespace[line=12pt]
\samplefile{ward}\par
\stop

\blank

\start \setupinterlinespace[line=6pt]
\samplefile{ward}\par
\stop

\stoptext
--

You can do something like this:

--
\starttext

\samplefile{ward}\par

\blank

\start \setupinterlinespace[line=12pt]
\samplefile{ward}\par
\stop

\blank

The Earth, as a habitat for animal life, is in old age and has a fatal 
illness.\vadjust{\kern-6pt}
Several, in fact. It would be happening whether humans had ever evolved 
or not.\vadjust{\kern-6pt}
But our presence is like the effect of an old-age patient who smokes 
many packs\vadjust{\kern-6pt}

of cigarettes per day—and we humans are the cigarettes.

\stoptext
--

but I had to insert all those \kern-6pt manually.
How can I obtain the same result automatically?
(please don't argue about the ugliness of the result ;) )

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
___


[NTG-context] shrink inter-line space

2021-12-17 Thread mf via ntg-context

Hello list,
here's a MWE to shrink the distance between two lines:

\starttext
\samplefile{ward}\par
\blank
\bgroup
\baselineskip=0pt
\samplefile{ward}\par
\egroup
\stoptext

How can I get lines closer, even overlapping?

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] Indentation inside \framed won't go away

2021-10-21 Thread mf via ntg-context

\definepapersize[a4-portrait][A4][A4]
\setuppapersize[a4-portrait]
\setuplayout[topspace=10mm,backspace=15mm,header=50pt,footer=50pt,textwidth=165mm,height=middle,width=middle]

\starttext

\offset[x=\dimexpr11mm\relax,y=\dimexpr23mm\relax]
{\framed[frame=on,offset=none,align=flushleft]
{% percent sign here, otherwise you get a space
Chief Vitalstatistix\\
Getafix\\
Dogmatix\\
Asterix\\
Obelix\\
}
}
\stoptext

Massi

Il 21/10/21 10:32, Ramkumar KB via ntg-context ha scritto:

Hello,

I have this nagging issue of indentation (in the 1st line) showing up 
inside \framed in spite of all the commands to skip indentation (see 
attached PDF).


It appears that *\setupindenting[no]* is not playing any role here and 
some other parameter is overriding  this.


Any tips would be appreciated.

best regards,
Ramkumar

\definepapersize[a4-portrait][A4][A4]
\setuppapersize[a4-portrait]
\setuplayout[topspace=10mm,backspace=15mm,header=50pt,footer=50pt,textwidth=165mm,height=middle,width=middle]

\starttext

\offset[x=\dimexpr11mm\relax,y=\dimexpr23mm\relax]
{\framed[frame=on,offset=none,align=flushleft]
{
% \startparagraph[align=high]
\setupindenting[no]
Chief Vitalstatistix\\
Getafix\\
Dogmatix\\
Asterix\\
Obelix\\
}
}
\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
___


Re: [NTG-context] SVG not rendering correctly with LMTX and conversion=mp

2021-10-18 Thread mf via ntg-context

Il 18/10/21 18:30, Hans Hagen via ntg-context ha scritto:

On 10/18/2021 6:06 PM, mf via ntg-context wrote:

Il 18/10/21 17:15, Jason Ross via ntg-context ha scritto:

The following MWE fails to render the text in the attached SVG properly:


\starttext
\externalfigure[test.svg][conversion=mp]
\stoptext


The axis labels, tick labels, and title are all incorrect. This file was
generated with Matplotlib.



If you open test.svg with Inkscape, ungroup and then save, you get a 
SVG that is typeset right with LMTX.


Looking at the differences between the two SVGs, I can see that 
Inkscape changes all the transform="translate(...)scale(...)" 
attributes into transform="matrix(...)".


Now focus on the "y = sin(x)" text.
In the attachment I modified the transform attributes of that text, 
from "translate(...)scale(...)" to "matrix(...)", taking the values 
from the version obtained from Inkscape.


Use that SVG with your MWE and you'll see "y = sin(x)" appearing in 
the right place in the PDF.


I would say the "translate(...)scale(...)" specification is not 
supported in LMTX (yet).
it is supported; i'll send you a snippet to test (as it was not really a 
minimal example)




Coming soon... (see attachment)

The problem was the order in which transformations are applied when 
multiple transformations are specified in the transform attribute, like 
in "translate(...)scale(...)...".


testsvg.tex and test.svg are the MWE and the SVG file provided by Jason 
Ross in the first post of this thread.


Massi


testsvg.pdf
Description: Adobe PDF document
\starttext
\externalfigure[test.svg][conversion=mp]
\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] SVG not rendering correctly with LMTX and conversion=mp

2021-10-18 Thread mf via ntg-context

Here it's wrong. See attachment.

Massimiliano

Il 18/10/21 18:30, Hans Hagen via ntg-context ha scritto:

On 10/18/2021 6:06 PM, mf via ntg-context wrote:

Il 18/10/21 17:15, Jason Ross via ntg-context ha scritto:

The following MWE fails to render the text in the attached SVG properly:


\starttext
\externalfigure[test.svg][conversion=mp]
\stoptext


The axis labels, tick labels, and title are all incorrect. This file was
generated with Matplotlib.



If you open test.svg with Inkscape, ungroup and then save, you get a 
SVG that is typeset right with LMTX.


Looking at the differences between the two SVGs, I can see that 
Inkscape changes all the transform="translate(...)scale(...)" 
attributes into transform="matrix(...)".


Now focus on the "y = sin(x)" text.
In the attachment I modified the transform attributes of that text, 
from "translate(...)scale(...)" to "matrix(...)", taking the values 
from the version obtained from Inkscape.


Use that SVG with your MWE and you'll see "y = sin(x)" appearing in 
the right place in the PDF.


I would say the "translate(...)scale(...)" specification is not 
supported in LMTX (yet).
it is supported; i'll send you a snippet to test (as it was not really a 
minimal example)


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
___ 



ytest.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] SVG not rendering correctly with LMTX and conversion=mp

2021-10-18 Thread mf via ntg-context

Il 18/10/21 17:15, Jason Ross via ntg-context ha scritto:

The following MWE fails to render the text in the attached SVG properly:


\starttext
\externalfigure[test.svg][conversion=mp]
\stoptext


The axis labels, tick labels, and title are all incorrect. This file was
generated with Matplotlib.



If you open test.svg with Inkscape, ungroup and then save, you get a SVG 
that is typeset right with LMTX.


Looking at the differences between the two SVGs, I can see that Inkscape 
changes all the transform="translate(...)scale(...)" attributes into 
transform="matrix(...)".


Now focus on the "y = sin(x)" text.
In the attachment I modified the transform attributes of that text, from 
"translate(...)scale(...)" to "matrix(...)", taking the values from the 
version obtained from Inkscape.


Use that SVG with your MWE and you'll see "y = sin(x)" appearing in the 
right place in the PDF.


I would say the "translate(...)scale(...)" specification is not 
supported in LMTX (yet).


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] undefined command in current latest

2021-10-11 Thread mf via ntg-context
It looks like the argument of \getmarking is not expanded, since you get 
"\it knuth" instead of an italicized "knuth" in the headers of this MWE:


\definemarking[myheader]
\setupheadertexts[{\getmarking[myheader][last]}]
\starttext
  \dorecurse{10}{\samplefile{knuth}\marking[myheader]{\it knuth}\par}
\stoptext

context version: 2021.10.10 23:43

Massi


Il 11/10/21 09:06, Alexandre Christe via ntg-context ha scritto:
Indeed I can report similar issues with \getmarking after updating to 
the latest version of Context. Did something change regarding its 
definition / use recently?


context -version
mtx-context     | ConTeXt Process Management 1.04
mtx-context     |
mtx-context     | main context file: 
/Users/aleks/context-osx-64/tex/texmf-context/tex/context/base/mkiv/context.mkiv

mtx-context     | current version: 2021.10.08 20:18
mtx-context     | main context file: 
/Users/aleks/context-osx-64/tex/texmf-context/tex/context/base/mkxl/context.mkxl

mtx-context     | current version: 2021.10.08 20:18

Alex


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Addition of authortitle sorttype for bibliographies

2021-10-05 Thread mf via ntg-context

probably got lost when my mail address was in transition



I sent you some mails during that period that were not answered.
I thought it was a retaliation for not presenting anything at the meeting :)

Anyway I'll prepare an article on running ConTeXt inside a container 
that could eventually end in the current issue of CJ, since Hraban wrote 
that


> New articles are also welcome, as always!

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

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


Re: [NTG-context] new upload

2021-08-31 Thread mf via ntg-context

The problem on lowlevel-alignments.pdf is solved too.
Now the update process is OK again.
Thanks.
Massi

Il 30/08/21 20:01, Hans Hagen via ntg-context ha scritto:

On 8/30/2021 7:27 PM, Rik Kabel via ntg-context wrote:
The corrected upload (2021.08.30 16:23) still has an issue. The 
--autopdf option results in:


╰─► context --autopdf test.tex
lua error : function call: 
...TX/tex/texmf-context/scripts/context/lua/mtx-context.lua:488: 
attempt to call a nil value (global 'filenewsuffix')


Without autopdf things work as expected.

ok. new upload

(the installer for windows arm64 should now work too, as i just tested 
it on the rpi 4 with windows 11)


Hans


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

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


Re: [NTG-context] new upload

2021-08-30 Thread mf via ntg-context

There's a problem downloading lowlevel-alignments.pdf.
Here's a slice of the log of install.sh:

mtx-install | updating tex/texmf, 1530 files
mtx-install | updating tex/texmf-context, 4130 files
mtx-install | changed  :   0 % :27550 : 
tex/texmf-context/context/data/scite/context/lexers/data/scite-context-data-context.lua
mtx-install | changed  :   1 % :15493 : 
tex/texmf-context/context/data/scite/context/lexers/data/scite-context-data-tex.lua
mtx-install | changed  :   1 % :23670 : 
tex/texmf-context/context/data/scite/context/scite-context-data-context.properties
mtx-install | changed  :   2 % :13061 : 
tex/texmf-context/context/data/scite/context/scite-context-data-tex.properties
mtx-install | changed  :   2 % :27550 : 
tex/texmf-context/context/data/textadept/context/data/scite-context-data-context.lua
mtx-install | changed  :   3 % :15493 : 
tex/texmf-context/context/data/textadept/context/data/scite-context-data-tex.lua
mtx-install | changed  :   3 % :   150521 : 
tex/texmf-context/context/data/vscode/extensions/context/syntaxes/context-syntax-tex.json
mtx-install | added:   7 % :  199 : 
tex/texmf-context/doc/context/documents/general/manuals/lowlevel-alignments.pdf
mtx-install | 
tex/texmf-context/doc/context/documents/general/manuals/lowlevel-alignments.pdf, 
trying again:
mtx-install | added:   7 % :  199 : 
tex/texmf-context/doc/context/documents/general/manuals/lowlevel-alignments.pdf
mtx-install | 
tex/texmf-context/doc/context/documents/general/manuals/lowlevel-alignments.pdf, 
trying again:
mtx-install | added:   7 % :  199 : 
tex/texmf-context/doc/context/documents/general/manuals/lowlevel-alignments.pdf
mtx-install | 
tex/texmf-context/doc/context/documents/general/manuals/lowlevel-alignments.pdf, 
trying again:
mtx-install | added:   7 % :  199 : 
tex/texmf-context/doc/context/documents/general/manuals/lowlevel-alignments.pdf
mtx-install | 
tex/texmf-context/doc/context/documents/general/manuals/lowlevel-alignments.pdf, 
trying again:
mtx-install | added:   7 % :  199 : 
tex/texmf-context/doc/context/documents/general/manuals/lowlevel-alignments.pdf
mtx-install | 
tex/texmf-context/doc/context/documents/general/manuals/lowlevel-alignments.pdf, 
try again later:


After 5 unsuccessful trials to download the file, the updating process 
does not complete. The script ends without errors, but it's clear the 
update has failed.


Massi


Il 30/08/21 16:30, Hans Hagen via ntg-context ha scritto:

Hi,

new in this upload are some features in tabulate (not all enabled yet), 
like


\starttabulate[|lG{.}|cG{,}|rG{=}|cG{x}|]
\NC 1.1 \NC 2,2 \NC 3=3 \NC a 0xFF   \NC \NR
\NC 11.11   \NC 22,22   \NC 33=33   \NC b 0xFFF  \NC \NR
\NC 111.111 \NC 222,222 \NC 333=333 \NC c 0x \NC \NR
\stoptabulate

\starttabulate[|lG{}|lG{}|]
\NC \showglyphs \setalignmentcharacter{.}1.1 \NC 
\setalignmentcharacter{.}1.1 \NC\NR
\NC \showglyphs \setalignmentcharacter{,}11,11   \NC 
\setalignmentcharacter{,}11,11   \NC\NR
\NC \showglyphs \setalignmentcharacter{=}111=111 \NC 
\setalignmentcharacter{=}111=111 \NC\NR

\stoptabulate

\starttabulate[|lG{.}|lG{}|]
\NC 1.1 \NC \setalignmentcharacter{.}1.1 \NC\NR
\NC 11.11   \NC \setalignmentcharacter{.}11.11   \NC\NR
\NC 111.111 \NC \setalignmentcharacter{.}111.111 \NC\NR
\stoptabulate

\starttabulate[|lG{.}|rG{.}|]
\NC foo.bar \NC foo.bar \NC \NR
\NC  oo.ba  \NC  oo.ba  \NC \NR
\NC   o.b   \NC   o.b   \NC \NR
\stoptabulate

\starttabulate[|cG{d}|]
\NC \smallcaps abcdefgh \NC \NR
\NC  xdy    \NC \NR
\NC \sl  xdy    \NC \NR
\NC \tttf    xdy    \NC \NR
\NC \tfd  d \NC \NR
\stoptabulate

The G option is like g but better so it sort of replaces it.

updated: lowlevel-expansion   (also discusses luametatex)
new    : lowlevel-alignments  (also discusses luametatex)

Hans


-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___ 

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


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

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


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

maillist : 

Re: [NTG-context] error in mtxrun.lua line 4548 in August 24th update

2021-08-25 Thread mf via ntg-context

Il 25/08/21 14:06, Hans Hagen ha scritto:

On 8/25/2021 1:20 PM, mf via ntg-context wrote:

Il 25/08/21 13:06, Hans Hagen ha scritto:

On 8/25/2021 11:18 AM, mf via ntg-context wrote:

Hello,
here's the error I get:

lua error : function call: 
...si/context/lmtx-latest/tex/texmf-linux-64/bin/mtxrun.lua:4548: 
bad argument #2 to 'lpegmatch' (string expected, got nil)


BTW I was trying to compile lowlevel-expansion.tex in

tex/texmf-context/doc/context/sources/general/manuals/lowlevel

after I've seen (looking at the diffs in the git repo) there were 
some updates in the manual.
It works here ... can you try with the top line removed? Otherwise we 
need to zoom in on where it fails (some path split issue).

Yes, it's the runpath directive not working.

ok, so can you track that down in mtx-context.lua? (i know you can)



The problem is that the argument "one" is nil, but the function 
file.join checks only for one=="".


Lines 4541--4548:

4541  function file.join(one,two,three,...)
4542   if not two then
4543return one=="" and one or lpegmatch(reslasher,one)
4544   end
4545   if one=="" then
4546return lpegmatch(stripper,three and concat({ two,three,... 
},"/") or two)

4547   end
4548   if lpegmatch(isnetwork,one) then

At line 4545 you check only for one being an empty string, but it 
happens to be nil, so the program fails at line 4548.


Patching line 4545 like this:

4545   if not one or one=="" then

removes the error.

I leave to you whether the "one" argument should arrive nil to that 
line, or it should be normalized to an empty string before entering 
file.join.


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] error in mtxrun.lua line 4548 in August 24th update

2021-08-25 Thread mf via ntg-context

Il 25/08/21 13:06, Hans Hagen ha scritto:

On 8/25/2021 11:18 AM, mf via ntg-context wrote:

Hello,
here's the error I get:

lua error : function call: 
...si/context/lmtx-latest/tex/texmf-linux-64/bin/mtxrun.lua:4548: bad 
argument #2 to 'lpegmatch' (string expected, got nil)


BTW I was trying to compile lowlevel-expansion.tex in

tex/texmf-context/doc/context/sources/general/manuals/lowlevel

after I've seen (looking at the diffs in the git repo) there were some 
updates in the manual.
It works here ... can you try with the top line removed? Otherwise we 
need to zoom in on where it fails (some path split issue).

Yes, it's the runpath directive not working.
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
___


[NTG-context] error in mtxrun.lua line 4548 in August 24th update

2021-08-25 Thread mf via ntg-context

Hello,
here's the error I get:

lua error : function call: 
...si/context/lmtx-latest/tex/texmf-linux-64/bin/mtxrun.lua:4548: bad 
argument #2 to 'lpegmatch' (string expected, got nil)


BTW I was trying to compile lowlevel-expansion.tex in

tex/texmf-context/doc/context/sources/general/manuals/lowlevel

after I've seen (looking at the diffs in the git repo) there were some 
updates in the manual.


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
___