* Convertnumber with \ref[number] fails in MkIV, works in LMTX @ 2021-10-28 1:47 Rik Kabel via ntg-context 2021-10-28 2:58 ` Rik Kabel via ntg-context 0 siblings, 1 reply; 9+ messages in thread From: Rik Kabel via ntg-context @ 2021-10-28 1:47 UTC (permalink / raw) To: mailing list for ConTeXt users; +Cc: Rik Kabel [-- Attachment #1.1: Type: text/plain, Size: 675 bytes --] Hello list, The following fails with ConTeXt ver: 2021.10.24 21:45 MKIV but works with the companion LMTX. The error message is:tex error > tex error on line 6 in file G:/TestConTeXt/convert.tex: ! Incompatible glue units , pointing to the second \convertnumber line. \definelabel[XX]%[text=,before=,after=,alternative=inright] \startTEXpage[offset=2em] abc\XX[xx]\par \ref[number][xx] · \convertnumber{r}{1} · \convertnumber{R}{\ref[number][xx]} \stopTEXpage In this case I am trying to display with roman numerals the number generated in the label created through \definelabel. Suggestions welcomed. -- Rik [-- Attachment #1.2: Type: text/html, Size: 1072 bytes --] [-- Attachment #2: Type: text/plain, Size: 493 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Convertnumber with \ref[number] fails in MkIV, works in LMTX 2021-10-28 1:47 Convertnumber with \ref[number] fails in MkIV, works in LMTX Rik Kabel via ntg-context @ 2021-10-28 2:58 ` Rik Kabel via ntg-context 2021-10-28 6:56 ` Hans Hagen via ntg-context 2022-01-19 17:39 ` Rik Kabel via ntg-context 0 siblings, 2 replies; 9+ messages in thread From: Rik Kabel via ntg-context @ 2021-10-28 2:58 UTC (permalink / raw) To: ntg-context; +Cc: Rik Kabel [-- Attachment #1.1: Type: text/plain, Size: 1794 bytes --] Following up on my own note, I see that this fails under LMTX if compiled in a clean directory, but succeeds if first compiled with the troublesome line removed, and then, restoring the line, compiled a second time. It also works by placing a .tuc file from an older version of the document into the directory before compiling. Very strange indeed. The expected output, from one of those successful compilations: So. I am clearly doing something wrong, but sometimes LMTX is letting me get away with it. -- Rik On 10/27/2021 21:47, Rik Kabel via ntg-context wrote: > > Hello list, > > The following fails with ConTeXt ver: 2021.10.24 21:45 MKIV but works > with the companion LMTX. The error message is:tex error > tex > error on line 6 in file G:/TestConTeXt/convert.tex: ! Incompatible > glue units , pointing to the second \convertnumber line. > > \definelabel[XX]%[text=,before=,after=,alternative=inright] > \startTEXpage[offset=2em] > abc\XX[xx]\par > \ref[number][xx] · > \convertnumber{r}{1} · > \convertnumber{R}{\ref[number][xx]} > \stopTEXpage > > In this case I am trying to display with roman numerals the number > generated in the label created through \definelabel. > > Suggestions welcomed. > > -- > Rik > > > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ [-- Attachment #1.2.1: Type: text/html, Size: 3210 bytes --] [-- Attachment #1.2.2: qxrqMGhzvIYHWWt2.png --] [-- Type: image/png, Size: 7124 bytes --] [-- Attachment #2: Type: text/plain, Size: 493 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Convertnumber with \ref[number] fails in MkIV, works in LMTX 2021-10-28 2:58 ` Rik Kabel via ntg-context @ 2021-10-28 6:56 ` Hans Hagen via ntg-context 2021-10-28 17:59 ` Rik Kabel via ntg-context 2022-01-19 17:39 ` Rik Kabel via ntg-context 1 sibling, 1 reply; 9+ messages in thread From: Hans Hagen via ntg-context @ 2021-10-28 6:56 UTC (permalink / raw) To: mailing list for ConTeXt users; +Cc: Hans Hagen On 10/28/2021 4:58 AM, Rik Kabel via ntg-context wrote: > Following up on my own note, I see that this fails under LMTX if > compiled in a clean directory, but succeeds if first compiled with the > troublesome line removed, and then, restoring the line, compiled a > second time. It also works by placing a .tuc file from an older version > of the document into the directory before compiling. Very strange > indeed. The expected output, from one of those successful compilations: > > So. I am clearly doing something wrong, but sometimes LMTX is letting me > get away with it. > > -- > Rik > > On 10/27/2021 21:47, Rik Kabel via ntg-context wrote: >> >> Hello list, >> >> The following fails with ConTeXt ver: 2021.10.24 21:45 MKIV but works >> with the companion LMTX. The error message is:tex error > tex >> error on line 6 in file G:/TestConTeXt/convert.tex: ! Incompatible >> glue units , pointing to the second \convertnumber line. >> >> \definelabel[XX]%[text=,before=,after=,alternative=inright] >> \startTEXpage[offset=2em] >> abc\XX[xx]\par >> \ref[number][xx] · >> \convertnumber{r}{1} · >> \convertnumber{R}{\ref[number][xx]} >> \stopTEXpage >> >> In this case I am trying to display with roman numerals the number >> generated in the label created through \definelabel. >> >> Suggestions welcomed. the conmversion is (partly) done in lua so at some point the \ref[number][xx] gets scanned which is more robust in lmtx than in mkiv normally one does the conversion differently: \definelabel[XX][numberconversion=R] \definelabel[YY][XX][numberconversion=A] \startTEXpage[offset=2em] 1: \XX[xx]\par 2: \YY[xx] \stopTEXpage Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Convertnumber with \ref[number] fails in MkIV, works in LMTX 2021-10-28 6:56 ` Hans Hagen via ntg-context @ 2021-10-28 17:59 ` Rik Kabel via ntg-context 0 siblings, 0 replies; 9+ messages in thread From: Rik Kabel via ntg-context @ 2021-10-28 17:59 UTC (permalink / raw) To: Hans Hagen, mailing list for ConTeXt users; +Cc: Rik Kabel [-- Attachment #1.1: Type: text/plain, Size: 3446 bytes --] On 10/28/2021 02:56, Hans Hagen wrote: > On 10/28/2021 4:58 AM, Rik Kabel via ntg-context wrote: >> Following up on my own note, I see that this fails under LMTX if >> compiled in a clean directory, but succeeds if first compiled with >> the troublesome line removed, and then, restoring the line, compiled >> a second time. It also works by placing a .tuc file from an older >> version of the document into the directory before compiling. Very >> strange indeed. The expected output, from one of those successful >> compilations: >> >> So. I am clearly doing something wrong, but sometimes LMTX is letting >> me get away with it. >> >> -- >> Rik >> >> On 10/27/2021 21:47, Rik Kabel via ntg-context wrote: >>> >>> Hello list, >>> >>> The following fails with ConTeXt ver: 2021.10.24 21:45 MKIV but >>> works with the companion LMTX. The error message is:tex error >>> > tex error on line 6 in file G:/TestConTeXt/convert.tex: ! >>> Incompatible glue units , pointing to the second \convertnumber line. >>> >>> \definelabel[XX]%[text=,before=,after=,alternative=inright] >>> \startTEXpage[offset=2em] >>> abc\XX[xx]\par >>> \ref[number][xx] · >>> \convertnumber{r}{1} · >>> \convertnumber{R}{\ref[number][xx]} >>> \stopTEXpage >>> >>> In this case I am trying to display with roman numerals the number >>> generated in the label created through \definelabel. >>> >>> Suggestions welcomed. > the conmversion is (partly) done in lua so at some point the > > \ref[number][xx] > > gets scanned which is more robust in lmtx than in mkiv > > normally one does the conversion differently: > > \definelabel[XX][numberconversion=R] > \definelabel[YY][XX][numberconversion=A] > > \startTEXpage[offset=2em] > 1: \XX[xx]\par 2: \YY[xx] > \stopTEXpage > > Hans > (Resending because attachment was too large.) That generates a new labeled item albeit with a roman numeral label. I am trying to get the value of a previously generated numeric label converted roman numerals. So, consider that I have a numeric label identifying a paragraph of text. I want to reference that label in another place but need to do it in Latin. I want to convert the original label number to a roman numeral for use in that one place, not generate a new label displayed as a roman numeral. So, \definelabel[XX][text=¶] \define\Naa{\ref[number][aa]} \define[1]\Nnn{\ref[number][#1]} \define\Raa{\convertnumber{R}{\ref[number][aa]}} \define[1]\Rnn{\convertnumber{R}{\ref[number][#1]}} \startTEXpage[offset=2em] Paragraph\XX[aa]\par Paragraph\XX[bb]\par Paragraph\XX[cc]\par 1: \Naa\par 2: \Nnn{bb}\par % these fail without an existing tuc file: I: {\la Vide paragraphum \Raa.}\par II: {\la Vide paragraphum \Rnn{bb}.} \stopTEXpage should produce: Paragraph *¶ 1 *Paragraph *¶ 2* Paragraph *¶ 3* 1: 1 2: 2 I: Vide paragraphum I. II: Vide paragraphum II. but this fails without an existing good tuc file. If I comment out the two latin lines, compile (to failure), and then uncomment the lines and try again, it compiles without error. Does this mean that \ref[number][label] does not really return a number as \convertnumber expects? This is the case with today's upload as well (ConTeXt ver: 2021.10.28 10:19 LMTX). -- Rik [-- Attachment #1.2: Type: text/html, Size: 5136 bytes --] [-- Attachment #2: Type: text/plain, Size: 493 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Convertnumber with \ref[number] fails in MkIV, works in LMTX 2021-10-28 2:58 ` Rik Kabel via ntg-context 2021-10-28 6:56 ` Hans Hagen via ntg-context @ 2022-01-19 17:39 ` Rik Kabel via ntg-context 2022-12-06 20:06 ` Rik Kabel via ntg-context 1 sibling, 1 reply; 9+ messages in thread From: Rik Kabel via ntg-context @ 2022-01-19 17:39 UTC (permalink / raw) To: ntg-context; +Cc: Rik Kabel [-- Attachment #1.1: Type: text/plain, Size: 768 bytes --] This is still a problem with the current standalone. \definelabel[X][text=] \startTEXpage[offset=1cm] \X\X[a]\X[b]\X\par \convertnumber{R}{\ref[number][a]} \convertnumber{G}{\ref[number][b]} \stopTEXpage %% The above example fails to compile when there is no tuc file, %% complaining of a missing number in line 4. When lines 4 %% and 5 are removed and the file is compiled, producing %% a .tuc file, and then they are restored, the example %% compiles without error. The effect of having or not having %% an associated .tuc file does seem a bit odd. Surely there is a way to get the number from a label reference that can then be converted to a numeral of choice. -- Rik [-- Attachment #1.2: Type: text/html, Size: 1220 bytes --] [-- Attachment #2: Type: text/plain, Size: 493 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Convertnumber with \ref[number] fails in MkIV, works in LMTX 2022-01-19 17:39 ` Rik Kabel via ntg-context @ 2022-12-06 20:06 ` Rik Kabel via ntg-context 2022-12-06 20:32 ` Hans Hagen via ntg-context 0 siblings, 1 reply; 9+ messages in thread From: Rik Kabel via ntg-context @ 2022-12-06 20:06 UTC (permalink / raw) To: ntg-context; +Cc: Rik Kabel [-- Attachment #1.1: Type: text/plain, Size: 1070 bytes --] On 2022-01-19 12:39, Rik Kabel via ntg-context wrote: > > This is still a problem with the current standalone. > > \definelabel[X][text=] > \startTEXpage[offset=1cm] > \X\X[a]\X[b]\X\par > \convertnumber{R}{\ref[number][a]} > \convertnumber{G}{\ref[number][b]} > \stopTEXpage > > %% The above example fails to compile when there is no tuc file, > %% complaining of a missing number in line 4. When lines 4 > %% and 5 are removed and the file is compiled, producing > %% a .tuc file, and then they are restored, the example > %% compiles without error. The effect of having or not having > %% an associated .tuc file does seem a bit odd. > > Surely there is a way to get the number from a label reference that > can then be converted to a numeral of choice. > > -- > Rik > (A year later) Is there still no way to do this without resorting to the .tuc-file gimmick? The need is to take a label reference number and display it under a different numberconversion regime. -- Rik [-- Attachment #1.2: Type: text/html, Size: 1832 bytes --] [-- Attachment #2: Type: text/plain, Size: 496 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Convertnumber with \ref[number] fails in MkIV, works in LMTX 2022-12-06 20:06 ` Rik Kabel via ntg-context @ 2022-12-06 20:32 ` Hans Hagen via ntg-context 2022-12-06 21:04 ` Rik Kabel via ntg-context 0 siblings, 1 reply; 9+ messages in thread From: Hans Hagen via ntg-context @ 2022-12-06 20:32 UTC (permalink / raw) To: ntg-context; +Cc: Hans Hagen On 12/6/2022 9:06 PM, Rik Kabel via ntg-context wrote: > \definelabel[X][text=] > \startTEXpage[offset=1cm] > \X\X[a]\X[b]\X\par > \convertnumber{R}{\ref[number][a]} > \convertnumber{G}{\ref[number][b]} > \stopTEXpage maybe like this: \definelabel[X][text=] \startTEXpage[offset=1cm] (\X) (\X[a]) (\X[b]) (\X) \par \doifelsereferencefound {a} {\convertnumber{number}{\currentreferencenumber}} {} \par \doifelsereferencefound {a} {\convertnumber{R}{\currentreferencenumber}} {} \par \doifelsereferencefound {b} {\convertnumber{G}{\currentreferencenumber}} {} \stopTEXpage ----------------------------------------------------------------- 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Convertnumber with \ref[number] fails in MkIV, works in LMTX 2022-12-06 20:32 ` Hans Hagen via ntg-context @ 2022-12-06 21:04 ` Rik Kabel via ntg-context 2022-12-06 21:54 ` Hans Hagen via ntg-context 0 siblings, 1 reply; 9+ messages in thread From: Rik Kabel via ntg-context @ 2022-12-06 21:04 UTC (permalink / raw) To: ntg-context; +Cc: Rik Kabel On 2022-12-06 15:32, Hans Hagen via ntg-context wrote: > On 12/6/2022 9:06 PM, Rik Kabel via ntg-context wrote: >> \definelabel[X][text=] >> \startTEXpage[offset=1cm] >> \X\X[a]\X[b]\X\par >> \convertnumber{R}{\ref[number][a]} >> \convertnumber{G}{\ref[number][b]} >> \stopTEXpage > > maybe like this: > > \definelabel[X][text=] > > \startTEXpage[offset=1cm] > (\X) > (\X[a]) > (\X[b]) > (\X) > \par > \doifelsereferencefound {a} > {\convertnumber{number}{\currentreferencenumber}} > {} > \par > \doifelsereferencefound {a} > {\convertnumber{R}{\currentreferencenumber}} > {} > \par > \doifelsereferencefound {b} > {\convertnumber{G}{\currentreferencenumber}} > {} > \stopTEXpage > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Perfect! Thank you. It looks like \currentreference number is initially empty, and when \doifelsereferencefound succeeds it is set to that value, and remains set to that value until another \doifelsereferencefound is encountered. If \doifelsereferencefound fails, \currentreference is again empty. Is that correct? -- Rik ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Convertnumber with \ref[number] fails in MkIV, works in LMTX 2022-12-06 21:04 ` Rik Kabel via ntg-context @ 2022-12-06 21:54 ` Hans Hagen via ntg-context 0 siblings, 0 replies; 9+ messages in thread From: Hans Hagen via ntg-context @ 2022-12-06 21:54 UTC (permalink / raw) To: Rik Kabel via ntg-context; +Cc: Hans Hagen On 12/6/2022 10:04 PM, Rik Kabel via ntg-context wrote: > > On 2022-12-06 15:32, Hans Hagen via ntg-context wrote: >> On 12/6/2022 9:06 PM, Rik Kabel via ntg-context wrote: >>> \definelabel[X][text=] >>> \startTEXpage[offset=1cm] >>> \X\X[a]\X[b]\X\par >>> \convertnumber{R}{\ref[number][a]} >>> \convertnumber{G}{\ref[number][b]} >>> \stopTEXpage >> >> maybe like this: >> >> \definelabel[X][text=] >> >> \startTEXpage[offset=1cm] >> (\X) >> (\X[a]) >> (\X[b]) >> (\X) >> \par >> \doifelsereferencefound {a} >> {\convertnumber{number}{\currentreferencenumber}} >> {} >> \par >> \doifelsereferencefound {a} >> {\convertnumber{R}{\currentreferencenumber}} >> {} >> \par >> \doifelsereferencefound {b} >> {\convertnumber{G}{\currentreferencenumber}} >> {} >> \stopTEXpage >> >> ----------------------------------------------------------------- >> Hans Hagen | PRAGMA ADE >> > Perfect! Thank you. > > It looks like \currentreference number is initially empty, and when > \doifelsereferencefound succeeds it is set to that value, and remains > set to that value until another \doifelsereferencefound is encountered. > If \doifelsereferencefound fails, \currentreference is again empty. Is > that correct? yes, btw, there are some more \currentreference* available 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-12-06 21:54 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-10-28 1:47 Convertnumber with \ref[number] fails in MkIV, works in LMTX Rik Kabel via ntg-context 2021-10-28 2:58 ` Rik Kabel via ntg-context 2021-10-28 6:56 ` Hans Hagen via ntg-context 2021-10-28 17:59 ` Rik Kabel via ntg-context 2022-01-19 17:39 ` Rik Kabel via ntg-context 2022-12-06 20:06 ` Rik Kabel via ntg-context 2022-12-06 20:32 ` Hans Hagen via ntg-context 2022-12-06 21:04 ` Rik Kabel via ntg-context 2022-12-06 21:54 ` Hans Hagen via ntg-context
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).