![](https://secure.gravatar.com/avatar/232c973dd2fbf20697756a5f3e8b9f98.jpg?s=120&d=mm&r=g)
Hello everybody, I'm looking for a comand to insert the current filename and or path like inserting the current date with \currentdate. Any help? Thanks Thomas Lohmann -- Dr. Thomas Lohmann Daimlerstr. 28 68526 Ladenburg Tel.: 06203 924277 Fax: 01212 5 11720241 Mobil: 0174 6179456 Email: lohmannt@web.de
![](https://secure.gravatar.com/avatar/6af1f724a401c9f6f746a973f33ff595.jpg?s=120&d=mm&r=g)
Hello Thomas,
I'm looking for a comand to insert the current filename and or path like inserting the current date with \currentdate. Any help?
Well, I don't think you can do this. You can only get the name of the main TeX file by using \jobname, but thats all. (Hopefully I didn't miss some secret.) Different approach: put some info in your file with a macro like \define\thisfile{/path/to/test.tex}. Or you can put some RCS information in your file for example. Patrick --
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
Patrick Gundlach wrote:
Hello Thomas,
I'm looking for a comand to insert the current filename and or path like inserting the current date with \currentdate. Any help?
Well, I don't think you can do this. You can only get the name of the main TeX file by using \jobname, but thats all. (Hopefully I didn't miss some secret.) Different approach: put some info in your file with a macro like \define\thisfile{/path/to/test.tex}. Or you can put some RCS information in your file for example.
of course you missed a few secret: \inputfilename \outputfilename \jobfilesuffix don't look at the code, some catcode mess is involved Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/6af1f724a401c9f6f746a973f33ff595.jpg?s=120&d=mm&r=g)
Hello Hans,
Well, I don't think you can do this. You can only get the name of the main TeX file by using \jobname, but thats all. (Hopefully I didn't miss some secret.) Different approach: put some info in your file with a macro like \define\thisfile{/path/to/test.tex}. Or you can put some RCS information in your file for example.
of course you missed a few secret:
\inputfilename \outputfilename \jobfilesuffix
don't look at the code, some catcode mess is involved
OK, I didn't. But the above still gives me the name of the main file only: \starttext \startlines \inputfilename \outputfilename \jobfilesuffix \stoplines \input included \readfile{included}{}{} \stoptext and in included.tex: Included file: \startlines \inputfilename \outputfilename \jobfilesuffix \stoplines gives me: test.tex test tex Included file: test.tex test tex Included file: test.tex test tex Patrick -- texshow-web: http://members.ping.de:8061 ConTeXt wiki: http://members.ping.de:8062
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
Patrick Gundlach wrote:
Hello Hans,
Well, I don't think you can do this. You can only get the name of the main TeX file by using \jobname, but thats all. (Hopefully I didn't miss some secret.) Different approach: put some info in your file with a macro like \define\thisfile{/path/to/test.tex}. Or you can put some RCS information in your file for example.
of course you missed a few secret:
\inputfilename \outputfilename \jobfilesuffix
don't look at the code, some catcode mess is involved
OK, I didn't. But the above still gives me the name of the main file only:
there is also \currentfile
\starttext \startlines \inputfilename \outputfilename \jobfilesuffix \stoplines \input included \readfile{included}{}{} \stoptext
and in included.tex: Included file: \startlines \inputfilename \outputfilename \jobfilesuffix \stoplines
gives me:
test.tex test tex
Included file: test.tex test tex
Included file: test.tex test tex
Patrick
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/6af1f724a401c9f6f746a973f33ff595.jpg?s=120&d=mm&r=g)
Hello Hans,
there is also \currentfile
\starttext \currentfile \stoptext -> undefined cs \currentfile Patrick -- texshow-web: http://members.ping.de:8061 ConTeXt wiki: http://members.ping.de:8062
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
Patrick Gundlach wrote:
Hello Hans,
there is also \currentfile
\starttext
\component somefile
\currentfile
now should report something; i'll add a default: \def\currentfile{\inputfilename}
\stoptext
-> undefined cs \currentfile
Patrick
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Patrick Gundlach
-
Thomas Lohmann