38

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>}?

strpeter
  • 5,215
Paulo Cereda
  • 44,220

3 Answers3

31
\documentclass{article}
\usepackage[clock]{ifsym}

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

enter image description here

Alain Matthes
  • 95,075
19

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

\usepackage[clock]{ifsym}
12

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

Paulo Cereda
  • 44,220