一种检查待办事项的方法

一种检查待办事项的方法

我最近发现了 todonotes 包。如果能以某种方式检查笔记是否已完成,那就太好了。我知道创建者在他的“待办事项列表”中有一个这个功能(有趣),但现在还没有实现。我的想法是把它隐藏在文档中,并在 listoftodos 中把它划掉。下面是一个最低限度的工作示例。这就是我现在的做法。

我在这里先向您的帮助表示感谢!

\documentclass[a4paper,12pt,captions=tableheading,abstracton,
%draft,
%final,
headsepline,bibliography=totoc]{scrreprt}

\usepackage{ulem}
\usepackage[obeyFinal,textsize=footnotesize]{todonotes}
\newcommand{\addref}{\todo[color=red!40]{Add reference.}}
\newcommand{\done}{\todo[disable]{Test}
}%this shouldnt show up in document and be striked out in listoftodos



\begin{document}
\listoftodos\clearpage
\todo{ToDo}

\addref{addRef}

\done{Done}
\end{document}

在这个问题的旧版本中,我还询问了 listoftodos 中的颜色。现在情况已经不同了。

答案1

我建议这样做。这个想法是手动在待办事项列表中添加删除线。

\documentclass{article}

\usepackage{ulem}
\usepackage{todonotes}
\newcommand{\addref}[1]{\todo[color=red!40]{Add reference.}}
\newcommand{\done}[1]{\todo[disable]{#1}\addcontentsline{tdo}{todo}{\sout{#1}}}

\begin{document}
\listoftodos

\section{Header}
Some text\todo{ToDo}.
More text that needs a reference\addref{paper}.
\done{Write text with reference}
\end{document}

输出如下所示。

示例输出

如果您希望将已完成的待办事项放在待办事项列表的末尾(评论中已请求),可以使用以下方法。这个想法是有一个单独的已完成待办事项列表(.tdod 而不是 .tdo)。

\documentclass{article}

\usepackage{ulem}
\usepackage{todonotes}
\newcommand{\addref}[1]{\todo[color=red!40]{Add reference.}}
\newcommand{\done}[1]{\todo[disable]{#1}\addcontentsline{tdod}{todo}{\sout{#1}}}

\begin{document}
\listoftodos
\makeatletter
\@starttoc{tdod}
\makeatother

\section{Header}
Some text\todo{ToDo}.
More text that needs a reference\addref{paper}.
\done{Write text with reference}
An extra todo, to show that things are ordered\todo{last todo}.
\end{document}

输出如下

示例输出

相关内容