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.

I can't get LaTeX to generate index entry for newline \n. I tried \index{"\\n"} and \index{"\n"} and \index{\n} and \index{\\n}. None of these seem to work.

I am getting errors like:

! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.14   \item \\n
                |hyperpage, 19

Anyone knows?

share|improve this question
    
I am struggling to understand why you would need this. –  Nicholas Hamilton Apr 15 '13 at 5:02
add comment

1 Answer

up vote 8 down vote accepted

If you want it alphabetized under symbols use

\index{\n@\texttt{\string\n}}

If you want it alphabetized under "n", use

\index{n@\texttt{\string\n}}
share|improve this answer
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.