5 Though there is nothing inherently wrong with the [nice answer by samcarter](https://topanswers.xyz/tex?q=2097#a2349), the following builds upon it to increase its robustness (since TeX's rules for nesting `\if`s can lead to surprises, and so having an unbalanced `\if` in some code or nesting `\if`s can lead to breakage).
10 The situation is a bit tricky because even if it won't take up any space, the `tikzpicture` will still have to start a line and `tcolorbox` you use afterwards will go in a fresh line.
13 The `3dtools` library has a key `same bounding box`, the main purpose of which is to allow the user to create animations in which a series of `tikzpicture`s has the same bounding box. The usage is `same bounding box=<id>`, where the `<id>` is an identifier. In your example this yields
11 Dirty hack: