I have two tables which are about 40% of the page height. Both are related and should stay on the same page. Therefore I put both tables inside a minipage and made it floating.


%% get fullwidth length

%% custom floating environment
% this puts the minipage on a separate page

    1 & 2 \\
    \captionof{table}{Lorem ipsum dolor sit amet, consectetur adipiscing elit.}


    1 & 2 \\
    \captionof{table}{Cras sodales pharetra ultrices. Morbi suscipit malesuada neque sit amet laoreet. See \cref{tbl:one}}


enter image description here

The only thing is I cannot get the captions to be of \marginparwidth and inside the margin directly under the table. I tried the following

% arguments:
% #1 short caption
% #2 offset
% #3 figure type (table, figure)
% #4 caption text
\RenewDocumentCommand{\captionof}{o O{0mm} m m}{%

but the label does not get resolved anymore and just shows ??.

enter image description here

I don't know if my approach is reasonable and any better solutions are welcome. I just need these two table on the same floating page such that labels get resolved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.