6

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?

1
  • I am struggling to understand why you would need this. Commented Apr 15, 2013 at 5:02

1 Answer 1

9

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}}

You must log in to answer this question.