[NTG-context] Re: start/stopregister

2024-04-26 Thread Thomas A. Schmitz

On 4/26/24 10:22 AM, Hans Hagen wrote:



That's because mkii is AI enhanced. Can you try this:


Ah, I see where I was wrong, thank you! I'm mapping from xml, so I 
became confused with the optional parameters that I write as attributes, 
with a number of ifs... But now it should be clear!


All best

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: start/stopregister

2024-04-26 Thread Thomas A. Schmitz

On 4/26/24 9:30 AM, Thomas A. Schmitz wrote:
And here I am again! Both in mkiv and in mkxl, start/stopregister does 
not work when there is already an index entry before. Example below!


All best

Thomas

\setuppapersize [A6]

\starttext
     A\index{A} B \page
     A\startregister [index] {A} B\startregister [index] [B] {B}
     \dorecurse {10} {\input tufte}
     A\stopregister [index] {A} B\stopregister [index] [B]

\page

\placeregister[index]

\stoptext


And I'm not even sure if this is allowed to say anymore, but: works in 
mkii...


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: start/stopregister

2024-04-26 Thread Thomas A. Schmitz

On 4/25/24 6:27 PM, Thomas A. Schmitz wrote:
Ah, simple typo! After fixing abel to label, startregister gives the 
expected results again! Thanks Hans! I may be back with more register 
questions soon...


And here I am again! Both in mkiv and in mkxl, start/stopregister does 
not work when there is already an index entry before. Example below!


All best

Thomas

\setuppapersize [A6]

\starttext
A\index{A} B \page
A\startregister [index] {A} B\startregister [index] [B] {B}
\dorecurse {10} {\input tufte}
A\stopregister [index] {A} B\stopregister [index] [B]

\page

\placeregister[index]

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: start/stopregister

2024-04-25 Thread Thomas A. Schmitz

On 4/25/24 18:16, Hans Hagen wrote:
Let's seen if we can make Thomas more of an expert as he's zooming in on 
the issue:


     extendregister {
     metadata   = { name =  name },
     references = { abel =  label },
     }

Let me know if you't see it.


Ah, simple typo! After fixing abel to label, startregister gives the 
expected results again! Thanks Hans! I may be back with more register 
questions soon...


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: start/stopregister

2024-04-25 Thread Thomas A. Schmitz

On 4/25/24 16:13, Henning Hraban Ramm wrote:

I’m using it like

\startregister[index][bibliografie]{Bibliografie}
…
\stopregister[index][bibliografie]

i.e. very similar to your example, and can confirm it doesn’t result in 
a page range in the index. Also gives no error.


Since I've become an expert on tuc files since yesterday (ha!): if I 
compare the tuc from a mkiv and a mkxl run, I see that mkiv produces an 
entry ["lastrealpage"]=9 in the references table, mkxl doesn't. This 
appears to be the relevant bit, and it is connected with the replacement 
of realpageno by c_realpageno in line 638 of strc-reg.lmt


references.lastrealpage = texgetcount(c_realpageno)

But that's as far as I could get...

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] start/stopregister

2024-04-25 Thread Thomas A. Schmitz

Hi all,

has \startregister been superseded in luametatex or is it not yet 
implemented? I tried to read strc-reg.lmt but couldn't figure out what 
is going on. The following silly minimal test produces the expected 
result with mkiv but not in mkxl.


All best

Thomas

\setuppapersize [A6]

\starttext
A\index{A} B\startregister [index] [B] {B}
\dorecurse {10} {\input tufte}
A\index{A} B\stopregister [index] [B]

\page

\placeregister[index]

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: utiliydata

2024-04-25 Thread Thomas A. Schmitz

