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
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 --
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 -----------------------------------------------------------------
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
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 -----------------------------------------------------------------
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
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