[OS X TeX] Re: Save date-time, not Print date

Victor Ivrii vivrii at gmail.com
Sun Jan 7 15:46:48 EST 2007


On 1/7/07, Douglas Philips <dgou at mac.com> wrote:
>
>
> > To make things even worse TeXShop actually saves .tex file every
> > time it typesets it; so

> > it will be by no means different from using \today unless  TeXShop
> > configured for external editor (so editing function of TeXShop is
> > switched off.


I think I was mistaken here: it saves foo.tex as typesetting only if
document was edited (not necessarily changed. Actually TeXShop behaves
like vi: you can save file even if it has not been edited since the
previous save, thus affecting timestamp; some editors do not allow it)


Still since it is  my/Robert Bruner solution, I just think that it is
my duty to warn about problems
arising from the use of this macro.

> Perhaps. But most backup/restore and version control systems (that I
> know of) don't cause those kinds of problems.

The person who uses this macro should check that the system he/she
uses does not cause this kind of problems


\documentclass[12pt]{article}

\newcommand\file{foo} % put the name of your file here

\begin{document}

Test

 \immediate\write18{\rm -f \file.date; ls -lT \file.tex | awk '{print
$8" "$7" "$6" "$9}' > \file.date}
%need to run tex with --shell-escape; some tex guru may be will
suggest a better solution
\input\file.date

\end{document}


-- 
========================
Victor Ivrii, Department of Mathematics, University of Toronto
http://www.math.toronto.edu/ivrii

------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list