Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Find Dir Root/Job Path in TeX/LaTeX

112 views
Skip to first unread message

vinoth

unread,
Nov 7, 2008, 1:16:30 AM11/7/08
to
Dear TeX users,

Is there any way to get the current file full path from root:

e.g."E:/books/Tex/sample.tex"

I have tested the commands

\jobname, \@currdir, \filename@area etc... which are not meet my
requirement.

Please advise.

thanks
-vp-

Robin Fairbairns

unread,
Nov 7, 2008, 4:35:50 AM11/7/08
to
vinoth <pvklat...@yahoo.com> writes:
>Is there any way to get the current file full path from root:
>
>e.g."E:/books/Tex/sample.tex"
>
>I have tested the commands
>
>\jobname, \@currdir, \filename@area etc... which are not meet my
>requirement.

tex itself doesn't store this information. (tex's file input and
output aren't "part" of tex -- they're added to knuth's original
source in the process of making an executable that will run[*].)

you need to know the working directory when you started your tex run.
to find this, either
1) run a shell script from within tex (using \write18 -- the command
to send for a widnoze user would be "cd", and the output is the
working directory), or
2) analyse the log.

(both methods are a mess, (1) is probably most reliable. neither is
entirely portable :-( )

you then need a file tracker such as fink. see
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=filename
for a discussion of this issue.

[*] simplification alert: the top line is true, but the details are
grubbier than i imply.
--
Robin Fairbairns, Cambridge

0 new messages