TeXnik - Tips TeX and LaTeX


Welcome to the TeXnik website (under construction)

Time-Functions
TUG logo

Main page

Index
UK FAQ
Documentation
Software
CTAN
Search CTAN:

Statistics

Google c.t.t.

Google d.c.t.t.

 


 


With this macros you can write the time of LaTeX-compilation into your doc.

in preamble:

\usepackage{time}
\newcommand\myTime{\now}
\lhead{\today - \myTime}
with \pagestyle{fancy} you can put the actual date with the time in the header. You can download an example-file.


Write in preamble:
\newcommand*{\theto}[1]{%
  \ifnum#1<10 0\fi
  \the#1%
}
\newcommand*{\timestamp}[1]{%
  \begingroup
    #1
    % format of date: "%d/%02d/%02d "
    \the\day/%
    \theto\month/%
    \expandafter\@gobbletwo\the\year
    \ %
    % format of time: "%02d.%02d"
    \begingroup
      \divide\time by 60 %
      \theto\time.%
      \multiply\time by 60 %
      \edef\x{\endgroup
        \advance\time by -\the\time\relax
      }%
    \x
    \theto\time
  \endgroup
}
and in the text use it like \timestamp{\small}. The parameter is the fontsize.

local time: Wed Oct 16 21:55:15 CEST 2019 ; file is: 111.087037037037 days old
contact webmaster _at_ TeXnik.de