对于这样的东西,我强烈鼓励您深入 LaTeX 层并学习 Donald Knuth 的 The TeXbook。这才是真正解释可用机制的地方。
如果您的任务列表确实要在末尾出现,您可以避免所有废话,只需分配您在整个文档中积累的全局令牌寄存器即可。您将在 The TeXbook 的附录 D(肮脏的技巧)中找到一些有用的想法和示例。
I haven't had much luck with the \addtocontents mechanism. I have much better luck writing arbitrary LaTeX code to the .aux file. The examples are really too big to post in an SO answer, but you can find one in the noweb in the way "subpage labels" are handled, and you can find something similar in my technical report Teach Technical Writing in Two Hours Per Week, which accumulates some lists of principles and practices. The noweb source is public (and in Debian), and if anyone wants to the the other, send me an email.
For stuff like this, I encourage you strongly to dig under the LaTeX layer and study The TeXbook by Donald Knuth. That's the place where the mechanisms available are really explained.
If your list of tasks is really going to come at the end, you can avoid all the nonsense and just allocate a global tokens register which you accumulated throughought the document. You'll find some helpful ideas and examples in Appendix D of The TeXbook (Dirty tricks).
\usepackage{todonotes}
\begin{document}
\todo{This will be a note typeset in the margin}
\todo[inline]{This will be an in-line todo}
\missingfigure{This will give me a box indicating a pic should go here}
\listoftodos % will give you all of your todos from the document.
\usepackage{todonotes}
\begin{document}
\todo{This will be a note typeset in the margin}
\todo[inline]{This will be an in-line todo}
\missingfigure{This will give me a box indicating a pic should go here}
\listoftodos % will give you all of your todos from the document.
发布评论
评论(3)
你可以这样做:
在你的序言中声明一个新的文件编写器。
然后,要在需要时打开文件,您可以将 writer 分配给文件并打开它:
写入文件:
最后,关闭文件:
要读取文件,可以像
一样简单\input
,或者您可以使用\newread
、\openin
、\read
和\closein
组合。这是你想做的吗?
编辑:这“对我有用”:
You can do:
in your preamble to declare a new file writer.
Then, to open a file when you want to, you can assign the writer to a file and open it:
To write to the file:
Finally, close the file with:
To read a file, it could be as simple as
\input
, or you can use\newread
,\openin
,\read
and\closein
combination.Is this what you want to do?
Edit: This "works for me":
我对
\addtocontents
机制不太感兴趣。我将任意 LaTeX 代码写入 .aux 文件的运气要好得多。这些示例确实太大,无法在 SO 答案中发布,但您可以在 中找到一个noweb 以“子页面标签”的处理方式,您可以在我的技术报告中找到类似的内容每周两小时教授技术写作,其中积累了一些原则和实践的列表。 noweb 源是公开的(并且在 Debian 中),如果有人想要另一个,请给我发电子邮件。对于这样的东西,我强烈鼓励您深入 LaTeX 层并学习 Donald Knuth 的 The TeXbook。这才是真正解释可用机制的地方。
如果您的任务列表确实要在末尾出现,您可以避免所有废话,只需分配您在整个文档中积累的全局令牌寄存器即可。您将在 The TeXbook 的附录 D(肮脏的技巧)中找到一些有用的想法和示例。
I haven't had much luck with the
\addtocontents
mechanism. I have much better luck writing arbitrary LaTeX code to the .aux file. The examples are really too big to post in an SO answer, but you can find one in the noweb in the way "subpage labels" are handled, and you can find something similar in my technical report Teach Technical Writing in Two Hours Per Week, which accumulates some lists of principles and practices. The noweb source is public (and in Debian), and if anyone wants to the the other, send me an email.For stuff like this, I encourage you strongly to dig under the LaTeX layer and study The TeXbook by Donald Knuth. That's the place where the mechanisms available are really explained.
If your list of tasks is really going to come at the end, you can avoid all the nonsense and just allocate a global tokens register which you accumulated throughought the document. You'll find some helpful ideas and examples in Appendix D of The TeXbook (Dirty tricks).
你需要 LaTeX 的
todonotes
包:http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/todonotes.html
you would want the
todonotes
package for LaTeX:http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/todonotes.html