2

I am trying to get the date of creation of the todo item. is it possible to add the todo item at compile time.

I did have a look at this.. But i was wondering if it is possible to do with the due keyword.

Atleast that's the best case scenario from this documentation.

%% TODONOTES
\usepackage{todonotes}
%\usepackage[disable]{todonotes} % TO DISABLE

\newcommand{\rnline}[1]{\todo[author=TANDEM,size=\small,inline,color=green!40,due=\today]{#1}}
\newcommand{\rn}[1]{\todo[color=blue!40]{#1}}

Any help will be appreciated.

  • 1
    The best case scenario defines, that the todo should be done today. When you translate the document the next day, the date will be adapted. But the creation date should keep the (first) creation date, That's something complete different. – knut Sep 12 '16 at 8:11
  • I agree with you. Everytime I compile it, the date changes.. and I was wondering if there is a way LaTeX can create a date of creating file in some format which need not be changed unless specified by the user.. maybe very specific question.. any hints in this direction would be helpful – tandem Sep 12 '16 at 8:16
  • What if you have \todo's from different days? Wouldn't it be safer simply put date manually to each of them? – Przemysław Scherwentke Sep 12 '16 at 8:42
  • I agree with having different dates... that's the reason i want a table which it can lookup before compiling. – tandem Sep 12 '16 at 9:21
1

I believe you can not use \today or current date of the day or such commands for adding the creation date for the todo comments. It is obvious by every compile the date will change and we will lose the former creation time (or due time). So maybe it is the best to write the time manually in your own defined template. I hope this helps:

\documentclass[a4paper]{article}

\usepackage[colorlinks]{hyperref}
\usepackage[colorinlistoftodos]{todonotes}
\newif\ifallowtodo

\begin{document}

\listoftodos
\allowtodotrue   

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla
\ifallowtodo \todo{Plain todonotes.\footnotesize{$\rightarrow$ \textit{Due Mar 22 '17}}} \else \fi
urna. Maecenas interdum nunc in augue. Mauris quis massa in ante
tincidunt mollis. Proin imperdiet. Donec porttitor pede id est. Sed
in ante. Integer id arcu. Nam lectus nisl, posuere sit amet,
imperdiet ut, tristique ac, lorem. In erat. In commodo enim.
\ifallowtodo \todo[color=blue!40]{Todonote with a different color. \footnotesize{$\rightarrow$ \textit{Due Sep 17 '16}}} \else \fi
Phasellus libero ipsum, tempor a, pharetra consequat, pellentesque
sit amet, sem. Praesent ut augue luctus elit adipiscing ultricies.
Vestibulum suscipit cursus leo. Nullam molestie justo.
\end{document}

\allowtodotrue is just a flag for \ifallowtodo to check whether we want the todo mode or full pdf without todo. You can get rid of that if it is not necessary. enter image description here

  • I did think of using this idea.. but i don't like the idea of writing dates manually. – tandem Sep 12 '16 at 9:22
  • I suggest some kind of snippet for this, either through your editor or a dedicated textexpansionsoftware, like aText, TextExpander or simular. I have it set up so that depending on which software I am currently in, it will output the current date whenever I write @today, and it will replace it immidiently when I use a texteditor to 2016-09-12, and when I am in a internet browser it will expand to mandag 12. september 2016. I've also set up a few variations, like @yesterday, @nextmonday``@day+14 etc. – Runar Sep 12 '16 at 9:41

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.