Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In a text, I'm using a tikzpicture as a math symbol. I'd like to reference this symbol in a glossary. It seems to me that makeindex doesn't know how to draw the picture. Here's an example.

\documentclass[12pt]{scrbook}

\usepackage{a4wide}
\usepackage{tikz}
\usepackage[toc, section, numberline]{glossaries}

\newcommand{\Plus}{\mathord{
\begin{tikzpicture}[baseline=0ex, line width=1, scale=0.13]
\draw (1,0) -- (1,2);
\draw (0,1) -- (2,1);
\end{tikzpicture}}}

\makeglossaries

\newglossaryentry{gls:Plus}{name={\ensuremath{\Plus}},description=\nopostdesc} % Does not work; change \Plus to, e.g., + else to compile.

\begin{document}
$A \gls{gls:Plus} B$

$A \Plus B$
\printglossary[type=main, style=list, nonumberlist=false]
\end{document}
share|improve this question
    
Here's the log I get when I try to compile, regardless of \protect, or not: pastebin.com/iJjw9GVQ –  Roland Jan 16 '13 at 11:41
add comment

1 Answer 1

Fragile command. Moving argument. So:

name={\ensuremath{\protect\Plus}}
share|improve this answer
    
While this might be an additional issue, changing the code in the minimal example does not make it compilable. –  Roland Jan 16 '13 at 11:29
    
Yes, it does (I checked at the time and again just now) You probably have corrupt .aux file from a previous attempt, delete that and do a clean run –  David Carlisle Jan 16 '13 at 12:09
    
Hm. Interestingly enough, deleting .aux files, and even saving the code as a different file did not change the described behaviour for me. (The newly compiled file did not even create an aux-file.) Can an outdated version of glossaries, or any other package be the cause? I've updated the interesting part of the log to the initial question, which might help to see what the cause of my problems is. –  Roland Jan 18 '13 at 9:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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