
[Reescreveu a postagem original. Para o mais tardeatualizarVeja abaixo.]
Parece que meus parágrafos param de recuar devido ao uso de
\captionof{figure}
no código abaixo. Alguma sugestão para uma solução alternativa ou correção?
\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}
Atualizar:
Duas sugestões foram feitas; como a caixa não deveria flutuar, tentei usar center
. No entanto, isso causa problemas estranhos de espaçamento do texto dentro da caixa, a menos que seja colocado de maneira um pouco diferente:
\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}
Responder1
Posso confirmar suas descobertas. Parece que \captionof{...}{caption text}
deveria ser encerrado em algum ambiente. Por exemplo
\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{center}
\begin{abox}{title}
{body}
\end{abox}
\captionof{figure}{caption}
\end{center}
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}
ou se abox
deveria flutuar, substitua center
por figure
:
\begin{figure}[ht]
\begin{abox}{title}
{body}
\end{abox}
\caption{caption}
\end{figure}