I'm writing my math notes. A paragraph may include (or be followed as a separate paragraph) by an "Open question".
This is a paragraph making some points about a topic. Open question: Why is this true?
Open question: I don't understand why bla is bleah. Is this due to this or to that?
Is there a way to have something like an \openQuestion command to be used like in the following way?
This is a paragraph making some points about a topic. \openQuestion{Why is this true?}
\openQuestion{I don't understand why bla is bleah. Is this due to this or to that?}
In particular, I'd like the following features:
- all the questions listed together somewhere (possibly after the Table of Contents) in order of appearance
- each entry of the list has the page number at which the question is posed
- the page number is clickable (to move to the referenced page)
- the argument to the \openQuestion command also appears in the final layout where the command is called, exactly as it were normal text outside the command scope.
For now I tried to do this with imakeidx
\documentclass[11pt,a4paper]{book}
\usepackage{imakeidx}
\makeindex[name=firstIndexName,title=Title of the First Index,intoc,columns=1]
\usepackage{hyperref}
\begin{document}
\mainmatter
This is a paragraph making some points about a topic. Why is this true?\index[firstIndexName]{Why is this true?}
I don't understand why bla is bleah. Is this due to this or to that?\index[firstIndexName]{I don't understand why bla is bleah. Is this due to this or to that?}
\backmatter
\printindex[firstIndexName]
\end{document}
which outputs (the relevant part)
Unfortunately, I can't achieve (see the numbered list above):
- "...in order of appearance". Instead the entries are sorted alphabetically.
- I have to write the question twice, once as argument to \index, once outside \index.

