[OS X TeX] Re: draftcopy "weirdness"

John B. Thoo jthoo at yccd.edu
Tue Apr 12 09:29:04 EDT 2011


Peter,

On Apr 11, 2011, at 4:37 AM, Peter Vamos wrote:

> At 05:03 +0100 11/4/11, John B. Thoo wrote:
> 
>> Date: Sun, 10 Apr 2011 16:32:27 +0100
>> From: Peter Vamos <P.Vamos at exeter.ac.uk>
>> 
>>> Additionally, if you want the time on a new line then you have to
>>> enclose the draftstring in a parbox or the minipage environment. For
>>> example, to approximate what you originally wanted, try this:
>>> 
>>> \usepackage[draft]{pdfdraftcopy}
>>> \draftstring{%
>>> \begin{minipage}{17cm}
>>> \begin{center}
>>> \  DRAFT \quad\today
>>> \end{center}
>>> \end{minipage}
>>> }
>> 
>> That puts the date on a new line very nicely; however, there is no time.
> 
> To get a time stamp you have to use TeX's \time register, this is the number of minutes since midnight. There is an example in The LaTeX Companion 2nd ed (TLC2) Example A.3.2  page 871, on how to  turn this into an hour : Minutes representation; this code is between the rows of %%%%%% below, I only changed their `h' and `min' to a colon `:'; you can modify this to other representations. I think that there is also a datetime package which would do this and probably more.
> 
> So try the code below. You may also experiment with the package suggested by  Juan Luis Varona (I haven't tried) but again you'll need the time stamp code from TLC2 below (or the package).
> 
> %%%%%%%%%%%%%
> \usepackage{calc}
> \newcounter{hours}\newcounter{minutes}
> \newcommand\printtime{\setcounter{hours}{\time/60}%
>         \setcounter{minutes}{\time-\value{hours}*60}%
>         \thehours :\theminutes}
> %%%%%%%%%%%%%%%%%%%
> \usepackage[draft]{pdfdraftcopy}
> \draftstring{%
> \begin{minipage}{17cm}
> \begin{center}
> \  DRAFT \quad\today\ \printtime
> \end{center}
> \end{minipage}
> }
> 
> 
> Hope this now does (roughly) what you wanted but now compatible with pdfLATEX.

That's very nice.  I like it.  In fact, I saved your code into a file named "vamosdraft.sty". :-)  My only further question is how can I get the time to print in four digits, viz., "hh:mm"?  Now, if the time is 6:04, e.g., it prints 6:4.  See

<http://ms.yccd.edu/~jb2/PickUp/ast_draft.pdf>

Thanks very much for your help.

---John.

-----------------------------------------------------------------------
"It is worth thinking deeply about simple things."
---Jesus De Loera, UC Davis mathematics, 12 Jan 2011




More information about the MacOSX-TeX mailing list