Todonotes,内联,无任何装饰

Todonotes,内联,无任何装饰

我想使用该todonotes包,但当我使用内联待办事项时,我不希望它们看起来有任何不同。在文档的末尾,我将列出所有待办事项,\listoftodos它们就在那里。我不希望在文档的起始点引起注意。

我知道我可以使用\todo[disable]{this is a todo},它不会在正文中显示待办事项,但我希望它以内联方式显示待办事项的正常文本。目前,我必须再次输入它,就像\todo[disable]{this is a todo} this is a todo它显示待办事项的文本一样。这可以不重复自己吗?

例子:

This is a paragraph of text. \todo[noformat]{There are some things I need to do} for this.

应该呈现

This is a paragraph of text. There are some things I need to do for this.

列表在最后

Todo list

There are some things I need to do . . . . . . . . . . . . . . . . . . . 1

这能做到吗?

答案1

这个答案是基于我的答案的很小的修改标记草稿文本的可靠方法是什么?

现在我确实在 TO DO 文本周围放置了红色分隔符,但在源代码中展示了如何消除这些分隔符,如果真的不想在主要文本中显示什么是 TO DO 什么不是 TO DO。我还在脚注中展示了该解决方案的有效性。

\documentclass{article}
\textheight=6in
\usepackage{xcolor}
\usepackage{stackengine}
\setstackgap{L}{.5\baselineskip}
\newcommand\markin[1]{\textcolor{red}{\sffamily%
  \scriptsize\bfseries#1}}
\usepackage{ifthen}
\newcounter{todoindex}
\setcounter{todoindex}{0}
\newcommand\TODO[1]{%
  \addtocounter{todoindex}{1}%
  \expandafter\gdef\csname todo\roman{todoindex}\endcsname{#1}%
  \markin{\Alph{todoindex}}% <-- ELIMINATE THIS TO GET RID OF LEADING MARKER
  #1%
  \markin{\Alph{todoindex}}% <-- ELIMINATE THIS TO GET RID OF TRAILINGMARKER
}
\newcounter{index}
\newcommand\showTODOs{%
  \vspace{5ex}%
  \rule{10ex}{.5ex}\textcolor{red}{TO-DO LIST}\rule{10ex}{.5ex}\\%
  \setcounter{index}{0}%
  \whiledo{\value{index} < \value{todoindex}}{%
    \addtocounter{index}{1}%
    \markin{\Alph{index}}\csname todo\roman{index}\endcsname\\%
  }%
}
\begin{document}
When writing documents\footnote{Note, this is a copy of the OP's
\TODO{That is, the one asking the question}
text}, I like to 'mark up'
draft/partial text (e.g., short summaries of what will go in a section
\TODO{I am using the TODO macro for longer notes that do not fit into a single
line, or are otherwise inconvenient to make short}%
) so that I can clearly see what needs to be adjusted. I know that things like the todonotes package exist (see this question, for example), but I want something
that can span arbitrary parts of the document (e.g., multiple paragraphs or even sections with whatever text is in there).

I have been using the color package's \verb|\color| 'switch' to do this
\TODO{I presume you actually meant that you are using the \textsf{xcolor}
package, since it improves upon the functionality of the former package.}%
 (with an alternate \verb|\textcolor| based command for short inline bits of text), with commands like this:

\begin{verbatim}
\usepackage[usenames,dvips]{color}
\newcommand{\todo}[1]{\textcolor{Purple}{#1}}    
\newcommand{\startToDo}{\color{Purple}}
\newcommand{\stopToDo}{\color{Black}}
\end{verbatim}

However, this has problems in various situations (such as footnotes, URLs, tables), some dependent on the particular other packages used. (See this question and this one.)

Does anyone have any ideas on a robust alternative I could use? I would prefer not to use marginal lines (as used to indicate changes) so that it is clear exactly which bits of text, figures, etc. are included. Differently-coloured 
text was the obvious choice for me.


\showTODOs

\end{document}

enter image description here

答案2

我认为该todo包可能更适合。使用\todo*,您可以创建一个相当多的待办事项,它不会显示在文本中,但仍会显示在列表中。要生成待办事项列表,您可以调用命令\todos。单击这里作为示例文件。

相关内容