4

Am I missing something here? Nobody else seems to have a breakable tcolorbox that center aligns on the second page. I'd like it to just top align, same as normal text

\documentclass[11pt,twoside]{report}
\usepackage[breakable,skins]{tcolorbox}
\usepackage{lipsum}
\usepackage[parfill]{parskip}

\newtcolorbox[auto counter,number within=chapter]{pabox}[2][!ht]{colbacktitle=black!70!white, colback=black!2!white, floatplacement=#1, float, enhanced jigsaw, breakable, height fill, fonttitle=\bfseries, parbox=false, toptitle=2mm, bottomtitle=2mm, title=Box.~\thetcbcounter: #2} %removed possibility of specifying other options, just position

\begin{document}

\begin{pabox}[t!]{Extremely annoying tcolorbox}\label{box:accuracy}
\lipsum[1-4]
\end{pabox}

\end{document}

enter image description here

2
  • It is quite impressing that tcolorbox can handle multipage floats. The second page is centered as it is a float page, see here if you want to get the text at the top: tex.stackexchange.com/questions/28556/… Mar 11, 2018 at 21:33
  • ohhhh I see! Thanks, that clarifies things a lot and is really helpful, especially since it's not the first time I've had this problem...
    – Irene
    Mar 12, 2018 at 15:05

1 Answer 1

2

remove floatplacement=#1, float, and accordingly correct pabox options:

\documentclass[11pt,twoside]{report}
\usepackage[breakable,skins]{tcolorbox}
\usepackage{lipsum}
\usepackage[parfill]{parskip}

\newtcolorbox[auto counter,number within=chapter]{pabox}[1][!ht]{% <-- chanded from 2 to 1
    colbacktitle=black!70!white, colback=black!2!white,
    %floatplacement=#1, float, % commented (remove)
    enhanced jigsaw,
    breakable,
    height fill,
    fonttitle=\bfseries, parbox=false, toptitle=2mm, bottomtitle=2mm,
    title=Box.~\thetcbcounter: #1} %removed possibility of specifying other options, just position

\begin{document}

\begin{pabox}{Extremely annoying tcolorbox}\label{box:accuracy}
\lipsum[1-4]
\end{pabox}
\end{document}

enter image description here

3
  • Ah. So does this mean I can't make it float? Like appear on the next page after it's specified, wrapping onto the next page after that, maybe have normal text continue on underneath the box on the second page...
    – Irene
    Mar 11, 2018 at 20:22
  • so far i don't know for floats which can occupy tho pages. argument breakable, means, that the box can be break and be on more pages starting where is inserted and that text after it can continue with its flow. i suspect that this is what you looking for.
    – Zarko
    Mar 11, 2018 at 20:30
  • ok, that sounds about right and should work. thanks!
    – Irene
    Mar 11, 2018 at 21:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .