[Tuglist] File name and path in footer

Radhakrishnan CV tuglist@tug.org.in
23 Sep 2002 17:06:19 +0530

>>>>> "HSR" == H S Rai <hsraidce@iitr.ernet.in> writes:

    HSR> Is there any way to include path and file name of source file
    HSR> in the footer on each page, in addition to page number?

Exploiting the shell-escape,

\immediate\write18{echo "\string\gdef\string\pwd{$PWD}" > pwd.tex}

%% write the current working directory to pwd.tex

\IfFileExists{pwd.tex}{\input pwd}{\gdef\pwd{.}}

%% read pwd.tex and stores the current path in \pwd
%% In case, for any reason pwd.tex is not written
%% \pwd is defined to {.}, so that LaTeX doesn't
%% complain during the run 


This should give you the path and file name. Use this in the
appropriate position in


The LaTeX run shall be:

 latex -shell-escpe <file>