# How to create an index entry for “|| operator”?

Following the \index quoting rules (prepend a reserved character with a double-quote), I do

\index{"|"| operator}


but the entry never shows up in the index. Doing these (similar) things does work as expected:

\index{"!"! operator}
\index{"| operator}


So what is special about '||'? Needless to say, it also doesn't work without double-quotes.

-

\index{"|"| operator}


should work. However there seem to exist some problems with hyperref. Simply put the index key or just the problematic part in braces works:

\index{{"|"|} operator}

-

You might want to try using \| instead of || for the operator; both to deal with problematic escaping, but more importantly to get spacing right when you use it.

-

If you index the symbol in math mode, it should work. That is, try

\index{$"|"|$ operator}

-