# More economic and robust command for abstract at the beginning of chapters

I want to put an abstract at the beginning of each chapter. I have cooked up a command in that aim, but it looks neither economic, nor robust (sometimes it is shifted to the right). How to improve this command?

My command is:

\def\chapstract#1{%
\medskip%
\begingroup%
\itshape\small\noindent%
\parbox{\linewidth}{%
\leftskip=1em%
\rightskip=1em%
#1%
}%
\endgroup%
\medskip%
}

-
Never set \leftskip and \rightskip in LaTeX, they are TeX primitives which should always be set through a list environment such as quote (which is probably what you want here) –  David Carlisle Apr 5 at 11:00

You don't give much indication of the desired layout but perhaps

\def\chapstract#1{\begin{quote}\small\itshape#1\end{quote}}


\leftskip and \rightskip are TeX primitives which should not be set directly in LaTeX. (The quote environment use the LaTeX list mechanism to set these in a safe way).

The full definition of quote in the standard classes is

 \newenvironment{quote}
{\list{}{\rightmargin\leftmargin}%
\item\relax}
{\endlist}


Which says to implicitly indent the left by a default amount and indent the right by the same as the left. So if as you note in comments that tou want a different indent then use chapastractenv instead of quote and define it as

\newenvironment{chapabstractenv}
{\list{}{%
\small\itshape\setlength\leftmargin{3cm}%
\rightmargin\leftmargin}%
\item\relax}
{\endlist}


then if you want a command form rather than using an environment

   \def\chapstract#1{\begin{chapabstractenv}#1\end{chapabstractenv}}

-
In fact, I want smaller margins that in the quote environment. –  Lionel Darondeau Apr 5 at 11:10
@LionelDarondeau see updated answer –  David Carlisle Apr 5 at 11:27

Thank you for your help, I think I will modify the quotation environment like that:

\makeatletter
\newenvironment{chapstract}{\list{}{ %
\leftmargin1pc \listparindent\normalparindent
\itemindent\z@
\rightmargin\leftmargin \parsep\z@ \@plus\p@}%
\item[]%
\itshape\small
}{%
\endlist
}
\makeatother


It is not more economic but it seems to be more correct.

-