3

I'm building off of an example here from the LaTeX Community.

What I want to do is create an index where multiple terms link to the same word in the index. So for example if the terms toyota, ford, and honda, appear on pages 7, 9 and 15 I want the index simply say:

cars … 7, 9, 15 

What I don't want is

cars,
toyota … 7
ford … 9
honda …15

I'm doing this in beamer. And the following example will create the term cars, but I don't know how to associate multiple words with that single term.

\documentclass[16pt,pdftex]{beamer}
\usepackage[T1]{fontenc}

\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{car}


\begin{document}

\begin{frame}
\frametitle{example}
\gls{car}
\end{frame}

\begin{frame}
\frametitle{example}
%\gls{subaru}
\end{frame}

\begin{frame}
\frametitle{example}
%\gls{toyota}
\end{frame}


\begin{frame}
\frametitle{example}
%\gls{ford}
\end{frame}


\begin{frame}[allowframebreaks]
\frametitle{Index}
\printterms[style=index]
\end{frame}
\end{document}
1

Make sure you have at least version 2.19 of datatool installed and use \glslink:

\documentclass[16pt,pdftex]{beamer}
\usepackage[T1]{fontenc}

\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{car}


\begin{document}

\begin{frame}
\frametitle{example}
\gls{car}
\end{frame}

\begin{frame}
\frametitle{example}
\glslink{car}{subaru}
\end{frame}

\begin{frame}
\frametitle{example}
\gls{car}{toyota}
\end{frame}


\begin{frame}
\frametitle{example}
\glslink{car}{ford}
\end{frame}


\begin{frame}[allowframebreaks]
\frametitle{Index}
\printterms[style=index]
\end{frame}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.