* synonyms with MKIV @ 2007-12-03 16:44 Peter Münster 2007-12-03 17:58 ` Wolfgang Schuster 0 siblings, 1 reply; 12+ messages in thread From: Peter Münster @ 2007-12-03 16:44 UTC (permalink / raw) To: ConTeXt list Hello, I get unexpected output with this test-file: % engine=luatex \definesynonyms[test][tests] \test{testOne}{first test} \test{testTwo}{second test} \starttext \testOne \placelistoftests \stoptext I would expect: testOne testOne first test but I get: testOne test testOne (Perhaps a problem with parameter numbers #1, #2 etc. ?) Cheers, Peter -- http://pmrb.free.fr/contact/ ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: synonyms with MKIV 2007-12-03 16:44 synonyms with MKIV Peter Münster @ 2007-12-03 17:58 ` Wolfgang Schuster 2007-12-03 19:18 ` Hans Hagen 2007-12-03 19:32 ` Hans Hagen 0 siblings, 2 replies; 12+ messages in thread From: Wolfgang Schuster @ 2007-12-03 17:58 UTC (permalink / raw) To: mailing list for ConTeXt users 2007/12/3, Peter Münster <pmlists@free.fr>: > Hello, > > I get unexpected output with this test-file: > > % engine=luatex > \definesynonyms[test][tests] > \test{testOne}{first test} > \test{testTwo}{second test} > \starttext > \testOne > \placelistoftests > \stoptext > > I would expect: > > testOne > testOne first test > > but I get: > > testOne > test testOne > > (Perhaps a problem with parameter numbers #1, #2 etc. ?) > > Cheers, Peter Hi Peter, this is a bug in the mkiv sorting macros, I posted a similiar message a few days ago but got no answer. http://archive.contextgarden.net/message/20071125.084213.6c34633f.en.html Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: synonyms with MKIV 2007-12-03 17:58 ` Wolfgang Schuster @ 2007-12-03 19:18 ` Hans Hagen 2007-12-03 19:32 ` Hans Hagen 1 sibling, 0 replies; 12+ messages in thread From: Hans Hagen @ 2007-12-03 19:18 UTC (permalink / raw) To: mailing list for ConTeXt users Wolfgang Schuster wrote: > this is a bug in the mkiv sorting macros, I posted a similiar message > a few days ago but got no answer. > > http://archive.contextgarden.net/message/20071125.084213.6c34633f.en.html no time yet -) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: synonyms with MKIV 2007-12-03 17:58 ` Wolfgang Schuster 2007-12-03 19:18 ` Hans Hagen @ 2007-12-03 19:32 ` Hans Hagen 2007-12-04 15:57 ` Wolfgang Schuster 1 sibling, 1 reply; 12+ messages in thread From: Hans Hagen @ 2007-12-03 19:32 UTC (permalink / raw) To: mailing list for ConTeXt users Wolfgang Schuster wrote: > 2007/12/3, Peter Münster <pmlists@free.fr>: >> Hello, >> >> I get unexpected output with this test-file: >> >> % engine=luatex >> \definesynonyms[test][tests] >> \test{testOne}{first test} >> \test{testTwo}{second test} >> \starttext >> \testOne >> \placelistoftests >> \stoptext >> >> I would expect: >> >> testOne >> testOne first test >> >> but I get: >> >> testOne >> test testOne >> >> (Perhaps a problem with parameter numbers #1, #2 etc. ?) >> >> Cheers, Peter > > Hi Peter, > > this is a bug in the mkiv sorting macros, I posted a similiar message > a few days ago but got no answer. \def\mksavesortedlistentry#1#2#3#4% class key entry meaning {\immediatewriteutilitytua{ti(js['#1'],{'e','#2',\!!bs#3\!!es,\!!bs#4\!!es})}} seems to work ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: synonyms with MKIV 2007-12-03 19:32 ` Hans Hagen @ 2007-12-04 15:57 ` Wolfgang Schuster 2007-12-04 18:22 ` Peter Münster 0 siblings, 1 reply; 12+ messages in thread From: Wolfgang Schuster @ 2007-12-04 15:57 UTC (permalink / raw) To: mailing list for ConTeXt users 2007/12/3, Hans Hagen <pragma@wxs.nl>: > Wolfgang Schuster wrote: > > 2007/12/3, Peter Münster <pmlists@free.fr>: > >> Hello, > >> > >> I get unexpected output with this test-file: > >> > >> % engine=luatex > >> \definesynonyms[test][tests] > >> \test{testOne}{first test} > >> \test{testTwo}{second test} > >> \starttext > >> \testOne > >> \placelistoftests > >> \stoptext > >> > >> I would expect: > >> > >> testOne > >> testOne first test > >> > >> but I get: > >> > >> testOne > >> test testOne > >> > >> (Perhaps a problem with parameter numbers #1, #2 etc. ?) > >> > >> Cheers, Peter > > > > Hi Peter, > > > > this is a bug in the mkiv sorting macros, I posted a similiar message > > a few days ago but got no answer. > > \def\mksavesortedlistentry#1#2#3#4% class key entry meaning > > {\immediatewriteutilitytua{ti(js['#1'],{'e','#2',\!!bs#3\!!es,\!!bs#4\!!es})}} > > seems to work this line should be \def\mksavesortedlistentry#1#2#3#4% class key entry meaning {\immediatewriteutilitytua{table.insert(js['#1'],{'e','#1',\!!bs#2\!!es,\!!bs#3\!!es})}} but there is also a big in core-syn.lua the following works for me, the order is "key, value" and not "value, key". I patched this at the moment in my format files and the output of the synonym table is now correct :-) function job.loadsortedlist(class) if job.sortedlists[class] then if not sorters.list.data[class] then sorters.list.data[class] = { language = 'en', entries = { }, flush = function(s) tex.sprint(tex.ctxcatcodes,s) end, sorted = false, class = class } local entries = sorters.list.data[class].entries for k,v in ipairs(job.sortedlists[class]) do if v[1] == 'l' then -- language sorters.list.data[class].language = v[2] else entries[#entries+1] = { v[1], -- kind (e) { { v[2], v[3] } }, -- key, entry v[4] -- optional meaning } end end end sorters.list.process(sorters.list.data[class]) end end Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: synonyms with MKIV 2007-12-04 15:57 ` Wolfgang Schuster @ 2007-12-04 18:22 ` Peter Münster 2007-12-05 8:29 ` Wolfgang Schuster 0 siblings, 1 reply; 12+ messages in thread From: Peter Münster @ 2007-12-04 18:22 UTC (permalink / raw) To: mailing list for ConTeXt users On Tue, Dec 04, 2007 at 04:57:51PM +0100, Wolfgang Schuster wrote: > > > this is a bug in the mkiv sorting macros, I posted a similiar message > > > a few days ago but got no answer. Hello Wolfgang, Indeed, now I remember... (But one long week was time enough for me to forget it.) > > \def\mksavesortedlistentry#1#2#3#4% class key entry meaning > > > > {\immediatewriteutilitytua{ti(js['#1'],{'e','#2',\!!bs#3\!!es,\!!bs#4\!!es})}} > > > > seems to work > > this line should be > > \def\mksavesortedlistentry#1#2#3#4% class key entry meaning > {\immediatewriteutilitytua{table.insert(js['#1'],{'e','#1',\!!bs#2\!!es,\!!bs#3\!!es})}} Both versions give wrong output with optional arguments. But the following version works for me: % engine=luatex \unprotect \def\mksavesortedlistentry#1#2#3#4% class key entry meaning {\immediatewriteutilitytua{table.insert(js['#1'],{'e','#3',\!!bs#3\!!es,\!!bs#4\!!es})}} \protect \definesynonyms[test][tests] \test[bbb]{short text}{long description} \test[aaa]{a short text}{a long description} \starttext \bbb~\aaa \placelistoftests \stoptext Cheers, Peter -- http://pmrb.free.fr/contact/ ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: synonyms with MKIV 2007-12-04 18:22 ` Peter Münster @ 2007-12-05 8:29 ` Wolfgang Schuster 2007-12-05 20:45 ` Peter Münster 0 siblings, 1 reply; 12+ messages in thread From: Wolfgang Schuster @ 2007-12-05 8:29 UTC (permalink / raw) To: mailing list for ConTeXt users 2007/12/4, Peter Münster <pmlists@free.fr>: > On Tue, Dec 04, 2007 at 04:57:51PM +0100, Wolfgang Schuster wrote: > > > > > this is a bug in the mkiv sorting macros, I posted a similiar message > > > > a few days ago but got no answer. > > Hello Wolfgang, > > Indeed, now I remember... > (But one long week was time enough for me to forget it.) > > > > \def\mksavesortedlistentry#1#2#3#4% class key entry meaning > > > > > > {\immediatewriteutilitytua{ti(js['#1'],{'e','#2',\!!bs#3\!!es,\!!bs#4\!!es})}} > > > > > > seems to work > > > > this line should be > > > > \def\mksavesortedlistentry#1#2#3#4% class key entry meaning > > {\immediatewriteutilitytua{table.insert(js['#1'],{'e','#1',\!!bs#2\!!es,\!!bs#3\!!es})}} > > Both versions give wrong output with optional arguments. But the following > version works for me: I forgot to mention you have to regenrate the format with my solution, your seems to work but I found a way to stop processing because you the optinal argument can also be used to write a mcro in the first pair of braces and this can produce problems. You can try to add the following synonym and TeX give you a error message. \test[zB]{z.\thinspace B.}{zum Beispiel} > % engine=luatex > \unprotect > \def\mksavesortedlistentry#1#2#3#4% class key entry meaning > {\immediatewriteutilitytua{table.insert(js['#1'],{'e','#3',\!!bs#3\!!es,\!!bs#4\!!es})}} > \protect > \definesynonyms[test][tests] > \test[bbb]{short text}{long description} > \test[aaa]{a short text}{a long description} > \starttext > \bbb~\aaa > \placelistoftests > \stoptext > > Cheers, Peter Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: synonyms with MKIV 2007-12-05 8:29 ` Wolfgang Schuster @ 2007-12-05 20:45 ` Peter Münster 2007-12-05 22:06 ` Hans Hagen 0 siblings, 1 reply; 12+ messages in thread From: Peter Münster @ 2007-12-05 20:45 UTC (permalink / raw) To: mailing list for ConTeXt users On Wed, Dec 05, 2007 at 09:29:08AM +0100, Wolfgang Schuster wrote: > > > > > > this line should be > > > > > > \def\mksavesortedlistentry#1#2#3#4% class key entry meaning > > > {\immediatewriteutilitytua{table.insert(js['#1'],{'e','#1',\!!bs#2\!!es,\!!bs#3\!!es})}} > > > > Both versions give wrong output with optional arguments. But the following > > version works for me: > > I forgot to mention you have to regenrate the format with my solution, your > seems to work but I found a way to stop processing because you the optinal > argument can also be used to write a mcro in the first pair of braces and this > can produce problems. I've also regenrated the format. But now I understand better: it works well with your patch for core-syn.lua and Hans' patch for core-syn.mkiv: {\immediatewriteutilitytua{table.insert(js['#1'],{'e','#2',\!!bs#3\!!es,\!!bs#4\!!es})}} Cheers, Peter -- http://pmrb.free.fr/contact/ ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: synonyms with MKIV 2007-12-05 20:45 ` Peter Münster @ 2007-12-05 22:06 ` Hans Hagen 2007-12-06 8:26 ` Wolfgang Schuster 0 siblings, 1 reply; 12+ messages in thread From: Hans Hagen @ 2007-12-05 22:06 UTC (permalink / raw) To: mailing list for ConTeXt users Peter Münster wrote: > On Wed, Dec 05, 2007 at 09:29:08AM +0100, Wolfgang Schuster wrote: >>>> this line should be >>>> >>>> \def\mksavesortedlistentry#1#2#3#4% class key entry meaning >>>> {\immediatewriteutilitytua{table.insert(js['#1'],{'e','#1',\!!bs#2\!!es,\!!bs#3\!!es})}} >>> Both versions give wrong output with optional arguments. But the following >>> version works for me: >> I forgot to mention you have to regenrate the format with my solution, your >> seems to work but I found a way to stop processing because you the optinal >> argument can also be used to write a mcro in the first pair of braces and this >> can produce problems. > > I've also regenrated the format. But now I understand better: it works well > with your patch for core-syn.lua and Hans' patch for core-syn.mkiv: > {\immediatewriteutilitytua{table.insert(js['#1'],{'e','#2',\!!bs#3\!!es,\!!bs#4\!!es})}} can you summarize what i need to change? ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: synonyms with MKIV 2007-12-05 22:06 ` Hans Hagen @ 2007-12-06 8:26 ` Wolfgang Schuster 2007-12-06 9:53 ` Hans Hagen 0 siblings, 1 reply; 12+ messages in thread From: Wolfgang Schuster @ 2007-12-06 8:26 UTC (permalink / raw) To: mailing list for ConTeXt users 2007/12/5, Hans Hagen <pragma@wxs.nl>: > Peter Münster wrote: > > On Wed, Dec 05, 2007 at 09:29:08AM +0100, Wolfgang Schuster wrote: > >>>> this line should be > >>>> > >>>> \def\mksavesortedlistentry#1#2#3#4% class key entry meaning > >>>> {\immediatewriteutilitytua{table.insert(js['#1'],{'e','#1',\!!bs#2\!!es,\!!bs#3\!!es})}} > >>> Both versions give wrong output with optional arguments. But the following > >>> version works for me: > >> I forgot to mention you have to regenrate the format with my solution, your > >> seems to work but I found a way to stop processing because you the optinal > >> argument can also be used to write a mcro in the first pair of braces and this > >> can produce problems. > > > > I've also regenrated the format. But now I understand better: it works well > > with your patch for core-syn.lua and Hans' patch for core-syn.mkiv: > > {\immediatewriteutilitytua{table.insert(js['#1'],{'e','#2',\!!bs#3\!!es,\!!bs#4\!!es})}} > > can you summarize what i need to change? Hi Hans, the first part was your change in core-syn.mkiv to wrote all elements to the tua file. The scond correction is on line 108 in core-syn.lua The order of key and entry is, the same as in the mkii macro { { v[2], v[3] } }, -- key, entry but you wrote { { v[3], v[2] } }, -- entry, key and can give the wrong entry in the synonymlist, e.g. \definsynonyms[test][tests] \test[A]{\TeX}{Description Text} give A Description Text and not TeX Description Text I tested already in my own installation and this did work. Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: synonyms with MKIV 2007-12-06 8:26 ` Wolfgang Schuster @ 2007-12-06 9:53 ` Hans Hagen 2007-12-06 14:45 ` Aditya Mahajan 0 siblings, 1 reply; 12+ messages in thread From: Hans Hagen @ 2007-12-06 9:53 UTC (permalink / raw) To: mailing list for ConTeXt users Wolfgang Schuster wrote: > The order of key and entry is, the same as in the mkii macro > > { { v[2], v[3] } }, -- key, entry > > but you wrote > > { { v[3], v[2] } }, -- entry, key ok, fixed just wondering ... now we move to a mix of tex and lua code, how complex is it to piece together what's happening now inside context Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: synonyms with MKIV 2007-12-06 9:53 ` Hans Hagen @ 2007-12-06 14:45 ` Aditya Mahajan 0 siblings, 0 replies; 12+ messages in thread From: Aditya Mahajan @ 2007-12-06 14:45 UTC (permalink / raw) To: mailing list for ConTeXt users On Thu, 6 Dec 2007, Hans Hagen wrote: > Wolfgang Schuster wrote: > >> The order of key and entry is, the same as in the mkii macro >> >> { { v[2], v[3] } }, -- key, entry >> >> but you wrote >> >> { { v[3], v[2] } }, -- entry, key > > ok, fixed > > just wondering ... now we move to a mix of tex and lua code, how complex > is it to piece together what's happening now inside context I think that it is going to be easier (once you get the hang of it). When I started reading mkii code, I understood the steps that were being followed, but the fine details were pretty hard to understand. With luatex, the broad steps are still in tex, so that part is the same, but the fine implementation (that needed a real programming language) are in lua. This makes it much easier to understand. I could read the new mkiv pretty printing code and see what it was doing. With the mkii pretty printing code, I spent about a week and was still clueless (rather, I understood bits and pieces, but there was no way I could extend it to another language). I think that this is enough to overcome to compensate for the overhead between going back and forth between lua and tex code. Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2007-12-06 14:45 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2007-12-03 16:44 synonyms with MKIV Peter Münster 2007-12-03 17:58 ` Wolfgang Schuster 2007-12-03 19:18 ` Hans Hagen 2007-12-03 19:32 ` Hans Hagen 2007-12-04 15:57 ` Wolfgang Schuster 2007-12-04 18:22 ` Peter Münster 2007-12-05 8:29 ` Wolfgang Schuster 2007-12-05 20:45 ` Peter Münster 2007-12-05 22:06 ` Hans Hagen 2007-12-06 8:26 ` Wolfgang Schuster 2007-12-06 9:53 ` Hans Hagen 2007-12-06 14:45 ` Aditya Mahajan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).