> 
> Nope, very sorry, can’t figure it out… I see job.register, I see I can access 
> structures.refrences.collected, but what about the next level
> 
> utilitydata.structures.references.collected={
> [""]={
>  [“REF"]={
> 
> What does the empty key do? And how do I retrieve the value of
> 
> REF.references.realpage?
> 
> Thomas

Sigh, as always: just when I had hit “send,” I figured it out:

structures.references.collected[""][REF].references.realpage

But I’m not sure if there is an easier/better way. And I still would like to 
know what the empty string as key does.

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: utiliydata

2024-04-25 Thread Thomas A. Schmitz

> On 24. Apr 2024, at 17:59, Hans Hagen  wrote:
> 
> grep for "job." (i bet you can figure it out and compensate the embaressment 
> that way)
> 
> Hans

Nope, very sorry, can’t figure it out… I see job.register, I see I can access 
structures.refrences.collected, but what about the next level

utilitydata.structures.references.collected={
 [""]={
  [“REF"]={

What does the empty key do? And how do I retrieve the value of

REF.references.realpage?

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] utiliydata

2024-04-24 Thread Thomas A. Schmitz
Hi all,

I’m slightly embarrassed because this should be easy, but I can’t figure out 
how to do this: in the tuc/tua file, I have the complete references of my 
document. How can I access it from within my Lua code? For instance, something 
like 

utilitydata.structures.references.collected.”MyReference”.references.realpage

How can this be accessed?

Thanks a lot and best wishes

Thomas

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Wiki - test/proposal to further clarify documentation

2024-04-17 Thread Thomas A. Schmitz


> On 16. Apr 2024, at 21:56, Peter Hopcroft via ntg-context 
>  wrote:
> 
> 
> 
>> On 17/04/2024, at 7:11 AM, Henning Hraban Ramm  wrote:
>> 
>> In my poster (still WIP) I wrote:
>> …
> 
> Excellent

No, I must admit I don’t like the first two paragraphs. The question is “what 
is ConTeXt,” and the answer is “we’re not LaTeX.” And why “infamous”? 

Thomas

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Is TIFF image no longer supported?

2024-04-14 Thread Thomas A. Schmitz

On 4/14/24 22:18, Thomas A. Schmitz wrote:




I don't think tiff has ever be supported?

Thomas


s/be/been/ Sorry!

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Is TIFF image no longer supported?

2024-04-14 Thread Thomas A. Schmitz

On 4/14/24 22:11, Joel via ntg-context wrote:
I have a document with PNG, JPG, and TIFF. When I try using 
\externalfigure[filename][frame=on, width=.\textwidth] it displays 
JPG and PNG fine, but the TIFF files don't render. Is TIFF not supported 
in ConTeXt anymore? --Joel


I don't think tiff has ever be supported?

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Very bizarre bug

2024-04-07 Thread Thomas A. Schmitz

On 4/7/24 22:33, Hans Hagen wrote:

No problem, is it a rpi 5? If so, how does that one perform?


Yes, it's a Pi 5 with 8GB of RAM, and I'm very satisfied with the 
performance. I use it headless for backup, file serving, and the 
occasional context job that ties the cpu up for a long time, and it's 
plenty fast for what I do with it. Runs less hot than the 3B that I have 
in my office for the same purpose (and supposedly the 4, but I've never 
had one of those).


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Very bizarre bug

2024-04-07 Thread Thomas A. Schmitz

On 4/7/24 19:44, Hans Hagen wrote:
ok, so this "on" ... where does it come from .. you can try to run with 
\tracingall and then quit the run after the first and search the log for 
!on to get a clue


Hans


Found it - and I'm embarrassed to say it was in my own environment file, 
not in the lmtx distribution. I have a Lua function that prints 
information about the computer model and the operating system into a 
layer. Unfortunately, there was an "elseif" in there somewhere which 
should catch exceptions (such as a raspberry pi), but instead of 
concatenating the relevant return values to display in the layer, I had 
a ' context (" on ")' in there (probably for debugging) which I forgot 
about.


Sorry for the noise - I was getting too sophisticated for my own good...

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Very bizarre bug

2024-04-07 Thread Thomas A. Schmitz

On 4/7/24 19:21, Hans Hagen wrote:
can you make a format with line 25 of context.mkxl uncommented to see if 
you get a message (not production, just a test)


Hans


That should give a message "some spurious input in line..." in the 
output or the log, right? No, did not see such a message.


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Very bizarre bug

2024-04-07 Thread Thomas A. Schmitz

Hi everybody,

this is bizarre, but hear me out: a file that I have has a mixture of 
xml, TeX and Lua. It compiles cleanly, no problem, on macos and linux. I 
also have a little raspberry pi on which I have installed lmtx. The file 
compiles, BUT: it has one additional page. The first page of the 
document is empty and has the word "on" in the upper left hand corner of 
the text area. I have checked several times, it always comes out like 
this. Everything else is exactly the same - context version, file and 
environment files (everything under git, so really identical). The "on" 
does not appear if I just make a "hello world" document on the raspi. So 
my question is: how can I begin to explore where this word creeps in? I 
suspect it's something in the linux-aarch64 tree or some test for this 
architecture that is the culprit, but what would be a good way to trace it?


All best

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Issue with italics

2024-02-26 Thread Thomas A. Schmitz
I just tried your example with the latest version of GFSDidot (the older 
version I had on my system did not show some diacritics; this problem 
disappeared when I installed the latest), and the italics are there, I don’t 
see any problem in the pdf. If you want the Greek displayed in Theano, you will 
have to add “force=yes” to your definition of the fallback family:

\definefallbackfamily
[mainface]
[rm]
[Theano Didot]
[preset=range:greek,force=yes]

Your text cannot have two main languages, so 

\mainlanguage[fr]

If you want hyphenation for your Greek passages, you can add

\setuplanguage [fr] [patterns={fr,agr}]

The line where you have polytonic Greek does not use precomposed characters, 
but combinations of greek characters and diacritics; this will probably not 
work in recent context versions that expect actual unicode input. 

I hope I have really understood what you want: GFSDIdot for the French text and 
Theano for Greek?

HTH

Thomas

> On 26. Feb 2024, at 13:32, Jean-Pierre Delange  wrote:
> 
> Dear list,
> 
> When handling the preamble to a document in which I would like to treat the 
> text in French, with sometimes italics text and phrases in ancient Greek, I 
> encounter the following difficulty:
> if I use TeX Gyre Pagella as the main font, everything works fine, except for 
> the Ancient Greek text, which I don't like the look of. But the Greek text is 
> displayed, as are the French italics. On the other hand, if I use GFS Didot 
> as the main font and Theano Didot for the Greek, the italics disappear and 
> the Greek text looks better. The CTX version I use is: mtx-context | current 
> version: 2024.01.24 22:39.
> 
> Herewith are two MWE attachments (*.tex + *.pdf) with different fonts. What 
> am I missing ? Thanks for your answers.
> 
> JP



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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: upload

2024-01-23 Thread Thomas A. Schmitz

Hi Otared,

I just tried, and my Macbook ran the update without any problem. Does it 
make any difference if you chmod +x the script install.sh?


All best

Thomas

On 1/23/24 21:59, Otared Kavian wrote:

Hi Dr Hans Van der Meer,

Thank you for your help. It seems that since January 18 something has
changed (either on MacOS or on the install script), because the last
time I could update without doing anything more than sh install.sh.

In any case I checked xattr with
which xattr
and got:
/usr/bin/xattr

Then I did
xattr -d com.apple.quarantine
/Applications/context-osx-arm64/install.sh
and got:
xattr: /Applications/context-osx-arm64/install.sh: No such xattr:
com.apple.quarantine

Invoking again sh install.sh resulted in the error message I reported
previously.

Best regards: Otared



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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Named characters

2024-01-15 Thread Thomas A. Schmitz

Hi all,

not a complaint, just a question (for Hans and Wolfgang, I guess): in 
recent versions of lmtx, Greek named characters (constructs such as 
\greekdasiatonos) don't work any more. Which means I have to adapt some 
of my older macros. Is this an oversight or did they get axed?


All best

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: How can I use a variable for a MetaPost coordinate ?

2023-10-05 Thread Thomas A. Schmitz
Have a look at chapter 6.4 of the metafun manual. You need StartPage ... 
StopPage in your MPcode, then you can knock yourself out by using 
variables such as PaperHeight or TextHeight and do all sorts of 
calculations.


All best

Thomas

On 10/5/23 05:54, peter.hopcroft--- via ntg-context wrote:
Hello list, I want to draw lines on a page. I want to pass my line 
coordinates as a percent of \width or \textheight, rather than as 
millimetres. So that if I change the page size I don't need to change 
the coordinates. The MWE below compiles but the pdf does not have any 
lines drawn on it. Is there a way of doing calculations on the 
coordinates for the draw using ConTexT variables like \textheight? Thank 
you, Peter Hopcroft



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

maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id}
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context 
wiki : https://wiki.contextgarden.net

___


[NTG-context] Re: Offline documentations

2023-10-02 Thread Thomas A. Schmitz

On 02.10.23 10:32, Juliano David Hilario wrote:
If I were to download the entire wiki with the exception of the 
discussion files and the user pages, do you think it would be wise? I 
would try to make it dynamically updatable too, if possible, and also 
try to make as offline-friendly as the Python docs. Do you think that 
would be wise? Thank you for your help, the wiki is very useful.


That doesn't answer your question if it would be wise, but if you manage 
to write a script that would create an archive of the wiki in a useful 
format for off-line browsing and keep it reasonably up to date, that 
would be a wonderful thing to have. I regularly find myself in 
situations where I don't have internet access and would love to have a 
look at the wiki.


On the other hand: there is a lot of cruft on the wiki, badly outdated 
pages that relate to mkii etc. But selecting the ones that are good and 
getting rid of the others would be a huge amount of work...


Thomas

___
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] Re: xmldoif: checking for contents of attribute

2023-08-24 Thread Thomas A. Schmitz
One way would be to do the search in Lua; when you have multiple searches to 
perform, that may be the easiest way to go. For example:

\startxmlsetups xml:test
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{doc|element}{xml:*}
\stopxmlsetups
 
\xmlregisterdocumentsetup{test}{xml:test}
 
\startxmlsetups xml:doc
\xmlflush{#1}
\stopxmlsetups
 
\startxmlsetups xml:element
 \xmlfunction {#1} {element}
\stopxmlsetups
 
\startluacode
function xml.functions.element (t)
 if t.at.class and t.at.class:find ("abc") then
context.startcolor { "blue" }
lxml.flush (t)
context.stopcolor ()
 else
context.startcolor { "red" }
lxml.flush (t)
context.stopcolor ()
 end
end
\stopluacode 
 
\startbuffer[test]


Yes
No

\stopbuffer
 
\starttext
 
\xmlprocessbuffer{test}{test}{}
 
\stoptext

Hope that gets you started.

Thomas

> On 24. Aug 2023, at 16:11, denis.ma...@unibe.ch wrote:
> 
> Hi,
>  I’m trying to check whether an attribute contains (or, actually starts with) 
> a given string.
> I’ve tried a whole bunch of different combinations, but I’ve had no luck so 
> far. Minimal example below. Anyone has a hint?
>  Best,
> Denis
>   %
> \startxmlsetups xml:test
> \xmlsetsetup{#1}{*}{-}
> \xmlsetsetup{#1}{doc|element}{xml:*} \stopxmlsetups
>  \xmlregisterdocumentsetup{test}{xml:test}
>   \startxmlsetups xml:doc
> \xmlflush{#1}
> \stopxmlsetups
>  \startxmlsetups xml:element
> \xmlfilter{#1}{./find(attribute('class'), 'abc')/command(xml:whatever)}
>  \xmldoifelse{#1}{./attribute('class')/contains('abc')} {Yes}{No}
> \stopxmlsetups
>  \startxmlsetups xml:whatever
> Yes
> \stopxmlsetups
>  \startbuffer[test]
> 
> 
> Yes
> No
> 
> \stopbuffer
>  \starttext
>  \xmlprocessbuffer{test}{test}{}
>  \stoptext


___
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] Re: MAPS nr 53

2023-08-23 Thread Thomas A. Schmitz

On 22.08.23 21:16, Hans Hagen wrote:

On 8/22/2023 8:24 PM, Keith McKay wrote:

Would it be possible to list the contents to whet our appetites?
the successive chapters are basically the long articles that taco wrote 
about mp fundamentals for ctx meetings / journal + one extra


Hans


I just got mine in the mail and hope that Taco is reading this: wow, 
this is really amazing. Very helpful and gently didactic, really an 
excellent read. This will keep me busy for a long time. Thanks, Taco!


Thomas

___
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] Re: XML processing beginner's question

2023-08-21 Thread Thomas A. Schmitz

On 8/21/23 18:36, Michael Löscher wrote:
Thank you so far. But what I would like to understand first ist how the 
different setups work togehter. How are they processed? What is the 
order of processing, which are the stets taken by the enginge when 
processing an xml document? Without understanding how that works, it is 
not possible to apply certain tests on the xml nodes.


As the manual mk.pdf, chapter XVII states: it's a mixture of streaming 
parser and tree manipulation. The whole xml document is transformed into 
a Lua table and then processed. But I definitely get the "do my homework 
for me" vibe, so this will be all from me.


Thomas

___
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] Re: XML processing beginner's question

2023-08-21 Thread Thomas A. Schmitz

On 8/21/23 17:59, Michael Löscher wrote:
Yes, I have done that. But I don't seem to have the basic context of how 
the processing works in order. All I have so far is this as a starting 
point:


Really? I told you about the various commands \xmldoif, but there's 
nothing in your starting point. I don't want to provide anybody homework 
solutions, so just to give you an idea to get you started:


\startxmlsetups xml:mysetup
\xmlsetsetup{main}{document|element|mdata|tdata|name|date|num|content|shortdescription|p}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:mysetup}

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

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

\startxmlsetups xml:mdata
\xmldoifelsetext {#1} {/date}
{{\bf \xmltext {#1} {name}}\par
{\it \xmltext {#1} {date}}\par}
{\xmltext {#1} {content}\par}
\stopxmlsetups

This will process the name in bold and the date in italic. But I'm sure 
you can do better after reading and digesting the chapter I referred to.


Thomas

___
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] Re: XML processing beginner's question

2023-08-21 Thread Thomas A. Schmitz
Have you looked at chapter 3.10 "Testing" of the manual xml-mkiv.pdf? 
There are a lot of commands there that should help you, such as


\xmldoiftext {#1} {/mdata/date}
 {\bf \xmlflush {#1}}

or \xmldoifelsetext.

There's also \xmlfilter, which you can use to test for the content of 
tags. And of course, you can process in Lua and search for strings or 
use lpeg. However, your question is a bit vague now. Show us some code 
you have and we can take it from there; that's easier than writing the 
whole setup for you.


Thomas


On 8/21/23 17:29, Michael Löscher wrote:

Hello list,

having the xml data at the bottom, I would like to process it so that 
the result is like this:


---
What it is (e.g. bold formatted)
date: 2023-08-01 (italic)
Description (small font size)
Another text (small font size)

hd1 - Header 1

§ 1 First  (A first short description)
AA
BB

§ 2 Second (A second short description)
CC
DD

§ 3 Third (A third short description)
EE
FF
---

How can I process the s differently? The first element contains 
a  tag and so it differs from the other ones. The second element's 
 tag contains the word "Header" which makes it different again. 
The other elements contain a  tag that they all have 
in common.


What could be the appropriate xml setups to generate the above output?

Michael

---
xml data:
\startbuffer[xmlcontent]


   
     
   What it is
   2023-08-01
     
     
   
     Description
     Another text
   
     
   
   
     
   hd1
   Header 1
     
     
   
     Text of Header 1
   
     
   
   
     
   1
   First
   A first short description
     
     
   
     AA
     BB
   
     
   
   
     
   2
   Second
   A second short description
     
     
   
     CC
     DD
   
     
   
   
     
   3
   Third
   A third short description
     
     
   
     EE
     FF
   
     
   

\stopbuffer



___
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] Re: redefine space to be the same as \␣ similar to knuthian approach

2023-08-21 Thread Thomas A. Schmitz

On 8/21/23 14:22, Carlos wrote:


fuck this shit.

The first reaction would of course be to respond in the same tone. I 
think it would be wrong.


You should be aware that to most of us, your messages sound like they 
come from a sociopath. Nothing in the subject we're talking about 
warrants this level of anger and emotion - these are just computer 
programs; the future of our world does not depend on redefining a 
typographical space. You may want to seek professional psychological help.


Thomas

___
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] Re: hyphenation inside quotation

2023-08-19 Thread Thomas A. Schmitz

On 8/19/23 17:51, Wolfgang Schuster wrote:


You can use the font method to have hyphenated words back.
The culprit which prevents hyphenation are the penalty settings
which are added by ConTeXt when the default method is used.

\mainlanguage [de]

\setuppapersize [A6]

\setupquotation[method=text]


Hi Wolfgang,

as always, thanks for the precise explanation. Is there a reason why 
this behavior is not the default? I.e.: in what situations would the 
default behavior be (more) desirable? Or is it just because 
\setupquotation is a subset of \setupdelimitedtext?


All best

Thomas

___
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] hyphenation inside quotation

2023-08-19 Thread Thomas A. Schmitz

Hi,

is this a limitation or a bug? Text inside \quotation{} is not 
hyphenated. It appears to be like this for a couple of versions, but I'm 
not sure if it has always been the case. Silly example to test:


\mainlanguage [de]

\setuppapersize [A6]

\setupbodyfont [14pt]

\starttext

„Originalgenie“ „Originalgenie“ „Originalgenie“

\quotation{Originalgenie} \quotation{Originalgenie} 
\quotation{Originalgenie}


\stoptext

All best

Thomas
___
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] side-by-side paragraphs broken?

2023-08-13 Thread Thomas A. Schmitz

Hi,

in more recent versions of lmtx, the side-by-side mechanism appears to 
be broken; example below. The right-hand paragraph does not respect the 
margin and backspace setting. The output looks fine in mkiv and with 
older versions of lmtx (the one from texlive, so 2023.03.10). Not sure 
if this has been reported yet.


All best

Thomas

\setuppapersize[A4,landscape]

\setuplayout[height=fit,
 width=middle,
 header=0cm,
 footer=0cm,
 leftmargin=2cm,
 topspace=1.2cm,
 backspace=1.5cm]

\showframe

\defineparagraphs[Half] [n=2]
\setupparagraphs [Half]

[before=,after=,distance=3em,align={normal,hanging},tolerance={stretch,verytolerant}]
\setupparagraphs [Half]
 [1]
 [width=0.43\textwidth,tolerance={stretch,verytolerant}]
\setupparagraphs [Half]
 [2]

[rulethickness=2mm,rulecolor=gray,rule=on,tolerance={stretch,verytolerant}]

\starttext

\startHalf
\input ward
\nextHalf
\input knuth
\stopHalf

\stoptext
___
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] Re: ideas for ConTeXt stickers?

2023-08-07 Thread Thomas A. Schmitz

On 8/7/23 20:08, Hans van der Meer via ntg-context wrote:
Please phrase your reaction differently. This is absolutely not about my 
sense of humor. But if you have observed the news media these last few 
years, you may have noticed how sensitive the public opinion has become 
about "humor" of this kind.  I am afraid it could place the Tex 
community (for which I care) in a less favourable light.


I must say I agree with Hans van der Meer here. For me, this sounds like 
middle school humor; I can't imagine any actual grown-up finding this 
funny. But I'm overall not convinced that such stickers make our world a 
better place. They have a tendency to wind up in places where you don't 
want to see them. So my two cents on your question: don't. They're worse 
than useless.


Thomas
___
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] Re: Problem with latest

2023-07-20 Thread Thomas A. Schmitz


> On 20. Jul 2023, at 17:38, Hans Hagen  wrote:
> 
> patch in that file:
> 
>local popen   = io.popen
> 

Thank you, that fixes it!

Thomas
___
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] Problem with latest

2023-07-20 Thread Thomas A. Schmitz
Hi everybody,

The latest (2023.07.18 22:07) has a consistent problem with all files on my 
computer; every run has this:

fatal lua error:

registered function call [1715]: 
...s/lmtx/tex/texmf-context/tex/context/base/mkxl/l-lua.lmt:84: attempt to call 
a nil value (upvalue 'popen’)

Does anyone else see this as well?

All best

Thomas

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

2023-07-19 Thread Thomas A. Schmitz

Hi everybody,

just a short question: I was under the impression that ConTeXt would not 
look for system fonts unless we set OSFONTDIR explicitly; this appears 
to be the basis of the page Use_the_fonts_you_want on the wiki, and I 
prefer this behavior because it lets me control the fonts I want to use. 
Recently, however (when exactly? I don't know.) this seems to have 
changed, and ConTeXt now searches the system font directories by 
default. I found this out because one of my documents is set up to use 
the STIX2 fonts. In the most recent versions of macos, some files of 
these fonts are included as system fonts under 
/System/Library/Fonts/Supplemental, but not all of them. It took me some 
head scratching to figure out why every run complained about missing 
glyphs until I saw that ConTeXt was using the wrong font. I had to set 
the variable OSFONTDIR to some value to prevent this from happening. So 
my question is: is looking for system fonts by default the new standard? 
Is it a good idea?


Thank you and all best

Thomas
___
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] Super slow installation

2023-05-30 Thread Thomas A. Schmitz via ntg-context

On 5/30/23 18:07, Thangalin via ntg-context wrote:

Still sluggish. Downloading texmf.zip took 22s for 50MB:

$ wget http://lmtx.pragma-ade.com/install-lmtx//texmf.zip 

--2023-05-30 09:02:50-- 
http://lmtx.pragma-ade.com/install-lmtx//texmf.zip 

Resolving lmtx.pragma-ade.com  
(lmtx.pragma-ade.com )... 213.125.29.165
Connecting to lmtx.pragma-ade.com  
(lmtx.pragma-ade.com )|213.125.29.165|:80... 
connected.

HTTP request sent, awaiting response... 200 OK
Length: 53293716 (51M) [application/zip]
Saving to: ‘texmf.zip’

texmf.zip           100%[===>]  50.82M  2.48MB/s    in 22s

2023-05-30 09:03:13 (2.26 MB/s) - ‘texmf.zip’ saved [53293716/53293716]

In the past, downloading 50MB has been much faster.



Couldn't it be something on your side, like a misconfigured router or ad 
blocker or something? I get faster download times:


wget http://lmtx.pragma-ade.com/install-lmtx//texmf.zip
--2023-05-30 18:12:43--  http://lmtx.pragma-ade.com/install-lmtx//texmf.zip
Resolving lmtx.pragma-ade.com (lmtx.pragma-ade.com)... 213.125.29.165
Connecting to lmtx.pragma-ade.com 
(lmtx.pragma-ade.com)|213.125.29.165|:80... connected.

HTTP request sent, awaiting response... 200 OK
Length: 53293716 (51M) [application/zip]
Saving to: ‘texmf.zip’

texmf.zip   100%[===>]  50,82M  4,85MB/sin 
11s


2023-05-30 18:12:53 (4,82 MB/s) - ‘texmf.zip’ saved [53293716/53293716]

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

2023-04-22 Thread Thomas A. Schmitz via ntg-context
Thank you, Pablo, but that doesn't help. I know how to use fallback 
fonts. I was wondering if the check key is working as it should.


Thomas

On 4/22/23 20:33, Pablo Rodriguez via ntg-context wrote:

Hi Thomas,

I don’t know what check does (maybe just check?), but the standard
behaviour with \definefallbackfamily is only to fall back when the
character is missing from the main font.

To force all characters from the range in the fallback font, "force=yes"
is required.

Here you have a minimal sample (which doesn‘t use "preset=range:greek"),
adding "force=yes" gets all Greek glyphs from GFS Heraklit:

   \definefallbackfamily [presentation] [serif] [GFSHeraklit]
   [range={greekandcoptic, greekextended}]
   \definefontfamily [presentation] [serif] [TeXGyrePagella]
   \setupbodyfont [presentation,12pt]

   \starttext
   Pπμᾷσδ
   \stoptext

Just in case it might help,


--
Prof. Dr. Thomas A. Schmitz
Institut für Klassische und Romanische Philologie
Universität Bonn
Am Hof 1e
53113 Bonn
http://www.philologie.uni-bonn.de/de/personal/schmitz

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

2023-04-22 Thread Thomas A. Schmitz via ntg-context

Hi all,

today, I was struggling with a fallback font I had defined, and I 
discovered that the key "check" doesn't work as I expected. Here's a 
small example:


\definefallbackfamily [presentation] [serif] [TeXGyreTermes] 
[range=0x2329-0x232A,check=yes]

\definefontfamily [presentation] [serif] [AntykwaTorunska]
\setupbodyfont [presentation,12pt]

\starttext

(〈P〉)

\stoptext

With this input, the two characters 〈 and 〉 are not typeset; in the log, 
I find


fonts   > checking > char 〈 (U+02329) in font 
'AntykwaTorunska-Regular' with id 1: missing
fonts   > checking > char 〉 (U+0232A) in font 
'AntykwaTorunska-Regular' with id 1: missing


If I have "check=no," the characters are taken from termes and replaced. 
I was under the impression that "check" should, well, check if the 
characters are not in the main font and fall back to the fallback font 
if they are not, but this doesn't appear to be the case. So what does 
"check" do? Or is this a bug?


Have a great weekend

Thomas
___
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] xmlsetentity on the fly?

2023-04-17 Thread Thomas A. Schmitz via ntg-context
Use \xmltexentity

Thomas

> On 17. Apr 2023, at 12:32, Hans van der Meer via ntg-context 
>  wrote:
> 
> I would like to change an entity 'on the fly'. Example


___
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] meta-imp-fen in mkxl?

2023-03-30 Thread Thomas A. Schmitz via ntg-context

Hi all,

I wanted to use a rightbrace as background for a table, as defined in 
meta-imp-fen.mkiv. Unfortunately, I can't get it to work, for 2 reasons:


1. meta-imp-fen doesn't appear to be ported to mkxl.

2. When I try to compile with the --luatex switch, I get this error message:

tex error   > tex error on line 101 in file 
/mnt/shared/lmtx/tex/texmf-context/tex/context/base/mkiv/meta-imp-dum.mkiv: 
! Undefined control sequence


l.101 \newinteger
   \c_grph_replacement_n


So, I'm a bit stymied right now. What can be done?

All best

Thomas
___
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] rewrite for Greek in the wiki

2023-01-21 Thread Thomas A. Schmitz via ntg-context

Hi Pablo,

thanks for this; it is very informative and clear. Just one short remark 
and one correction:


1. "Before 1982, Greek ort[h]ography was polytonic." That's a bit of an 
oversimplification. I'm no expert here, but I think many Greek print 
publications had already given up on using circumflex and grave accent 
or at least greatly simplified their use; the law of 1982 simple 
codified what had been developing for some time. Your sentence makes it 
sound like a sudden and random decision.


2. I think it would be worth pointing out that unfortunately, Greek 
lowercase letters with acute accent occur separately in two unicode 
blocks: the combinations in U+03AC-U+03AF and U+03CC-U+03CF ("Greek 
small letter X with tonos") are functionally identical to the 
combinations in the U+1F7 block ("Greek small letter X with acute 
accent"). This is a source of confusion both in fonts and in 
programming, because some programs normalize these letters, so for 
string operations and searches, you may obtain surprising results.


Thank you for the article!

Thomas

On 1/21/23 13:16, Pablo Rodriguez via ntg-context wrote:

Dear list,

just in case it might help, I’ve rewritten the Greek entry in the wiki:

   https://wiki.contextgarden.net/Greek

Although nobody seemed to have mentioned them (afaIk), there are two issues:

1. Hyphenation patterns are different for ancient, monotonic and modern
polytonic Greek. Greek ortography was polytonic before 1982.

ConTeXt includes patterns for ancient and monotonic Greek, but none for
modern polytonic Greek
(http://mirror.ctan.org/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/hyph-el-polyton.tex).

Ironically, modern polytonic Greek patterns would be required to typeset
both the act and the decree that introduced the monotonic ortography.

2. Greek doesn’t seem to have language-dependent commands (such as
\currentdate).

In both cases, Hans will reply that nobody asked for any of them.

Of course, I totally agree. AfaIk, nobody asked for these features.

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 / 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] Trouble with latest...

2023-01-08 Thread Thomas A. Schmitz via ntg-context

On 1/8/23 21:02, Wolfgang Schuster via ntg-context wrote:

You luametatex binary is too old and fails on the new \advanceby command.

When I tried to update my current installation a few moments ago the 
updater also failed to load the new luametatex binary (I haven't tried 
to regenerate the format files) but a fresh installation works without 
problems.


Wolfgang


Thank you, Wolfgang, will try with a fresh installation. Now that you 
mention it, I see some error messages in the log


mtx-install | changed  :   0 % :  3360848 : 
tex/texmf-linux-64/bin/luametatex

mtx-install | tex/texmf-linux-64/bin/luametatex, try again later:

All best

Thomas
___
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] Trouble with latest...

2023-01-08 Thread Thomas A. Schmitz via ntg-context
Hi all,

I tried upgrading to the 2023 version, but generating the format fails with 
lots of these messages:

! Control sequence expected instead of undefined.
 \syst_basics_allocate_yes  #1#2#3#4#5->\ifnum #1<#4\relax \global 
\advanceby  #1\plusone \permanent \global #3#5=#1\relax \else \writestatus 
{warning}{no room f
  \newmuskip   \scratchmuskip
 \newmuskip   \globalscratchmuskip  \newmuskip   \privatescratchmuskip

! Control sequence expected instead of undefined.
 \syst_basics_allocate_yes  #1#2#3#4#5->\ifnum #1<#4\relax \global 
\advanceby  #1\plusone \permanent \global #3#5=#1\relax \else \writestatus 
{warning}{no room f
 

But I was surprised that nobody else had seen it yet. Can anyone confirm (or 
yell “works for me!”)?

All best

Thomas
___
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] TUG 2023

2023-01-04 Thread Thomas A. Schmitz via ntg-context

Hi everybody,

an excellent year 2023 to all of you - I hesitate to say "it can only 
get better from 2022." That's what we thought last year, and boy were we 
wrong and did it get worse... Let's hope that this year will be more 
peaceful and less pandemic...


But to my topic: the official announcement for TUG 2023 is out. It will 
be in Bonn, Germany, in a building literally (literally!) just across 
the street from my university office. So I feel somewhat motivated to go 
and give a talk on ConTeXt and spread the word. Since I'm a simple user 
and no developer, I'm a bit hesitant though: is any of the developers 
going (Hans?)? Since the public will be 99 % LaTeX-centric: I had the 
idea of showing (off) how ConTeXt can typeset xml and produce different 
outputs from the same source (similar to what I've done in Bassenge in 
2019). Those of you who have been to TUG conferences before: would that 
be of interest even to people who know little to nothing about ConTeXt 
yet are familiar with other forms of TeX? I guess I just what to get a 
feeling what to expect at a TUG conference.


All best wishes

Thomas
___
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] Heisenbug in current?

2022-11-23 Thread Thomas A. Schmitz via ntg-context

On 11/23/22 23:25, Hans Hagen via ntg-context wrote:

probably not that random ... can you put this on top of font-otr.lua

local number = number

and see if that helps .. if so you can then spend the rest of the 
evening figuring out where 'number' gets defined global


Yup, that seems to help! Thank you for the quick fix - I could swear it 
would pop up randomly, and sometimes not at all. As for the global 
definition - that will have to wait till tomorrow. I just had to take a 
painkiller because my back hurts and start feeling very tired... Thanks, 
as always!


Good night everybody

Thomas
___
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] Heisenbug in current?

2022-11-23 Thread Thomas A. Schmitz via ntg-context

Hi all,

I'm very hesitant to report this because I can't reproduce it 
consistently: some of my files don't compile with bizarre font errors, 
sometimes. At first I thought it may be a hardware problem on my laptop, 
but I've seen more or less the same error on 3 different computers now, 
intermittently. The offending call is always similar:


fonts   > otf loading > loading 
'/mnt/shared/lmtx/tex/texmf/fonts/data/public/dejavu/DejaVuSansMono.ttf', 
hash 'dejavusansmono'
otf reader  > fatal error in file 
'/mnt/shared/lmtx/tex/texmf/fonts/data/public/dejavu/DejaVuSansMono.ttf': 
...e0dde776fb1556f32e/formats/luametatex/font-otr-macro.lua:1040: 
attempt to call a nil value (field 'to16dot16')


It concerns several fonts, both my own and (as here) from the 
installation, and the first error is always this "field 'to16dot16.'" 
Has anybody else seen this? Do the developers have any idea what this 
could be? Has there been a change in the code concerning this field?


Sorry for being so vague, but I'm pulling my hair  because this error 
crops up totally at random, AFAICS.


All best

Thomas
___
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-21 Thread Thomas A. Schmitz via ntg-context

On 11/20/22 19:19, Thomas A. Schmitz via ntg-context wrote:
I load data from an external xml file (not the one I'm processing) and 
store some of it in a lua table.


local examples = lxml.load ("my_examples", "examples.xml")


Replying to myself, and sorry for the noise (this was fairly easy, 
should have seen it earlier):


instead of loading the file "examples.xml," I simply include it via 
xmlinclude into the tree; this way the proper setups are applied.


All best

Thomas
___
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-20 Thread Thomas A. Schmitz via ntg-context

On 11/17/22 11:04, Hans Hagen via ntg-context wrote:


so, basically you collect data and use it later ... for huge datasets 
that saves some time


if you have only chapters to process you can even decide to flush in 
that function


Alright, I'm making very good progress here, but right now I'm stumbling 
upon a problem I can't solve. It's difficult to make a minimal example, 
so bear with some snippets.


I load data from an external xml file (not the one I'm processing) and 
store some of it in a lua table.


local examples = lxml.load ("my_examples", "examples.xml")
local sets = lxml.load ("my_sets", "example_sets.xml")

for e in xml.collected (examples, "/examples/chapter/example") do
local ex_id = e.at.id
all_examples [ex_id] = e
end

This works as expected, with print (inspect (all_examples)), I can see 
that the table looks the way I expect.


I then retrieve some entries of the table by their key:

local current_example = all_examples [key]

Again, this appears to work; when I have a

lxml.displayverbatim (current_example)

in my file, the xml is typeset and looks like I would expect it to look. 
However, whatever I try, I get the serialized xml typeset, with all 
 verbatim, instead of processed. Here's what I've tried:


\startxmlsetups xml:chapter:example
\xmlfirst {#1} {.} \par
\stopxmlsetups

lxml.command (current_example, ".", "xml:chapter:example")

or

xml.sprint (lxml.id (current_example))

or

local problem = xml.text (lxml.id (current_example), "./[text()]")
xml.sprint (problem)

I was expecting at least the last version to retrieve the pure text, but 
it typesets again with the tags included.


So I guess my question is: how can I tell ConTeXt to parse my xml as xml 
and apply the proper setups instead of serializing it?


All best wishes

Thomas
___
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-17 Thread Thomas A. Schmitz via ntg-context

> On 17. Nov 2022, at 11:04, Hans Hagen via ntg-context  
> wrote:
> 
> so, basically you collect data and use it later ... for huge datasets that 
> saves some time
> 
> if you have only chapters to process you can even decide to flush in that 
> function
> 
> Hans

I think this is exactly the approach I’m looking for: collecting everything in 
Lua tables and then retrieving and typesetting it later. I’m experimenting with 
it right now. I will have to define a proper lxml.command for every xml tag, I 
guess; otherwise, the xml gets serialized? I’ll play some more and will 
certainly be back with questions :-)

Thank you, as always, and all best

Thomas
___
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 Thomas A. Schmitz via ntg-context

On 11/16/22 21:51, Denis Maier via ntg-context wrote:

Just a quick question regarding this?
Is xml.filter equivalent to \xmlfilter? If so, how do you pass the match to a 
command as you'd do with \xmlfilter?


I'm still digesting and playing with Massi's reply; will probably be 
back with more questions :-)


Anyway:

If you've filtered something out like this

local tree = xml.filter (t, "../chapter[@title='mytitle'")

you can then apply a command to it

lxml.command(lxml.id(tree), ".", "xml:chapter:command")

and have to define the command as

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

for example.

Thomas

___
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 Thomas A. Schmitz via ntg-context

On 11/16/22 19:56, mf via ntg-context wrote:

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


You're right, of course, using a colon was a stupid idea. When I replace 
it with an underscore, you can see that both are in fact identical:


\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 chapter_id = t.at.ch_id
 local other_chapter_id = t.at["ch_id"]
 context (chapter_id)
 context.par ()
 context (other_chapter_id)
 context.par ()
local metadata = xml.filter (t, 
'../../topics/topic[@t:id=="%s"]', ch_id)
print (inspect(metadata))
lxml.command(t, ".", "xml:chapter:content")
context.par ()
end
\stopluacode

\starttext
\xmlprocessbuffer{main}{test}{}
\stoptext

___
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 Thomas A. Schmitz via ntg-context
Hi Duncan,

Thank you for pointing this out! I knew this was true inside the xmlns 
namespace, so you can’t have identical xml:id tags, but you’re probably right 
that it’s better to avoid this confusion altogether. Alas, this doesn’t help 
with my problem. Since there was a type in my minimal example from my 
experimentations, I include a corrected version, avoiding the identical tags

All best

Thomas

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


> On 16. Nov 2022, at 17:18, Duncan Hothersall via ntg-context 
>  wrote:
> 
> I'm not sure about the code, sorry, but I do know that an XML document can't 
> have two IDs of the same value. Typically you would use a linkend attribute 
> on the element which is referencing an id (in this case the topics, I think).
> 
> Probably doesn't help with your problem, but it's likely a prerequisite for 
> it to work.
> 
> Bests,
> 
> Duncan


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

2022-11-16 Thread Thomas A. Schmitz via ntg-context
Hi all,

I thought this was easy, but I overestimated my competence… I want to filter 
xml elements via their attributes and retrieve and typeset parts belonging 
together. Here is a small test file that explains what I’m trying:

\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.id
local metadata = xml.filter (root, 
'../../topics/topic[@id=="%s"]', ch_id)
print (inspect(metadata))
lxml.command(t, ".", "xml:chapter:content")
context.par ()
context (ch_id)
context.par ()
end
\stopluacode

\starttext
\xmlprocessbuffer{main}{test}{}
\stoptext

The line with xml.filter does not work as I expected. How can I walk the tree, 
find the “topic” element with the same “id” attribute as the chapter I’m 
currently in, and then typeset the different children of the topic element? 

Thanks a lot and all best

Thomas

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

2022-11-03 Thread Thomas A. Schmitz via ntg-context

On 11/3/22 19:24, Hans Hagen via ntg-context wrote:
You're going way too complex. Access to features and info has alwaye 
been part of mkic (and therefore lmtx). You can peek into the s-font* 
styles for all kind of ways to get overviews. Anyway, the following 
helper operates on the current font:


Thank you, Hans! Yes, I had a hunch that most of this was unnecessary 
because the information is already there. I also thought it would be 
convenient to have a helper script that could display everything before 
I decide whether I want to add a font to my texmf-font tree... Will play 
with this and then wikify!


All best

Thomas
___
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] font features

2022-11-03 Thread Thomas A. Schmitz via ntg-context

On 11/3/22 13:27, Henning Hraban Ramm via ntg-context wrote:
If it works for you, then it’s a problem of my installation, otherwise a 
regression in current LMTX...


No, I get the same error message, this looks promising but doesn't work.

And at the risk of sounding grumpy, but all of this is too much manual 
intervention; I would like to have a completely automated script. So 
I'll show what I have and add a few comments:


local Feature_Table = { }
local Parsed_Features = { }

local My_Font = environment.arguments["font"]

local Font_Features = os.resultof("otfinfo -f " .. My_Font)

for Feature_Sigla, Feature_Name in
  string.gmatch(Font_Features, "(%S-)\t(.-)\n") do
  Feature_Table[Feature_Sigla] = Feature_Name
end

COMMENTS

Expectation: this should return a list of all features and their 
descriptions as a lua table. If you run the file as


context test.cld --font="/path/to/font"

this works, and you get a table

Feature_Table={
 ["aalt"]="Access All Alternates",
 ["c2sc"]="Small Capitals From Capitals"} etc.

CODE

for name, _ in pairs(Feature_Table) do
  Context_Name = "f:" .. name
  Parsed_Features[name] = Context_Name
  context.definefontfeature( { Context_Name }, { name="yes" } )
end

COMMENTS

This should produce a lua table with ConTeXt fontfeatures and define 
those features. The table appears to be correct:


Parsed_Features={
 ["aalt"]="f:aalt",
 ["c2sc"]="f:c2sc"} etc.

So I expected that this should be equivalent to

\definefontfeature [f:aalt] [aalt=yes]

and return a list of defined features.

CODE

local Test_String = [[
ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 1234567890 1/4 2/8 
3/9 ffi ft fi fl ffl

]]

local Font_Name =  os.resultof("otfinfo -a " .. My_Font)

context.definefontfamily( { "Test" }, { "serif" }, { Font_Name }, {} )

context.setupbodyfont{ "Test, 12pt" }

COMMENTS

Again, this works; the font is set as bodyfont.

CODE

context.starttext()

for name, feature in pairs(Feature_Table) do
  context.start ()
  context.addfeature { Parsed_Features[name] }
  context.midaligned (feature)
  context.bold (Parsed_Features[name])
  context.par ()
  context.blank{ "medium" }
  context(Test_String)
  context.par ()
  context.stop ()
end

context.stoptext()

COMMENTS

And this doesn't work: the names are picked up, but the font features 
are not defined; the sample text does not reflect any features. So this 
is what I've got... maybe one of the wizards can help.


Thomas
___
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] font features

2022-11-03 Thread Thomas A. Schmitz via ntg-context

On 11/3/22 12:52, Herbert Voss via ntg-context wrote:

You'll get only the features with otfinfo in the terminal. For example:


Thank you, I was aware of that. But that's only the first step: you 
still have to use this list to define ConTeXt featuresets and then 
typeset. I was trying to build a cld document that automates this 
process, but can't get it to work. And I suspect that somewhere in the 
distribution, there is already a module that does exactly that.


Thomas
___
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] font features

2022-11-03 Thread Thomas A. Schmitz via ntg-context

Hi,

is there an easy way to get a list of all features that a font has and 
typeset a sample text to see the result of every single feature? There 
probably is, but I couldn't find anything...


All best

Thomas
___
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] Backgrounds has changed in latest lmtx

2022-10-23 Thread Thomas A. Schmitz via ntg-context

On 10/23/22 21:54, Leah Neukirchen wrote:

FWIW I get the error too on linux64.


OK, found it. File 
lmtx/tex/texmf-context/tex/context/fonts/mkiv/xits-math.lfg


is missing the lines

local common  = fonts.goodies.load("common-math.lfg")
local presets = common.mathematics.tweaks.presets

at the beginning of the file. However, math is typeset in Latin Modern. 
But that's for the math people to see...


All best

Thomas
___
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] Backgrounds has changed in latest lmtx

2022-10-23 Thread Thomas A. Schmitz via ntg-context

On 10/23/22 21:34, Otared Kavian via ntg-context wrote:

Hi Thomas,

Both your examples typeset fine with my installation of LMTX (version 
2022.10.22 11:23) on MacOS 11.7.
(Indeed you previous file test file reporting the background issue is typeset 
fine also).

Best regards : Otared


Thanks, Otared - that's bizarre. I just tried both on linux64 and macos 
(12.6, arm): run install.sh, reload font cache and run context without 
the luatex switch on the minimal example with the XITS Math font, and on 
both systems, I get the error that I have sent this afternoon. Can you 
try after rebuilding the font cache?


Thanks

Thomas
___
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] Backgrounds has changed in latest lmtx

2022-10-23 Thread Thomas A. Schmitz via ntg-context

On 10/23/22 16:21, Mikael Sundqvist via ntg-context wrote:

It works here. Are you sure that you updated to the latest? (There was
a few updates lately)

/Mikael


I have just update to

current version: 2022.10.22 11:23

so I think that's the latest. Minimal example:

\definefontfamily [test] [serif] [Times]
\definefontfamily [test] [sans]  [Helvetica]
\definefontfamily [test] [mono]  [DejaVu Sans Mono] 
[rscale=0.9,features=none]

\definefontfamily [test] [math]  [XITS Math]

\starttext

Test

\stoptext

___
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] Backgrounds has changed in latest lmtx

2022-10-23 Thread Thomas A. Schmitz via ntg-context

On 10/23/22 15:51, Hans Hagen wrote:

there was another fix yesterday (already uploaded)

Hans


Ah sorry, I missed that! It runs with my test file now, thanks! But my 
real file dies with this error:


fatal lua error:

registered function call [1141]: 
...x/tex/texmf-context/tex/context/fonts/mkiv/xits-math.lfg:61: attempt 
to index a nil value (global 'presets')

stack traceback:
...x/tex/texmf-context/tex/context/fonts/mkiv/xits-math.lfg:61: 
in main chunk

[C]: in function 'dofile'
...mtx/tex/texmf-context/tex/context/base/mkiv/good-ini.lua:78: 
in function <...mtx/tex/texmf-context/tex/context/base/mkiv/good-ini.lua:68>

(...tail calls...)

mtx-context | fatal error: return code: 1

which appears to be related to the new math code?

All best

Thomas
___
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] Backgrounds has changed in latest lmtx

