[Tex/LaTex] controlling position of tcolorbox

tcolorbox

I am attempting to control the position of a boxed insert created using the tcolorbox package. However I cannot fully control the position of the box as for figures and tables, for example using for example htpb!. Here is an example that replicates the issue:

\documentclass{article}
\usepackage{tcolorbox}
\usepackage{lipsum}
\begin{document}
\lipsum[2-6]
\begin{tcolorbox}[float=htpb!, title=A box]
    This is a box!\\
    With a couple lines.
\end{tcolorbox}
Some more text. 
\end{document}

I would like the box to appear before "some more text."

Best Answer

There's no need to let this box to float around (I never needed it for tcolorbox yet). Just remove the float option.

\documentclass{article}
\usepackage{tcolorbox}
\usepackage{lipsum}
\begin{document}
\lipsum[2-6]

\begin{tcolorbox}[title=A box]
    This is a box!\\
    With a couple lines.
\end{tcolorbox}

Some more text. 
\end{document}
Related Question