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.
Best Answer
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 thebook
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 thearticle
class. Without any statement (so default,oneside
) the effect is as desired and doesn't give any error messages. However, when the optiontwoside
is passed it again results in errors.In summary, it would seem that the
fltpage
andcaption
packages are incompatible when used in a documentclass that: a. has not, by default, atwoside
layout; and atwoside
layout is required and therefore passed as an option; or b. has by default atwoside
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 asarticle
, in combination withtwoside
layout.