2022-10-23 Thread Thomas A. Schmitz via ntg-context

Here comes another one that works with the switch --luatex but not in lmtx:

\setuppapersize[A6,landscape][A6,landscape]

\startuseMPgraphic{ornament}
StartPage ;

save diff ;numeric diff;
diff = .3cm ;

save w; numeric w;
w = xpart (lrcorner Field[Text][Text] - llcorner Field[Text][Text]) - diff ;

save factor; numeric factor;
if NOfPages <= 1 :
  factor = w ;
else :
  factor = w/(NOfPages - 1) ;
fi ;

save p; path p ;
p = unitsquare xyscaled (diff,diff)
   shifted (xpart llcorner Field[Text][Text],0.85cm) ;

for i = 1 upto NOfPages:
  if RealPageNumber = i:
fill p xyscaled (0,2) shifted ( (i-1)*factor,-diff-0.85cm)
 withcolor blue ;
  else :
fill p shifted ( (i-1)*factor, 0)
 withcolor red ;
  fi ;
endfor ;
StopPage ;
\stopuseMPgraphic

\defineoverlay
  [Ornament]
  [\useMPgraphic{ornament}]

\setupbackgrounds[page]
 [state=repeat,
  background={Ornament}]

\starttext

\dorecurse {10} {Test \page}

