GeneralCustomizing theorems

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
an.cl
Posts: 2
Joined: Wed Mar 25, 2009 7:13 pm

Customizing theorems

Post by an.cl »

I'm writing some guides for some people at the moment and was wondering if anyone knew how I could "color" in theorems, i.e. shade them with a different background color of any sort.

Recommended reading 2024:

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

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Customizing theorems

Post by gmedina »

Hi,

some of the features provided by the ntheorem package could be useful for you. Please have a look at the package documentation (partuicularly, section 2.3.7 Framed and Boxed Theorems, pp 7ff).
1,1,2,3,5,8,13,21,34,55,89,144,233,...
an.cl
Posts: 2
Joined: Wed Mar 25, 2009 7:13 pm

Customizing theorems

Post by an.cl »

Thanks, using that now.

Odd problem, though: I've used \newshadedtheorem but now it doesn't like having figures within things:

Code: Select all

\theoremclass{Theorem}
\theoremstyle{break}
\theoremheaderfont{\normalfont\bfseries}
\theorembodyfont{\normalfont}
\theoremsymbol{\ensuremath{\diamondsuit}}
\theoremseparator{:}
\newframedtheorem{example}{Example}[section]

...

\begin{example}
\begin{figure}[h]
\begin{center}
\includegraphics{SomeImage.eps}
\caption{Blobby}
\end{center}
\end{figure}
\end{example}
But it throws up with "Not in outer par mode".

Does anyone know how to fix this?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Customizing theorems

Post by localghost »

Omit the float environment and use the \captionof command provided by the caption package. The figure doesn't need to float in this case.


Best regards and welcome to the board
Thorsten¹
Post Reply