I am using the
shaded
environment from the framed package to produce text with a coloured background. When I use shaded on its own, everything works fine, but if I embed it in another environment then the shadecolor
I defined affects the text colour after the environment closes.A minimal example:
Code: Select all
\documentclass{article}
\usepackage[svgnames]{xcolor}
\usepackage{framed}
\definecolor{shadecolor}{named}{Salmon}
\newenvironment{example}%
{\noindent\raggedright
\begin{shaded}\color{Blue}\textbf{Example: }}{
\end{shaded}}
\setlength{\parskip}{12pt}
\begin{document}
Here's a sentence in the default colour (black)
\begin{shaded}
Here's some text in the shaded environment with salmon background.
\end{shaded}
This sentence is also in the default colour (black)
\begin{example}
This example should have a Salmon background and blue text. Seems to work nicely!
\end{example}
This is more text which should be black, but is salmon instead! Where has that come from?
\end{document}
Thanks
James