| Olaf Conradi 2006-05-31, 7:17 pm |
| Hello,
I am trying set two floats next to each other with subfig. This works
all ok, unless it's wider than \textwidth. Below is a minimal example to
demonstrate. I am using adjustwidth of package chngpage.
Using caption version 3.0c it all looks ok (the main caption of figure 1.1
is not exactly centered though):
*File List*
article.cls 2004/02/16 v1.4f Standard LaTeX document class
size10.clo 2004/02/16 v1.4f Standard LaTeX file (size option)
caption.sty 2004/07/16 v3.0c Customising captions (AS)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
subfig.sty 2005/06/28 ver: 1.3 subfig package
chngpage.sty 2003/08/10 v1.2 change page layout
ragged2e.sty 2003/03/25 v2.04 ragged2e Package (MS)
everysel.sty 1999/06/08 v1.03 EverySelectfont Package (MS)
***********
But using newer version 3.0j, I get the following output. The overfull
boxes are both subcaptions. The first exceeds in the second. The second
exceeds the margin.
Overfull \hbox (113.811pt too wide) in paragraph at lines 22--22
[] []
Overfull \hbox (113.811pt too wide) in paragraph at lines 27--27
[] []
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./subfl.aux)
*File List*
article.cls 2004/02/16 v1.4f Standard LaTeX document class
size10.clo 2004/02/16 v1.4f Standard LaTeX file (size option)
caption.sty 2006/03/21 v3.0j Customising captions (AR)
caption3.sty 2006/03/16 v3.0j caption3 kernel (AR)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
subfig.sty 2005/06/28 ver: 1.3 subfig package
chngpage.sty 2003/08/10 v1.2 change page layout
ragged2e.sty 2003/03/25 v2.04 ragged2e Package (MS)
everysel.sty 1999/06/08 v1.03 EverySelectfont Package (MS)
***********
But the release notes of caption 3.0i says:
Now works correctly inside list-based environments like "narrow" or "wide"
The real reason I am trying this, is because I want to put two source
listings (lstlisting environment) inside subfloat. I created the
following package to achieve this:
http://composestar.cvs.sourceforge....sty?view=markup
It creates a newsubfloat for lstlisting.
Can anyone shed some light on this problem?
Cheers
-Olaf
The is the minimal example (which goes wrong with caption v3.0j):
\documentclass{article}
\usepackage{caption}
\usepackage{subfig}
\usepackage{chngpage}
\listfiles
\begin{document}
\section{Hello}
This is one paragraph of text.
Foo foo foo foo foo foo foo foo.
\begin{figure}[t]
\begin{adjustwidth}{-2cm}{-2cm}
\centering
\subfloat[One subcaption. Let's make this subcaption a bit longer.]{%
\label{fig:example_one_a}%
\parbox{7cm}{One one one one one one one one one one one one one one one one.}%
}%
\qquad
\subfloat[Another subcaption.]{%
\label{fig:example_one_b}%
\parbox{7cm}{Two two two two two two two two two two two two two two two two.}%
}
\caption{The main caption is here.}%
\label{fig:example_one}%
\end{adjustwidth}%
\end{figure}
This is also one paragraph of text to conclude this example, see Figure~\ref{fig:example_one}.
Bar bar bar bar bar bar bar bar.
\begin{figure}[b]
\centering
\subfloat[One subcaption. Let's make this subcaption a bit longer.]{%
\label{fig:example_two_a}%
\parbox{5cm}{One one one one one one one one one one one one one one one one.}%
}%
\qquad
\subfloat[Another subcaption.]{%
\label{fig:example_two_b}%
\parbox{5cm}{Two two two two two two two two two two two two two two two two.}%
}
\caption{The main caption is here.}%
\label{fig:example_two}%
\end{figure}
\end{document}
|