[OS X TeX] print the latex source filename

Alain Schremmer schremmer.alain at gmail.com
Fri Mar 20 10:43:01 EDT 2009


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 am going to have to try the above!!!!

So far, to keep track of the multiple-choice exam versions I have  
used, as well as the seed number, the following

			\newcounter{hours}\newcounter{minutes}

			\newcommand{\printtime}%
				{%begin definition
					\setcounter{hours}{\time/60}%
					\setcounter{minutes}{\time-\value{hours}*60}%
					\thehours:\theminutes%
				}%end definition

Intrigued regards
--schremmer




More information about the MacOSX-TeX mailing list