Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to renew quotation environment for custom margins and noindent for first line

539 views
Skip to first unread message

Pander

unread,
Jun 23, 2011, 5:39:57 AM6/23/11
to
Hi all,

How to renew quotation environment for custom margins. I would like to
set custom value for left and an identical for the right margin, e.g.
\mymargin. Also, I would like that quotation environment starts with a
\noindent for only the first line. As far as I am concerned it inject
a \noindent directly before the contents of the environment.

I know that it should look something like:

\makeatletter
\renewenvironment{quotation}
{\list{}{...}
{\endlist}
\makeatother

Please, how do I do this?

Thanks,

Pander

Lars Madsen

unread,
Jun 23, 2011, 5:46:33 AM6/23/11
to

why don't you do what the rest of us do, look in the source

in article quotations is defined as

\newenvironment{quotation}
{\list{}{\listparindent 1.5em%
\itemindent \listparindent
\rightmargin \leftmargin
\parsep \z@ \@plus\p@}%
\item\relax}
{\endlist}

compare it with quote:

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

experimenting with these may bring you to the right solution (in the
mean time you will learn something)

play with \listparindent or \itemindent


--

/daleif (remove RTFSIGNATURE from email address)

Memoir and mh bundle maintainer
LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.minimalbeispiel.de/mini-en.html

Enrico Gregorio

unread,
Jun 23, 2011, 6:00:30 AM6/23/11
to
Pander <pan...@users.sourceforge.net> wrote:

\renewenvironment{quotation}
{\list{}{\leftmargin=<??>% <-- set here your margin
\listparindent \parindent
\itemindent \listparindent
\rightmargin \leftmargin
\parsep \parskip}%
\item\relax\noindent\ignorespaces}
{\endlist}

Ciao
Enrico

GL

unread,
Jun 23, 2011, 6:03:47 AM6/23/11
to
Le 23/06/2011 11:46, Lars Madsen a �crit :

Have you forgot \setlength ? ;-)

\renewenvironment{quotation}[1][\leftmargin=1.5em]
{\list{}{\listparindent 1.5em
\itemindent \listparindent
\rightmargin \leftmargin
\parsep \z@ \@plus\p@ #1}%
\item\relax}
{\endlist}

\begin{quotation}

\begin{quotation}[\itemindent=2cm \leftmargin =2em]

more flexible...

Lars Madsen

unread,
Jun 23, 2011, 6:05:22 AM6/23/11
to GL

GL, what are you talking about now?

> \renewenvironment{quotation}[1][\leftmargin=1.5em]
> {\list{}{\listparindent 1.5em
> \itemindent \listparindent
> \rightmargin \leftmargin
> \parsep \z@ \@plus\p@ #1}%
> \item\relax}
> {\endlist}
>
> \begin{quotation}
>
> \begin{quotation}[\itemindent=2cm \leftmargin =2em]
>
> more flexible...
>
>
>>
>> compare it with quote:
>>
>> \newenvironment{quote}
>> {\list{}{\rightmargin\leftmargin}%
>> \item\relax}
>> {\endlist}
>>
>> experimenting with these may bring you to the right solution (in the
>> mean time you will learn something)
>>
>> play with \listparindent or \itemindent
>>
>>
>>
>>
>

GL

unread,
Jun 23, 2011, 6:49:21 AM6/23/11
to
Le 23/06/2011 12:05, Lars Madsen a �crit :

I'd expected from you: \setlength {\itemident}{\listparindent}
with the braces and all that stuff ;-)

Lars Madsen

unread,
Jun 23, 2011, 6:55:37 AM6/23/11
to GL

Do you even know what I posted?

copy'n'pasted from article.cls

why should I change it?

I get it, you do not like \setlength, so what? I find it handy in
several cases.

For example adding calc, \setlength allows additions, your syntax below
does not. A user cannot easily get \leftmargin = 1.5em + \parindent
(say). So for non-programmers \setlength has its advantages, not just
for programming macros, but also for user interfaces.

>>
>>> \renewenvironment{quotation}[1][\leftmargin=1.5em]
>>> {\list{}{\listparindent 1.5em
>>> \itemindent \listparindent
>>> \rightmargin \leftmargin
>>> \parsep \z@ \@plus\p@ #1}%
>>> \item\relax}
>>> {\endlist}
>>>
>>> \begin{quotation}
>>>
>>> \begin{quotation}[\itemindent=2cm \leftmargin =2em]
>>>
>>> more flexible...
>>>
>>>
>>>>
>>>> compare it with quote:
>>>>
>>>> \newenvironment{quote}
>>>> {\list{}{\rightmargin\leftmargin}%
>>>> \item\relax}
>>>> {\endlist}
>>>>
>>>> experimenting with these may bring you to the right solution (in the
>>>> mean time you will learn something)
>>>>
>>>> play with \listparindent or \itemindent
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>

GL

unread,
Jun 23, 2011, 7:45:12 AM6/23/11
to
Le 23/06/2011 12:55, Lars Madsen a �crit :

>
> I get it, you do not like \setlength, so what? I find it handy in
> several cases.
>
> For example adding calc, \setlength allows additions, your syntax below
> does not. A user cannot easily get \leftmargin = 1.5em + \parindent
> (say). So for non-programmers \setlength has its advantages, not just
> for programming macros, but also for user interfaces.

I would say only for user interface. And by the way since eTeX exists,
\def\setlength #1#2{#1\dimexpr #2\relax \relax }

provides all, with the same syntax as \dimexpr that is, an economy in
the learning of its usage.

tabu does not know \setlength: tracking an assignment in the log
{changing \dimen118=12pt into \dimen118=18pt}

is painful, tracking it amongst the lines produces by calc.sty is
impossible...

Regards.

Pander

unread,
Jun 23, 2011, 9:11:11 AM6/23/11
to
On Jun 23, 11:46 am, Lars Madsen <dal...@RTFMSIGNATUREimf.au.dk>
wrote:

My goal is to use \parindent on the left and right of quotation and
when an indentation occurs inside a quotation env, it will be absolute
two times \parindent and relative on one \parindent.

When I do:

\rewenvironment{quotation}
{\list{}{\listparindent \parindent%


\itemindent \listparindent
\rightmargin \leftmargin
\parsep \z@ \@plus\p@}%
\item\relax}
{\endlist}

Nothing is changed in horizontal margins or indentation but an empty
line is added before and after the quotation. :S

Lars Madsen

unread,
Jun 23, 2011, 11:09:20 AM6/23/11
to

\documentclass[a4paper]{article}
\usepackage{lipsum}
\makeatletter
\renewenvironment{quotation}
{\list{}{
\listparindent \parindent
\itemindent 0pt
\leftmargin\parindent


\rightmargin \leftmargin
\parsep \z@ \@plus\p@}%
\item\relax}
{\endlist}

\makeatother

\begin{document}

% text width
\noindent\rule{\textwidth}{3mm}

\begin{quotation}
\lipsum[1-3]
\end{quotation}

\noindent\rule{\textwidth}{3mm}


\end{document}

0 new messages