3

In a ‘mini page’ environment, is there a way to have a back ground and then writing on top? Rather than just writing and a translucent background.

2
  • 4
    Welcome to TeX-SE! Sure, e.g. \documentclass{article} \usepackage{xcolor} \begin{document} \colorbox{blue!20}{\begin{minipage}{4cm} xyz \end{minipage}} \end{document}
    – user121799
    May 14 '19 at 6:27
  • 6
    Let me mention that there are much more advanced options such as tcolorbox.
    – user121799
    May 14 '19 at 6:32
6
\documentclass{article} 
\usepackage[svgnames]{xcolor} 
\usepackage{blindtext}
\begin{document} 

\blindtext

\noindent
\fcolorbox{Brown}{Aqua}{\begin{minipage}{\dimexpr\linewidth-2\fboxsep-2\fboxrule} 
\color{Brown}\blindtext 
\end{minipage}} 

or

\noindent
\colorbox{Khaki}{\begin{minipage}{\dimexpr\linewidth-2\fboxsep} 
\blindtext 
\end{minipage}} 

\end{document}

enter image description here

1

By using either tikz or framed package, you can achieve it. Example given below:

\usepackage{framed}

\begin{shaded}
....
\end{shaded}

tcolorbox also having many features....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.