\documentclass{minimal}
\usepackage{tikz}
\usepackage{lipsum}
\begin{document}
\noindent
\begin{tikzpicture}[trim left = (box.west)]
\node[draw = red] (box) {%
\begin{minipage}{\textwidth}
\lipsum[1]
\end{minipage}
};
\node[left = 1cm] at (box.west) {hello};
\end{tikzpicture}
\lipsum[2]
\end{document}
Is there a way to force the box to have the same width as the text above ?
Without using if possible
\begin{minipage}{0.94\textwidth}
Thanks



minipagewith a width oftextwidth, your box is obviously larger than the text block below. Could you elaborate about what your problem is exactly? – SebGlav Aug 19 '22 at 14:38inner xsepand theinner ysepvalue. The red border adds by default anouter xsepandouter ysepto the size of the node (by default half the line width) so that the anchors of the node lie at the actual outside. So your actual TikZpicture is\textwidth + 2*/pgf/inner xsep + 2*/pgf/outer xsepwide. (But remember the bounding box issue of your previous question which would have ignored any outer seps anyway.) So:\begin{minipage}{\dimexpr\textwidth-.6666ex-.4pt\relax}would be a start. (Default inner sep is .3333ex and default linewidth is .4pt.) – Qrrbrbirlbel Aug 19 '22 at 14:49tcolorboxpackage? – Qrrbrbirlbel Aug 19 '22 at 14:52