4

I have a problem with tdclock. In one post I saw, it can be replace ved by some commands. Can anyone help me how to do that? Do I need to put those commands in CMD or some other place? Please help.

7

UPDATE

The issues reported here have been fixed by the package authors in the recent version 2.5 (2014-02-21). There should no longer be the need for the manual changes listed below.


This is a bug in tdclock: Whenever two documents with active clocks are opened at the same time in AdobeReader, at least one of them doesn't render the clock correctly.

Another annoyance is the shaded background of working clocks. This can be fixed by setting the text fields readonly in tdclock.sty.

orig. tdclock.sty patched tdclock.sty

To fix both issues, you can either apply the patch file listed below using patch, or by means of the sed commandline utility, as shown in https://tex.stackexchange.com/a/76145. Both commands are available on standard Linux boxes and in the Cygwin environment for Windows PCs. sed is also available as a standalone binary for Windows that can be directly used in CMD.

--- tdclock.sty 2013-12-05 08:41:41.000000000 +0100
+++ tdclock.sty.fix 2013-12-05 08:43:00.000000000 +0100
@@ -1,4 +1,4 @@
-\ProvidesPackage{tdclock} [2009/06/01 v2.2 clock accessory]
+\ProvidesPackage{tdclock} [2013/12/05 v2.3 clock accessory]

 %
 %  Luis Randez  randez@unizar.es
