[OS X TeX] print the latex source filename
Peter Dyballa
Peter_Dyballa at Web.DE
Fri Mar 20 09:57:40 EDT 2009
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}
--
Greetings
Pete
The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" (I found it!) but "That's funny..."
– Isaac Asimov
More information about the MacOSX-TeX
mailing list