59

I need to change the indentation that the quote and quotation environments and commands employ. I assume that there is some length I need to set, but I've googled around, and cannot find what I am after. So, how to alter the indentation?

5 Answers 5

32

What about something like that ?

\newenvironment{myquote}%
  {\list{}{\leftmargin=0.3in\rightmargin=0.3in}\item[]}%
  {\endlist}

You can also make the margin size an option:

\newenvironment{myquote}[1]%
  {\list{}{\leftmargin=#1\rightmargin=#1}\item[]}%
  {\endlist}

And use with:

\begin{myquote}{0.3in}
  % ...
\end{myquote}
3
  • 5
    That works, but modifying the original quote environments seems better; with this, I will have to do a global replace of myquote with quote to return to a fully standard document, whereas by modifying the environment itself, commenting out the modification would suffice. Still, +1 and an acceptance in the future if nothing like what I'd envisioned is forthcoming.
    – vanden
    Commented Aug 28, 2010 at 2:22
  • 16
    Can't you use \renewenvironment{quote} with the code above instead?
    – frabjous
    Commented Aug 28, 2010 at 12:51
  • 3
    @frabjous: Well, now that you say that, it is obvious. :-)
    – vanden
    Commented Aug 30, 2010 at 3:22
25

Use the etoolbox package to patch the \quote command.

\usepackage{etoolbox}
\patchcmd{\quote}{\rightmargin}{\leftmargin 4em \rightmargin}{}{}

(The default definition of \quote is \list{}{\rightmargin\leftmargin}\item\relax.)

4
  • 4
    What's the advantage of using etoolbox over just a \renewenvironment?
    – doncherry
    Commented Jul 4, 2011 at 21:43
  • 6
    @doncherry: Selectively changing a definition instead of copy-paste-change may have two advantages: a) Updates of other parts of the definition carry over to your change (but should be monitored) b) If the original definition is long, you may save a lot of writing with a concise partial change.
    – lockstep
    Commented Jul 4, 2011 at 21:52
  • 1
    For the sake of learning by doing, I want to patch the \quote and \quotation commands with \color{blue} or similar, as found in @igor-kotelnikov's answer: \newenvironment{myquotation}{\setlength{\leftmargini}{0em}\color{blue}\quotation}{\endquotation}. Commented May 27, 2017 at 10:53
  • Finally, I've used \apptocmd{\quote}{\color{blue}}{}{}. Hope this is the right way to it in this case, instead of patchcmd. Commented May 27, 2017 at 13:00
18

I recently released the quoting package which provides a consolidated environment for displayed text as an alternative to quotation and quote. As the main feature, "[f]irst-line indentation is activated by adding a blank line before the quoting environment". With regard to the question at hand: It is also possible to change left-hand and right-hand indentation globally or for single environments using a key--value syntax.

\documentclass{article}

\usepackage[english]{babel}
\usepackage{blindtext}

\usepackage[leftmargin=3em]{quoting}

\begin{document}

\blindtext
% Removing the comment sign in the following line will activate first-line indentation
%
\begin{quoting}
\blindtext
\end{quoting}

\blindtext
%
\begin{quoting}[leftmargin=\parindent]
\blindtext
\end{quoting}

\blindtext

\end{document}
1
  • Thanks. I realised this whole time that I imported the quoting environment but was using quotation instead of quote in my tex.
    – craastad
    Commented Mar 26, 2017 at 8:20
4

\advance\leftmargini 2em before \begin{quote} or \begin{quotation}.

2
  • 3
    Works, but affects all list-like environments.
    – Lev Bishop
    Commented Aug 27, 2010 at 13:34
  • 5
    I haven't tried this, but if you enclose the entire thing in a \begingroup and \endgroup then it should localize the effect.
    – ESultanik
    Commented Aug 27, 2010 at 13:49
2

I would modify fredz's answer a bit:

\newenvironment{myquotation}{\setlength{\leftmargini}{0em}\quotation}{\endquotation}

This preserves identation in the beginning of paragraphs. For my own needs I have

\newenvironment{myquotation}{\setlength{\leftmargini}{0em}\color{blue}\quotation}{\endquotation}

to print long quotations in blue color.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .