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.

I'm creating a problem bank and each problem is named using a list (e.g., \item Parametric particle trajectory). I'd like to auto-generate a list of problem names from this list and I;d like that list to appear at the beginning of the document. Is there anyway to get LaTeX to do this?

I could create a new environment if that's necessary; I'm just not sure how to proceed.

share|improve this question
add comment

migrated from stackoverflow.com Jul 14 '12 at 21:06

This question came from our site for professional and enthusiast programmers.

1 Answer

You could use \addcontentsline{}{}{} to add this to the table of contents:

enter image description here

Using the hyperref package make these click able links.

Code:

\documentclass{book}
\usepackage{lipsum}
\usepackage{hyperref}

\newcommand*{\Item}[1][]{%
    \item \textbf{#1}%
    \addcontentsline{toc}{section}{#1}
}%

\begin{document}
\tableofcontents
\chapter{Questions}
\begin{enumerate}
\Item[Parametric particle trajectory]
    \lipsum[1]
\Item[Non-parametric particle trajectory]
    \lipsum[1]
\end{enumerate}
\end{document}
share|improve this answer
add comment

Your Answer

 
discard

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