Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Suppose I am taking notes in class and label certain things with my own environment like:

\begin{Theorem} Important Theorem Here. \end{Theorem} 

or smaller key ideas labeled with my own command like:

\newcommand{\keyidea}[1]{\textbf{#1}}
\keyidea{Important point here}

How could I then essentially create a summary of the document. In other words, automatically generate all the text in either the Theorem environment or labeled as a key idea and put it either at the end of the document or in anoter file? It would be similar to a table of contents, but a summary

share|improve this question
    
Welcome to TeX.SE. While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. In this case you should also show what the expected output should be to clarify the question. –  Peter Grill Mar 26 '12 at 21:21
    
So you want to keep the original text as-is, but have a duplicate set of 'important stuff' printed somewhere else in your document? –  Werner Mar 26 '12 at 22:15
    
@PeterGrill thanks for the introduction and sorry for not adhering to the MWE standards, I will remember to do so in the future; since the question has been answered, I won't go back and add the missing details. –  jelinson Apr 2 '12 at 20:23
    
@Werner indeed that is correct. –  jelinson Apr 2 '12 at 20:23

1 Answer 1

up vote 5 down vote accepted

You can use the tocloft package for this. With this package you can generate your own lists. Maybe the following code could be an approach for you:

\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}
share|improve this answer
    
Many thanks! Now, anyway to remove the dotted lines? –  jelinson Apr 2 '12 at 20:24
1  
Page 5 in the tocloft documentation: \makeatletter \renewcommand{\@dotsep}{10000} \makeatother –  Holle Apr 2 '12 at 20:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.