# Conflict between packages noindentafter and atbeginend

The following MWE shows a conflict between the packages noindentafter and atbeginend:

\documentclass{article}

\usepackage{
atbeginend,
noindentafter,
}

\NoIndentAfterEnv{enumerate}

\pagestyle{empty}

\begin{document}
\noindent This is not indented.

This is indented. Follows an enumeration:

\begin{enumerate}
\item Enough.
\end{enumerate}

I am indented. Do not indent me.

\noindent I am not indented.
\end{document}


Instead of a specific hack to be input by the user, I think that an amedment to any of those packages would be the way to go.

• I don't know whether it is worth to pursue this conflict. atbeginend is not available on CTAN, on TeXlive or Miktex -- it seems to be a 'shadow' package. I recommend to switch to \AtBeginEnvironment and \AtEndEnvironment from etoolbox which is a very good package! – user31729 Aug 31 '16 at 19:51
• Better than loading a package to fix the broken document, it would be better to fix the document. "I am indented. Do not indent me." is indented because the document has blank lines that specify a paragraph break and thus indentation. If that sentence is not a new paragraph the blank lines should not be there – David Carlisle Aug 31 '16 at 20:33
• sorry it is wrong to treat tex white space as cosmetic indentation in the source. a blank line is parsed as \par and denotes the end of a paragraph. latex display environments and for math and lists etc go to some effort to detect a blank line before or after the display and indent or not indent the following block of text just in case there is a paragraph break. – David Carlisle Sep 1 '16 at 17:50
• vertical glue is added around lists (and display math) whether or not the display is mid-paragraph (and so has no following indentation) or at tehe end of a paragraph (when the following text is indented) – David Carlisle Sep 1 '16 at 17:58
• note leaving a blank line before display math is worse than leaving it before a list, tex always does the wrong thing in that case. – David Carlisle Sep 2 '16 at 22:13

A blank line (before or after the list) denotes a paragraph break and that signals to latex to indent the following text as a new paragraph. if there is no blank line the list is considered as part of the existing paragraph and the following text is not indented.

So, if the document markup is corrected, no package is needed.

\documentclass{article}

\pagestyle{empty}

\begin{document}

\section*{zzz}
This is not  indented.

This is indented. Follows an enumeration:
\begin{enumerate}
\item Enough.
\end{enumerate}
I am not indented. Do not indent me.

I am  indented.
\end{document}


Note that internally each item of the list and the list itself use separate paragraphs to control margins and vertical space, but latex (in the case of lists) or the tex engine itself (in the case of display math) adjusts the typesetting of the following "internal" paragraph if the display is to be considered as logically part of the surrounding paragraph, to suppress indentation and in some cases use tighter vertical spacing.

• Although not properly an answer to my original question regarding the conflict between the packages, the comments are valuable enough to make it more interesting than an answer in the strict sense. I wonder if you could possibly expand it by adding the comments you made on my wrong assumption about glue. Btw, this just reminded me of Wittgenstein's "question dissolving" in that my real problem was actually my thinking that I had a genuine problem as stated in my post. – Marcos Sep 2 '16 at 23:09