<div dir="ltr"><div>While David's solution (of course) works, I'm pretty sure that if you consult the documentation for the package datenumber there will be an option to enable padding with a leading zero (though it's odd to me that apparently this is turned one for days? Or have you never had to do a report during the first nine days of a month?)</div><div><br></div><div>William</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 31, 2017 at 5:39 PM, David Carlisle <span dir="ltr"><<a href="mailto:d.p.carlisle@gmail.com" target="_blank">d.p.carlisle@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">\ifnum\thedatemonth<10 0\fi\thedatemonth<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 31 January 2017 at 22:33, Christopher W Ryan <<a href="mailto:cryan@binghamton.edu">cryan@binghamton.edu</a>> wrote:<br>
> I'm resurrecting a thread from back in October (month 10--two digits--this<br>
> is of consequence).  My challenge was this:<br>
><br>
> I am using R and Sweave and MikTeX on Windows 7.  I use this workflow<br>
> to generate a recurring report quarterly. Same report, just new data.<br>
><br>
> The R code generates a graph, saving it as a pdf file, the filename<br>
> including the system date., like this:<br>
><br>
> <timeseriesplot, results=hide, echo=FALSE>>=<br>
> # make the major graph<br>
> pdf(file=paste("<br>
> NaloxoneUseEMS-timeseriesplot-<wbr>", Sys.Date(), ".pdf",<br>
> sep=""), height=8, width=12)<br>
> ## bunch of R code in here to create a graph<br>
> dev.off()<br>
> @<br>
><br>
><br>
>   Each time I run the report, the name of the saved pdf file changes, to<br>
> match the system date. I want to include the<br>
> most current graph in my pdf output.<br>
><br>
> William Adams kindly provided this excellent solution:<br>
><br>
> \documentclass{article}<br>
><br>
> \usepackage{datenumber}<br>
><br>
> \begin{document}<br>
><br>
> NaloxoneUseEMS-timeseriesplot-<wbr>\thedateyear-\thedatemonth-\<wbr>thedateday<br>
><br>
> \end{document}<br>
><br>
><br>
> Which worked very well for a while.  But now that it is January (month 1, or<br>
> 01, and there is the crux of the problem) it no longer does.  Here is part<br>
> of the latex error message that provides a clue:<br>
><br>
><br>
> ERROR: LaTeX Error: File `ERROR: LaTeX Error: File `ERROR: LaTeX Error: File<br>
> `NaloxoneUseEMS-<wbr>timeseriesplot-2017-1-31' not found.<br>
><br>
><br>
> So it appears that the Latex package datenumber is searching for the<br>
> graphics file called<br>
><br>
><br>
> NaloxoneUseEMS-timeseriesplot-<wbr>2017-1-31.pdf (which of course does not exist)<br>
><br>
><br>
><br>
> whereas my R code is creating the graphics file called<br>
><br>
><br>
> NaloxoneUseEMS-timeseriesplot-<wbr>2017-01-31.pdf (which was successfully created<br>
> and is sitting in the proper directory.)<br>
><br>
><br>
> Can I make datenumber use 2 digits for \thedatemonth?<br>
><br>
><br>
> Thanks.<br>
><br>
><br>
> --Chris Ryan<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Fri, Oct 14, 2016 at 3:15 PM, Christopher W Ryan <<a href="mailto:cryan@binghamton.edu">cryan@binghamton.edu</a>><br>
> wrote:<br>
>><br>
>> William--<br>
>><br>
>> Fantastic! Thanks!<br>
>><br>
>> --Chris<br>
>><br>
>> On Fri, Oct 14, 2016 at 2:43 PM, William Adams <<a href="mailto:will.adams@frycomm.com">will.adams@frycomm.com</a>><br>
>> wrote:<br>
>> > \documentclass{article}<br>
>> ><br>
>> > \usepackage{datenumber}<br>
>> ><br>
>> > \begin{document}<br>
>> ><br>
>> > NaloxoneUseEMS-timeseriesplot-<wbr>\thedateyear-\thedatemonth-\<wbr>thedateday<br>
>> ><br>
>> > \end{document}<br>
><br>
><br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> ______________________________<wbr>_________________<br>
> TeX FAQ: <a href="http://www.tex.ac.uk/faq" target="_blank" rel="noreferrer">http://www.tex.ac.uk/faq</a><br>
> Mailing list archives: <a href="http://tug.org/pipermail/texhax/" target="_blank" rel="noreferrer">http://tug.org/pipermail/<wbr>texhax/</a><br>
> More links: <a href="http://tug.org/begin.html" target="_blank" rel="noreferrer">http://tug.org/begin.html</a><br>
><br>
> Automated subscription management: <a href="http://tug.org/mailman/listinfo/texhax" target="_blank" rel="noreferrer">http://tug.org/mailman/<wbr>listinfo/texhax</a><br>
> Human mailing list managers: <a href="mailto:postmaster@tug.org">postmaster@tug.org</a><br>
</div></div></blockquote></div><br></div>