Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

How can I tag all occurrences of a keyword then reference all the pages containing the same tag?

Course Queries Syllabus Queries
Max. 2000 characters
Replies

usr_profile.png
Rukhsar Fatima

User

( 6 months ago )

 

I am writing a syllabus with specific curricular requirements. Activities are tagged with these requirements to demonstrate alignment. I want to use a labelling or indexing system to tag the instances of alignment and then refer to all of the pages were an instance of alignment occurs.

Is there a package that will reference all of the pages containing the same label, as in an index, but allow me to print the pages for that label at an arbitrary point in the document?

This need seems to have elements of \label - \ref and of \index.

I don't have a minimal working example but what I want would look something like this.

\documentclass{article}
\begin{document}
\begin{description}
\item[CR1] This is a description of a requirement. \\ See page <LIST OF PAGES LABELED WITH CR1>
\item[CR2] This is a description of another requirement. \\ See page <LIST OF PAGES LABELED WITH CR2>
\end{description}

\section{Section 1}
This is an activity aligned with CR1. (\label{CR1} or \index{CR1})

This is an activity aligned with CR2. (\label{CR2} or \index{CR2})
\section{Section 2}
This is another activity aligned with CR1. (\label{CR1} or \index{CR1})

\end{document}

usr_profile.png
Jai Khanna

User

( 6 months ago )

I see Nicola just did a glossaries version but here's my barebones makeindex version.

enter image description here

You just want an index style that saves each page list in a definition rather than typesetting, say foo.ist:

preamble
"\n\\makeatletter{"
postamble
"}\n\\makeatother\n"

item_0 "}\n\\@namedef{"
delim_0 "}{"

Then

pdflatex file
makeindex -s foo.ist file
pdflatex file

should produce the above output from a document like

\documentclass{article}
\usepackage{makeidx}
\makeindex
\def\listfor#1{\csname #1\endcsname}
\begin{document}

\printindex

\begin{description}
\item[CR1] This is a description of a requirement. \\ See pages \listfor{CR1}
\item[CR2] This is a description of another requirement. \\ See pages \listfor{CR2}
\end{description}

\section{Section 1}
This is an activity aligned with CR1\index{CR1}.

aa
\clearpage

This is an activity aligned with CR2\index{CR2}.
\section{Section 2}
This is another activity aligned with CR1\index{CR1}.

\section{Section 3}
This is an activity aligned with CR1\index{CR1}.


aa
\clearpage

This is an activity aligned with CR2\index{CR2}.
\section{Section 4}
This is another activity aligned with CR1\index{CR1}.


aa
\clearpage

aa
\clearpage

This is an activity aligned with CR2\index{CR2}.
\section{Section 4}
This is another activity aligned with CR1\index{CR1}.

\end{document}

what's your interest


forum_ban8_5d8c5fd7cf6f7.gif