[Tex/LaTex] Redefining quote environment with tiny font and double quote signs

fontsizeline-spacingpunctuationquoting

I want to redefine the quote environment in such a way to get the output of the following code.

\begin{quote}{\tiny\textquotedblleft Text \textquotedblright}\end{quote}

I also want to fix the line spacing because the distance between the lines looks so wide.

Best Answer

This is the original definition of the quote environment from article:

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

Here is a redefined one using your requirements in the form of an MWE:

enter image description here

\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\renewenvironment{quote}
               {\list{}{\rightmargin\leftmargin}%
                \item\relax\tiny\textquotedblleft\ignorespaces}
               {\unskip\unskip\textquotedblright\endlist}
\begin{document}
\lipsum[1]
\begin{quote}
\lipsum*[2]
\end{quote}
\lipsum[3]
\end{document}

The correction of \ignorespaces at \begin{quote} is to remove any spaces between at the start, while \unskip\unskip does the same at \end{quote}. Also, don't wrap the contents in a group { }, which provide the unwanted spacing.

Note that this will replace the existing quote environment. If you're planning on using the original format, it is best to define a new (say) altquote environment for this purpose.


An updated version of quote allows for an optional argument [name] which prepends "name said:" before adding the quote. If no name is supplied, the default quote (above) is set:

enter image description here

\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{ifmtarg}% http://ctan.org/pkg/ifmtarg
\makeatletter
\renewenvironment{quote}[1][]
               {\list{}{\rightmargin\leftmargin}%
                \item\relax\tiny\@ifmtarg{#1}{\relax}
                  {\textbf{#1}~said:~}\textquotedblleft\ignorespaces}
               {\unskip\unskip\textquotedblright\endlist}
\makeatother
\begin{document}
\lipsum[1]
\begin{quote}
\lipsum*[2]
\end{quote}
\lipsum[3]
\begin{quote}[bkarpuz]
\lipsum*[4]
\end{quote}
\end{document}

Testing for empty arguments is supplied by the ifmtarg package's conditional

\@ifmtarg{<arg>}
  {<Code for arg empty>}
  {<Code for arg not empty>}