[Rewritten the original post. For the later update see below.]
It seems that my paragraphs stop indenting due to the use of
\captionof{figure}
in the code below. Any suggestions for a workaround or fix?
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
{hyperref}
\makeatletter
\usepackage{tcolorbox}
\tcbuselibrary{most}
\usepackage{caption}
\makeatother
\begin{document}
\newtcolorbox{abox}[2][]{float, fonttitle=\bfseries,enhanced, attach boxed title to top center={yshift=-2mm}, title={#2},#1}
\begin{abox}{title}
{body}
\end{abox}
\captionof{figure}{caption}
test test test test test test test test test test test test test test
test test test test test test test
test test test test test test
test test test test test test test test test test test test test test
test test test test test test test test test test
\end{document}
Update:
Two suggestions were made; as the box shouldn't float I tried using center
. This however causes strange spacing issues of text within the box, unless it is placed slightly differently:
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage[skip=1ex]{caption}
\usepackage{tcolorbox}
\tcbuselibrary{most}
\newtcolorbox{abox}[2][]{enhanced, fonttitle=\bfseries,
attach boxed title to top center={yshift=-2mm},
title={#2},#1}
\usepackage[unicode=true,
pdfusetitle,
bookmarks=true,
bookmarksnumbered=false,
bookmarksopen=false,
breaklinks=false,
pdfborder={0 0 1},
backref=false,
colorlinks=false]{hyperref}
\begin{document}
\begin{abox}{title}
{
{\begin{enumerate}
\item testttttt
\end{enumerate}
testttttt
\begin{enumerate}\setcounter{enumi}{1}
\item testttttt
\end{enumerate}
testttttt
\begin{enumerate}\setcounter{enumi}{2}
\item testttttt
\end{enumerate}}
}
\end{abox}
\begin{center}
\captionof{figure}{caption}
\end{center}
\end{document}
\end{abox}
and the following paragraph?