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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to define a quote environment such that after the quote on the right occurs the author with page number. My solution is yet the redefinition of the quote environment

\usepackage{amsthm} % pushQED, popQED

with the following result:

The drawback is the parskip in front of the author, which wastes some space in the first quote, but is right in the second one. If I change my command to:


I get the following result:

Now the placement of the author's name in the first quote is perfect, but in the second quote I want a parskip in front, like in my first example.

How can I find out, whether the line has enough space to put the author without a parskip behind or if there is not enough space to introduce a parskip to put the author on the next line?

share|improve this question
Welcome for TeX.SX. I included the images for you. Note if you want to edit your question before you got 10rep points you need to change them to links by removing the ! in front of them. – Martin Scharrer Mar 17 '11 at 22:38
up vote 31 down vote accepted

There's a nice \signed macro that serves this purpose on page 106 of the TeXbook; here's a little variation used to build the aquote environment which behaves as expected;


\def\signed #1{{\leavevmode\unskip\nobreak\hfil\penalty50\hskip2em
  \parfillskip=0pt \finalhyphendemerits=0 \endgraf}}



This is a case where the name fits in nicely with the quote so the name will appear in the same line.

\begin{aquote}{Nicolas Bourbaki}
This is a case where the name won't fit in nicely with the quote, and in this case the name will be moved to the next line.


Here's the result:

enter image description here

share|improve this answer
Thank you! Exactly, what I searched for. Also many thanks for the exact reference in the TeXbook. – FredericChopin Mar 18 '11 at 7:31
Why do you need the the \savebox? Is parameter #1 otherwise unavailable in the closing part of the environment? – Christian Lindig Mar 18 '11 at 19:22
@Christian Lindig: yes,you are right, when defining a new environment, you cannot specify parameters directly in the closing part of the definition; the standard trick is to store them in boxes in the opening part and use the boxes in the closing part. – Gonzalo Medina Mar 18 '11 at 19:37

I just want to add for completeness that the memoir package provides the


command, which can be used immediately after a quote or quotation environment and does what the question asks.

share|improve this answer

Also for completeness, please refer to the attrib package. You can approximate the effect you want with the following:

  We call a disposition the arrangement of that which has parts, in respect 
  either of place or of capacity or of kind; for there must be a certain 
  position, as the word ‘disposition’ shows.

  \attrib{{\em Metaphysics} {\greektext D}.19, 1022b1--3}
share|improve this answer
Welcome to TeX.sx! – Peter Jansson Mar 11 '13 at 17:22
This doesn't answer the question, though, because it will always put the attribution on a new line, even if there's room on the existing one. – cfr Jan 9 at 2:01

Your Answer


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.