# Combining the caption and fltpage package when using twopage setting in book class

I have run into a strange problem when using the caption package and the fltpage package in the book documentclass with the twoside setting.
After eliminating all kinds of variable it turned out that what is given below is the true MWE for the problem. I assume I'm doing something wrong as I'm relatively new to LaTeX and probably missed something in the documentation of the caption package.

\documentclass[twoside]{book}
\usepackage{caption}
\usepackage[leftFloats, CaptionAfterwards]{fltpage}

\begin{document}

\captionsetup[FPfigure]{format=hang, font=small, labelfont=bf}

\begin{FPfigure}
\fbox{\rule[-10cm]{0pt}{\textheight}Frame ... page.\hspace{5cm}}
\caption{A caption alone ... figure without a caption!}
\end{FPfigure}

\end{document}


If the option twoside is removed than it will produced the desired layout for the caption. But with it I get the following errors:

7x Illegal parameter number in definition of \AP@ \end{FPfigure}
Undefined control sequence \end{document} Environment undefined.
Undefined control sequence \end{document} Package caption Error: No float type '' defined 29x Missing \endcsname inserted Reference FPfigure-1-pos' on page 1 undefined on input line 10.

If the fltpage environment is not used (just a normal figure) then also no errors are given and the correct layout is produced.
I'm working on a Windows system using MiKTeX 2.9

As this is for my thesis I really need the twoside option. Any help would be greatly appreciated. I must say that I didn't try other classes.

-
Can you use rightFloats instead of leftFloats? –  Gonzalo Medina Sep 21 '12 at 2:46
@GonzaloMedina Preferably not as that would result requiring the reader to flip the page to see the figure legend if I'm not mistaken. In addition I just tested it, but it doesn't work either. –  Wouter Kuit Sep 21 '12 at 2:52
I just realised that the book class as a default uses the twoside option (texblog.org/2007/07/09/…) so there is no real need to define it as such. I don't have access to LaTeX at the moment but will test if the layout changes for my master document (on the MWE I did not notice this). –  Wouter Kuit Sep 21 '12 at 18:00

I managed to solve the "problem" as it turned out not to be problem at all.

As already stated in the question, removing the twoside option resulted in the MWE functioning again. At first I didn't realise this, but as the book documentclass has by default the layout set as two-sided! So including it doesn't add anything, but more importantly, removing the statement doesn't change anything either!

In essence, the fix in the question was already the answer, but it is a mystery why the explicit statement of a default setting would result in these error messages.

I then did some further testing with classes that do not as a default have the twoside option enabled such as the article class. Without any statement (so default, oneside) the effect is as desired and doesn't give any error messages. However, when the option twoside is passed it again results in errors.

In summary, it would seem that the fltpage and caption packages are incompatible when used in a documentclass that: a. has not, by default, a twoside layout; and a twoside layout is required and therefore passed as an option; or b. has by default a twoside layout but this is also given as a statement when devining the documentclass.

My question related to the second option and is therefore answered, remove the optional mentioning of the twoside option. The issue remains for people wanting to use it in other documentclasses such as article, in combination with twoside layout.

-
As I'm new to the site as a question asker/answerer I don't know what to do now. Rephrase the original question so that it now is about the article documentclass? Or mark it as "answered" and leave it at that? It would be good if some senior people could comment on this. –  Wouter Kuit Sep 21 '12 at 21:58
In addition, it would seem to me that this is really a bug in either of the two macro's. Because the fltpage packages is not actively maintained (and is in fact still a beta) I will point the maintainer of caption` to this question, and hope for other users that it issue is related to that package. –  Wouter Kuit Sep 21 '12 at 22:00
I'd say you've answered your own question here: please mark with the 'checkmark' (when you can). –  Joseph Wright Sep 23 '12 at 13:49