[OS X TeX] print the latex source filename
Alex Hamann
mailinglist at alex-hamann.de
Sat Mar 21 05:36:13 EDT 2009
On 21.03.2009, at 02:41, Alain Schremmer wrote:
>
> On Mar 20, 2009, at 9:57 AM, Peter Dyballa wrote:
>
>>
>> Am 20.03.2009 um 12:56 schrieb Alessandro Languasco:
>>
>>> Nice
>>
>> A bit nicer is this block of code from Heiko Oberdiek for
>> "branding" the pdfTeX output also with the date of the source (it
>> also uses \jobname):
>>
>> \makeatletter % following code needs hyperref
>> \@ifundefined{pdffilemoddate}{%
>> \PackageError{sourcetime}{%
>> pdfTeX >= 1.30.0 required%
>> }%
>> \let\pdffilemoddate\@gobble
>> }{}%
>> \newcommand*{\SourceFile}[1]{%
>> \edef\@SourceFileDate{\pdffilemoddate{#1}}%
>> % empty in case of errors, but don't harm in next comparison
>> \ifnum\pdfstrcmp{\@SourceFileDate}{\@CurrentSourceFileDate}>0 %
>> \let\@CurrentSourceFileDate\@SourceFileDate
>> \expandafter\@ParseDate\@SourceFileDate\@nil
>> \hypersetup{%
>> pdfcreationdate={\@SourceFileDate},%
>> pdfmoddate={\@SourceFileDate}%
>> }%
>> \PackageInfo{sourcetime}{%
>> Using file `#1'%
>> }%
>> \fi
>> }
>> \newcommand*{\@CurrentSourceFileDate}{}
>> \expandafter\def\expandafter\@ParseDate\detokenize{D:}
>> #1#2#3#4#5#6#7#8{%
>> \year=#1#2#3#4\relax
>> \month=#5#6\relax
>> \day=#7#8\relax
>> \@ParseTime
>> }
>> \def\@ParseTime #1#2#3#4#5\@nil{%
>> \time=\numexpr #1#2 * 60 + #3#4\relax
>> }
>> \makeatother
>> \SourceFile{\jobname.tex}
>
> I haven't been able to make this code work.
snip
>
> Puzzled regards
> --schremmer
same here :-(
Alex
More information about the MacOSX-TeX
mailing list