\stoptext

All best

Thomas
___
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] Backgrounds has changed in latest lmtx

2022-10-21 Thread Thomas A. Schmitz via ntg-context
Hi everybody,

With the latest lmtx, my page backgrounds don’t work any more. I think Otared 
mentioned that the simpleslides module is having problems. I’m trying to figure 
out what is happening, but I don’t see any warnings or errors, just unexpected 
results (which is not a good thing). I’m starting with the fundamentals. Here 
is a fairly minimal example: compile with context --luatex to see the expected 
result and with lmtx to see what is wrong.

All best

Thomas

\setuppapersize[A6,landscape][A6,landscape]

\setuplayout[backspace=1cm,
 topspace=0.4cm,
 marking=off,
 width=13cm,
 height=9.7cm,
 header=0.6cm,
 footer=0cm,
]

\startreusableMPgraphic{card}
StartPage ;
save p ; path p[] ;
p[0] = ulcorner Page -- urcorner Page ;
p[0] := p[0] shifted (0, -0.97cm) ;
for i = 1 upto 18 :
p[i] = p[i-1] shifted (0, -14.42pt) ;
draw p[i] withcolor (0.5,0.5,0.5) ;
endfor ;
pickup pencircle scaled 2pt ;
draw p[0] withcolor red ;
StopPage ;
\stopreusableMPgraphic

