1

I'd like to use the \today command within a pathname.

\usepackage{graphicx}
\usepackage[iso]{datetime}   
\graphicspath{{./Figures_\today/}}

This should point to ./Figures_2017-11-13/

What is the best way to concatenate/expand \today output with a string?

  • Welcome to TeX.SE! I've taken the liberty of editing your code slightly; feel free to revert. – Mico Nov 13 '17 at 21:56
5

datetime was replaced by datetime2, which allows \today to expand. It also uses the ISO format as the default, so just replace

\usepackage[iso]{datetime}

with

\usepackage{datetime2}
  • 1
    I'll defer to you and delete:-) – David Carlisle Nov 13 '17 at 22:18
  • @DavidCarlisle Your answer is also useful :-) It doesn't have the overhead of loading datetime2. (I upvoted it.) – Nicola Talbot Nov 13 '17 at 23:04
  • Thanks -- note that datetime2 uses a different default time zone than datetime – bbuzz31 Nov 14 '17 at 1:27
  • @bbuzz31 datetime doesn't have time zone support. datetime2 obtains it from \pdfcreationdate. – Nicola Talbot Nov 14 '17 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.