<div dir="ltr">I'm resurrecting a thread from back in October (month 10--two digits--this 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>
<span class="gmail-il">The</span> R code generates a graph, saving it as a pdf file, <span class="gmail-il">the</span> filename<br>
including <span class="gmail-il">the</span> <span class="gmail-il">system date</span>., like this:<br><br><timeseriesplot, results=hide, echo=FALSE>>=<br>
# make <span class="gmail-il">the</span> major graph<br>
pdf(file=paste("<div id="gmail-:29k" class="gmail-a3s gmail-aXjCH gmail-m157c46bf6900a315"><wbr>NaloxoneUseEMS-timeseriesplot-<wbr>", Sys.<span class="gmail-il">Date</span>(), ".pdf",<br>
sep=""), height=8, width=12)<br>
## bunch of R code in here to create a graph<br>
dev.off()<br>@<br></div><br><br> Each time I run <span class="gmail-il">the</span> report, the name of the saved pdf file changes, to match the system date. I want to include <span class="gmail-il">the</span><br>
most current graph in my pdf output.<br>
<br>
William Adams kindly provided this excellent solution:<br><br>\documentclass{article}
<p style="margin-top:0px;margin-bottom:0px;text-indent:0px">\usepackage{datenumber}</p>
<p style="margin-top:0px;margin-bottom:0px;text-indent:0px">\begin{document}</p>
<p style="margin-top:0px;margin-bottom:0px;text-indent:0px">NaloxoneUseEMS-timeseriesplot-<wbr>\thedateyear-\thedatemonth-\<wbr><span class="gmail-il">thedateday</span></p>
<p style="margin-top:0px;margin-bottom:0px;text-indent:0px">\end{document}</p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px"><br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px">Which worked very well for a while. But now that it is January (month 1, or 01, and there is the crux of the problem) it no longer does. Here is part of the latex error message that provides a clue:</p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px"><br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px">ERROR: LaTeX Error: File `ERROR: LaTeX Error: File `ERROR: LaTeX Error: File `NaloxoneUseEMS-timeseriesplot-2017-1-31' not found.</p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px"><br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px">So it appears that the Latex package datenumber is searching for the graphics file called <br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px"><br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px">NaloxoneUseEMS-timeseriesplot-2017-1-31.pdf (which of course does not exist)<br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px"> <br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px">whereas my R code is creating the graphics file called</p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px"><br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px">NaloxoneUseEMS-timeseriesplot-2017-01-31.pdf (which was successfully created and is sitting in the proper directory.)</p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px"><br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px">Can I make datenumber use 2 digits for \thedatemonth?</p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px"><br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px">Thanks.</p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px"><br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px">--Chris Ryan<br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px"> <br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px"><br></p><p style="margin-top:0px;margin-bottom:0px;text-indent:0px"><br><br><br></p><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 14, 2016 at 3:15 PM, Christopher W Ryan <span dir="ltr"><<a href="mailto:cryan@binghamton.edu" target="_blank">cryan@binghamton.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">William--<br>
<br>
Fantastic! Thanks!<br>
<br>
--Chris<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, Oct 14, 2016 at 2:43 PM, William Adams <<a href="mailto:will.adams@frycomm.com">will.adams@frycomm.com</a>> 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>
</div></div></blockquote></div><br></div>