Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Situation

I was browsing The Comprehensive LATEX Symbol List looking for a simple analog clock in which I could use in a pamphlet. At some moment, I found an interesting entry (page 91):

Clock entry

I tried to use the \showclock macro in my document, but unfortunately a pdflatex run showed me the following error:

! Undefined control sequence.
l.10 \showclock{4}{50}

In my Linux box with TL2011, the very same attempt to call \showclock{4}{50} gets even worse, with no ifsym package available.

Documentation

I tried to read the documentation, but texdoc ifsym lists only a German document, of which I only understand a few words - sadly. (Ich spreche kein Deutsch.) :( Anyway, the icon table in the end of the documentation gives me the idea of a possible font problem, like a missing indexing or reference.

MWE

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ifsym}

\begin{document}

\showclock{4}{50}

\end{document}

Question

Is there any package with a similar command, say \clock{<hours>}{<minutes>}?

share|improve this question
    
I'm surprised you linked to the documentation on ctan, and not texdoc.net :) –  cmhughes Mar 26 '12 at 2:59
    
@cmhughes: Oops, my bad. :) –  Paulo Cereda Mar 26 '12 at 16:35
    
only because I know you co-created texdoc.net :) –  cmhughes Mar 26 '12 at 17:45
add comment

3 Answers 3

up vote 23 down vote accepted
\documentclass{article}
\usepackage[clock]{ifsym}

\begin{document}
Il est minuit 45 : \showclock{0}{45}
\end{document}    

enter image description here

share|improve this answer
    
Wow. I feel so silly, I had no idea about providing a package option. Merci. :) –  Paulo Cereda Mar 25 '12 at 21:00
add comment

It seems the \showclock command becomes available if you activate it with a clock package option:

\usepackage[clock]{ifsym}
share|improve this answer
    
Thanks Stephan! I was really unaware of this option. I tried to figure out how to solve it, but it was in vain. :) –  Paulo Cereda Mar 25 '12 at 21:02
add comment

For completeness sake, I'll add a honorable mention to a similar package I found when trying to find a solution to my original question: the clock package. According to the documentation:

  • The basic command available is \clock{<hours>}{<minutes>} 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 \clocktime (without any argument) then the TeX clock will output the current system time at time of compilation.

  • \ClockFrame: a boolean parameter and can be true or false. Saying \ClockFramefalse lets the border disappear, saying \ClockFrametrue lets the border appear.

  • The parameter \ClockStyle takes a number between 0 and 3 where 0 stands for a clock with invisible dial.

A full MWE:

\documentclass{article}

\usepackage{clock}
\usepackage[clock]{ifsym}

\begin{document}

\ClockFramefalse\ClockStyle=0\clock{13}{10}
\ClockFramefalse\ClockStyle=1\clock{14}{22}
\ClockFramefalse\ClockStyle=2\clock{15}{48}
\ClockFramefalse\ClockStyle=3\clock{7}{50}

\ClockFrametrue\ClockStyle=0\clock{11}{32}
\ClockFrametrue\ClockStyle=1\clock{12}{0}
\ClockFrametrue\ClockStyle=2\clock{8}{9}
\ClockFrametrue\ClockStyle=3\clock{1}{15}

\end{document}

The previous code creates the following output:

Clock

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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