Graphics, Figures & Tablesboxed figure: fbox around minipage??

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
soods
Posts: 2
Joined: Mon Feb 16, 2009 3:58 pm

boxed figure: fbox around minipage??

Post by soods »

Hi,

Just trying to put a box around a fig with some listings and text. Thought I had to put it in a minipage; but doesnt seem to work

This works without the box...

Code: Select all

\begin{figure}[htp]
\begin{minipage}{5in}
\begin{lstlisting}
assadaa
\end{lstlisting}
something about the above
\begin{lstlisting}
(more code)
\end{lstlisting}
blah
\end{minipage}
\end{figure}

with an attempted box i get the error
(/usr/local/texlive/2007/texmf-dist/tex/latex/listings/lstlang1.sty) [11]
! Argument of \lst@next has an extra }.
<inserted text>
\par
l.338 \end{minipage} }


produced by this code

Code: Select all

\begin{figure}[htp]
\fbox{\begin{minipage}{5in}
\begin{lstlisting}
assadaa
\end{lstlisting}
something about the above
\begin{lstlisting}
(more code)
\end{lstlisting}
blah
\end{minipage} }
\end{figure}


Ideas? thanks

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

boxed figure: fbox around minipage??

Post by localghost »

Have a look at the listings manual. It shows you how to put a frame around a listing.


Best regards and welcome to the board
Thorsten¹
soods
Posts: 2
Joined: Mon Feb 16, 2009 3:58 pm

Re: boxed figure: fbox around minipage??

Post by soods »

Thanks.

Here I'm trying to put a box around multiple listings.
Might try a tabular.
Post Reply