Graphics, Figures & Tables(wrap-)figures inside a theorem environment

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Boersma
Posts: 21
Joined: Mon Nov 22, 2010 9:29 pm

(wrap-)figures inside a theorem environment

Post by Boersma »

Hi all,

I want to include figures inside my self-made example environment. However: it seems that is its impossible to do this inside such environment, I receive the "not in outer par mode" -error.

My MWE: (mayby not really minimal, but not too much I think)

Code: Select all

Code, edit and compile here:
\documentclass[a4paper]{report}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage[font=small,format=plain,labelfont=bf,sf,textfont=sf,up]{caption}
\usepackage{amsmath}
\usepackage[amsmath,framed]{ntheorem}
\usepackage[framemethod=TikZ]{mdframed}
%Examples
\theoremheaderfont{\small \bfseries \sffamily}
\theorembodyfont{\small \sffamily}
\theoremseparator{:}
\newmdtheoremenv[topline=false, bottomline=false, rightline=false,
middlelinewidth=2pt]
{examp}{Example}[chapter]
\begin{document}
\lipsum[1]
\begin{figure} [!h]
\begin{minipage}[b]{0.58\textwidth}
\begin{examp}[Controlling temperature]
\lipsum[2]
\begin{align}
a = b + c
\end{align}
\lipsum[34]
\begin{align}
d = e + f
\end{align}
\end{examp}
\end{minipage}
\hfill
\begin{minipage}[b]{0.38\textwidth}
\centering
SMALL\\PICTURE\\ILLUSTRATES\\EXAMPLE
\caption{Beautiful caption of small picture.}
\end{minipage}
\end{figure}
\lipsum[1]
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This is my workaround, two minipages next to each other, but due to the amount of white space this is not really nice.

Suggestions?

Regards,
Boersma

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