1

Here my question: what would be the best in order to make a sort of glossary, with picture ?

In fact, I've got make tools description, in one hand with text (nothing hard here), and, in the other hand, since it's better to have seen what it is, with picture of them.

I was thinking of doing it with a glossary, but I'm not sure that's the best way to do.

Does anyone have any of what (and how) I should do ?

Julien
  • 865
  • 1
  • 9
  • 16
  • 1
    Why shouldn't it work? On the whole there is not much difference between a glyph or a picture or a mathematical symbol. – Ulrike Fischer Aug 16 '12 at 18:00
  • Then, would you name me the command to do so ? I mean, in a glossary, you give it a name, a content, link, but, what for the image (should be separated from the explanation text, if possible) ? Or should I just put a picture, with the captation as explanation ? – Julien Aug 16 '12 at 20:58
  • 1
    Sorry but how should I know what layout you want? You can use \includegraphics in the various fields of a glossaryentry like you can use \int or \alpha. In some places you will have to use \protect and perhaps some additional braces {...} but besides this there is no difference between "how I can insert a graphic" to "how can I insert an alpha". – Ulrike Fischer Aug 17 '12 at 08:53
  • Sorry if I'm not clear enough, English isn't my first language. Here, a sample of code from the glossaries package : \newglossaryentry{electrolyte}{name=electrolyte, description={solution able to conduct electric current}}. Where would you put the \includegraphics ? – Julien Aug 17 '12 at 10:15

1 Answers1

2

Well so here an example of various places where you could put a graphic:

\documentclass{article}
\usepackage[nonumberlist]{glossaries}
\makeglossaries
\usepackage{graphicx,xcolor}

\newcommand\tigerdescription{a large animal. Some facts:
 \begin{itemize}
  \item Has stripes
  \item Its image: \colorbox{red}{\includegraphics[width=1cm]{tiger}}
 \end{itemize}}


\newglossaryentry{tiger}
  {name={\raisebox{-0.5cm}{\colorbox{green}{\includegraphics[width=1cm]{tiger}}}},
   sort=tiger,
   text={tiger (\protect\raisebox{-0.5em}{\protect\colorbox{blue}{\protect\includegraphics[width=1em]{tiger}}})},
   description={\tigerdescription}}%

\begin{document}

A \gls{tiger} is a large animal.

\printglossary[style=list]%
\end{document}
Ulrike Fischer
  • 327,261
  • 1
    I'm curious why you created \tigerdescription instead of just typing the description within the \theglossaryentry – Scribblemacher Aug 17 '12 at 10:45
  • 2
    This allows to put empty lines (\par) in the description text. It means I don't to add to put a lot of \protect in the text if I want to disable sanitize. And it avoids long lines in the .glo. – Ulrike Fischer Aug 17 '12 at 11:39
  • Thanks a lot. Then, everything is possible (following this post : http://tex.stackexchange.com/a/8951/13993). But there's still 1 question remaining : is there any better way to do it (less time-eater, etc.) ? – Julien Aug 17 '12 at 12:01