Se produjo una cancelación inesperada de la sangría al combinar el uso del paquete caption y capt-of

Se produjo una cancelación inesperada de la sangría al combinar el uso del paquete caption y capt-of

Los párrafos después de "captionof" no tienen sangría adecuada. Comente \usepackage{caption}o \captionof{figure}{figure}retire las sangrías.

Pero necesito el paquete capt-of y también el paquete caption para redefinir "labelsep" para que sea un espacio que no sea dos puntos. ¿Existe una forma alternativa de hacerlo?

Aquí hay un ejemplo:

\documentclass{article}

\usepackage{capt-of}
\usepackage{caption}

\begin{document}
before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption 

\captionof{figure}{figure}

after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption 

after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption 
\end{document}

Respuesta1

Esta pregunta ya tiene respuesta aquí:\captionof se mete con la sangría del párrafopero me gustaría agregar un poco de explicación.

Eldocumentaciónof \captionofin captionpackage (página 18) dice que "... por lo que debes usar ambos \captionofy \captionof*solo dentro de cajas o entornos". Entonces, poner el comando en un grupo propio {\captionof{figure}{figure}}debería ser una forma legítima.

Además, no es necesario, \usepackage{capt-of}ya que captionel paquete también lo proporciona \captionof.

información relacionada