## LaTeX forum ⇒ MakeIndex, Nomenclature, Glossaries and Acronyms ⇒ Linked Index for Presentation Topic is solved

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
mafis103
Posts: 7
Joined: Sat Feb 23, 2013 9:29 am

Hi everyone,

I am supposed to do a linked index for some lecture slides. There is no problem with the indexing itself, but with the linking - I can see the page numbers, but there are no links, although hyperref is loaded (and I think it is loaded by the beamer class anyway).

I have no clue, what I am doing wrong. Here is an example that can show my problem:

The commented line you can see is one of my tries to make it work and one of the rare things I found on the internet concerning that topic. (When activated, I put of course a |bb behind the index terms). But that try didn't even compile.

Can you tell me where the problem is and maybe what the solution is? I haven't found much about that topic in forums etc. so I am wondering if I am the only one with this problem?

Best regards and thanks in advance

Tags:

nlct
Posts: 266
Joined: Thu Nov 06, 2008 11:15 am
Contact:
mafis103 wrote:
\newcommand{\bb}[1]{\hyperpage{\textbf{#1}}}

\hyperpage requires just the page number as its argument, so this would need to be
\newcommand{\bb}[1]{\textbf{\hyperpage{#1}}}

However beamer disables \hyperpage so you can't use it. Here's a possible alternative that uses the datagidx package (part of the datatool bundle):
    \documentclass[16pt,pdftex]{beamer}      \makeatletter     % beamer doesn't define \@idxitem, but it's used by the     % \printterms "index" style, so define it:     \newcommand\@idxitem{\par\hangindent40pt}     \makeatother      \usepackage{datagidx}      \newgidx{index}{Index}     \DTLgidxSetDefaultDB{index}      \newterm{taindex}     \newterm{waindex}     \newterm[parent=waindex]{ssubaz}     \newterm{zbzindex}     \newterm[parent=zbzindex]{isubbu}     \newterm{ezzz}     \newterm[parent=ezzz]{ezsubaz}     \newterm{ezzbindex}     \newterm[parent=ezzbindex]{uzsubbu}     \newterm{binden}     \newterm{aindex}     \newterm[parent=aindex]{suba2}     \newterm{bindex}     \newterm[parent=bindex]{subb2}      \begin{document}      \begin{frame}     \frametitle{TableOfContents}     \tableofcontents     \end{frame}      \begin{frame}     \frametitle{Part1SecA}     test \gls{taindex} \gls{ssubaz}     \gls{isubbu}     \end{frame}      \begin{frame}     \frametitle{Part1SecA}     % Make the next term have a bold page number in the index:     test \gls{[textbf]taindex}      \gls{ezsubaz}     \gls{uzsubbu}     \end{frame}      \begin{frame}     \frametitle{Part2SecB}     test \gls{binden}\gls{suba2}     \gls{subb2}     \end{frame}      \begin{frame}[allowframebreaks]     \frametitle{Index}     \printterms[style=index]     \end{frame}     \end{document}

You don't need makeindex, just two LaTeX runs. On the second run, the page numbers in the index will be hyperlinks.

Regards
Nicola Talbot

mafis103
Posts: 7
Joined: Sat Feb 23, 2013 9:29 am
Hi nicola,

thank you very much for your help. Is there any way to avoid always naming the index-terms twice?
(One time in the text and the other time by
\newterm{INDEXNAME}
)

EDIT: And another question,

I redefined the "myindex" command like this:
\newcommand{\myindex}[1]{\gls{#1}}

But now I have the problem that I want to refer to indexes, that have the same name, but a different Parent-concept. How can I differentiate them (with makeindex it was possible to do this {concept!sub} thing to differentiate, with \gls that doesn't work anymore of course)
Is it possible to make them sort automatically by alphabet?

nlct
Posts: 266
Joined: Thu Nov 06, 2008 11:15 am
Contact:
mafis103 wrote:Is there any way to avoid always naming the index-terms twice? (One time in the text and the other time by
\newterm{INDEXNAME}

)

No, I'm sorry. With datagidx you have to define the terms in the preamble.

I redefined the "myindex" command like this:
\newcommand{\myindex}[1]{\gls{#1}}

But now I have the problem that I want to refer to indexes, that have the same name, but a different Parent-concept. How can I differentiate them (with makeindex it was possible to do this {concept!sub} thing to differentiate, with \gls that doesn't work anymore of course)

You can override the default label using the label key in the optional argument of \newterm:
\newterm[label=foobar,parent=foo]{bar}

Now you can reference it using
\gls{foobar}

You can also override how the text appears when using \gls (as opposed to how it will appear in the index):
\newterm[label=foobar,text={bar (foo)},parent=foo]{bar}

or
\newterm[label=foobar,text={foo bar},parent=foo]{bar}

etc.
Is it possible to make them sort automatically by alphabet?

The entries should automatically be sorted alphabetically (according to the entry level, as with makeindex). If this isn't happening, can you provide a minimal example illustrating the problem.

Regards
Nicola Talbot

mafis103
Posts: 7
Joined: Sat Feb 23, 2013 9:29 am
Hi Nicola,

please excuse my late response and thank you very much for your helpful answers. I will try your hints as soon as possible and maybe come back again with other question

But until that: Just Thank you, I wouldn't have found out about that solution by myself.

mafis103
Posts: 7
Joined: Sat Feb 23, 2013 9:29 am
Hi there again.

Everything is working fine so far, but I have got a problem:
When I add a lot of indexes, the pages don't break and the indexes flow over the frame.... (see example).
Is there any solution for that?

        \documentclass[16pt,pdftex]{beamer}          \makeatletter         % beamer doesn't define \@idxitem, but it's used by the         % \printterms "index" style, so define it:         \newcommand\@idxitem{\par\hangindent40pt}         \makeatother          \usepackage{datagidx}          \newgidx{index}{Index}         \DTLgidxSetDefaultDB{index}          \newterm{taindex}         \newterm{waindex}         \newterm[parent=waindex]{ssubaz}         \newterm{zbzindex}         \newterm[parent=zbzindex]{isubbu}         \newterm{ezzz}         \newterm[parent=ezzz]{ezsubaz}         \newterm{ezzbindex}         \newterm[parent=ezzbindex]{uzsubbu}         \newterm{binden}         \newterm{aindex}         \newterm[parent=aindex]{suba2}         \newterm{bindex}         \newterm[parent=bindex]{subb2}         \newterm{cindex}         \newterm{dindex}         \newterm{eindex}         \newterm{findex}         \newterm{gindex}         \newterm{hindex}         \newterm{iindex}         \newterm{jindex}         \newterm{kindex}          \newterm{dindex2}         \newterm{eindex2}         \newterm{findex2}         \newterm{gindex2}         \newterm{hindex2}         \newterm{iindex2}         \newterm{jindex2}         \newterm{kindex2}         \newterm{dindex3}         \newterm{eindex3}         \newterm{findex3}         \newterm{gindex3}         \newterm{hindex3}         \newterm{iindex3}         \newterm{jindex3}         \newterm{kindex3}          \begin{document}          \begin{frame}         \frametitle{TableOfContents}         \tableofcontents         \end{frame}          \begin{frame}         \frametitle{Part1SecA}         test \gls{taindex} \gls{ssubaz}         \gls{isubbu}         \end{frame}          \begin{frame}         \frametitle{Part1SecA}         % Make the next term have a bold page number in the index:         test \gls{[textbf]taindex}         \gls{ezsubaz}          \gls{dindex}         \gls{eindex}         \gls{findex}         \gls{gindex}         \gls{hindex}         \gls{iindex}         \gls{jindex}         \gls{kindex}         \gls{uzsubbu}         \gls{dindex2}         \gls{eindex2}         \gls{findex2}         \gls{gindex2}         \gls{hindex2}         \gls{iindex2}         \gls{jindex2}         \gls{kindex2}         \gls{dindex3}         \gls{eindex3}         \gls{findex3}         \gls{gindex3}         \gls{hindex3}         \gls{iindex3}         \gls{jindex3}         \gls{kindex3}         \end{frame}          \begin{frame}         \frametitle{Part2SecB}         test \gls{binden}\gls{suba2}         \gls{subb2}         \end{frame}          \begin{frame}[allowframebreaks]         \frametitle{Index}         \printterms[style=index]         \end{frame}         \end{document}

mafis103
Posts: 7
Joined: Sat Feb 23, 2013 9:29 am
- just pushing that thread up, because the last posted question still remains -

Stefan Kottwitz
Posts: 8262
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
This thread was originally about hyperlinking the index, and the original question has been solved. Probably that's why your follow-up question at the end wasn't seen by many readers. It's usually the best to open a new topic for a new problem. You can always provide a link back to a related topic.

Stefan