[NTG-context] Re: redefine space to be the same as \␣ similar to knuthian approach
On 8/18/2023 8:48 PM, Carlos wrote: And with luatex frozen for better or for worse, I better stick to plain tex not sure what frozen has to do with it ... it will be around and maintained forever but no fundamental new functionality will be added that said: luametatex is of not much use when you use plain (or whatever else) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Some very simple cld - loading a module
Wolfgang: Many thanks for the fix and for the detailed explanation, which was very helpful! Best wishes Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 On Aug 18, 2023, 10:56 AM -0600, Wolfgang Schuster , wrote: ** Caution: EXTERNAL Sender ** Hamid,Idris schrieb am 18.08.2023 um 17:30: Dear gang, The following, simple MWE gives an undefined control sequence error: === % \usemodule[translate] % \enableinputtranslation \startluacode -- context.usemodule({translate}) context.usemodule{translate} context.usemodule({ "first" }) or context.usemodule{ "first" } context.enableinputtranslation() context.darkgreen() \stopluacode \startTEXpage[offset=1em] \translateinput[Hermes][Idris] Hermes \disableinputtranslation Hermes \stopTEXpage === tex error > tex error on line 14 in file ./test-luacode.tex: Undefined control sequence \translateinput [Hermes][Idris] === The reason for the error is that the module is not being loaded. Toggling back to context syntax, of course, works. Reference: ConTeXt Lua Documents by Hans Hagen, page 22. The following analogous code works: \startluacode context.startchapter{first} \stopluacode It doesn't work or at least it does not what you expect, the examples in the manual pass strings ( "..." ) wherever text is expected while you pass a lua variable to the commands. Passing variables only work when the variable itself refers to a string, e.g. translate = "translate" Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Table head/body via lua
On Fri, 18 Aug 2023 21:11:38 +0200 Wolfgang Schuster wrote: > What you can do here is to put the table together piece by piece with > the collecting > mechanism which collect parts of the table until you flush the whole > collection > at the end with the \stopcollecting command. Many thanks, I'll try this. -- Regards, Alexey Kryukov Moscow State University Faculty of History ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Table head/body via lua
Alexey Kryukov schrieb am 18.08.2023 um 20:31: On Fri, 18 Aug 2023 20:12:33 +0200 Wolfgang Schuster wrote: Do you create the whole table with Lua? When this is the case a small change to the table section commands on the Lua side can fix your problems but otherwise a different approach is needed. Hi Wolfgang, thanks for the answer. Basically I would like to typeset a document represented as TEI xml. Unfortunately, TEI support for table typesetting is rather limited: there are no tags corresponding to table head of body. It is only possible to specify a specific role for some rows. So I have to use lua code to add head/body markup where appropriate, and that's exactly what I can't do due to the described problem. If there is no better solution, I can simply extend my xml with custom tags, but I would like to keep it as TEI compliant as possible. What you can do here is to put the table together piece by piece with the collecting mechanism which collect parts of the table until you flush the whole collection at the end with the \stopcollecting command. \starttext \bTABLE \startcollecting \startcollect \bTABLEbody \stopcollect \startcollect \bTR \bTD Cell 1\eTD \bTD Cell 2\eTD \eTR \stopcollect \startcollect \eTABLEbody \stopcollect \stopcollecting \eTABLE \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] unsubscribe
> On 18. Aug 2023, at 20:17, Carlos wrote: > > On Fri, Aug 18, 2023 at 06:20:29PM +0200, Mikael Sundqvist wrote: >> Hi, >> >> It is extremely difficult to follow what you write. >> >> On Fri, Aug 18, 2023 at 11:43 AM Carlos wrote: >>> >>> If I have the following, with these linebreaks as in: >>> >>> {\par But a system cannot be successful if it is too strongly >>> influenced by a single person. {\obeylines Once the initial design is >>> complete and fairly robust, the real test begins as people >>> with many different viewpoints undertake their own >>> experiments.}} >> >> Is that the complete document? What do you have in mind with obeying >> lines in the middle of a paragraph? > > it's the only possible way off the top of my head to circumvent body > font size with a given width, while keeping both: the kern of \TeX\ > and the double spacing that lmtx injects following a sentence, > within sanity check, hence the nonfrenchspacing > > The separation of any of these four components would have hurt T > E X sig > nificantly. > If I had not participated fully in all these activities, literally > hundreds of improvements would never have been made, because I would > never have thought of them or perceived why they were important. > But a system cannot be successful if it is too strongly influenced > by a single person. Once the initial design is > > >> >>> >>> and opted to load another font, other than cmr that is, a \frenchspacing >>> approach wouldn't be further required >> >> cmr? Not used in ConTeXt for a long time. (And what does the changing >> of font have to do with this?) > > latin modern. >> >>> >>> Bear with me here, in the current state, for example, and as long as say >>> >>> «…person.␣{\obeylines Once the initial is >>> complete…» though feasible enough, leaves any prior \␣ at the mercy of >>> whatever fontsize and/or set width happens to be. And this is just plain >>> wrong. >> >> What? >> >>> >>> Likewise, if a word sequence such as \TeX\ occurs as in {\ss The separation >>> of any of these four components would have hurt \TeX\ significantly. } >> >> Likewise what? >> >>> >>> The next sentence: «If I had not participated…» does not get any >>> \nofrenchspacing which is equally and doubly problematic. It shows lack of >>> consistency. And this ought not to be an ‹either› ‹or› scenario. But >>> rather, an and conjunctional construct. It fails both ways. >> >> Consistency of what? Spacing? Where? Can you make a complete example? >> (You can show space amount with \showmakup[space]) > > yes. and showmakeup displays: .SP:10.945 If > > rather than for example with: .SP:5.235 > OnceSP:3.926 > theSP:3.926 > initial SP:3.926 > designSP:3.926 > is > > and > > :3.586 > THK:-1.853 > H__E > X > HK:-1.390 > SP:3.586 > sigRH:0.000 > IR:0.000 > RS:0.000 > LH:0.000 > H__nificantlyLS:0.000BS:6.565 > > > and here's your example: > > \setuplayout[width=16cm] > \showmakeup > > \starttext > > Thus, I came to the conclusion that the designer of a new > system must not only be the implementer and first > large||scale user; the designer should also write the first > user manual. > \setupbodyfont[12.895pt] > > {\ss The separation of any of these four components would have > hurt \TeX\ significantly. If I had not participated fully in > all these activities, literally hundreds of improvements > would never have been made, because I would never have > thought of them or perceived why they were important.\par} > > Do you see that width of 16cm? That's what throws it off > > but then again, anything less than that 12.895 font size, throws off the > kern of \TeX\ too. > > As a result, I can't use any lower font size, before everything, > including kerning of \TeX\ and spaces after sentences, are completely > off. > > I mean. obeylines serve a better function than having extra spaces all > over with no end in sight, really. >> >>> >>> Furthermore, with the same token, if width is specified with a >>> >>> \setuplayout[width=15cm] >> >> OK, here the game changes... >> >>> >>> Anything less than 12.895pt, especifically for that use case, wwould >>> throw anything, particularly control sequences such as \TeX\ out >>> of whack, and conversely, once a value of that very pt or pica or >>> whatever is lowered, it brings that nonfrenchspacing right back on. >>> And if width increments occur, then it follows that any control sequence >>> kerning >>> also gets thrown off as a result. >> >> Of course the width influences the spacing. That is how the paragraph >> builder works (and really, why it often looks good). >> >>> >>> It seems so far, that with lmtx, any standalone file, document, minimal >>> working example that does not load cmr at the outset does not produce >>> an acceptable outcome either. By saying acceptable I meant to say it >>> namely from a typographical point of view. Nothing else. >> >> I have no clue of what you talk about here. >> >>> >>> from the TeXbook
[NTG-context] Re: redefine space to be the same as \␣ similar to knuthian approach
Hi, 1. Learn to two provide a working minimal example which shows the problem. 2. The example below results in a correct output for \TEX. \setuplayout[width=16cm] \showmakeup \starttext Thus, I came to the conclusion that the designer of a new system must not only be the implementer and first large||scale user; the designer should also write the first user manual. \setupbodyfont[12.895pt] {\ss The separation of any of these four components would have hurt \TeX\ significantly. If I had not participated fully in all these activities, literally hundreds of improvements would never have been made, because I would never have thought of them or perceived why they were important.\par} \stoptext Wolfgang test.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: redefine space to be the same as \␣ similar to knuthian approach
On Fri, Aug 18, 2023 at 02:26:55PM -0400, Carlos wrote: > On Fri, Aug 18, 2023 at 06:20:29PM +0200, Mikael Sundqvist wrote: > > Hi, > > > > It is extremely difficult to follow what you write. > > > > On Fri, Aug 18, 2023 at 11:43 AM Carlos wrote: > > > > > > If I have the following, with these linebreaks as in: > > > > > > {\par But a system cannot be successful if it is too strongly > > > influenced by a single person. {\obeylines Once the initial design is > > > complete and fairly robust, the real test begins as people > > > with many different viewpoints undertake their own > > > experiments.}} > > > > Is that the complete document? What do you have in mind with obeying > > lines in the middle of a paragraph? > > > > > > > > and opted to load another font, other than cmr that is, a \frenchspacing > > > approach wouldn't be further required > > > > cmr? Not used in ConTeXt for a long time. (And what does the changing > > of font have to do with this?) > > > > > > > > Bear with me here, in the current state, for example, and as long as say > > > > > > «…person.␣{\obeylines Once the initial is > > > complete…» though feasible enough, leaves any prior \␣ at the mercy of > > > whatever fontsize and/or set width happens to be. And this is just plain > > > wrong. > > > > What? > > > > > > > > Likewise, if a word sequence such as \TeX\ occurs as in {\ss The > > > separation > > > of any of these four components would have hurt \TeX\ significantly. } > > > > Likewise what? > > > > > > > > The next sentence: «If I had not participated…» does not get any > > > \nofrenchspacing which is equally and doubly problematic. It shows lack of > > > consistency. And this ought not to be an ‹either› ‹or› scenario. But > > > rather, an and conjunctional construct. It fails both ways. > > > > Consistency of what? Spacing? Where? Can you make a complete example? > > (You can show space amount with \showmakup[space]) > > > > > > > > Furthermore, with the same token, if width is specified with a > > > > > > \setuplayout[width=15cm] > > > > OK, here the game changes... > > > > > > > > Anything less than 12.895pt, especifically for that use case, wwould > > > throw anything, particularly control sequences such as \TeX\ out > > > of whack, and conversely, once a value of that very pt or pica or > > > whatever is lowered, it brings that nonfrenchspacing right back on. > > > And if width increments occur, then it follows that any control sequence > > > kerning > > > also gets thrown off as a result. > > > > Of course the width influences the spacing. That is how the paragraph > > builder works (and really, why it often looks good). > > > > > > > > It seems so far, that with lmtx, any standalone file, document, minimal > > > working example that does not load cmr at the outset does not produce > > > an acceptable outcome either. By saying acceptable I meant to say it > > > namely from a typographical point of view. Nothing else. > > > > I have no clue of what you talk about here. > > > > > > > > from the TeXbook 380-381 > > > > > > «\obeylines doesn’t say ‘\def^^M{\par}’, so we must make any desired > > > changes to > > > \par before invoking \obeylines. (2) The \uncatcodespecials operation > > > changes a > > > space to category 12; but the \tt font has the character ‘␣’ in the > > > ⟨space⟩ position, so we > > > don’t really want ␣12 . (3) The \obeyspaces macro in Appendix B merely > > > changes the > > > ⟨space⟩ character to category 13; active character ␣13 has been defined > > > to be the same > > > as \space, a macro that expands to ␣10 . This is usually what is desired; > > > for example, > > > it means that spaces in constructions like ‘\hbox to 10 pt {...}’ won’t > > > cause any > > > trouble. But in our application it has an undesirable effect, because it > > > produces spaces > > > that are affected by the space factor. To defeat this feature, it’s > > > necessary either to > > > say \frenchspacing or to redefine ␣13 to be the same as \␣. The latter > > > alternative is > > > better, because the former will discard spaces at the beginning of each > > > line.» > > > > > > «In theory, this seems like it ought to work; but in practice, it fails > > > in two ways. One > > > rather obvious failure—at least, it becomes obvious when the macro is > > > tested—is that > > > all the empty lines of the file are omitted. The reason is that the \par > > > command at the > > > end of an empty line doesn’t start up a new paragraph, because it occurs > > > in vertical > > > mode. The other failure is not as obvious, because it occurs much less > > > often: The \tt > > > fonts contain ligatures for Spanish punctuation, so the sequences ?‘ and > > > !‘ will be > > > printed as ¿ and ¡ respectively. Both of these defects can be cured by > > > inserting > > > > > > and > > > > > > > > > «When INITEX creates a brand new TEX, all characters have a space factor > > > code > > > of 1000, except that the
[NTG-context] Re: Table head/body via lua
On Fri, 18 Aug 2023 20:12:33 +0200 Wolfgang Schuster wrote: > Do you create the whole table with Lua? When this is the case a small > change to the table section > commands on the Lua side can fix your problems but otherwise a > different approach is needed. Hi Wolfgang, thanks for the answer. Basically I would like to typeset a document represented as TEI xml. Unfortunately, TEI support for table typesetting is rather limited: there are no tags corresponding to table head of body. It is only possible to specify a specific role for some rows. So I have to use lua code to add head/body markup where appropriate, and that's exactly what I can't do due to the described problem. If there is no better solution, I can simply extend my xml with custom tags, but I would like to keep it as TEI compliant as possible. -- Regards, Alexey Kryukov Moscow State University Faculty of History ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: redefine space to be the same as \␣ similar to knuthian approach
On Fri, Aug 18, 2023 at 06:20:29PM +0200, Mikael Sundqvist wrote: > Hi, > > It is extremely difficult to follow what you write. > > On Fri, Aug 18, 2023 at 11:43 AM Carlos wrote: > > > > If I have the following, with these linebreaks as in: > > > > {\par But a system cannot be successful if it is too strongly > > influenced by a single person. {\obeylines Once the initial design is > > complete and fairly robust, the real test begins as people > > with many different viewpoints undertake their own > > experiments.}} > > Is that the complete document? What do you have in mind with obeying > lines in the middle of a paragraph? > > > > > and opted to load another font, other than cmr that is, a \frenchspacing > > approach wouldn't be further required > > cmr? Not used in ConTeXt for a long time. (And what does the changing > of font have to do with this?) > > > > > Bear with me here, in the current state, for example, and as long as say > > > > «…person.␣{\obeylines Once the initial is > > complete…» though feasible enough, leaves any prior \␣ at the mercy of > > whatever fontsize and/or set width happens to be. And this is just plain > > wrong. > > What? > > > > > Likewise, if a word sequence such as \TeX\ occurs as in {\ss The separation > > of any of these four components would have hurt \TeX\ significantly. } > > Likewise what? > > > > > The next sentence: «If I had not participated…» does not get any > > \nofrenchspacing which is equally and doubly problematic. It shows lack of > > consistency. And this ought not to be an ‹either› ‹or› scenario. But > > rather, an and conjunctional construct. It fails both ways. > > Consistency of what? Spacing? Where? Can you make a complete example? > (You can show space amount with \showmakup[space]) > > > > > Furthermore, with the same token, if width is specified with a > > > > \setuplayout[width=15cm] > > OK, here the game changes... > > > > > Anything less than 12.895pt, especifically for that use case, wwould > > throw anything, particularly control sequences such as \TeX\ out > > of whack, and conversely, once a value of that very pt or pica or > > whatever is lowered, it brings that nonfrenchspacing right back on. > > And if width increments occur, then it follows that any control sequence > > kerning > > also gets thrown off as a result. > > Of course the width influences the spacing. That is how the paragraph > builder works (and really, why it often looks good). > > > > > It seems so far, that with lmtx, any standalone file, document, minimal > > working example that does not load cmr at the outset does not produce > > an acceptable outcome either. By saying acceptable I meant to say it > > namely from a typographical point of view. Nothing else. > > I have no clue of what you talk about here. > > > > > from the TeXbook 380-381 > > > > «\obeylines doesn’t say ‘\def^^M{\par}’, so we must make any desired > > changes to > > \par before invoking \obeylines. (2) The \uncatcodespecials operation > > changes a > > space to category 12; but the \tt font has the character ‘␣’ in the ⟨space⟩ > > position, so we > > don’t really want ␣12 . (3) The \obeyspaces macro in Appendix B merely > > changes the > > ⟨space⟩ character to category 13; active character ␣13 has been defined to > > be the same > > as \space, a macro that expands to ␣10 . This is usually what is desired; > > for example, > > it means that spaces in constructions like ‘\hbox to 10 pt {...}’ won’t > > cause any > > trouble. But in our application it has an undesirable effect, because it > > produces spaces > > that are affected by the space factor. To defeat this feature, it’s > > necessary either to > > say \frenchspacing or to redefine ␣13 to be the same as \␣. The latter > > alternative is > > better, because the former will discard spaces at the beginning of each > > line.» > > > > «In theory, this seems like it ought to work; but in practice, it fails in > > two ways. One > > rather obvious failure—at least, it becomes obvious when the macro is > > tested—is that > > all the empty lines of the file are omitted. The reason is that the \par > > command at the > > end of an empty line doesn’t start up a new paragraph, because it occurs in > > vertical > > mode. The other failure is not as obvious, because it occurs much less > > often: The \tt > > fonts contain ligatures for Spanish punctuation, so the sequences ?‘ and !‘ > > will be > > printed as ¿ and ¡ respectively. Both of these defects can be cured by > > inserting > > > > and > > > > > > «When INITEX creates a brand new TEX, all characters have a space factor > > code > > of 1000, except that the uppercase letters ‘A’ through ‘Z’ have code 999. > > (This > > slight difference is what makes punctuation act differently after an > > uppercase letter; do > > you see why?) Plain TEX redefines a few of these codes using the \sfcode > > primitive, > > which is similar to \catcode (see Appendix B); for example,
[NTG-context] Re: redefine space to be the same as \␣ similar to knuthian approach
On Fri, Aug 18, 2023 at 06:20:29PM +0200, Mikael Sundqvist wrote: > Hi, > > It is extremely difficult to follow what you write. > > On Fri, Aug 18, 2023 at 11:43 AM Carlos wrote: > > > > If I have the following, with these linebreaks as in: > > > > {\par But a system cannot be successful if it is too strongly > > influenced by a single person. {\obeylines Once the initial design is > > complete and fairly robust, the real test begins as people > > with many different viewpoints undertake their own > > experiments.}} > > Is that the complete document? What do you have in mind with obeying > lines in the middle of a paragraph? it's the only possible way off the top of my head to circumvent body font size with a given width, while keeping both: the kern of \TeX\ and the double spacing that lmtx injects following a sentence, within sanity check, hence the nonfrenchspacing The separation of any of these four components would have hurt T E X sig nificantly. If I had not participated fully in all these activities, literally hundreds of improvements would never have been made, because I would never have thought of them or perceived why they were important. But a system cannot be successful if it is too strongly influenced by a single person. Once the initial design is > > > > > and opted to load another font, other than cmr that is, a \frenchspacing > > approach wouldn't be further required > > cmr? Not used in ConTeXt for a long time. (And what does the changing > of font have to do with this?) latin modern. > > > > > Bear with me here, in the current state, for example, and as long as say > > > > «…person.␣{\obeylines Once the initial is > > complete…» though feasible enough, leaves any prior \␣ at the mercy of > > whatever fontsize and/or set width happens to be. And this is just plain > > wrong. > > What? > > > > > Likewise, if a word sequence such as \TeX\ occurs as in {\ss The separation > > of any of these four components would have hurt \TeX\ significantly. } > > Likewise what? > > > > > The next sentence: «If I had not participated…» does not get any > > \nofrenchspacing which is equally and doubly problematic. It shows lack of > > consistency. And this ought not to be an ‹either› ‹or› scenario. But > > rather, an and conjunctional construct. It fails both ways. > > Consistency of what? Spacing? Where? Can you make a complete example? > (You can show space amount with \showmakup[space]) yes. and showmakeup displays: .SP:10.945 If rather than for example with: .SP:5.235 OnceSP:3.926 theSP:3.926 initial SP:3.926 designSP:3.926 is and :3.586 THK:-1.853 H__E X HK:-1.390 SP:3.586 sigRH:0.000 IR:0.000 RS:0.000 LH:0.000 H__nificantlyLS:0.000BS:6.565 and here's your example: \setuplayout[width=16cm] \showmakeup \starttext Thus, I came to the conclusion that the designer of a new system must not only be the implementer and first large||scale user; the designer should also write the first user manual. \setupbodyfont[12.895pt] {\ss The separation of any of these four components would have hurt \TeX\ significantly. If I had not participated fully in all these activities, literally hundreds of improvements would never have been made, because I would never have thought of them or perceived why they were important.\par} Do you see that width of 16cm? That's what throws it off but then again, anything less than that 12.895 font size, throws off the kern of \TeX\ too. As a result, I can't use any lower font size, before everything, including kerning of \TeX\ and spaces after sentences, are completely off. I mean. obeylines serve a better function than having extra spaces all over with no end in sight, really. > > > > > Furthermore, with the same token, if width is specified with a > > > > \setuplayout[width=15cm] > > OK, here the game changes... > > > > > Anything less than 12.895pt, especifically for that use case, wwould > > throw anything, particularly control sequences such as \TeX\ out > > of whack, and conversely, once a value of that very pt or pica or > > whatever is lowered, it brings that nonfrenchspacing right back on. > > And if width increments occur, then it follows that any control sequence > > kerning > > also gets thrown off as a result. > > Of course the width influences the spacing. That is how the paragraph > builder works (and really, why it often looks good). > > > > > It seems so far, that with lmtx, any standalone file, document, minimal > > working example that does not load cmr at the outset does not produce > > an acceptable outcome either. By saying acceptable I meant to say it > > namely from a typographical point of view. Nothing else. > > I have no clue of what you talk about here. > > > > > from the TeXbook 380-381 > > > > «\obeylines doesn’t say ‘\def^^M{\par}’, so we must make any desired > > changes to > > \par before invoking \obeylines. (2) The \uncatcodespecials operation > > changes a > > space to category 12; but the
[NTG-context] Re: Table head/body via lua
Alexey Kryukov schrieb am 18.08.2023 um 19:02: Hi, I am trying to generate a table representation for some xml source. As the data structure doesn't directly correspond to the desired table structure, some manipulations via lua are required. So far everything works OK except table sectioning commands, like \bTABLEhead, \eTABLEhead, bTABLEbody or \eTABLEbody: it seems impossible to incapsulate them into lua functions. For example, the following is not compiled: \starttext \bTABLE \ctxlua{context.bTABLEbody()} \bTR \bTD Cell 1\eTD \bTD Cell 2\eTD \eTR \ctxlua{context.eTABLEbody()} \eTABLE \stoptext Can anybody suggest a workaround (except changing the source XML of course)? Do you create the whole table with Lua? When this is the case a small change to the table section commands on the Lua side can fix your problems but otherwise a different approach is needed. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Table head/body via lua
Hi, I am trying to generate a table representation for some xml source. As the data structure doesn't directly correspond to the desired table structure, some manipulations via lua are required. So far everything works OK except table sectioning commands, like \bTABLEhead, \eTABLEhead, bTABLEbody or \eTABLEbody: it seems impossible to incapsulate them into lua functions. For example, the following is not compiled: \starttext \bTABLE \ctxlua{context.bTABLEbody()} \bTR \bTD Cell 1\eTD \bTD Cell 2\eTD \eTR \ctxlua{context.eTABLEbody()} \eTABLE \stoptext Can anybody suggest a workaround (except changing the source XML of course)? -- Regards, Alexey Kryukov Moscow State University Faculty of History ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Some very simple cld - loading a module
Hamid,Idris schrieb am 18.08.2023 um 17:30: Dear gang, The following, simple MWE gives an undefined control sequence error: === % \usemodule[translate] % \enableinputtranslation \startluacode -- context.usemodule({translate}) context.usemodule{translate} context.usemodule({ "first" }) or context.usemodule{ "first" } context.enableinputtranslation() context.darkgreen() \stopluacode \startTEXpage[offset=1em] \translateinput[Hermes][Idris] Hermes \disableinputtranslation Hermes \stopTEXpage === tex error > tex error on line 14 in file ./test-luacode.tex: Undefined control sequence \translateinput [Hermes][Idris] === The reason for the error is that the module is not being loaded. Toggling back to context syntax, of course, works. Reference: ConTeXt Lua Documents by Hans Hagen, page 22. The following analogous code works: \startluacode context.startchapter{first} \stopluacode It doesn't work or at least it does not what you expect, the examples in the manual pass strings ( "..." ) wherever text is expected while you pass a lua variable to the commands. Passing variables only work when the variable itself refers to a string, e.g. translate = "translate" Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Experiments with \doloopoverlist
I was using an old LMTX copy, and that was the issue. Thanks to Hans for pointing that out. Now I'm trying to expand my solution a little more. Is there any way to retrieve an element in a dataset by using the key? For example, given an "authors" dataset, I would like to do something similar to: %% Given this data structure ... \setdataset[authors][ nombre={Andrés Conrado Montoya Acosta}, bio={This is a bio, it could be two or three paragraphs long}, email={loremip...@email.edu.co}, cvlac={ https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002125949 }, orcid={https://orcid.org/0009-0007-0765-4241}, gscholar={ https://scholar.google.com/citations?user=GpYTTU0J=es=1}, ] %% I want to do something like \startGetAuthor[nombre={Andrés Conrado Montoya Acosta}] \datasetentry{bio}\par email: \mailhref{\datasetentry{email}} \stopGetAuthor So, if my name is found in the dataset, get the data for that name. Is something like that possible? Thank you for your time. -- Andrés Conrado Montoya Andi Kú andresconr...@gmail.com http://sesentaycuatro.com http://messier87.com http://chiquitico.org Los fines no justifican los medios, porque la medida verdadera de nuestro carácter está dada por los medios que estamos dispuestos a utilizar, no por los fines que proclamamos. “You develop an instant global consciousness, a people orientation, an intense dissatisfaction with the state of the world, and a compulsion to do something about it. From out there on the moon, international politics look so petty. You want to grab a politician by the scruff of the neck and drag him a quarter of a million miles out and say, ‘Look at that, you son of a bitch.’” — Apollo 14 astronaut Edgar Mitchell ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: redefine space to be the same as \␣ similar to knuthian approach
Hi, It is extremely difficult to follow what you write. On Fri, Aug 18, 2023 at 11:43 AM Carlos wrote: > > If I have the following, with these linebreaks as in: > > {\par But a system cannot be successful if it is too strongly > influenced by a single person. {\obeylines Once the initial design is > complete and fairly robust, the real test begins as people > with many different viewpoints undertake their own > experiments.}} Is that the complete document? What do you have in mind with obeying lines in the middle of a paragraph? > > and opted to load another font, other than cmr that is, a \frenchspacing > approach wouldn't be further required cmr? Not used in ConTeXt for a long time. (And what does the changing of font have to do with this?) > > Bear with me here, in the current state, for example, and as long as say > > «…person.␣{\obeylines Once the initial is > complete…» though feasible enough, leaves any prior \␣ at the mercy of > whatever fontsize and/or set width happens to be. And this is just plain > wrong. What? > > Likewise, if a word sequence such as \TeX\ occurs as in {\ss The separation > of any of these four components would have hurt \TeX\ significantly. } Likewise what? > > The next sentence: «If I had not participated…» does not get any > \nofrenchspacing which is equally and doubly problematic. It shows lack of > consistency. And this ought not to be an ‹either› ‹or› scenario. But > rather, an and conjunctional construct. It fails both ways. Consistency of what? Spacing? Where? Can you make a complete example? (You can show space amount with \showmakup[space]) > > Furthermore, with the same token, if width is specified with a > > \setuplayout[width=15cm] OK, here the game changes... > > Anything less than 12.895pt, especifically for that use case, wwould > throw anything, particularly control sequences such as \TeX\ out > of whack, and conversely, once a value of that very pt or pica or > whatever is lowered, it brings that nonfrenchspacing right back on. > And if width increments occur, then it follows that any control sequence > kerning > also gets thrown off as a result. Of course the width influences the spacing. That is how the paragraph builder works (and really, why it often looks good). > > It seems so far, that with lmtx, any standalone file, document, minimal > working example that does not load cmr at the outset does not produce > an acceptable outcome either. By saying acceptable I meant to say it > namely from a typographical point of view. Nothing else. I have no clue of what you talk about here. > > from the TeXbook 380-381 > > «\obeylines doesn’t say ‘\def^^M{\par}’, so we must make any desired changes > to > \par before invoking \obeylines. (2) The \uncatcodespecials operation changes > a > space to category 12; but the \tt font has the character ‘␣’ in the ⟨space⟩ > position, so we > don’t really want ␣12 . (3) The \obeyspaces macro in Appendix B merely > changes the > ⟨space⟩ character to category 13; active character ␣13 has been defined to be > the same > as \space, a macro that expands to ␣10 . This is usually what is desired; for > example, > it means that spaces in constructions like ‘\hbox to 10 pt {...}’ won’t cause > any > trouble. But in our application it has an undesirable effect, because it > produces spaces > that are affected by the space factor. To defeat this feature, it’s necessary > either to > say \frenchspacing or to redefine ␣13 to be the same as \␣. The latter > alternative is > better, because the former will discard spaces at the beginning of each > line.» > > «In theory, this seems like it ought to work; but in practice, it fails in > two ways. One > rather obvious failure—at least, it becomes obvious when the macro is > tested—is that > all the empty lines of the file are omitted. The reason is that the \par > command at the > end of an empty line doesn’t start up a new paragraph, because it occurs in > vertical > mode. The other failure is not as obvious, because it occurs much less often: > The \tt > fonts contain ligatures for Spanish punctuation, so the sequences ?‘ and !‘ > will be > printed as ¿ and ¡ respectively. Both of these defects can be cured by > inserting > > and > > > «When INITEX creates a brand new TEX, all characters have a space factor code > of 1000, except that the uppercase letters ‘A’ through ‘Z’ have code 999. > (This > slight difference is what makes punctuation act differently after an > uppercase letter; do > you see why?) Plain TEX redefines a few of these codes using the \sfcode > primitive, > which is similar to \catcode (see Appendix B); for example, the instructions > \sfcode‘)=0 > \sfcode‘.=3000 > make right parentheses “transparent” to the space factor, while tripling the > stretcha- > bility after periods. The \frenchspacing operation resets \sfcode‘. to > 1000.» Everything you cite above is very likely true for plain TeX, but maybe not for ConTeXt... /Mikael PS
[NTG-context] Some very simple cld - loading a module
Dear gang, The following, simple MWE gives an undefined control sequence error: === % \usemodule[translate] % \enableinputtranslation \startluacode -- context.usemodule({translate}) context.usemodule{translate} context.enableinputtranslation() context.darkgreen() \stopluacode \startTEXpage[offset=1em] \translateinput[Hermes][Idris] Hermes \disableinputtranslation Hermes \stopTEXpage === tex error > tex error on line 14 in file ./test-luacode.tex: Undefined control sequence \translateinput [Hermes][Idris] === The reason for the error is that the module is not being loaded. Toggling back to context syntax, of course, works. Reference: ConTeXt Lua Documents by Hans Hagen, page 22. The following analogous code works: \startluacode context.startchapter{first} \stopluacode So how do we properly load the module from within a luacode environment? Thank you in advance. Best wishes Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Penalties and overprinting in tabulate
On 8/18/2023 4:36 PM, denis.ma...@unibe.ch wrote: Dear list, typesetting the example below results in lines printed above each other? Without the penalties, this doesn't happen. What am I missing here? How I can use the penalties without the not wanted overprinting? Best, Denis \startsetups[mypenalties] \setdefaultpenalties \setpenalties\clubpenalties{1}{150} \setpenalties\widowpenalties{1}{1} \setpenalties\displaywidowpenalties{1}{1} \stopsetups \setuplayout[setups=mypenalties] \starttext \starttabulate[|p(.15\textwidth)|p|] \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \stoptabulate \stoptext \unprotect \c_tabl_tabulate_splitlinemode\plustwo \protect maybe in the meantime that should be default Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Penalties and overprinting in tabulate
On 8/18/2023 4:36 PM, denis.ma...@unibe.ch wrote: Dear list, typesetting the example below results in lines printed above each other? Without the penalties, this doesn't happen. What am I missing here? How I can use the penalties without the not wanted overprinting? Best, Denis \startsetups[mypenalties] \setdefaultpenalties \setpenalties\clubpenalties{1}{150} \setpenalties\widowpenalties{1}{1} \setpenalties\displaywidowpenalties{1}{1} \stopsetups \setuplayout[setups=mypenalties] \starttext \starttabulate[|p(.15\textwidth)|p|] \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \stoptabulate \stoptext \startsetups[nopenalties] \setdefaultpenalties \stopsetups % \setuptabulate[setups=nopenalties] % in next version \setuptabulate[inner=\setups{nopenalties}] or \starttabulate[|p(.15\textwidth)s{nopenalties}|ps{nopenalties}|] but i admit it needs some thought ... outer level only but that is also pretty much an engine thing then (no big deal but ... needs pondering) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Penalties and overprinting in tabulate
Dear list, typesetting the example below results in lines printed above each other? Without the penalties, this doesn't happen. What am I missing here? How I can use the penalties without the not wanted overprinting? Best, Denis \startsetups[mypenalties] \setdefaultpenalties \setpenalties\clubpenalties{1}{150} \setpenalties\widowpenalties{1}{1} \setpenalties\displaywidowpenalties{1}{1} \stopsetups \setuplayout[setups=mypenalties] \starttext \starttabulate[|p(.15\textwidth)|p|] \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf \NC \NR \stoptabulate \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: breakpoints in verbatim text
On 8/18/2023 1:02 PM, Wolfgang Schuster wrote: Alex Leray schrieb am 18.08.2023 um 12:19: Hello Wolfgang, Le 17/08/23 à 18:56, Wolfgang Schuster a écrit : Is it correct all your listing are HTML code and you need line breaks for the entries of the href attributes? The content is from a dutch net-artist artist from the early days of the public web, and is often (volontary) mixing different natural nd machine langages. Not all snippets are HTML, but most of them are some sort of HTML pidgin. I see, the typing environment is in this case the safest option to ensure special characters like % remain i the output. For simple text without special characters you could have switched to the lines environment and use a monospaced but I wouldn't trust it here (even when you enable \asciimode). Syntax highlighting of the code listing isn't needed in your case. No, I don't need syntax highlighting My problem is solved using manual zero width spaces at the moment but I'd be interested to find a more structural solution. Checking at the Context source code I would have thought that breakpoints were possible withing typing env. See https://source.contextgarden.net/tex/context/base/mkiv/buff-ver.mkiv?search=typing#l51 It would be interesting to document on the wiki that behavior, which I can do later when my understanding is better. The typing environment disables the breakpoint (and a few other) mechanism because they can lead to undesired side effects but Hans suggestion to provide a hook which can be used to re-enable the feature, e.g. \startsetups [typing:mine] \setbreakpoints[compound] \stopsetups \setuptyping [CUSTOM] [setups=typing:mine] The only flaw I can see in the suggestion is the use of the \everyinitializeverbatim register because it is used for inline and display verbatim. A better place to add the option is \buff_verbatim_initialize_typing_two for \starttyping and \buff_verbatim_initialize_type_two for \type. ok -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] redefine space to be the same as \␣ similar to knuthian approach
If I have the following, with these linebreaks as in: {\par But a system cannot be successful if it is too strongly influenced by a single person. {\obeylines Once the initial design is complete and fairly robust, the real test begins as people with many different viewpoints undertake their own experiments.}} and opted to load another font, other than cmr that is, a \frenchspacing approach wouldn't be further required Bear with me here, in the current state, for example, and as long as say «…person.␣{\obeylines Once the initial is complete…» though feasible enough, leaves any prior \␣ at the mercy of whatever fontsize and/or set width happens to be. And this is just plain wrong. Likewise, if a word sequence such as \TeX\ occurs as in {\ss The separation of any of these four components would have hurt \TeX\ significantly. } The next sentence: «If I had not participated…» does not get any \nofrenchspacing which is equally and doubly problematic. It shows lack of consistency. And this ought not to be an ‹either› ‹or› scenario. But rather, an and conjunctional construct. It fails both ways. Furthermore, with the same token, if width is specified with a \setuplayout[width=15cm] Anything less than 12.895pt, especifically for that use case, wwould throw anything, particularly control sequences such as \TeX\ out of whack, and conversely, once a value of that very pt or pica or whatever is lowered, it brings that nonfrenchspacing right back on. And if width increments occur, then it follows that any control sequence kerning also gets thrown off as a result. It seems so far, that with lmtx, any standalone file, document, minimal working example that does not load cmr at the outset does not produce an acceptable outcome either. By saying acceptable I meant to say it namely from a typographical point of view. Nothing else. from the TeXbook 380-381 «\obeylines doesn’t say ‘\def^^M{\par}’, so we must make any desired changes to \par before invoking \obeylines. (2) The \uncatcodespecials operation changes a space to category 12; but the \tt font has the character ‘␣’ in the ⟨space⟩ position, so we don’t really want ␣12 . (3) The \obeyspaces macro in Appendix B merely changes the ⟨space⟩ character to category 13; active character ␣13 has been defined to be the same as \space, a macro that expands to ␣10 . This is usually what is desired; for example, it means that spaces in constructions like ‘\hbox to 10 pt {...}’ won’t cause any trouble. But in our application it has an undesirable effect, because it produces spaces that are affected by the space factor. To defeat this feature, it’s necessary either to say \frenchspacing or to redefine ␣13 to be the same as \␣. The latter alternative is better, because the former will discard spaces at the beginning of each line.» «In theory, this seems like it ought to work; but in practice, it fails in two ways. One rather obvious failure—at least, it becomes obvious when the macro is tested—is that all the empty lines of the file are omitted. The reason is that the \par command at the end of an empty line doesn’t start up a new paragraph, because it occurs in vertical mode. The other failure is not as obvious, because it occurs much less often: The \tt fonts contain ligatures for Spanish punctuation, so the sequences ?‘ and !‘ will be printed as ¿ and ¡ respectively. Both of these defects can be cured by inserting and «When INITEX creates a brand new TEX, all characters have a space factor code of 1000, except that the uppercase letters ‘A’ through ‘Z’ have code 999. (This slight difference is what makes punctuation act differently after an uppercase letter; do you see why?) Plain TEX redefines a few of these codes using the \sfcode primitive, which is similar to \catcode (see Appendix B); for example, the instructions \sfcode‘)=0 \sfcode‘.=3000 make right parentheses “transparent” to the space factor, while tripling the stretcha- bility after periods. The \frenchspacing operation resets \sfcode‘. to 1000.» -- If at first you don't succeed, you must be a programmer. ___ 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 ___