@@ -154,21 +154,21 @@

 \def\tdyear{%
 \clock@setfonsize\clock@setheight\clock@setfontcolor%\clock@setwidth
-\setbox\sizebox=\hbox{\TextField[name=year, width=60pt, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize]{}}%
+\setbox\sizebox=\hbox{\TextField[readonly=true,name=year, width=60pt, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize]{}}%
 \vrule width 0pt height 2pt\kern-1pt\kern-\wd\sizebox\kern 60pt{\raisebox{-\b@h\clock@fontsize}{\raisebox{-\a@h pt}{\mbox{\TextField[name=year, width=60pt, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,readonly=true,
 value={}]{}\kern-60pt\kern \a@a pt\kern \b@b\clock@fontsize\kern \b@b\clock@fontsize\vrule width 0pt height 2pt}}}}%
 }

 \def\pdfslash{%
 \clock@setfonsize\clock@setheight\clock@setfontcolor%\clock@setwidth
-\setbox\sizebox=\hbox{\TextField[ width=60pt, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,value=/]{}}%
+\setbox\sizebox=\hbox{\TextField[readonly=true, width=60pt, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,value=/]{}}%
 \vrule width 0pt height 2pt\kern-0.75pt\kern-\wd\sizebox\kern 60pt{\raisebox{-\b@h\clock@fontsize}{\raisebox{-\a@h pt}{\mbox{\TextField[name=separatordate, width=60pt, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,
 readonly=true,value=/]{}\kern-60pt\kern \a@one pt\kern \b@one\clock@fontsize\vrule width 0pt height 2pt}}}}%
 }

 \def\pdfcolon{%
 \clock@setfonsize\clock@setheight\clock@setfontcolor%\clock@setwidth
-\setbox\sizebox=\hbox{\TextField[name=separatortime, width=0.90\clock@fontsize, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,value=:]{}}%
+\setbox\sizebox=\hbox{\TextField[readonly=true,name=separatortime, width=0.90\clock@fontsize, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,value=:]{}}%
 \vrule width 0pt height 2pt\kern-0.4pt\kern-\wd\sizebox\kern 0.90\clock@fontsize{\raisebox{-\b@h\clock@fontsize}{\raisebox{-\a@h pt}%
 {\mbox{\TextField[name=separatortime, width=0.90\clock@fontsize, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,
 readonly=true,value=:]{}\kern-0.90\clock@fontsize\kern\a@one pt\kern \b@one\clock@fontsize\vrule width 0pt height 2pt}}}}%
@@ -176,7 +176,7 @@

 \def\clockfield#1{%
 \clock@setfonsize\clock@setheight\clock@setfontcolor%\clock@setwidth
-\setbox\sizebox=\hbox{\TextField[name=#1, width=1.31\clock@fontsize, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize]{}}%
+\setbox\sizebox=\hbox{\TextField[readonly=true,name=#1, width=1.31\clock@fontsize, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize]{}}%
 \vrule width 0pt height 2pt\kern-\a@a pt\kern-\wd\sizebox\kern 1.31\clock@fontsize{\raisebox{-\b@h\clock@fontsize}%
 {\raisebox{-\a@h pt}{\mbox{\TextField[name=#1, width=1.31\clock@fontsize, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,readonly=true,
 value={}]{}\kern-1.31\clock@fontsize\kern\a@a pt\kern \b@b\clock@fontsize\vrule width 0pt height 2pt}}}}%
@@ -191,23 +191,23 @@

 \def\initfields{%
 \begin{Form}
-\mbox{\TextField[format=\startclock,name=resultado2, hidden=true, width=0truecm, height=0truecm, bordercolor= 1 1 1, backgroundcolor= 1 1 1,value={}]{}}
+\mbox{\TextField[readonly=true,format=\startclock,name=resultado2, hidden=true, width=0truecm, height=0truecm, bordercolor= 1 1 1, backgroundcolor= 1 1 1,value={}]{}}
 \end{Form}%
-%\TextField[name=resultado1, hidden=true, width=0pt, height=0pt,charsize=0pt]{}
-\TextField[name=hours, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=minutes, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=seconds, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=cronohours, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=cronominutes, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=crseconds, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=day, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=month, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=year, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+%\TextField[readonly=true,name=resultado1, hidden=true, width=0pt, height=0pt,charsize=0pt]{}
+\TextField[readonly=true,name=hours, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=minutes, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=seconds, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=cronohours, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=cronominutes, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=crseconds, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=day, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=month, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=year, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
 \PushButton[name=button1, onclick={\auxiliar;},hidden=true]{}%
 \PushButton[name=button2, onclick={\resetclock;},hidden=true]{}%
-\TextField[name=separatordate, hidden=true, width=0pt, height=0pt,charsize=0pt, value=/]{}%
-\TextField[name=separatortime, hidden=true, width=0pt, height=0pt,charsize=0pt, value=:]{}%
-\TextField[name=cronobox, hidden=true, width=0pt, height=0pt,charsize=0pt, value= ]{}%
+\TextField[readonly=true,name=separatordate, hidden=true, width=0pt, height=0pt,charsize=0pt, value=/]{}%
+\TextField[readonly=true,name=separatortime, hidden=true, width=0pt, height=0pt,charsize=0pt, value=:]{}%
+\TextField[readonly=true,name=cronobox, hidden=true, width=0pt, height=0pt,charsize=0pt, value= ]{}%
 }

 \def\initclock{%
@@ -230,11 +230,11 @@
 %
 \def\startclock{%
 %
-global.iop;
-global.fuente;
-global.interval;
-global.duration;
-global.death;
+%iop;
+%fuente;
+%interval;
+%duration;
+%death;
 %
 var iop=1;
 var fuente=eval(\clock@font);
@@ -251,9 +251,9 @@
 function rresett()
 {
 var fObj0 = new Date();
-global.horas0 = fObj0.getHours();
-global.minutos0 = fObj0.getMinutes();
-global.segundos0 = fObj0.getSeconds();
+horas0 = fObj0.getHours();
+minutos0 = fObj0.getMinutes();
+segundos0 = fObj0.getSeconds();
 }
 %
 function alerta(kolor,kolorfill)
@@ -284,7 +284,7 @@
 minutos  = formateo(minutos);
 segundos = formateo(segundos);
 %
-resta = (eval(horas1-global.horas0)*60+eval(minutos1-global.minutos0))*60+eval(segundos1-global.segundos0);
+resta = (eval(horas1-horas0)*60+eval(minutos1-minutos0))*60+eval(segundos1-segundos0);
 h = Math.floor(resta/3600);        htexto=formateo(h);
 m = Math.floor((resta-3600*h)/60); mtexto=formateo(m);
 s = resta-3600*h-60*m;             stexto=formateo(s);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.