# List all usages of an environment at the top of every page on which it is included

I have a question environment defined as follows:

\newenvironment{question}[1]{
\vspace{.10in}
{\bf #1}
}


The argument is the "question name". I would now like to include the name of every question which appears on a page in the header of that page. For example, if a page includes questions foo and bar, I want foo, bar to appear in the header. In particular, if a question spans multiple pages, I want this question to be listed on every page it was split across.

This is somewhat similar to listing the chapter name in the corner, however I will often have multiple questions on one page.

My goal is closely related to Decorate every page of an environment, however rather than simply identifying that there exists a question on the page, I need to store a list of those questions.

How can I do this in LaTeX?

• Unrelated: \bf has been outdated since 1993! Use \textbf{#1} instead. Apr 2 '20 at 7:04
• tex.stackexchange.com/a/26143/193767
– user193767
Apr 2 '20 at 7:24