It’s been rather a long time sine I last posted anything as I’ve been working on my thesis and article… sorry!
Theses and articles typically go through many versions, ding-dong to-and-fro between supervisors and co-authors. Some people keep track of the version number (or date-last-modified) by giving each draft a different file name. Personally, though, I tend to get inconsistent with the file naming, especially when it’s 2:30am. So I figured it might work better for me if the date-last-modified was printed in the PDF of the thesis/article draft itself.
One could always put the date in the header or footer, but there might already be some content in those regions. Besides, it’s probably not a good idea to mess with the formattings for a journal article. Instead, I put \today
in a watermark, so the date would get updated I compile my draft:
\usepackage{draft watermark} \usepackage{datetime} \ddmmyydate \SetWatermarkLightness{.9} \SetWatermarkText{Draft\string@\today} \SetWatermarkScale{.6} |
The colour, lightness, font and other attributes of the watermark are configurable. I also used the datetime
package to configure the date formatting. Here’s how the output looks like (a page from my thesis draft):
Thanks! question: How to create watermark with two lines, say the date is under the word “draft”?
You could try something like
\SetWatermarkText{parbox{6em}{centering Draft\today}}
o.k. following your suggestion I tried
\SetWatermarkText{parbox{6em}{textcolor{cyan}{centering DRAFT\today}}}
and it works perfect. Thanks again 🙂
You're welcome. You can also do
\SetWatermarkColor{cyan}
instead of using a textcolor in the watermark text. Makes the code a little more readable. 🙂
You will have incorrect spacing with
{textcolor{cyan}{centering DRAFT\today}}}
Changing to
\SetWatermarkText{parbox{6em}{centeringtextcolor{cyan}{DRAFT\today}}}
will resolve it.
Indeed, this makes the spacing better. Thank you.
How can I change '7. August 2015' into '7/08/2015'?
Have a look at the datetime (now obsolete) or datetime2 (this one's newer) packages.
e.g. you might use
If using datetime2, you'll need to call DTMsetstyle instead: