I want to have the text go on the right side of my tcolorbox (like this), instead of it just being white space on the right side of my tcolorbox.
This code illustrates a tcolorbox with all white on the right side:
\documentclass{book}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\begin{document}
\chapter{First}
\section{Furst}
\subsection{Ok}
%Defining a newtcolorbox to be a standard box for all examples in the text:
\newtcolorbox[auto counter,number within=section]{phbox}[1][]{skin=bicolor,title=Figure~\thetcbcounter,#1,size=title,colback=white,colbacklower=black!10!white}
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
\begin{phbox}[label={fig:label},halign=center,width=\linewidth/2]
\tcbincludepdf[scale=1,size=tight,opacityframe=0]{example-image.pdf}
\tcblower
Here is a bunch of text to explain a figure.
\end{phbox}
Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere
\end{document}
I've tried using nobeforeafter
and after=,
in the tcolorbox options, but this does not produce the desired effect. My best guess is a solution using before
and after
, I've tried looking in the manual for clues, but I've come up empty.
Do I have to use the wrapfig
package to achieve this? I would prefer a way to do it with tcolorbox
.
Thanks!
Edit: To clarify: Before using a new package, I wanted to make sure that there wasn't an obvious easy way to do it using tcolorbox
. The thing I'm asking for seems like it should be easy to do, maybe it was too obvious for the manual.
I'm already using a lot of tcolorbox in my document, and it's a lot more work having to put stuff in a wrapfigure if I could just put after=\somecommand
in the tcolorbox options instead.
Also it's not obvious (to me) that combining wrapfig
and tcolorbox
would be unproblematic.
tcolorbox
3.61. documentation something you wan't to achieve?tcolorbox
. As if withwrapfig
. But not only does the OP not want to usewrapfig
(for unspecified reasons). The OP wants to usetcolorbox
to do this. If that's right, then this is a feature request to thetcolorbox
maintainer, IMHO, and so off-topic.savelowerto
or something similartcolorbox
's facilities for that - a couple ofminipage
s would do it.) But the image the OP linked to shows text flowing around the box and that is different. (Unless you break the text manually into pieces, of course.)