Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

From what I understand, it's pretty much impossible to include floats within an fbox/minipage. I basically want a paragraph of framed text with a couple of subfigures included within the frame. Any ideas as to how I might implement this?

share|improve this question
2  
If you don't need a floating environment just use an fbox/minipage with \captionsetup{type=figure} as 1st line. Afterwards \caption, \subcaption(box), \subfloat etc. should work fine. (I'm assuming you are using either the subcaption or the subfig package for typesetting sub-figures.) –  Axel Sommerfeldt Jan 4 '12 at 11:29
    
    
luser, please comment at least if this should be a floating environment or not. –  Axel Sommerfeldt Jan 5 '12 at 12:13
    
I'm not sure if it needs to be a floating environment. I need text and two side-by-side figures surrounded by a box. If this can be done without a floating environment as above, then no, it needn't be floating. –  luser Jan 11 '12 at 9:50
add comment

1 Answer

For such things you can use packages like framed, mdframed, adjustbox or tcolorbox.

Every package has its own benefits and drawbacks: you can read the related documentation to get more information.

The following example uses tcolorbox. To provide subfigures I am using subcaption.

\documentclass[12pt]{article}
\usepackage{caption,subcaption}
\usepackage{tcolorbox}
\usepackage{kantlipsum}
\begin{document}
\begin{tcolorbox}
\kant[1]
\begin{center}
\captionsetup{type=figure}
\begin{subfigure}[b]{.5\linewidth}
\centering
\rule{3cm}{1cm}
\caption{A subfigure}\label{fig:1a}
\end{subfigure}%
\begin{subfigure}[b]{.5\linewidth}
\centering
\rule{3cm}{1cm}
\caption{B subfigure}\label{fig:2a}
\end{subfigure}
\caption{FIGURES}
\end{center}
\kant[2]
\end{tcolorbox}
\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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