[OS X TeX] Re: Package "draftwatermark" -- adding date-time stamp

John B. Thoo jthoo at yccd.edu
Thu Jan 24 06:53:06 CET 2013


Date: Wed, 23 Jan 2013 09:30:16 -0600
From: Herbert Schulz <herbs at wideopenwest.com>

> On Jan 23, 2013, at 9:20 AM, "John B. Thoo" <jthoo at yccd.edu> wrote:
> 
>> Hi.  I'd like to add a date-time stamp to "draftwatermark"; I'm using pdflatex.  In
>> 
>> <http://mirror.hmc.edu/ctan/macros/latex/contrib/draftwatermark/draftwatermark.pdf>
>> 
>> it states, "Other features available as options in draftcopy (e.g., the possibility of time- stamping the watermark text) can be obtained working on the watermark text itself."
>> 
>> How do I do this?  Thanks.
>> 
>> ---John.
> 
> 
> Howdy,
> 
> Did you read any further in the documentation than that first page? Look for something like \SetWatermarkText.

Yes, I did, but I didn't know how to get it to print the date and time that I ran pdflatex.


> Also, if you installed TeX Live 2012 via the MacTeX installer there is no need to install the draftwatermark package since it's already part of TeX Live. You can look at the documentation by running
> 
> texdoc draftwatermark
> 
> in Terminal. In TeXShop you can use Help->Show Help for Package. (Opt-Cmd-I) and enter draftwatermark for the package name.

I'm still using TeX Live 2009.  I will upgrade to TeX Live 2012 ASAP.  Thanks.


Date: Wed, 23 Jan 2013 16:57:42 +0000
From: "Vamos, Peter" <P.Vamos at exeter.ac.uk>

> John,
> On 23 Jan 2013, at 15:20, John B. Thoo wrote:
> 
> Hi.  I'd like to add a date-time stamp to "draftwatermark"; I'm using pdflatex.
> [snip]
> How do I do this?  Thanks.
> 
> Exactly the same way as discussed previously
> 
> [...snip, snip...]
> 
> ==========
> \usepackage{calc}
> \usepackage{ifthen}
> \newcounter{hours}\newcounter{minutes}
> \newcommand\printtime{%
> \setcounter{hours}{\time/60}%
> \setcounter{minutes}{\time-\value{hours}*60}%
> \ifthenelse{\value{hours}<10}{0\thehours}{\thehours}:\hspace{-0.33em}
> \ifthenelse{\value{minutes}<10}{0\theminutes}{\theminutes}
> }
> 
> %%%%%%%%%%%%%%%%%%%
> \usepackage{draftwatermark}
> \SetWatermarkText{
> \begin{minipage}{17cm}
> \begin{center}
> DRAFT  \\ {\fontsize{48}{17}\selectfont \today, \printtime}
> \end{center}
> \end{minipage}

Thanks.  I had to make only smalls modifications, viz., (i) I used \SetWatermarkScale, (ii) I put in a negative \vspace, and (iii) I changed the fontsize.

 \SetWatermarkScale{3}
 \SetWatermarkText{%
    \begin{minipage}{6in}
    \begin{center}
      DRAFT

      \vspace{-14ex}
      {\fontsize{12}{6}\selectfont \today, \printtime}
    \end{center}
    \end{minipage}
  }


Thank you both, Herb and Peter, for your help.

---John.
-----------------------------------------------------------------------
"Ten thousand difficulties do not make one doubt....  A man may be annoyed that he cannot work out a mathematical problem ... without doubting that it admits an answer."

---John Henry Newman [_Apologia_, p. 239 in Project Gutenberg's 
   <http://www.gutenberg.org/ebooks/22088>]





More information about the macostex-archives mailing list