假设我在课堂上做笔记,并用我自己的环境标记某些事物,例如:
\begin{Theorem} Important Theorem Here. \end{Theorem}
或者用我自己的命令标记的较小的关键想法,例如:
\newcommand{\keyidea}[1]{\textbf{#1}}
\keyidea{Important point here}
那么我如何才能创建文档摘要呢?换句话说,自动生成定理环境中的所有文本或标记为关键思想的文本,并将其放在文档末尾或另一个文件中?它类似于目录,但摘要
答案1
您可以使用此tocloft
包来实现这一点。使用此包,您可以生成自己的列表。也许以下代码可以为您提供一种方法:
\documentclass{article}
\usepackage{tocloft}
% create a new list incl. counter
\newlistof{ideaTagCounter}{ideaTags}{List of \textbackslash ideatags}
% define the idea command
\newcommand{\keyidea}[1]{%
\refstepcounter{ideaTagCounter}% step the counter
\addcontentsline{ideaTags}{ideaTagCounter}{\theideaTagCounter:\quad#1}% add item to list
\textbf{#1}%
}
\AtEndDocument{
\cleardoublepage
\listofideaTagCounter% print the list
}
\begin{document}
Lorem ipsum dolor \keyidea{idea1} sit amet, consetetur sadipscing elitr \keyidea{idea2}, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam \keyidea{idea3} erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidun \keyidea{idea4} t ut labore et dolore magna aliquyam erat, sed diam voluptua \keyidea{idea5}. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat \keyidea{idea6}, sed diam voluptua. At vero eos et accusam et justo duo \keyidea{idea7} dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\newpage
Duis autem vel eum iriure dolor in \keyidea{idea8} hendrerit in vulputate velit esse molestie consequat, vel illum \keyidea{idea9}dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue \keyidea{idea10} duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
\end{document}