defining a comamnd as variable which behaves as constant
Dear list, I have the following document: \mainlanguage[es] \starttext \startTEXpage[offset=1em] \dorecurse{27}% {\def\abcd{\convertnumber{a}{\recurselevel}}% \dorecurse{27}% {\abcd\convertnumber{a}{\recurselevel} }\par} \stopTEXpage \stoptext I want to test all lowercase-letter pairs in Spanish. Excuse me for my missing programming notions. For the sample above, I would need a command that behaves as a variable when defined, but as a constant when invoked. Is there any way to achieve that without using counters? Sorry if there is too much nonsense in the previous paragraph. But I need to know how to do it for another example too. Many thanks for your help, Pablo -- http://www.ousia.tk
On Sun, 10 Apr 2016, Pablo Rodriguez wrote:
Dear list,
I have the following document:
\mainlanguage[es] \starttext \startTEXpage[offset=1em] \dorecurse{27}% {\def\abcd{\convertnumber{a}{\recurselevel}}% \dorecurse{27}% {\abcd\convertnumber{a}{\recurselevel} }\par} \stopTEXpage \stoptext
I want to test all lowercase-letter pairs in Spanish.
Is there any way to achieve that without using counters? Sorry if there is too much nonsense in the previous paragraph. But I need to know how to do it for another example too.
\edef\abcd{....} Aditya
On 04/10/2016 07:17 AM, Aditya Mahajan wrote:
On Sun, 10 Apr 2016, Pablo Rodriguez wrote:
[...] Is there any way to achieve that without using counters? Sorry if there is too much nonsense in the previous paragraph. But I need to know how to do it for another example too.
\edef\abcd{....}
Thank you very much for your reply, Aditya. I have seen \edef for years, but I didn’t know what it actually was. Many thanks again for your help, Pablo -- http://www.ousia.tk
Pablo Rodriguez mailto:oinos@gmx.es 10. April 2016 um 00:00 Dear list,
I have the following document:
\mainlanguage[es] \starttext \startTEXpage[offset=1em] \dorecurse{27}% {\def\abcd{\convertnumber{a}{\recurselevel}}% \dorecurse{27}% {\abcd\convertnumber{a}{\recurselevel} }\par} \stopTEXpage \stoptext
I want to test all lowercase-letter pairs in Spanish.
Excuse me for my missing programming notions. For the sample above, I would need a command that behaves as a variable when defined, but as a constant when invoked.
Is there any way to achieve that without using counters? Sorry if there is too much nonsense in the previous paragraph. But I need to know how to do it for another example too. You can use Lua to create a list of all character combinations. The convert function takes three argument, the first is the conversion method, the second the conversion value and the third the language (optional and only used by certain conversion methods).
\starttext \startluacode for i = 1,27 do for j = 1,27 do context(converters.convert("a",i,"es")) context(converters.convert("a",j,"es")) context.par() end end \stopluacode \stoptext Wolfgang
participants (3)
-
Aditya Mahajan
-
Pablo Rodriguez
-
Wolfgang Schuster