Newsgroup: it.comp.software.tex
Titolo: Paragrafi con sfondo colorato

So che Latex non è pensato per usare i colori, però avrei bisogno di
scrivere dei paragrafi dotati di uno sfondo colorato.
Ho provato con \colorbox ma non gestisce i paragrafi ed il testo finisce
tutto su una riga, e quindi fuori dal foglio.
Ho provato anche con:
\begin{minipage}{...}
    \pagecolor{...}
\end{minipage}
Ma mi cambia lo sfondo di tutta la pagina e non solo della minipage.
Esiste un modo per scrivere un paragrafo con lo sfondo colorato?
Qualche pacchetto, qualcosa...
Ciao
Marco 

 Qualche pacchetto, qualcosa...
tempo fa avevo postato qualcosa del genere; solo che il testo colorato
e' chiuso in un box (che si puo' eliminare).  eccolo di nuovo: HTH.
\documentclass[a4paper]{article}
\usepackage[dvips]{color}
% Definition of a new command:        \wbox{text}
%
% "\wbox" typesets its argument in a centered and framed
% box, having total width \wboxwidth: the border is
% \wboxrule wide, and its color is \wbordercolor; the space
% between border and text is \wboxsep wide; and the
% background color is \wbackgroundcolor.
%
% Defaults values are:
%
% - \wboxwidth:              0.75 of \textwidth
% - \wboxrule:               2 pt
% - \wboxsep:                1 em
% - \wbordercolor:           black
% - \wbackgroundcolor:       white
%
% and may be changed using \setlength (for \wboxwidth,
% \wboxrule and \wboxsep) or \renewcommand (for
% \wbordercolor and \wbackgroundcolor).
%
% Note: you cannot break a \wbox between two pages.
\newlength{\wboxwidth}
\newlength{\wboxrule}
\newlength{\wboxsep}
\setlength{\wboxwidth}{0.75\textwidth}
\setlength{\wboxrule}{2pt}
\setlength{\wboxsep}{1em}
\newcommand{\wbordercolor}{black}
\newcommand{\wbackgroundcolor}{white}
\newcommand{\wbox}[1]
{ \setlength{\fboxrule}{\wboxrule}\setlength{\fboxsep}{\wboxsep}
  \begin{center}
    \fcolorbox{\wbordercolor}{\wbackgroundcolor}
    {\begin{minipage}{\wboxwidth}{#1}\end{minipage}}
  \end{center}}
% Note the final space in the following command
\newcommand{\quick}{The quick brown fox jumps over the lazy
  dog. }
\newcommand{\sonet}{
  Shall I compare thee to a summer's day? \\
  Thou art more lovely and more temperate: \\
  Rough winds do shake the darling buds of May, \\
  And summer's lease hath all too short a date: \\[2ex]
  Sometime too hot the eye of heavens shines, \\
  And often is his gold complexion dimm'd; \\
  And every fair from fair sometime declines, \\
  By chance, or nature's changing course, untrimm'd; \\[2ex]
  But thy eternal summer shall not fade, \\
  Nor lose possession of that fair thou owest; \\
  Nor shall Death brag thou wander'st in his shade, \\[2ex]
  When in eternal lines to time thou growest; \\
  So long as men can breathe, or eyes can see, \\
  So long lives this, and this gives life to thee.}
% Here an example follows...
\definecolor{Red}{rgb}{1.0,0.0,0.0}
\definecolor{LemonChiffon}{rgb}{1.0,1.0,0.75}
\definecolor{DarkOrchid}{rgb}{0.6,0.2,0.8}
\definecolor{DarkGreen}{rgb}{0.0,0.39,0.0}
\definecolor{SaddleBrown}{rgb}{0.55,0.27,0.07}
\definecolor{SteelBlue}{rgb}{0.27,0.51,0.71}
\definecolor{AliceBlue}{rgb}{0.94,0.97,1.0}
\definecolor{MidnightBlue}{rgb}{0.1,0.1,0.44}
\begin{document}
\quick \quick \quick \quick \quick
\quick \quick \quick \quick \quick
\setlength{\wboxwidth}{0.67\textwidth}
\renewcommand{\wbordercolor}{DarkOrchid}
\renewcommand{\wbackgroundcolor}{LemonChiffon}
\wbox{{\centering\large\bfseries\color{red}Sonet 18\par\medskip}
  \color{DarkGreen}\sonet}
\quick \quick \quick \quick \quick
\quick \quick \quick \quick \quick
\clearpage
% In order to have all the text lines centered in the \wbox,
% the "center" environment may be used; but, however,that
% environment inserts extra space before and after itself.
% Here is another example, where the spacing is adjusted by
% hand to generate something similar to the previous one.
\quick \quick \quick \quick \quick
\quick \quick \quick \quick \quick
\renewcommand{\wbordercolor}{SteelBlue}
\renewcommand{\wbackgroundcolor}{AliceBlue}
\wbox{\centering{\large\bfseries\color{SaddleBrown}Sonet 18}
  \center\color{DarkGreen}
  \sonet\vspace{-\medskipamount}\endcenter}
\quick \quick \quick \quick \quick
\quick \quick \quick \quick \quick
\end{document}
-- 
|   Maurizio Loreti -- 
ROT13:ybe...@cq.vasa.vg
   |  (@_
| Un. of Padova, Dept. of Physics, Padova, Italy |  //\
|     
http://www.pd.infn.it/~loreti/mlo.html
     |  V_/_

 e' chiuso in un box (che si puo' eliminare).  eccolo di nuovo: HTH.
Direi che č perfetto!
Lo adatto un pň alle mie esigenze.
Grazie
Marco