\defineoverlay[Card][\reuseMPgraphic{card}]

\setupbackgrounds[page]
 [state=repeat,
  background={Card}]

\starttext

Test

\stoptext
___
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] Compiling a large metapost document

2022-06-02 Thread Thomas A. Schmitz via ntg-context


On 01.06.22 23:30, Stefan Nedeljkovic wrote:
I Tried editing the file context/tex/texmf/web2c/texmfcnf.lua, and 
running context --generate, context --make, but the error persists. I'm 
new to context and I don't know how to configure this file. Running 
--usage reveals in the log that the category "token" is exceeded. I 
tried the aforementioned editing of the conf file, but the log stays the 
same.




That is the correct file, and I would assume that the category 
"luametatex.tokensize" (line 135) would be the correct one to edit. Is 
that the one you've edited, e.g. by bumping size to double its current 
value?


Thomas
___
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] Compiling a large metapost document

2022-06-01 Thread Thomas A. Schmitz via ntg-context


On 6/1/22 22:15, Stefan Nedeljkovic via ntg-context wrote:
The problem *is* the file size. There is not a minimal example, 
because everything works when there is less drawdot commands. There is 
125000+ drawdot commands in the file.

The run ends with the message:
If you really absolutely need more capacity, you can ask a wizard to 
enlarge me.

mtx-context     | fatal error: return code: 1

I really don't know how to "enlarge" LMTX, so my question is not about 
debugging the file, but rather compiling it. The current version of the 
file should produce no syntax etc. errors. I accidentally uploaded the 
wrong file twice, now it should be fixed, and you should get the same 
message in the console as me.


Excuse me: you want me to download a huge file, from an unknown author, 
that may or may not contain all sorts of things. You want me to compile 
this file on my computer. To obtain an error message that you could have 
mentioned in your first message. Why? Why don't you search the list 
archives with the key words "enlarge capacity"? I still don't understand 
what you expect us to do.


Thomas
___
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] Compiling a large metapost document

2022-06-01 Thread Thomas A. Schmitz via ntg-context



On 6/1/22 19:35, Stefan Nedeljkovic via ntg-context wrote:
Sorry, i just updated the file, should now compile, but fail due to 
resources. Are the configuration options to context that would enable 
this file to be compiled?
The question still stands: what do you expect us to do? Hunt for a 
problem through a huge file? What have you done to identify this 
problem? Is there a minimal example?


Thomas
___
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 Thomas A. Schmitz via ntg-context


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

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

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


Re: [NTG-context] Xml - Lua - context

2022-03-28 Thread Thomas A. Schmitz via ntg-context


> On 28. Mar 2022, at 18:21, Adam Reviczky via ntg-context  
> wrote:
> 
> Hi Thomas,
> 
> Not sure whether it helps or not, but in regards to combinations and Lua I 
> have had some challenges as well, but Hans' and Wolfgangs' solution with 
> externalfigures works fine for me now:
> 
> https://mailman.ntg.nl/pipermail/ntg-context/2021/103822.html
> https://mailman.ntg.nl/pipermail/ntg-context/2021/103827.html
> 
> Adam


Thank you, that’s already very useful! I should have looked if there is a 
“delayed” alternative for externalfigure as well, but I also take Hans’s 
warning to heart that all of this is non-trivial. 

Thank you, best wishes

Thomas
___
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] Xml - Lua - context

2022-03-28 Thread Thomas A. Schmitz via ntg-context
And here comes question 2, a very basic one: on A4 landscape pages, I want to 
place two images next to each other (like the spread pages of a book). What 
would be the preferred way of the really competent users to do this, again 
keeping in mind that I want to loop over page numbers in a pdf file and thus am 
coding in Lua. So far, I have tried or thought about:

1. Embedded xtable

This is what I’m using now, an xtable of two columns for every A4 page. It 
works, but I wonder if it’s a good method.

2. combinations

This appeared to be the most natural approach (because it’s what combinations 
are for), but I ran into expansion problems, added a few “function () end” in 
my code, but couldn’t make it compile. Combinations, combined with framed and 
externalfigure, are difficult to write in Lua - or am I too stupid to find the 
winning combination (sorry for the puns).

3. columns

Again, this would seen like a natural approach, having every A4 page set up as 
two columns, but maybe that’s overkill? 

I’d be curious to know what you think!

All best

Thomas
___
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] Xml - lua - context

2022-03-28 Thread Thomas A. Schmitz via ntg-context
Dear all,

For a small project, I have two questions (without MWE…) on processing xml via 
Lua and context. I’ll write two messages so eager volunteers can reply more 
easily!

So question one: given an xml structure like this

  

  Introduction: the Iliad


  Introduction: the Iliad

  

I want to typeset the section title with some added information. Since I’m 
processing in a loop, I thought this would be easier in Lua, so I have 
something like this:

local i = 0

local sessions = { “April 2”, “April 9”, “April 16” } -- etc.

function xml.functions.section(t)
i = i + 1
local raw_section = xml.text (t, "/sectiontitle")
local section_head = i .. ". session, " .. sessions [i] .. ": " .. 
raw_section
context.startsection { title=section_head }
lxml.flush (t)
context.stopsection ()
end

However, this means that the section_head is serialized as a string and not 
processed according to the xml setups, so I have “the Iliad” in my 
typeset document. How can this be avoided? How can I have the ... 
processed instead of serialized in the section title? 

Thanks for looking at my code!

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


> On 26. Mar 2022, at 16:42, Denis Maier via ntg-context  
> wrote:
> 
> I think you've done that already ...

Oh my goodness, I’m getting too old for this… Thanks for pointing that out!

[Historical context: the Greek scholar Didymus had several nicknames. One was 
Chalcenterus “Bronze-Guts” because he could remain seated at his desk for hours 
without moving. The other was “bibliolathas” “Book-forgetter” because he wrote 
so many books he couldn’t remember them himself. End of historical context]

Thomas
___
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] Trying to get a simple bibliography

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


> On 26. Mar 2022, at 14:04, A A via ntg-context  wrote:
> 
> The next question I guess is whether ConTeXt support other specs like MLA or 
> Chicago style. I tried MLA but without sucess. Is MLA possible in ConTeXt?

One (admittedly far-fetched) possibility would be to read the documentation. 
mkiv-publications, p. 29: context supports apa and aps styles for the moment; 
contributions are always welcome.

Thomas
___
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] Force a hyphenation

2022-03-16 Thread Thomas A. Schmitz via ntg-context

Hi Willi,

I must admit that after the reform some 20 years ago, I'm no longer 
certain about German rules. But I think that in fact, according to the 
new rules, ß is no longer hyphenated the way you suggest. Duden § 164.3: 
"Ein einzelner Konsonantenbuchstabe im Wortinneren kommt in der Regel 
auf die neue Zeile; von mehreren Konsonantbuchstaben trennt man nur den 
letzten ab.

Zum Beispiel
[…]
Grü-ße, hei-ßen

So Eiwei-ßes may in fact be correct... But I assume that Arthur has some 
authoritative answer to this question.


Best

Thomas


On 3/16/22 16:48, Willi Egger via ntg-context wrote:

Hi,

at the moment I am dealing with a German text. Although I have 
\mainlanguage[de] in the preamble the word 'des Eiweißes' is hyphenated as 'des 
Eiwei-ßes'. Of course this should be 'des Eiweis-ses'.

How can I make sure that ConTeXt is hyphenating this corerctly?

Kind regards
Willi


___
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 is DOA on my M1 Mac

2022-03-15 Thread Thomas A. Schmitz via ntg-context


> On 15. Mar 2022, at 15:03, Gavin via ntg-context  wrote:
> 
> JP and Bruce,
> 
> Do either of you have the new upload working on an M1 Mac?
> 
> I appreciate the ideas, but I’m not entirely new to this. I’ve kept several 
> different ConTeXt installations. I can run them from terminal or TeXShop. 
> I’ve written TeXShop engines to switch between different installations and to 
> use TeXShop’s alternative path. I’ve never had a problem like the one I am 
> having with the new upload.
> 
> TeXShop and Terminal both have full disk access. Before I devote much more 
> time trying to figure out what might be wrong with my set-up – where other 
> installations work fine – I’d love to get confirmation that somebody got the 
> new upload to work on an M1 Mac.
> 
> Gavin

I can confirm that context version: 2022.03.12 17:56 is running fine on my 
MacBook M1. And excuse my snark, but 

> zsh: permission denied: mtxrun
> 
> I’m not sure how to get around this.

made me also think you were entirely new to this. These security settings have 
been around for a long time now on macOS. 

Thomas
___
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] PageNumber in MetaFun

2022-03-02 Thread Thomas A. Schmitz via ntg-context


On 3/2/22 13:05, Marco Patzer via ntg-context wrote:

LMTX 2022.01.21 20:13 produces a rectangle on page 2, an older MkIV
produces a circle on page 2. Is this expected behaviour?

Marco


This has changed some time ago; try "RealPageNumber" instead of 
"PageNumber."


Thomas
___
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 make an in-text list without periods

