[OS X TeX] \jobname+3

Chris Goedde cgg.lists at gmail.com
Tue Sep 13 15:48:25 EDT 2011


On Sep 13, 2011, at 2:14 PM, Alain Schremmer wrote:

> Not quite strictly LaTeX.
> 
> 
> I use a lot ]jobname in references such as
> 
> ../QuestionsBase/\jobname/12
> 
> With a file named 4.tex this gives
> 
> ../QuestionsBase/4/12
> 
> 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. You can then do (I believe)

../QuestionsBase/\arabic{filenum}/12

to get what you want.

Chris


More information about the MacOSX-TeX mailing list