1

I adapt the solution in Set the width of a fcolorbox for a multiparagraph statement - there should be a uniform colour box encompassing multiple paragraphs:

\documentclass{beamer}
\usepackage{xcolor}
\usepackage{xparse}
\NewDocumentCommand{\framecolorbox}{oommm}
 {% #1 = width (optional)                                                                                                                                                        
  % #2 = inner alignment (optional)                                                                                                                                              
  % #3 = frame color                                                                                                                                                             
  % #4 = background color                                                                                                                                                        
  % #5 = text                                                                                                                                                                    
  \IfValueTF{#1}
   {%                                                                                                                                                                            
    \IfValueTF{#2}
     {\fcolorbox{#3}{#4}{\makebox[#1][#2]{#5}}}
     {\fcolorbox{#3}{#4}{\makebox[#1]{#5}}}%                                                                                                                                     
   }
   {\fcolorbox{#3}{#4}{#5}}%                                                                                                                                                     
 }
 \begin{document}
     \framecolorbox[4cm]{blue}{blue!40}{%                                                                                                                                        
       what do I
   do here?
 }

\end{document}

The compilation fails:

Runaway argument?
{what do I 
! Paragraph ended before \framecolorbox  was complete.
<to be read again> 
                   \par 
l.21

?

How to fix?

Viesturs
  • 7,895

1 Answers1

1

If you need just a colorbox with some paragraph along with auto pagebreak, then it's so easy to achieve with the use of framed.sty and the MWE is:

\usepackage{xcolor}
\usepackage{framed}

\colorlet{shadedcolor}{cyan!10}

\begin{document}

\begin{shaded} ....

... \end{shaded}

MadyYuvi
  • 13,693