[OS X TeX] \jobname+3

Alain Schremmer schremmer.alain at gmail.com
Wed Sep 21 20:52:38 EDT 2011


On Sep 21, 2011, at 6:45 PM, Manuel Pégourié-Gonnard wrote:

> Le 13/09/2011 21:48, Chris Goedde a écrit :
>> On Sep 13, 2011, at 2:14 PM, Alain Schremmer wrote:
>>
>>> Is there a way to use something along the lines of
>>>
>>> ../QuestionsBase/\jobname+3/12
>>>
>>> so as to get, with a file named 4.tex,
>>>
>>> ../QuestionsBase/7/12
>>
>> The sequence
>>
>> \newcounter{filenum}
>> \setcounter{filenum}{\jobname}
>> \addtocounter{filenum}{3}
>>
>> will create a counter called filenum that will have value of  
>> \jobname + 3.
>
> Or, simpler, \number\numexpr\jobname + 3\relax will do the trick  
> (using e-TeX
> extensions).
>
> Manuel.
>
> PS: of course if you don't feel like typing this all over the place  
> in your doc,
> you can use a macro such as:
>
> \newcommand \jnplus [1] {\number\numexpr\jobname+#1\relax}
>
> and then
>
> ../QuestionsBase/\jnplus{3}/12

This is just in time: I got buried in stuff and it is only now that I  
was going to experiment with Goedde's suggestion. And of course now I  
will try yours too.

But what is an "e-TeX extension"? I went to <http://www.tex.ac.uk/cgi- 
bin/texfaq2html?label=etex> but that did not tell me, what, in  
practice, this entails.

Grateful regards to both.
--schremmer




More information about the MacOSX-TeX mailing list