Text FormattingColored Text Frames

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
diabeteman
Posts: 1
Joined: Thu Oct 13, 2011 10:18 pm

Colored Text Frames

Post by diabeteman »

Hello everyone :)

I hope I'm in the right forum.

I need to generate colored frames around some text. I only have one limitation: the text will be surrounded with an environment "notice" and I cannot change that (the LaTeX code is generated by sphinx)

This environment will be used like this in the document body:

Code: Select all

\begin{notice}{<notice_class>}{Some title to the notice:}
Text text text text text \emph{text text} text text.
\end{notice}
<notice_class> will be one of [note, hint, tip, important, attention, caution, warning, danger, error] and the color of the frame should depend on this.

Here is the sphinx style-sheet where the "notice" environment is coded (lines 235 to 292)
sphinx.sty
sphinx style-sheet
(14.3 KiB) Downloaded 201 times
I've looked everywhere but I don't know how to renew the "notice" environment so that it puts the notice in a color frame.

And I don't know either how to change this color according to the notice_class 1st argument.

Can somebody point me in the right direction? :mrgreen:

Thanks in advance!

Robin

EDIT: to clarify things, the "default" notice environment renders like this

Image

and I would like it to render like this

Image

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply