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
___