Displaying quotes
Imagine your text contains a quotation from another author. It might be hard to read if it's just embedded in your text. A common way to improve the readability is setting the text off by indenting both margins. To do this, we will quote thoughts of famous physicists in our example:
- Create a new document with some introductory text:
\documentclass{article} \begin{document} \noindent Niels Bohr said: ``An expert is a person who has made all the mistakes that can be made in a very narrow field.'' Albert Einstein said:
- Display the quote:
\begin{quote} Anyone who has never made a mistake has never tried anything new. \end{quote}
- Add some more body text, and finish:
Errors are inevitable. So, let's be brave trying something new. \end{document}
- Click on Typeset to see the result:
Firstly, we quoted inline, that is, within the text flow in the paragraph. `
produces a left quotation mark, also called a backtick, and '
provides a right quotation mark. To get double quotes, we just typed two such symbols. We call this inline quoting.
Then, we used the quote
environment to display a quotation separated from the surrounding text. We did not begin a new paragraph for it, because the quotation is already set a bit off in its own paragraph. That's called displayed quoting.
Quoting longer text
When writing short quotations, the quote
environment looks very good. But when you would like to quote text containing several paragraphs, you might wish to have the same paragraph indentation as in your surrounding text. The quotation
environment will do this for you.
Let's quote some of the benefits of TeX and LaTeX found on a web page on CTAN:
- Start a new document and add this text:
\documentclass{article} \usepackage{url} \begin{document} The authors of the CTAN team listed ten good reasons for using \TeX. Among them are: \begin{quotation} \TeX\ has the best output. What you end with, the symbols on the page, is as useable, and beautiful, as a non-professional can produce. \TeX\ knows typesetting. As those plain text samples show, TeX's has more sophisticated typographical algorithms such as those for making paragraphs and for hyphenating. \TeX\ is fast. On today's machines \TeX\ is very fast. It is easy on memory and disk space, too. \TeX\ is stable. It is in wide use, with a long history. It has been tested by millions of users, on demanding input. It will never eat your document. Never. \end{quotation} The original text can be found on \url{https://www.ctan.org/what_is_tex.html}. \end{document}
- Click on Typeset and look at the output:
This time, we used the quotation
environment to display some paragraphs. As in normal text, blank lines separate the paragraphs; they are left-indented at their beginning just like in all our body text.
But what if we don't like that paragraph indentation? Let's check out an alternative.
In this example, we want to avoid paragraph indentation and instead, we shall separate the paragraphs with some vertical spacing. As filler text, we will use a few sentences of the previous example about quoting, as shown here:
- Create a small document with the following code (make sure the highlighted code is included):
\documentclass{article} \usepackage{parskip} \usepackage{url} \begin{document} The authors of the CTAN team listed ten good reasons for using \TeX. Among them are: \TeX\ has the best output. What you end with, the symbols on the page, is as useable, and beautiful, as a non-professional can produce\ldots The original text can be found on \url{https://www.ctan.org/what_is_tex.html}. \end{document}
- Click on Typeset and see the effect:
Here, we loaded the parskip
package—its only purpose is to remove the paragraph indentation completely. At the same time, this package introduces a skip between paragraphs. But this package doesn't affect the definition of the quotation
environment; you still could use the quote
environment.
Visualizing paragraph breaks
In order to distinguish paragraphs, there are two common ways. One is to indent the beginning of each paragraph; this is the default LaTeX style. The other way is to insert vertical space between paragraphs while omitting the indentation, which is suitable for narrow columns where indenting would cost too much width.