2022-01-23 Thread Thomas A. Schmitz via ntg-context

This is a FAQ: you can't mix keywords and assignments, hence:

\startitemize [n,text] [stopper=]

Thomas

On 23.01.22 21:05, Joel via ntg-context wrote:
Strangely when I use `\startitemize[text, n, stopper=]`, which I hoped 
would make the period go away, I just get a regular bulleted list, it 
seems to ignore the 'text' command.


How can I achieve this output (below)?

There are many kinds of animals at the children's zoo: (1) rabbits, (2) 
pigs, (3) sheep, and (4) dogs.


--Joel

Minimum working example:

\starttext
     There are many kinds of animals at the children's zoo:
     \startitemize[text, n, stopper=]
         \item rabbits,
         \item pigs,
         \item sheep,
         and
         \item dogs.
     \stopitemize
\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] SimpleSlides and Visual counters

2022-01-16 Thread Thomas A. Schmitz via ntg-context


On 16.01.22 15:56, Otared Kavian via ntg-context wrote:

Hi Aditya,

Some time ago I reported an issue with LMTX regarding your visual counter (at 
least the version used in the simpleslides module).
Now I think I have found where the issue comes from: it is due to the fact that 
somehow the conditional

if PageNumber > 2 :

[some code]

fi ;


Hi Otared,

I'm not Aditya, but I've encountered the same problem within 
simpleslides. Can you replace PageNumber with RealPageNumber and see 
whether this solves your problem?


Best

Thomas
___
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] Critical Editions?

2022-01-04 Thread Thomas A. Schmitz via ntg-context
I basically agree with everything you say, Jean-Pierre. Publishers are 
modern-day robber barons, and they have been stifling and exploiting scholars 
and scholarship for many years now. Behemoths such as Brill, de Gruyter, or 
Elsevier are bankrupting libraries in the entire world. However, we scholars 
also have some responsibility: if we could agree with each other, we could 
easily bypass the big publishers and have our critical editions (in a variety 
of formats) on our university’s websites. But we don’t do that: younger 
scholars need the validation of big name publications to build reputation and 
find a job, older scholars (myself included) are vain and/or old-fashioned and 
prefer a “real” book.

For your questions at the end: as you know, TEI is an insanely huge beast. 
Nobody will be willing and/or able to implement all of it in ConTeXt. What we 
need is actual use cases: scholars coming here and building up the expertise 
via the work they’re actually doing. Preferably in smaller installments so the 
developers and advanced users can slowly prepare bits and pieces of these 
stylesheets. No-one is going to look at a 400-page edition with all kinds of 
special needs in one go; we start with a chapter, a few pages, and we make our 
way. That’s what I expected when I wrote the wiki page on TEI xml: that it 
would slowly develop into something more comprehensive. Alas, it has been 
sitting there for 11 years… Every now and then, someone will appear on the 
mailing list and say: I need four apparatuses and six parallel translations and 
bells and whistles at every paragraph, but when you ask for real examples and 
specifications, they ride out into the sunset, never to be heard of again… So: 
I’m all for continuing in this direction, but we need some continuity. (And, 
not to brag, but still: I even managed to obtain some funding a couple of years 
ago to improve the bibliographical support in ConTeXt; if you have a real 
project, you can always allocate some funding for these things). As for 
learning TEI: I really think this is absolutely inevitable; even if new formats 
will be invented in the future (and TEI has serious shortcomings for many sorts 
of manuscript traditions), they will probably do so with TEI as a starting 
point.

I’m not working on a critical edition right now, but I have done some 
preparatory work and am willing to chip in!

All best

Thomas

> On 4. Jan 2022, at 18:54, Jean-Pierre Delange via ntg-context 
>  wrote:
> 
> Thomas,
> 
> You are deeply right ! But this is an issue in academic edition, not only 
> because students read no more at length (specially in humanities), and by 
> consequence, don't buy books, but among other reasons there is a general 
> problem in publishing in academic fields, pointed by Jürgen Hanneder : even 
> Universities libraries don't buy all items published by scholars in a 
> specific field, but publishers themselves have leveled the academic criterium 
> by commercial/economic considerations. Then, scholars have to gather 
> financial funding with technical computing practice, which is another issue, 
> and furthermore they have to find money in order to publish at expansive cost 
> (see Brill prices, for example).
> 
> You are right about some academic tools, like those developed by Tuft 
> University (like ancient greek thesaurus : http://stephanus.tlg.uci.edu/ or 
> The Liddell-Scott-Jones online dictionary : 
> http://stephanus.tlg.uci.edu/lsj/#eid=1), but for providing such tools as 
> online digital work, there is two ways :
> 
> 1. Academic courses on TEI XML given to advanced students in order to help 
> them to produce well achieved projects (and provide manuals to do that; an 
> example here in French  : 
> http://www.bvh.univ-tours.fr/XML-TEI/ManuelWeb/Manuel_TEI_BVH.html)
> 
> 2. Or, there are not so numerous nests like NTG-Context discussion list ! How 
> to help Jürgen (and scholars generally) who knock at the door looking for an 
> analysis of their needs and questioning how ConTeXt may help them ?
> 
> a) They have to learn TEI XML, then
> 
> b) learn Context stylesheet !
> 
> Is it possible to gather a group of people interested by these topics ? Are 
> we starting today ?

___
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] Critical Editions?

2022-01-04 Thread Thomas A. Schmitz via ntg-context

> On 3. Jan 2022, at 10:43, hanneder--- via ntg-context  
> wrote:
> 
> While the system is ingenious
> and a great relief (for we do not have to work with xml directly), I am also 
> critical about these
> new demands, because they force us to use a fairly complex system for 
> sometimes quite simple tasks.
> I am a Sanskritist, we do not have huge budgets or a large staff, so 
> efficiency is an issue. 

Just for what it’s worth: I don’t see any future in developing a ConTeXt input 
format for critical editions, for the following reasons:

1. Producing a print-only version (i.e. printed book) makes no sense in 2022. 
This is not sustainable because no-one will be able to take your edition and 
continue to work on it. You have to provide a digital edition as research data.

2. This digital edition has to be in a standard format that is sustainable at 
least for some time so it can be processed with various types of software. TEI 
xml has become the de facto standard.

3. ConTeXt is not stable enough to provide such a standard format: it is in 
development; what you code today may not be compilable in 2 (or 5 or 50) years. 

4. However, ConTeXt is wonderful for processing xml. 

Hence: keep the input source and the processing separate. Code in TEI xml (or a 
subset of it) and develop a ConTeXt stylesheet to process it. 

Thomas
___
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] adjusting vertical space

2021-11-25 Thread Thomas A. Schmitz via ntg-context


On 11/25/21 00:06, jbf via ntg-context wrote:

The following MWE


You do know what MWE stands for, right?

Thomas
___
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] rule beneath chapter number

2021-11-12 Thread Thomas A. Schmitz via ntg-context


On 11/12/21 18:13, Henning Hraban Ramm via ntg-context wrote:

You’re right, tabular numbers are nonproportional. I meant versal (“normal”) 
numbers in opposite of oldstyle (mediaeval) numbers.


I think there are two mutually exclusive feature pairs that you're 
mixing up:


lnum vs onum: lining numbers versus old style numbers; "lining" having 
no descenders, but sitting on the line.


pnum vs tnum: proportional vs tabulate numbers. As the name suggests, 
the latter look better where numbers are vertically aligned because each 
numeral will take exactly the same space, so tables, but also footnotes 
etc. The former of course will look better in running text.


Add to this that numbers can also be subscript or superscript. Some very 
extensive professional fonts have surprising combinations of these 
features, so in the end, one has to do what you did: fiddle with 
featuresets until the result looks right.


Thomas
___
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] Something smells rotten in the state of luametatex...

2021-10-08 Thread Thomas A. Schmitz via ntg-context


Hi all,

I have a document here for one of my classes: xml processed via context, 
some layers, some two column paragraphs, a bibliography, nothing out of 
the ordinary. With mkiv, it compiles cleanly:


mkiv lua stats  > used engine: luatex version: 1.13, functionality 
level: 7420, banner: this is luatex, version 1.13.0 (tex live 2021)

mkiv lua stats  > used hash slots: 48846 of 65536 + 25
mkiv lua stats  > lua properties: engine: lua 5.3, used memory: 212 MB, 
ctx: 210 MB, max: unknown MB, hash chars: min(64,40), symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 2.775 seconds, 119 processed pages, 119 
shipped pages, 42.883 pages/second

system  | total runtime: 5.996 seconds

When I compile the same document with luametatex, things slow down to a 
crawl:


mkiv lua stats  > used engine: luametatex version: 2.0921, functionality 
level: 20210903, format id: 594, compiler: gcc
mkiv lua stats  > tex properties: 740039 hash slots used of 2097152, 
48372 control sequences, approximate memory usage: 36 MB
mkiv lua stats  > lua properties: engine: lua 5.4, used memory: 100 MB, 
ctx: 93 MB, max: 138 MB, symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 27.509 seconds, 119 processed pages, 119 
shipped pages, 4.326 pages/second

system  | total runtime: 139.458 seconds of 139.493 seconds

So, it takes more than 20 times as long... The CPU of my computer goes 
up to 100 %, and the entire machine sometimes becomes unresponsive 
during the run. Obviously, I can't provide a MWE, but this seems 
bizarre. One thing I see on my terminal: there are hundreds of lines 
like this


Overfull \hbox (0.8pt too wide) in paragraph at lines 18--18
6:17:  [glue][glue][glue][boundary][hlist][penalty][glue][hlist][penalty] >[glue][glue]


It's almost like some debug setting has been triggered. But that may be 
a red herring. Anyway, I just wanted to report this; maybe some bigger 
problem (with the binary or the format?) is lurking somewhere.


All best

Thomas
___
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] metafun: circular arc

2021-10-05 Thread Thomas A. Schmitz via ntg-context


Thank you so much, Hans, that's a neat solution! I was banging my head 
against the wall, but this makes sense.


On 10/5/21 6:38 PM, Hans Hagen wrote:

Because you know how to rotate and scale:

\startuseMPgraphic{empedocless}
path p, q, r ;
pair a ;

p := fullcircle scaled 10cm ;
drawarrow p  withpen pencircle scaled 1mm withcolor red ;
draw    point 0 of p withpen pencircle scaled 1mm withcolor blue ;
q := p cutafter (point .4 along p) ;
drawarrow q  withpen pencircle scaled .5mm withcolor green ;
draw followtext(q, "\strut TEXT ONE") ;

p := fullcircle scaled 8cm ;
drawarrow p  withpen pencircle scaled 1mm withcolor cyan ;
draw    point 0 of p withpen pencircle scaled 1mm withcolor magenta ;
q := p cutafter (point .3 along p) ;
q := q rotated 120 ;
drawarrow q  withpen pencircle scaled .5mm withcolor yellow ;
draw followtext(q, "\strut TEXT TWO") ;

% the real deal: best make a macro for this

p := fullcircle scaled 6cm ;
draw    point 0 of p withpen pencircle scaled 5mm withcolor blue ;
drawarrow p  withpen pencircle scaled 1mm withcolor red ;
a := (point eps of p) rotated 45 ;
draw a withpen pencircle scaled 2mm;
q := p cutafter a ;
q := q rotated 20 ;
drawarrow q  withpen pencircle scaled .5mm withcolor green ;
draw followtext(q, "\strut TEXT TWO") ;

\stopuseMPgraphic

\useMPgraphic{empedocless}

So, just always start at point 0 and then just rotate the cutof piece 
over the angle that you want. The eps in the last case makes that we 
actually have a cut off piece (zero fails here).


So ... solution 4. best suits non math gurus (like you and me).


This is the part of your reply that fails to convince. You don't even 
know how bad I am at math...


Thanks, and all best

Thomas
___
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] metafun: circular arc

2021-10-05 Thread Thomas A. Schmitz via ntg-context


Hi all,

I hope the following example is not too convoluted:

\useMPlibrary [txt]

