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

Background color on quote environment

651 views
Skip to first unread message

anter...@gmail.com

unread,
Aug 19, 2007, 9:40:14 AM8/19/07
to
Hello to all!

I would like to know how one can change the background of a quote. Not
just a word but of an entire environment.

I tried colorbox but it transformed my quote into a single line... not
what I expected :s


Thanks in advance

Antero Neves

Werner Grundlingh

unread,
Aug 19, 2007, 9:47:18 AM8/19/07
to
On Aug 19, 6:40 am, "anterone...@gmail.com" <anterone...@gmail.com>
wrote:

As suggested in the UK TeX FAQ entry
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=breakbox
try using the framed package, available online from CTAN at
http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=framed
It allows for a shaded (coloured) box that may be broken across pages.

Hope this helps,
Werner

Rolf Niepraschk

unread,
Aug 19, 2007, 5:36:10 PM8/19/07
to
anter...@gmail.com schrieb:

> Hello to all!
>
> I would like to know how one can change the background of a quote. Not
> just a word but of an entire environment.
>
> I tried colorbox but it transformed my quote into a single line... not
> what I expected :s
>
>

Try the following example.

...Rolf

%---------------------------
\documentclass[11pt,a4paper,pagesize]{scrartcl}

\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{framed,blindtext}
\usepackage[svgnames]{xcolor}

\newcommand*\MARKER{\noindent
\rule[.5\ht\strutbox]{\textwidth}{.5mm}%
}

\newenvironment{colorQuote}[1][lightgray]{%
\quote
\setlength\fboxsep{2ex}%
\hsize=\linewidth
\def\FrameCommand##1{%
\hskip\rightmargin \hskip\leftmargin
\colorbox{#1}{##1}%
}%
\MakeFramed{\FrameRestore}}%
{\endMakeFramed\endquote}

\begin{document}

\MARKER

\begin{colorQuote}
\blindtext \blindtext \blindtext
\end{colorQuote}

\MARKER

\begin{colorQuote}[LightGoldenrodYellow]
\blindtext
\end{colorQuote}

\begin{colorQuote}[red!50!yellow!30]
\blindtext
\end{colorQuote}

\end{document}
%---------------------------

anter...@gmail.com

unread,
Aug 20, 2007, 11:05:57 AM8/20/07
to
On 19 Ago, 22:36, Rolf Niepraschk <Rolf.Niepras...@gmx.de> wrote:
> anterone...@gmail.com schrieb:

That works great!

Thanks a lot!

Bjoern von Prollius

unread,
Jan 9, 2008, 2:05:44 PM1/9/08
to
This solution from Rolf Niepraschk (see below) worked fine for me -
until today, when I updated my packages from CTAN (using MiKTeX 2.6).

LaTeX now produces the following error (tested with the example as
quoted below):
---------
! LaTeX Error: Something's wrong--perhaps a missing \item.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.31 \end{colorQuote}
----------

Anyone has a clue what might be the problem?

Thanks a lot,

Bjoern


Rolf Niepraschk schrieb:

0 new messages