Background: My TeX file is generated from R Markdown and captions are automatically placed below included figures. Here is a minimal example of what my generated TeX file looks like:
\documentclass[man]{apa7}
\title{Test}
\begin{document}
\maketitle
Lorem ipsum
\begin{figure}
The figure
\caption{The caption.}
\end{figure}
\end{document}
Problem: Figure captions need to be rendered above the corresponding figure (as per APA guidelines) without moving \caption.
What I have tried: I understand that captions can be rendered above the figure without changing the code via the floatrow package and \floatsetup[figure]{style=plaintop}. However, loading floatrow interferes with endfloat, which is loaded by apa7. Specifically, figures are no longer placed at the end of the document but rendered in place:
\documentclass[man]{apa7}
\usepackage{floatrow}
\floatsetup[figure]{style=plaintop}
\title{Test}
\begin{document}
\maketitle
Lorem ipsum
\begin{figure}
The figure
\caption{The caption.}
\end{figure}
\end{document}
According to the documentation of endfloat, floatrow should always be loaded before endfloat (and, thus, before apa7). Hence, I try to load floatrow via \RequirePackage{} but this yields errors. I can fix some of those by undefining two lengths, but this leaves me with the following error that I can't seem to resolve:
! Missing \endcsname inserted.
<to be read again>
\@classoptionslist
l.1453 \ProcessOptionsWithKV{floatrow}
Here's the minimal reproducible example:
\RequirePackage{floatrow}
\let\abovecaptionskip\undefined
\let\belowcaptionskip\undefined
\documentclass{apa7}
\begin{document}
Lorem ipsum
\end{document}
Note that despite the error message I get a rendered PDF file that looks as expected. Also this is not specific to apa7; I get the same error when I use the article or book document class.
\documentclass? – egreg Sep 17 '20 at 20:39apa7loadsendfloatto place figures at the end of the document. When I loadfloatrowafter\documentclassand, thus, after loadingendfloat, figures are rendered in place rather than being delayed. – crsh Sep 18 '20 at 06:19floatrowjust for caption position then you can also do this by just entering the caption before the float, e.g.,\begin{figure}\caption{xyz}\includegraphics{}\end{figure}, then you don't need to loadfloatrowat all. – Marijn Sep 18 '20 at 06:38\captioninside the figure environment. – crsh Sep 18 '20 at 06:43