[OS X TeX] Numerical commands
Alain Schremmer
schremmer.alain at gmail.com
Thu Jul 8 22:24:14 EDT 2010
On Jul 8, 2010, at 8:24 PM, Michael Sharpe wrote:
>
> On Jul 8, 2010, at 3:51 PM, Alain Schremmer wrote:
>
>> This is half off-topic:
>>
>> With arrayjobx, I am defining commands such as, for instance, in
>> 4.sty:
>>
>> \newarray\IV %4
>> \readarray{IV} %Chapter 4. From Local Graphs to Global
>> Graphs
>> {% begin array
>> %4-1
>> CheckableItem1
>> &4-2
>> CheckableItem2
>> [...]
>> &%4-50
>> CheckableItem50
>> }%end array
>>
>> I am using these commands as below and things work well but I was
>> wondering if there might be a way to generate automatically the
>> command names from the file names, for instance the command
>> \IV
>> from the file name
>> 4
>>
>> But the only thing I could think of, namely using
>> \Roman{\jobname}
>> naturally does not work.
>>
>
> This is more latexish, and more like what you asked for.
>
> \newcounter{numjob}
> \setcounter{numjob}{\jobname}
> \edef\xx{\Roman{numjob}}% eg, if \jobname expands to 4, \xx expands
> to IV
> \expandafter\newarray\csname\xx \endcsname% same effect as \newarray
> \IV
> \expandafter\let\expandafter\XX\csname\xx \endcsname% \XX is
> synonym for \IV
> %example
> \readarray{\xx}{A&B&C}
> \XX(3) % expands to C
It is exactly what I wanted. I even understand it. It is beautiful.
Very grateful regards
--schremmer
P.S. How about if I were to say I wouldn't mind a million dollars by
midnight EST?
More information about the MacOSX-TeX
mailing list