Pretext: I am aware of packages such as todonotes
, todo
, and fixme
, but this is more of a task for learning LaTeX programming. Therefore, the use of additional packages downloaded from CTAN is discouraged. Would also like to avoid using additional *.sty files.
How does one create a command in the main *.tex for a counted item to be later displayed in a listing? For example:
Text before\todo[optional caption]{my text here}.
Some other text in the document\todo{another todo but without caption}.
The todo note will be coloured, prefixed, or otherwise marked in the inline text. Calling \listoftodos
will then create a list of the \todo
s in the document and generate a (hyperlinked) list similar but separate to \tableofcontents
, where the content in {}
will be replaced by that in []
if and only if it is present, with the page number on the right. This list will only need a single level of depth.
Was looking through the source code for the todonotes
package, but could not make much sense of it. From what I can tell, this task will require defining two new commands, storing the texts in a list of todos, handling optional arguments, and finally making a referenced list of todos using hyperref
in a(nother) table of contents. The list will be written to the *.aux file.
Bonus:
Safety to be used within an equation or section header, safety to have formatting or an equation within the note
How can options be added? A simple show or hide option for the inline text (while still being displayed in the
\listoftodos
) would be nice.Can this method be extended for other items?
\myitem
,\listofmyitems
,\otheritems
,\listofotheritems
?
Addendum: is there any advanced guide online for programming (La)TeX? This will be helpful for any future ventures.
etoolbox
andxparse
be allowed, as a helper package?[]
(easy to get withxparse
or an option for the toc entry)