名前: 本田 日時: 2003-04-03 12:56:49 IPアドレス: 61.114.8.*
>>17950 The time is 08h 08min. の場合は \documentclass[a4j,12pt]{jsarticle} \usepackage{calc} \newcounter{hours}\newcounter{minutes} \makeatletter \newcommand{\printtime}{% \setcounter{hours}{\time/60}% \setcounter{minutes}{\time-\value{hours}*60}% \two@digits{\thehours}~h~\two@digits{\theminutes}~min} \makeatother \begin{document} \noindent The time is \printtime. \end{document} The time is _8h _8min. %('_' はスペース) の場合は \documentclass[a4j,12pt]{jsarticle} \usepackage{calc} \newcounter{hours}\newcounter{minutes} \makeatletter \def\phantom@two@digits#1{% \ifnum#1<10 \leavevmode\phantom{0}\fi\number#1}% \newcommand{\printtime}{% \setcounter{hours}{\time/60}% \setcounter{minutes}{\time-\value{hours}*60}% \phantom@two@digits{\thehours}~h~\phantom@two@digits{\theminutes}~min} \makeatother \begin{document} \noindent The time is \printtime. \end{document} のようにすればできるとおもいます. \two@digitsはLaTeX2eに予めあります.
この書き込みへの返事: