The combination of \addvspace{x}\addvspace{x} will cause the skip x but \addvspace{x}\noindent \addvspace{x} gives a 2x skip.
\documentclass{scrartcl}
\newenvironment{env}{%
\par\addvspace{2\baselineskip}%
\hspace*{2em}%
\begin{minipage}{0.5\textwidth}%
}{%
\end{minipage}%
\par\addvspace{2\baselineskip}%
\noindent\ignorespacesafterend%
}
\begin{document}
Line of text Line of text Line of text Line of text and
\begin{env}
--- \verb+env+ ---
\end{env}
no indent here. Line of text Line of text Line of text.
Next par (with indent). Line of text Line of text Line of text.
\begin{env}
--- \verb+env+ ---
\end{env}
Next par (with indent). Line of text Line of text Line of text.
\begin{env}
--- Two \verb+env+s following ---
\end{env}
\begin{env}
--- dont work with \verb+\addvspace+ ---
\end{env}
\end{document}
This example gives the doubled space. If i comment out the line \noindent\ignorespacesafterend% in the definition of {env} there is a single space with is the desired result but then the line no indent here ... will be indented which is not correct, I think.
Is it possible to make {env} behave like e.g. {equation}?
\noindentyou're starting a paragraph; so the two\addvspaceare not near to each other any more. – egreg Jan 07 '12 at 14:33xgalley! – Joseph Wright Jan 07 '12 at 14:45xgalley.pdfbut didn’t found something useful …) – Tobi Jan 07 '12 at 16:20xgalleyis to address these issues in a very different way at a low level. So for example\noindentis not 'start a paragraph with no indent' but 'set a flag such that the next paragraph which starts will have no indent'. This allows additive treatment of vspace, but is currently experimental. In any case, unlike other LaTeX3 code you can't just loadxgalleyand expect everything to continue working as before. – Joseph Wright Jan 07 '12 at 16:22