3

For some reason LaTeX indents the text right after the end of a "landscape" section of my DVI output, even though I don't want it to do so. Any thoughts on how I can fix this?

Werner
  • 603,163
Jake
  • 31
  • 2
    Welcome to TeX.SE. It is always best to compose a MWE that illustrates the problem including the \documentclass so that those trying to help don't have to recreate it.

    Personally, I have often solved my own problems in the process of reducing the amount of code actually required to reproduce the problem.

    – Peter Grill Oct 24 '11 at 19:38

2 Answers2

4

You can use \noindent to prevent indentation.

Gonzalo Medina
  • 505,128
4

What is happening is that after the \end{landscape} a new paragraph is started. LaTeX adds an indent to the beginning of the paragraph unless you have globally disabled this.

So, you could either add \noindent immediately after the \end{landscape} (as per @GonzaloMedina's solution), or modify the \end{landscape} to always add a \noindent for you:

\begin{document}

\let\OldEndLandscape\endlandscape
\def\endlandscape{\OldEndLandscape\noindent}

\begin{landscape}
\lipsum[1]
\end{landscape}
\lipsum[2]
\end{document}

As per the comments, you need to ensure that there is no space after \end{landscape}, or use a % to terminate any blank lines as in:

...
\end{landscape}
   %
\lipsum[2]

If you desire an automated solution that enforces no indentation after \end{landscape}, perhaps you can use the solution at Looking for an \ignorespacesandpars.

Peter Grill
  • 223,288
  • But this won't work with "regular" text, since it won't take care of the space after \end{landscape}: an example: `\documentclass{article} \usepackage{lscape}

    \let\OldEndLandscape\endlandscape \def\endlandscape{\OldEndLandscape\noindent}

    \begin{document}

    \begin{landscape} a \end{landscape} b\c \end{document}of course, writingbin a new line after\end{landscape}` (which I cannot do here in this comment)

    – Gonzalo Medina Oct 24 '11 at 20:31
  • Good point: I have added that point to the solution. – Peter Grill Oct 24 '11 at 20:55