答案1
您可以使用adjustbox
。使用float
或nofloat
键。无论哪种情况,您都需要定义一个新的浮点类型,例如使用newfloat
包。
\documentclass{article}
\usepackage{lipsum}% for example text only
\usepackage{hyperref}% for hyperlinked references
\usepackage{adjustbox}
\usepackage{newfloat}
\DeclareFloatingEnvironment[
fileext=loc,
listname={List of cars},
name=Car,
placement=pbth,
within=section,
%chapterlistsgaps=off,
]{car}
\begin{document}
\section{Bla}
\lipsum
\begin{adjustbox}{minipage=\textwidth-2\fboxsep-2\fboxrule, fbox, captionbelow={ferrari}, label={car:ferrari}, nofloat=car}
Test
\end{adjustbox}
See my new car~\ref{car:ferrari}.
\lipsum
\end{document}