\define\EmpArrow{\getscaledglyph{1.6}{name:dejavumath}{\char"2B05}}

\setupbodyfont [ss,9pt]

\starttext

\startuseMPgraphic{empedocles}
%numeric a ; a = 6.56cm ;
%numeric b ; b = 1.1 ;
save S; path S[] ;
S[1] = fullcircle scaled 8cm rotated 306 ;
S[2] = S[1] scaled 1.1 ;
S[3] = S[1] scaled 1.23 ;
S[4] = S[1] scaled 1.3 ;
S[5] = S[1] scaled 1.43 ;
S[6] = S[1] scaled 1.5 ;
S[7] = S[1] scaled 1.6 ;
z[1] = point 1 along S[7] ;
z[2] = point 1 along S[1] ;
z[3] = point 0.1 along S[7] ;
z[4] = point 0.1 along S[1] ;
z[5] = point 0.2 along S[7] ;
z[6] = point 0.2 along S[1] ;
z[7] = point 0.3 along S[7] ;
z[8] = point 0.3 along S[1] ;
z[9] = point 0.4 along S[7] ;
z[10] = point 0.4 along S[1] ;
z[11] = point 0.5 along S[7] ;
z[12] = point 0.5 along S[1] ;
z[13] = point 0.6 along S[7] ;
z[14] = point 0.6 along S[1] ;
z[15] = point 0.7 along S[7] ;
z[16] = point 0.7 along S[1] ;
z[17] = point 0.8 along S[7] ;
z[18] = point 0.8 along S[1] ;
S[8] = z[1] -- z[2] ;
S[9] = z[3] -- z[4] ;
S[10] = z[5] -- z[6] ;
S[11] = z[7] -- z[8] ;
S[12] = z[9] -- z[10] ;
S[13] = z[11] -- z[12] ;
S[14] = z[13] -- z[14] ;
S[15] = z[15] -- z[16] ;
S[16] = z[17] -- z[18] ;
z[19] = S[3] intersection_point S[8] ;
z[20] = S[3] intersection_point S[16] ;
S[18] = S[3] cutbefore z[20] cutafter z[19] ;
z[21] = S[5] intersection_point S[8] ;
z[22] = S[5] intersection_point S[16] ;
S[19] = S[5] cutbefore z[22] cutafter z[21] ;
z[23] = S[12] intersection_point S[3] ;
S[20] = S[3] cutbefore z[20] cutafter z[23] ;
for i = 1 upto 16:
draw S[i] withcolor 0.7white ;
endfor ;
draw z[23] -- z[20] withcolor red ;
draw S[20] withcolor blue ;
label.bot(textext("\noexpand\framed[align=middle,frame=off]{Jahr \crlf 
20.000 = 0}"), z[10]) ;
label.llft(textext("\noexpand\framed[align=middle,frame=off]{Jahr \crlf 
2.000}"), z[8]) ;
label.lft(textext("\noexpand\framed[align=middle,frame=off]{Jahr \crlf 
4.000}"), z[6]) ;
label.lft(textext("\noexpand\framed[align=middle,frame=off]{Jahr \crlf 
6.000}"), z[4]) ;
label.ulft(textext("\noexpand\framed[align=middle,frame=off]{Jahr \crlf 
8.000}"), z[2]) ;
label.urt(textext("\noexpand\framed[align=middle,frame=off]{Jahr \crlf 
12.000}"), z[18]) ;
label.rt(textext("\noexpand\framed[align=middle,frame=off]{Jahr \crlf 
14.000}"), z[16]) ;
label.rt(textext("\noexpand\framed[align=middle,frame=off]{Jahr \crlf 
16.000}"), z[14]) ;
label.lrt(textext("\noexpand\framed[align=middle,frame=off]{Jahr \crlf 
18.000}"), z[12]) ;
draw followtext(S[18], "\strut\hbox to 2em{\EmpArrow}\hskip2em 
RUHEPAUSE\hskip4em\strut") ;
draw followtext(S[19], "\strut\hbox to 2em{\EmpArrow}EINHEIT 
(SPHAIROS)\hskip2em\strut") ;

\stopuseMPgraphic

\useMPgraphic{empedocles}

\stoptext

I have a big problem and some smaller questions, for those who are 
better at math and at metafun than I am:


1. The big problem: for the next followtext, I need the circular arc 
between points z[23] and z[20]. But however I place the cutbefore and 
cutafter, I don't get the proper part of the circle. I'm looking at the 
right intersection points, as the red line shows, but the blue line 
shows that I'm not getting the right section of the circle. How can I 
get this section into the path S[20]?


2. Math... :-) Is there a better way to define three circles that are at 
exactly the same distance than my naive "scaled 1.3" and "scaled 1.5"?


3. TeX and metafun: is there a better way to have the followtext exactly 
centered between the two circles rather than just fiddle with the scale 
factor?


4. Or is there a better approach to my problem altogether? I'm trying to 
reproduce an illustration from a book, so I'm very open to suggestions 
here. I looked at the example in the metafun manual chapter 10.4, but 
I'm not sure if using an overlay and multiple \followtokens would be 
easier. Especially since there is the scary remark "This definition is 
not the right one!" in this chapter without any further explanation.


I hope you all had a wonderful meeting last week. I was sad I couldn't 
come, I was in Paris for a conference, the first after 18 months, so I 
couldn't skip this one.


Thanks and best wishes

Thomas
___
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] Create an enumeration style

2021-08-11 Thread Thomas A. Schmitz via ntg-context

> On 11. Aug 2021, at 10:09, Otared Kavian via ntg-context  
> wrote:
> 
> Thanks for the example and the fix, but I would rather think that the « 
> french » part of ordinals should be
> 
>   french = function(n)
>   if n == 1 then
>   return « er"
>   else
>return « ème"
>   end
>   end,

Except if you have something like “1ère image”… Ah, languages are so messy (no 
pun with recent events in Paris intended).

Thomas
___
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] Harvard bibliography style

2021-08-10 Thread Thomas A. Schmitz via ntg-context
To get you started: the APA standards are defined in publ-imp-apa.mkvi and 
publ-imp-apa.lua. You could try and copy these files to different names 
(beginning with publ-imp-) and then make changes. You’ll have to replace the 
“apa:” prefix with the name you give your own style. From my experience, it is 
easier to start with empty files and then add definitions as you go than to 
modify the APA files; they are very complex and pull in lots of definitions 
from other files. In general: people here will be more willing to help if they 
see you make some effort to help yourself.

> On 10. Aug 2021, at 13:03, Jorge Manuel via ntg-context  
> wrote:
> 
> Alan,
> 
> Sorry for the insistence, but I need some help in setting up my bibliography. 
> I want to continue to use context, but there is no out-of-the-box solution 
> for bibliographic references that are based on the harvard agsm style (this 
> is the standard in my country).

That’s not relevant to your questions, is it?

> 
> 1. Parenthetical citations
> 
>   I need to remove the comma between de name and year. For example, the 
> APA standard produces (Alan, 2021) I want (Alan 2021).
> 

The comma is defined in l. 360-7 in publ-imp-apa.mkvi:

\definebtx
  [apa:\s!cite:authoryear]
  [apa:\s!cite:author]
  [\c!left={(},
   \c!right={)},
   \c!inbetween={\btxcomma},
   \c!separator:names:3={\btxcomma\textampersand\space},
   \c!separator:names:4={\btxspace\textampersand\space}]

So instead of inbetween=\btxcomma, you could try inbetween=\btxspace

> 2. Articles in bibliography
> 
>  I need te remove de parenthesis in year and add single quotes in the 
> article title. 
> 
> The standard are:
> Surname of the author(s) of the article, Initials Year of publication, 
> ‘Article title in single quotes’, Journal title: title complement, Volume 
> number, Issue number, Article pages.
> 
> Example: 
> Higson, R 2010, ‘Conceptual artists’ war on complacency’, Australian, 16 
> November, p. 15. 

The period after the initial is controlled by

\setupbtx [stopper:initials=]

Which you can find in publ-ini.mkxl. The default value is stopper:initials={.}, 
you can simply delete the {.} part, and there will be no period.

The double quotes are defined in publ-imp-default.mkvi, l. 144-8:

\definebtx
  [\s!default:\s!list:title:article]
  [\s!default:\s!list:title]
  [\c!style=, % journal is set in italics
   \c!command=\quotation] 

You can either replace command=\quotation with command=\quote or adapt the 
symbol for quotations for your language, e.g.

\setuplanguage[en]
[leftquotation=\upperleftsinglesixquote,
 rightquotation=\upperrightsingleninequote]

Which would of course set the single quotes for all English text in your 
document.

Once again: bibliographies are infinitely complex (if you read the source, you 
will find a couple of heartfelt outbursts from Hans), you’ll see that some 
changes have undesirable side effects, and it will take time to accomplish what 
you need. I have found it easier to start with very simple definitions and then 
add bells and whistles; the files in the distribution are complex because they 
follow complex standards and try to define all possible cases. This may be a 
bit overwhelming for a relative beginner.

3.Other documents
> 
> I have other changes, but if I understand how can adapte  the article 
> bibliographic style I can make my own changes  for other documents. 

Possible.

Good luck.

Thomas
___
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] Code document and simpleslides and create in one go the document with simpleslides added

2021-07-31 Thread Thomas A. Schmitz via ntg-context


On 7/31/21 4:06 PM, Pablo Rodriguez via ntg-context wrote:

BTW, I cannot get simpleslides working with LMTX.



I had to make some slight adjustments but have been to lazy to upload a 
new and improved version. One reason being that I can't remember my 
username and password for the modules section of the garden... I'll have 
to ask Taco to reset it for me.


Thomas
___
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] Code document and simpleslides and create in one go the document with simpleslides added

2021-07-31 Thread Thomas A. Schmitz via ntg-context


On 7/31/21 3:27 PM, Jeroen via ntg-context wrote:

Is there an easy way to write a Context document and also code simpleslides
in the same document so that the simpleslides are automatically added to
the document as for example an appendix? Ie one tex document with Context
code, perhaps with some \input and something like a two-pass job. I was
thinking if the simpleslides could be saved as a number of png images and
then with the recurse add them to the document with placefigure.


"Easy" is an ambiguous term... I can tell you how I do this (I use xml, 
but with a bit of code, this can be adapted to TeX documents): I have 
the code for the slides and my own comments in the same documents; I 
pass a --mode to the compilation to filter and select content. When I 
have my presentation as a file "presentation.pdf," I save it and then 
have the slides included automatically via a counter, like this:


function xml.functions.combined_slide(t)
i = i + 1
local textwidth = tex.dimen.textwidth
context.page()
	context.framed( { width=number.todimen(textwidth), frame="off", 
align="middle", height="10cm" },
		function() context.externalfigure( { "presentation.pdf" }, { page=i, 
width="13cm" } ) end )

context.blank { "line" }
end

So, as others have said: no need to convert to png. Setting up a 
workflow takes some time and thought, but once it's in place, it works 
very well; I have now used my xml-based workflow for 12 years or so, for 
all my university lectures and talks.


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

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


Re: [NTG-context] Strange new behaviour of the mailing list

2021-07-31 Thread Thomas A. Schmitz via ntg-context


On 7/31/21 11:41 AM, Denis Maier via ntg-context wrote:

I think so too. Especially since the original sender's address isn't included in 
"reply to all" messages.
I think it's an improvement. I have never understood why the original 
sender needs an additional mail, on top of the one (s)he receives from 
the list.


Thomas
___
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] ligature exceptions

2021-07-28 Thread Thomas A. Schmitz via ntg-context

Hi all,

just two quick questions: a couple of weeks ago, there was a long 
discussion on ligature exceptions in, e.g., German. Hans provided an 
elegant new mechanism (\startlanguageoptions). So my two questions:


1. Is the old mechanism (\replaceword[eg][Auflage][Au{fl}age]) now 
obsolete? I tried using it, but unwanted ligatures still occurred. If it 
is indeed deprecated, I'll add a note to the wiki (this would mean that 
the current texlive version does not have the new mechanism and the 
latest lmtx doesn't use the old one, so that's somewhat problematic).


2. Both mechanisms only work for complete words, is that right? So I 
can't just provide a pattern such as "uf|forder," I have to provide a 
full list with all inflected forms:


auf|fordern
auf|fordert
auf|fordernd
Auf|forderung
Auf|forderungen

and for 1-3 also the forms with a capital letter.

Thank you!

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

2021-07-15 Thread Thomas A. Schmitz


On 7/15/21 11:10 PM, Jairo A. del Rio wrote:

Hi, list! Is this already fixed in a new upload? I'm compiling old
documents and having the same problem as Thomas, although Wolfgang's
comment fixes it nicely.

Cordially,


There hasn't been a new upload since I asked my question, so for the 
time being, you have to apply the patch yourself.


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

2021-07-12 Thread Thomas A. Schmitz
Hi all,

I don’t know if I’m overlooking something really basic or if this is a bug. The 
following MWE compiles with mkiv, but not with lmtx:

\startreusableMPgraphic{fold}
   fill unitsquare xyscaled (1mm,1mm) withcolor blue ;
\stopreusableMPgraphic

\definelayer[foldingmarkslayer][width=\paperwidth,height=\paperheight]
\setlayer[foldingmarkslayer][y=101mm,x=11mm]{\reuseMPgraphic{fold}}

\setupbackgrounds [page][background=foldingmarkslayer]

\starttext

Test

\stoptext

The error I get:

tex error on line 6 in file ./test.tex: Use of \meta_usempgraphic_nop doesn't 
match its definition

Any pointers? Thanks

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

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


Re: [NTG-context] font feature

2021-07-09 Thread Thomas A. Schmitz

> On 8. Jul 2021, at 23:33, Hans Hagen  wrote:
> 
> you forgot the 'default' so you basically force basemode which is does 
> permanent features .. add/subtract works only in node mode
> 
> \definefontfeature
>  [f:onum]
>  [onum=yes,pnum=yes]
> 
> \definefontfamily [test] [serif] [AntykwaTorunska] [features={default,f:onum}]
> \definefontfamily [test] [sans]  [Myriad Pro]
> \definefontfamily [test] [mono]  [DejaVu Sans Mono]
> \definefontfamily [test] [math]  [Xits Math]
> 
> \setupbodyfont[test,12pt]
> 
> \starttext
>test 1 2 3 test 1/2 \subtractfeature[f:onum] test 1 2 3 test 1/2
> \stoptext

Thank you, Hans, this works! I’m looking for a place to add this information to 
the “featuresets” page on the wiki, will do this soon!

All best

Thomas
___
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] font feature

2021-07-08 Thread Thomas A. Schmitz


Hi all,

is it possible to subtract a featureset that has been applied to a 
fontfamily? MWE:


\definefontfeature
  [f:frac]
  [frac=yes,onum=no,pnum=no]

\definefontfeature
  [f:onum]
  [onum=yes,pnum=yes]

\definefontfamily [test] [serif] [AntykwaTorunska] [features=f:onum]
\definefontfamily [test] [sans]  [Myriad Pro]
\definefontfamily [test] [mono]  [DejaVu Sans Mono]
\definefontfamily [test] [math]  [Xits Math]

\setupbodyfont[test,12pt]

\starttext

Mozarts erster Satz ist ein
{\subtractfeature[f:test]\addfeature[f:frac]4/4}-Takt, Beethoven wählt 
einen Dreiertakt, Mozarts Romanze ist ein 3/8-Takt, Beethoven wählt 
einen 2/4,
Mozarts Rondo ist eine Gavotte im 2/2-Takt, Beethoven schreibt ein 
Jagdrondo im 6/8-Takt.


\stoptext

If I comment out the part [features=f:onum], I get the fractions that 
I'm looking for, but it seems that I can't get the same effect with 
\subtractfeature and \addfeature. I'm confused...


Thanks and all best

Thomas
___
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] Question about "streams" module

2021-06-22 Thread Thomas A. Schmitz


On 6/22/21 5:43 PM, MANUEL GONZALEZ SUAREZ wrote:

Hello everybody:
  My question is this: Is the "streams" module obsolete? If not, where can I 
find documentation on its use?
Thanks
M. González.


Hans is working on a new mechanism and has recently been thinking about 
integrating (some of) the functionality of this module. As far as I 
remember, it was mkii. (And I was the one who pushed Hans to do work on 
it, but could never really come up with a reasonable interface and 
specifications.) So I would say yes, it is more or less obsolete; I 
wouldn't start a project with it.


Thomas
___
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] LMTX and my custom typescripts

2021-05-28 Thread Thomas A. Schmitz

> On 28. May 2021, at 18:40, Michael Guravage  
> wrote:
> 
> Any encouragement in how to resolve this would be much appreciated.
> 

Hi Michael,

Try renaming it to type-imp-DollyPro.tex (and then of course 
\usetypescriptfile[type-imp-DollyPro]), that should help. This changed a couple 
of months ago and was announced on the list, so shame on you for not following 
our discussions religiously…

Best

Thomas
___
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] TeX capacity exceeded

2021-05-19 Thread Thomas A. Schmitz


On 19.05.21 18:34, Hans Hagen wrote:



Can you check the latest upload? You should be able to go way higher.



Yes, with 2021.05.19 18:22, the file compiles again in lmtx! I'm also 
trying your suggestions for improving the Lua code and rethinking my 
tables for analyzing the vocabulary. Thank you for the quick fix! And I 
hope there won't be any problem for other users - I'm aware that memory 
on computers can differ vastly. I sometimes run ConTeXt on my raspberry 
pi 3, which has just 1 G of RAM, whereas my newish iMac at home has 40 
G. So it's difficult to find the sweet spot that will satisfy everybody...


All best

Thomas
___
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] TeX capacity exceeded

2021-05-17 Thread Thomas A. Schmitz


Hi all,

I have a rather large (almost 120,000 lines) xml file, processing pulls 
in another large xml file. The project compiles under mkiv; with lmtx, I get


tex error   > tex error on line 8 in file : TeX capacity exceeded, 
sorry [reference count=32767]


 \reallanguagetag

just twenty pages shy of the end of the document.

There is an error log with this content:

return {
 ["errortype"]=3,
 ["filename"]="",
 ["lastcontext"]="\n\n\n \\reallanguagetag \n\n 
\\reallanguagetag #1->\\ifcsname \\??languagelinked #1\n\\endcsname 
\\lastnamedcs \\else #1\\fi \n \\setusedlanguage #1->\\edef 
\\currentusedlanguage {\\reallanguagetag {#1}\n}\\ifempty 
\\currentusedlanguage \\let \\currentusedlanguage \\currentlanguage 
\\always\\let \\usedlanguageparameter \\languageparameter \\orelse \\ifx 
\\currentusedlanguage \\v!global \\let \\currentusedlanguage\n\n 
\\typo_delimited_push ...\\currentdelimitedtext {#1}\\edef 
\\m_delimited_argument {#2}\\ifempty \\m_delimited_argument 
\\typo_delimited_set_language_nop \n\\else 
\\typo_delimited_set_language_yes \\fi \\let 
\\currentparentdelimitedtext \\currentdelimitedtext \\global \\advance 
\\c_typo...\n\n \\delimitedtext [#1]#*[#2]->\\dontleavehmode 
\\typo_delimited_push {#1}{#2}\n\\edef \\p_delimited_method 
{\\delimitedtextparameter \\c!method }\\ifx \\p_delimited_method 
\\v!font \\expandafter \\typo_delimited_fontdriven \\else \\expandafter 
\\typo_delimited_other \\fi \n\n \n 
{\n...\n\n \n",

 ["lastluaerror"]="",
 ["lasttexerror"]="TeX capacity exceeded, sorry [reference count=32767]",
 ["lasttexhelp"]="If you really absolutely need more capacity, you can 
ask a wizard to enlarge me.",

 ["linenumber"]=8,
 ["offset"]=10,
 ["skiplinenumber"]=8,
}

 In mkiv, these are the stats at the end of the run:

mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: 
/mnt/shared/lmtx/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.009 seconds, 1 scans 
with scantime 0.005 seconds, 0 shared scans, 27 found files, scanned 
paths: /home/tas/texmf
mkiv lua stats  > stored bytecode data: 455 modules (0.122 sec), 96 
tables (0.007 sec), 551 chunks (0.130 sec)
mkiv lua stats  > traced context: maxstack: 1422, freed: 2, unreachable: 
1420

mkiv lua stats  > cleaned up reserved nodes: 63 nodes, 9 lists of 442
mkiv lua stats  > node memory usage: 17 attribute, 4 attribute_list, 1 
glue, 51 glue_spec, 3 kern, 2 penalty, 2 temp, 2 user_defined
mkiv lua stats  > node list callback tasks: 8 unique task lists, 9336 
instances (re)created, 177413 calls

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

mkiv lua stats  > driver time: 0.886 seconds
mkiv lua stats  > used backend: pdf (backend for directly generating pdf 
output)

mkiv lua stats  > jobdata time: 0.161 seconds saving, 0.052 seconds loading
mkiv lua stats  > callbacks: internal: 261417, file: 319, direct: 3, 
late: 31831, function 200128, total: 493698 (464 per page)

mkiv lua stats  > randomizer: resumed with value 0.47143577262518
mkiv lua stats  > positions: 9535 collected, 9535 regular, 0 special
mkiv lua stats  > v-node processing time: 0.401 seconds
mkiv lua stats  > result saved in file: plutarchusvitae.pdf, 
compresslevel 3, objectcompresslevel 1

mkiv lua stats  > loaded patterns: de::3 en::1 la::65, load time: 0.000
mkiv lua stats  > xml load time: 0.648 seconds, 4 files, 4 converted
mkiv lua stats  > lxml preparation time: 0.626 seconds, 233814 nodes, 
578788 lpath calls, 578743 cached calls

mkiv lua stats  > interactive elements: 0 references, 37 destinations
mkiv lua stats  > margin data: 10798 entries, 0 pending
mkiv lua stats  > loaded fonts: 9 files: garamondpremrpro.otf, 
sabonltstd-bold.otf, sabonltstd-italic.otf, sabonltstd-roman.otf, 
kadmosu.otf, oldstandard-bold.otf, oldstandard-italic.otf, 
xitsmath-regular.otf, dejavusansmono.ttf
mkiv lua stats  > font engine: otf 3.113, afm 1.513, tfm 1.000, 17 
instances, 6 shared in backend, 0 common vectors, 6 common hashes, load 
time 0.146 seconds
mkiv lua stats  > used platform: linux-64, type: unix, binary subtree: 
texmf-linux-64
mkiv lua stats  > used engine: luatex version: 1.13, functionality 
level: 7420, banner: this is luatex, version 1.13.0 (tex live 2021)

mkiv lua stats  > used hash slots: 47131 of 65536 + 25
mkiv lua stats  > lua properties: engine: lua 5.3, used memory: 601 MB, 
ctx: 579 MB, max: unknown MB, hash chars: min(64,40), symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 22.310 seconds, 1068 processed pages, 1068 
shipped pages, 47.871 pages/second

system  | total runtime: 213.928 seconds


Is texmfcnf.lua still the configuration file I need to look at for this 
kind of problem? Which variable could I change?


Thanks, and all best

Thomas

Re: [NTG-context] randomize direction of arrow in metafun

2021-05-15 Thread Thomas A. Schmitz

On 5/15/21 2:42 PM, Mikael Sundqvist wrote:

Hi,

you could do something like this:

\startMPpage
for i = 0 upto 10:
  drawarrow if uniformdeviate(1)<0.5: reverse fi ((0,0)--(2cm,0)) yshifted i*cm;
endfor;
\stopMPpage

/Mikael


Hi Mikael,

wonderful, thanks for the quick answer! Yes that works as intended!

Thomas
___
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] randomize direction of arrow in metafun

2021-05-15 Thread Thomas A. Schmitz

Hi all,

for a slide template, I want to draw colored arrows in a randomized 
color (from a list of colors). This works (and the code is far too 
clever for me, I must have copied it somewhere):


save mycolor ; color mycolor[] ;
mycolor[1] := (0.2, 0.3, 0.4) ;
mycolor[2] := (0.6, 0.6, 0.4) ;
mycolor[3] := (0.5, 0.8, 0.5) ;

so I can write

drawarrow p withcolor mycolor[round(uniformdeviate(9))] ;

But I also want the direction of the arrow to be random. My first idea 
was to define a variable that would expand either to "reverse" or the 
empty string right after drawarrow, but that's where I'm stuck. Anyone 
has an idea how to achieve this? (It's probably somewhere in the source, 
but I can't find it.) And is the method of defining the random color OK, 
or could this also be improved.


Thanks, and all best

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