Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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%
}
share|improve this question
2  
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

2 Answers 2

up vote 9 down vote accepted

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}}
share|improve this answer
    
In fact, I want smaller margins that in the quote environment. –  Lionel Darondeau Apr 5 at 11:10
1  
@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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.