[OS X TeX] jobname

Alain Schremmer schremmer.alain at gmail.com
Mon Apr 23 18:49:36 EDT 2007

On Apr 23, 2007, at 5:03 PM, Peter Dyballa wrote:

> Am 23.04.2007 um 17:51 schrieb Alain Schremmer:
>> 		TextBooks > Math000Book doesn't work (with either \def or \edef)  
>> as LaTeX complains about  \includegraphics{\jobname-1}
> This can't work! \jobname is one thing and -1 is another thing.

Actually not really but I should have looked at my original query  
which was:

> Given a file ROOT that \include{FILE}, \jobname in FILE returns  
> ROOT which makes sense but is there a way to get FILE instead of ROOT?

1) Looking more closely at my mini-example I just realized that the  
suggested code doesn't let \jobname return FILE but still returns ROOT.

Indeed, the following

	PRINTunit >10   contains  \include EDITunit \jobname (=10)  which  
contains  \includegraphics{\jobname-1}

works but this is only by accident since 10 happened also to be ROOT.

The following does not work:

	TextBooks > Math000Book contains \include EDITunit \jobname (=10)  
which contains  \includegraphics{\jobname-1}

because it takes ROOT, that is Math000Book as \jobname. Indeed, I had  
not noticed that LaTeX had said before "! LaTeX Error: File  
`Math000Book-1' not found."

2) Come to think of it, it is surprising that, in the first case,  
LaTeX did look for the figure called 10-1 and not for a figure called  
… 9!

------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/

More information about the MacOSX-TeX mailing list