TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After discovered how to mix glossary and acronym system (See here), and how to put kana/kanji working with pdfLaTeX (See here), I was trying to mix the both, in order to create kind of dictonnary, with the name of the object, in romanji (with our alphabet), in kana/kanji in parenthesis, and then, a description, with a picture if necessary.

The 2 packages, and command works well to gather, but, if you try to put some kana/kanji in the "name", in the glossary entry (with the related command), it doesn't work. But, if in the description, there's no problem.

Here an exemple that goes fine :

\usepackage{CJKutf8,pinyin} % Enables TeX to generate (a) East Asian glyphs and (b) their pronunciations.
\usepackage[overlap,CJK]{ruby} % Simple method for generating sub- and super-textual pronunciation keys (Pīnyīn, kana, etc.)
    breaklinks = true,
    bookmarksnumbered = true,
    colorlinks = true,
    linkcolor = bleuvert,
    bookmarks = true,
    pdfpagemode = UseOutlines,
    pdfstartview = FitH,
    pdfpagelayout = OneColumn,
    urlcolor = darkpink,
\date{Dernière compilation le \today}
\newglossaryentry{Test}{name={Obon}, description={\kana{お}\kanji{盆}}}
\chapter{Les index}

(Sorry if looks so ugly...) Note that, my problem is, rather than having the japanese caracters in the description, I'd like to have them in the name, like this : `\newglossaryentry{Test}{name={Obon (\kana{お}\kanji{盆})}, description={This is ...}}

Any idea ?

=> \unexpanded{} was the solution, thanks to egreg for is answer.

share|improve this question
Can you provide a minimal example that illustrates the problem? – Nicola Talbot Jan 29 '13 at 19:36
up vote 4 down vote accepted

It's a problem related to the timing of expansions. It seems that making the commands robust solves the issue if the characters are in the description field.


However, this doesn't solve it when they are in the name field; in this case this hack works:

  name={Obon \unexpanded{\kana{お}\kanji{盆}}},
share|improve this answer
Hi, thanks for answer. There were absolutly no problem if in the description field. Indeed, your hack for the 'if in the name field case', does work perfectly ! Thanks a lot. What the \unexpanded{} does ? And why this solved the problem here ? – Julien Jan 30 '13 at 20:20

Your Answer


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.