Latex printing single slash, backslash r, backslash n
问题 I want the following line inside a *.tex file to be printed "as is": while (tmp[0] == '\r' || tmp[0] == '\n') {tmp++;} When I wrap it in a \verb command like this: \verb"while (tmp[0] == '\r' || tmp[0] == '\n') {tmp++;}" it doesn't work, and I get: ! Undefined control sequence. All other google answers are so complicated. Surely, there's got to be an easy way to do this, right? Thanks! EDIT: Here is the minimal counter example requested in the comments: %%%%%%%%%%%%%%%%%%%%%%%%%% % document