TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In most cases, TeX does not distinguish between spaces and newlines. However, inside some macros and environments this distinction matters a lot. Time for a big list? Please edit the CW answer.

This occurred when pondering about Forward-inverse search using SyncTeX with the precison of a single word; this "expert knowledge" is however also relevant for any tool that tries to preprocess (La)TeX code, such as latexdiff.

share|improve this question
As everyone can define its own verbatim-like environment e.g. with the help of fancyvrb or listings I don't see how you should ever been able to get a complete list. – Ulrike Fischer Jun 14 '12 at 14:58
@UlrikeFischer: Yes, indeed this adds even more complexity. But still not impossible, just makes the list bigger and... dynamic :-) – krlmlr Jun 14 '12 at 22:08
up vote 1 down vote accepted


  • verbatim

  • lstlisting, plus custom environments defined through \lstnewenvironment (listings package)

  • Verbatim, plus custom environments defined through \DefineVerbatimEnvironment (fancyvrb package)


  • \index

  • \verb

  • \obeylines

share|improve this answer

Your Answer


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.