I'm having a problem with makeindex -g, quoting, and using Y':

I create two index entries like this:


(with \newcommand{\main}[1]{\textbf{#1}})

This generates these .idx entries:


To use -g (I also use -r), I've set up an index style using quote '\'' (and some more formatting). This seems to mess with having ' in the index entries, while makeindex (version 2.15 [TeX Live 2017] (kpathsea + Thai support)) does not print an error related to it.

The output in .ind is:

  \item Farbmodell
    \subitem $YC_BC_R$\hspace{1em}\dotfill\hspace{1em}\main{43}
  \item Y@$Y$\hspace{1em}\dotfill\hspace{1em}\see{Luma}{43}

So the ' got lost in the first output, and Y@ is being displayed for the second. Unfortunately I have no idea how to fix it (the set of usable quote characters seems quite limited).

I case this matters, here's my document preamble:


If you set the quote character to ', then you have to quote it when using it in an index entry.

Here's a schematic solution. The filecontents* environment is just to make the example self-contained. If the current directory contains a file with the same name as the main TeX file and extension .mst, this one will be automatically used by MakeIndex.

File main.tex

quote '\''



\providecommand{\main}[1]{#1} % I don't know what \main should do


Some text




File main.idx


File main.ind (after running MakeIndex)


  \item Farbmodell
    \subitem $Y'C_BC_R'$, \main{1}


  \item $Y'$, \see{Luma}{1}



enter image description here

| improve this answer | |
  • You find the definition of |main below the first code block in the question, but it's irrelevant to the problem anyway. – U. Windl Apr 8 '19 at 12:21
  • I searched my candidates in Emacs using \\index{[^}]*'[^}]*}, and it worked perfectly! – U. Windl Apr 8 '19 at 19:15

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.