summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/analogclock/analogclock-doc.tex
blob: 7b30672e609b10d74c0e7e3f4788549bb9dc5a19 (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
\documentclass[12pt]{article}
\usepackage[timeinterval=29]{analogclock}

\title{\texttt{analogclock} v1.0: An analog clock with PDF\LaTeX}
\author{Luis R\'{a}ndez \& Juan I. Montijano}
%\address[IUMA]{IUMA \\ Universidad de Zaragoza }
\date{IUMA -- Universidad de Zaragoza\\[6pt] \{monti,randez\}@unizar.es\\[6pt] \today}

\begin{document}

\maketitle


\initclock  % This must be used one time to initialize the clock

\section{The package}
The \texttt{analogclock} \LaTeX\/ package
allows the users to insert into a \LaTeX\/ generated pdf document
a ticking analog clock showing the time at the moment when the document
is being reading, such as the one next:

\centerline{\Large\analogclock}

The clock gives dynamically hours and minutes.

The package is loaded by  \texttt{$\backslash$usepackage[timeinterval=$n$]\{analogclock\}},
$n$ being any positive integer. The clock will update its internal status every $n$ seconds.  Thus, if we load
the package with the option [timeinterval=120], the clock will change every 2 minutes.
The default time interval is set to 29 seconds.

Note that for low values of $n$ the memory used by Adobe increases while the document remains opened and can 
become very high.  Then values of $n$ below 10 is not recommended.

The package is based on javascript code embedded into the pdf document. It uses a special font clock.ttf  obtained
converting, with FontForge software, the metafont clock.mf by Oliver Corff (\TeX\/ Clock package).

\section{Restrictions--requirements}
The package  requires hyperref, xkeyval, xcolor and tikz packages.

By now, since it uses a ttf font, the package only works under windows.  We have not been able to make it
work on Linux.  Any help will be welcomed.

Once the pdf document is generated, in order to view the clock in another computer, the clock.ttf must be installed
on it.  Otherwise the clock will appear incomplete.  We have not been able to embed the font in the pdf document
so that it can be used by javascript code. Any help will be welcomed.

The package works with PDF\LaTeX\/.  The document generated through \LaTeX\/$\to$DviPs$\to$Ps2pdf or 
\LaTeX\/$\to$Dvipdfm does not display the hands of the clock.

\section{Installation}
Copy the package file analogclock.sty to a directory where \LaTeX\/ can find it.
Install clock.ttf font (by copying this file to the windows/fonts directory)

\section{Getting the package}

The package can be downloaded at  http://pcmap.unizar.es/numerico/software

\section{Macros}

The clock must be initialized with  \texttt{$\backslash$initclock}, usually at the beginning of the document, after 
\texttt{$\backslash$begin\{document\}}.

The main macro \texttt{$\backslash$analogclock} displays an analog clock colored with the current text color.
The size also depends on the current font size.  Thus, you can change the size and color for example with

\texttt{$\backslash$centerline\{$\backslash$textcolor\{blue\}\{$\backslash$Huge $\backslash$analogclock\}\}}

you get

\centerline{\textcolor{blue}{\Huge \analogclock}}

There is another macro,  \texttt{$\backslash$clocksizefactor\{``factor''\}}, that increases the size of the clock
by a desired factor.  To set the size of the clock to its original size, use
\texttt{$\backslash$clocksizefactor\{1\}}

The macro \texttt{$\backslash$faceclock\{$m$\}\{``face color''\}} sets the type and the background color of the clock face, as shown in the table below. The type $m$ must be an integer number.  If $m<0$ the clock is not framed, else it is framed.  The absolute value of $m$ gives the  (four) possible faces.  About the face color, it can be used any color allowed in xcolor package.  If it is left empty, then a transparent face color is used.

\bigskip
\centerline{Analog clock macros}
\begin{tabular}{|l|c|l|}
\hline
macro  &  result  &  action \\
\hline
 $\backslash$initclock        &                                      & initialize  clock   \\ \hline
 $\backslash$analogclock      & \analogclock                         & clock  \\ \hline
 $\backslash$faceclock\{``face type''\}\{``face color''\}       &      & sets face clock    \\ \hline
 $\backslash$faceclock\{-1\}\{\}  $\backslash$analogclock         & \faceclock{-1}{}\analogclock     & first face (no frame)   \\ \hline
 $\backslash$faceclock\{1\}\{\} $\backslash$analogclock       & \faceclock{1}{}\analogclock     & first face (with frame)   \\\hline
 $\backslash$faceclock\{-2\}\{red\} $\backslash$analogclock       & \faceclock{-2}{red}\analogclock      & second face (no frame)   \\ \hline
 $\backslash$faceclock\{2\}\{red\} $\backslash$analogclock        & \faceclock{2}{red}\analogclock       & second face (with frame)  \\\hline
 $\backslash$faceclock\{-3\}\{white\} $\backslash$analogclock     & \faceclock{-3}{white}\analogclock    & third face (no frame)   \\\hline
 $\backslash$faceclock\{3\}\{white\} $\backslash$analogclock      & \faceclock{3}{white}\analogclock     & third face (with frame)  \\\hline
 $\backslash$faceclock\{-4\}\{pink\}$\backslash$analogclock      & \faceclock{-4}{pink}\analogclock    & no face (no frame)  \\\hline
 $\backslash$faceclock\{4\}\{pink\} $\backslash$analogclock      & \faceclock{4}{pink}\analogclock     & no face  (with frame)  \\\hline
 $\backslash$clocksizefactor\{``factor''\} & \clocksizefactor{2.5}\analogclock    & amplification factor   \\\hline
\end{tabular}


\end{document}



\end{frame}