summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/clock/doc/clockdoc.tex
blob: 88945bf63a7d66d4b080762684996ea8f055c346 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
\documentclass[12pt]{ltxdoc}
\usepackage{clock}

\newcommand\exa{\nopagebreak \begin{flushleft}\smallskip \nopagebreak
                \begin{minipage}[t]{6cm}\sloppy}
\newcommand\exb{\end{minipage}\kern 1cm\begin{minipage}[t]{8cm}\sloppy }
\newcommand\exc{\end{minipage}\kern -3cm \smallskip\end{flushleft}}

\ClockFramefalse
\title{{\bigclockfont\clock{10}{10}}\\[0.5cm]
	The \TeX\ Clock 0.3}
\author{Oliver Corff}
\date{October 01, 2001}
\begin{document}
\maketitle


\section{Graphical Clocks}

The \TeX\ clock is a small hack\footnote{%
	The \TeX\ clock was inspired by a discussion on
	\texttt{comp.text.tex} somewhen in spring 2001;
	special thanks to Daniel Luecking for the detection
	of spurious spaces.} 
for those who desire to show the time
in a graphical fashion. The basic command available is
\verb-\clock{..}{..}- which takes two arguments: hours and minutes. It
does not matter whether the hours are given in a 12h or a 24h range;
the \TeX\ clock understands both.

When saying \verb-\clocktime- (without any argument) then the \TeX\ clock
will output the current system time at time of compilation in graphical
manner: 


\exa
	A random time: \clock{13}{47}\\
	The compilation time: \clocktime
\exb
	\begin{verbatim}
	A random time: \clock{13}{47}\\
	The compilation time: \clocktime
	\end{verbatim}
\exc


\section{Installation}

Before, however, we go into the details of the \TeX\ clock, some notes
on the installation of this software package.
The installation procedure depends on the nature of the actual
\TeX\ system. The directory tree of e.\,g., teTeX is different
from the emtex tree; hence the source archive \texttt{clock.zip}
features the following subdirectories the contents of which has to be
placed into appropriate branches of the \TeX\ installation:
\begin{sloppypar}
\begin{itemize}
	\item \texttt{mfinput} holds the Metafont source file 
		for the clock. The suggested path for emtex
		users is \verb"\emtex\mfinput\clock"; for teTeX users
		\verb"$TEXMF/fonts/source/public/clock" is a suitable
		choice.
	\item \texttt{tfm} holds the font metrics file.
	The suggested path for emtex users is \verb"\emtex\tfm\clock";
	for teTeX users \verb"$TEXMF/fonts/tfm/public/clock"
	is a suitable choice.
	\item \texttt{texinput} holds the style files which are read
		by \TeX\ and \LaTeXe.
		The suggested path for emtex users is
		\verb"\emtex\texinput\clock"; for teTeX users
		\verb"$TEXMF/tex/latex/clock" is a suitable choice.
	\item \texttt{doc} contains the documentation (the document
		which you are reading right now). It can be placed
		in \verb"\emtex\doc\clock" (for emtex users) or 
		\verb"$TEXMF/doc/latex/clock" (for teTeX users).
\end{itemize}
\end{sloppypar}

It may become necessary to rehash the directory database of the
\TeX\ system. When in doubt, consult your system administrator or
local \TeX\ wizard.
On teTeX systems, the command \texttt{texhash} will perform this service.


\section{Activating the \TeX\ clock}

\begin{sloppypar}
In order to access the features of this little clock, \TeX\ users
put \verb*-\input clock- near the beginning of their document, while
\LaTeXe\ users say \verb-\usepackage{clock}- in the preamble of
their document. There are no options for the \TeX\ clock.


\section{Clock Styles}

The appearance of the clock is controlled by two style parameters.
\verb-\ClockFrame- is a Boolean parameter and can be \verb-true- or
\verb-false-. Saying \verb-\ClockFramefalse- lets the border
disappear, saying \verb-\ClockFrametrue- lets the border appear.
\end{sloppypar}

The parameter \verb-ClockStyle- takes a number between $0$ and $3$
where $0$ stands for a clock with invisible dial:
\begin{center}
\begin{tabular}{ccc}
\texttt{\char92 Clockstyle=}\textit{n}	& With Border & Without Border\\
0 	& \clockfont\ClockStyle=0 \ClockFrametrue\clock{10}{10}
 	& \clockfont\ClockStyle=0 \ClockFramefalse\clock{10}{10}\\
1 	& \clockfont\ClockStyle=1 \ClockFrametrue\clock{10}{10}
 	& \clockfont\ClockStyle=1 \ClockFramefalse\clock{10}{10}\\
2 	& \clockfont\ClockStyle=2 \ClockFrametrue\clock{10}{10}
 	& \clockfont\ClockStyle=2 \ClockFramefalse\clock{10}{10}\\
3 	& \clockfont\ClockStyle=3 \ClockFrametrue\clock{10}{10}
 	& \clockfont\ClockStyle=3 \ClockFramefalse\clock{10}{10}
\end{tabular}
\end{center}

When used with \LaTeX2e, the size of the clock will automatically
adapt to the text environment, but if the user so desires, deviating
sizes can be selected with the usual font size commands.

\section{The Text Clock}

A graphical clock is not always ideal, sometimes a simple four-digit
digital display is more useful. For this purpose, the \TeX\ clock
provides a text-style clock.
Saying \verb-\texttime- shows the system time at the time of
compilation in a colon-separated 24 hour format.
Of course, the hours of the day are available as \verb-\texthours-,
and the minutes can be accessed by saying \verb-\textminutes-

\exa
	The compilation time is: \texttime\\
	Minute \textminutes\ of the hour\\
	Hour \texthours\ of the day\\
\exb
	\begin{verbatim}
	The compilation time is: \texttime\\
	Minute \textminutes\ of the hour\\
	Hour \texthours\ of the day\\
	\end{verbatim}
\exc

\section{The \TeX\ clockwork}

\begin{sloppypar}
The inner workings of the \TeX\ clock are of astonishing simplicity.
Sixty different minute hands and the same number of hour hands are
stored as characters, and for any given minute \verb-\minute- the appopriate
minute hand is selected like \verb-\char\minute-. While the time
of minutes translates directly into the minute hand escapement,
the escapement of the hour hand has to be augmented by tiny steps
calculated from the minutes in order to create a natural, clock-like
look as the hour hand stands more often than not between full hours.
The border and the
various dials are stored as individual characters which then can be
added to the display of the clock as desired. 
\end{sloppypar}

\end{document}