| 1 |
\documentclass[12pt]{ltxdoc} |
| 2 |
\usepackage{clock} |
| 3 |
|
| 4 |
\newcommand\exa{\nopagebreak \begin{flushleft}\smallskip \nopagebreak |
| 5 |
\begin{minipage}[t]{6cm}\sloppy} |
| 6 |
\newcommand\exb{\end{minipage}\kern 1cm\begin{minipage}[t]{8cm}\sloppy } |
| 7 |
\newcommand\exc{\end{minipage}\kern -3cm \smallskip\end{flushleft}} |
| 8 |
|
| 9 |
\ClockFramefalse |
| 10 |
\title{{\bigclockfont\clock{10}{10}}\\[0.5cm] |
| 11 |
The \TeX\ Clock 0.3} |
| 12 |
\author{Oliver Corff} |
| 13 |
\date{October 01, 2001} |
| 14 |
\begin{document} |
| 15 |
\maketitle |
| 16 |
|
| 17 |
|
| 18 |
\section{Graphical Clocks} |
| 19 |
|
| 20 |
The \TeX\ clock is a small hack\footnote{% |
| 21 |
The \TeX\ clock was inspired by a discussion on |
| 22 |
\texttt{comp.text.tex} somewhen in spring 2001; |
| 23 |
special thanks to Daniel Luecking for the detection |
| 24 |
of spurious spaces.} |
| 25 |
for those who desire to show the time |
| 26 |
in a graphical fashion. The basic command available is |
| 27 |
\verb-\clock{..}{..}- which takes two arguments: hours and minutes. It |
| 28 |
does not matter whether the hours are given in a 12h or a 24h range; |
| 29 |
the \TeX\ clock understands both. |
| 30 |
|
| 31 |
When saying \verb-\clocktime- (without any argument) then the \TeX\ clock |
| 32 |
will output the current system time at time of compilation in graphical |
| 33 |
manner: |
| 34 |
|
| 35 |
|
| 36 |
\exa |
| 37 |
A random time: \clock{13}{47}\\ |
| 38 |
The compilation time: \clocktime |
| 39 |
\exb |
| 40 |
\begin{verbatim} |
| 41 |
A random time: \clock{13}{47}\\ |
| 42 |
The compilation time: \clocktime |
| 43 |
\end{verbatim} |
| 44 |
\exc |
| 45 |
|
| 46 |
|
| 47 |
\section{Installation} |
| 48 |
|
| 49 |
Before, however, we go into the details of the \TeX\ clock, some notes |
| 50 |
on the installation of this software package. |
| 51 |
The installation procedure depends on the nature of the actual |
| 52 |
\TeX\ system. The directory tree of e.\,g., teTeX is different |
| 53 |
from the emtex tree; hence the source archive \texttt{clock.zip} |
| 54 |
features the following subdirectories the contents of which has to be |
| 55 |
placed into appropriate branches of the \TeX\ installation: |
| 56 |
\begin{sloppypar} |
| 57 |
\begin{itemize} |
| 58 |
\item \texttt{mfinput} holds the Metafont source file |
| 59 |
for the clock. The suggested path for emtex |
| 60 |
users is \verb"\emtex\mfinput\clock"; for teTeX users |
| 61 |
\verb"$TEXMF/fonts/source/public/clock" is a suitable |
| 62 |
choice. |
| 63 |
\item \texttt{tfm} holds the font metrics file. |
| 64 |
The suggested path for emtex users is \verb"\emtex\tfm\clock"; |
| 65 |
for teTeX users \verb"$TEXMF/fonts/tfm/public/clock" |
| 66 |
is a suitable choice. |
| 67 |
\item \texttt{texinput} holds the style files which are read |
| 68 |
by \TeX\ and \LaTeXe. |
| 69 |
The suggested path for emtex users is |
| 70 |
\verb"\emtex\texinput\clock"; for teTeX users |
| 71 |
\verb"$TEXMF/tex/latex/clock" is a suitable choice. |
| 72 |
\item \texttt{doc} contains the documentation (the document |
| 73 |
which you are reading right now). It can be placed |
| 74 |
in \verb"\emtex\doc\clock" (for emtex users) or |
| 75 |
\verb"$TEXMF/doc/latex/clock" (for teTeX users). |
| 76 |
\end{itemize} |
| 77 |
\end{sloppypar} |
| 78 |
|
| 79 |
It may become necessary to rehash the directory database of the |
| 80 |
\TeX\ system. When in doubt, consult your system administrator or |
| 81 |
local \TeX\ wizard. |
| 82 |
On teTeX systems, the command \texttt{texhash} will perform this service. |
| 83 |
|
| 84 |
|
| 85 |
\section{Activating the \TeX\ clock} |
| 86 |
|
| 87 |
\begin{sloppypar} |
| 88 |
In order to access the features of this little clock, \TeX\ users |
| 89 |
put \verb*-\input clock- near the beginning of their document, while |
| 90 |
\LaTeXe\ users say \verb-\usepackage{clock}- in the preamble of |
| 91 |
their document. There are no options for the \TeX\ clock. |
| 92 |
|
| 93 |
|
| 94 |
\section{Clock Styles} |
| 95 |
|
| 96 |
The appearance of the clock is controlled by two style parameters. |
| 97 |
\verb-\ClockFrame- is a Boolean parameter and can be \verb-true- or |
| 98 |
\verb-false-. Saying \verb-\ClockFramefalse- lets the border |
| 99 |
disappear, saying \verb-\ClockFrametrue- lets the border appear. |
| 100 |
\end{sloppypar} |
| 101 |
|
| 102 |
The parameter \verb-ClockStyle- takes a number between $0$ and $3$ |
| 103 |
where $0$ stands for a clock with invisible dial: |
| 104 |
\begin{center} |
| 105 |
\begin{tabular}{ccc} |
| 106 |
\texttt{\char92 Clockstyle=}\textit{n} & With Border & Without Border\\ |
| 107 |
0 & \clockfont\ClockStyle=0 \ClockFrametrue\clock{10}{10} |
| 108 |
& \clockfont\ClockStyle=0 \ClockFramefalse\clock{10}{10}\\ |
| 109 |
1 & \clockfont\ClockStyle=1 \ClockFrametrue\clock{10}{10} |
| 110 |
& \clockfont\ClockStyle=1 \ClockFramefalse\clock{10}{10}\\ |
| 111 |
2 & \clockfont\ClockStyle=2 \ClockFrametrue\clock{10}{10} |
| 112 |
& \clockfont\ClockStyle=2 \ClockFramefalse\clock{10}{10}\\ |
| 113 |
3 & \clockfont\ClockStyle=3 \ClockFrametrue\clock{10}{10} |
| 114 |
& \clockfont\ClockStyle=3 \ClockFramefalse\clock{10}{10} |
| 115 |
\end{tabular} |
| 116 |
\end{center} |
| 117 |
|
| 118 |
When used with \LaTeX2e, the size of the clock will automatically |
| 119 |
adapt to the text environment, but if the user so desires, deviating |
| 120 |
sizes can be selected with the usual font size commands. |
| 121 |
|
| 122 |
\section{The Text Clock} |
| 123 |
|
| 124 |
A graphical clock is not always ideal, sometimes a simple four-digit |
| 125 |
digital display is more useful. For this purpose, the \TeX\ clock |
| 126 |
provides a text-style clock. |
| 127 |
Saying \verb-\texttime- shows the system time at the time of |
| 128 |
compilation in a colon-separated 24 hour format. |
| 129 |
Of course, the hours of the day are available as \verb-\texthours-, |
| 130 |
and the minutes can be accessed by saying \verb-\textminutes- |
| 131 |
|
| 132 |
\exa |
| 133 |
The compilation time is: \texttime\\ |
| 134 |
Minute \textminutes\ of the hour\\ |
| 135 |
Hour \texthours\ of the day\\ |
| 136 |
\exb |
| 137 |
\begin{verbatim} |
| 138 |
The compilation time is: \texttime\\ |
| 139 |
Minute \textminutes\ of the hour\\ |
| 140 |
Hour \texthours\ of the day\\ |
| 141 |
\end{verbatim} |
| 142 |
\exc |
| 143 |
|
| 144 |
\section{The \TeX\ clockwork} |
| 145 |
|
| 146 |
\begin{sloppypar} |
| 147 |
The inner workings of the \TeX\ clock are of astonishing simplicity. |
| 148 |
Sixty different minute hands and the same number of hour hands are |
| 149 |
stored as characters, and for any given minute \verb-\minute- the appopriate |
| 150 |
minute hand is selected like \verb-\char\minute-. While the time |
| 151 |
of minutes translates directly into the minute hand escapement, |
| 152 |
the escapement of the hour hand has to be augmented by tiny steps |
| 153 |
calculated from the minutes in order to create a natural, clock-like |
| 154 |
look as the hour hand stands more often than not between full hours. |
| 155 |
The border and the |
| 156 |
various dials are stored as individual characters which then can be |
| 157 |
added to the display of the clock as desired. |
| 158 |
\end{sloppypar} |
| 159 |
|
| 160 |
\end{document} |