I would like that the two following code become equivalent:
Code 1 (Prints "a b")
\documentclass{report}
\begin{document}
a
b
\end{document}
Code 2 (Prints "ab")
\documentclass{report}
\begin{document}
ab
\end{document}
Is such a thing possible?
\ignorespacesdoesn't really help. You'll note I don't leave an end-of-line character after the redefinition to\ignorespaces. – Werner Nov 13 '15 at 07:15\ignorespaces.". There is no end-of-line active on the "\catcode" line (because of the %) but there is one afer\ignorespaces, no? But maybe you meant that you did not left a blank line before\begin{document}? – 永劫回帰 Nov 13 '15 at 07:25\let^^M\ignorespaces. So, at the time of reading it,^^Mhas not been redefined. The next end-of-line character is inside thedocumentenvironment. Regardless, setting category codes like this could lead to problems, so you're best off setting them just before you need them, even if it means you do it in the main document. – Werner Nov 13 '15 at 07:28