I have a few pictures where the box around them is too big. The code below is an example. In this case the figure goes too far to the right. Can anyone help me get these under control?
\begin{figure}
\begin{centering}
\tcbox{
\begin{minipage}{.5\textwidth}
\begin{tikzpicture}
\node (F1) at (0,0) [draw, shape=circle] {F1};
\node (B1) at (0,2.5) [draw, shape=circle] {B1};
\node (B2) at (2.5,2.5) [draw, shape=circle] {B2};
\node (F2) at (2.5,0) [draw, shape=circle] {F2};
\node (F3) at (2.5,-2.5) [draw, shape=circle] {F3};
\draw [-{Stealth[scale=3.0]}] (F1) -- node[below left] {2} (B1);
\draw [-{Stealth[scale=3.0]}] (F1) -- node[below left] {3} (B2);
\draw [-{Stealth[scale=3.0]}] (F2) -- node[above left] {6} (B1);
\draw [-{Stealth[scale=3.0]}] (F1) -- node[below left] {1} (F2);
\draw [-{Stealth[scale=3.0]}] (F2) -- node[right] {1} (B2);
\draw [-{Stealth[scale=3.0]}] (F3) -- node[right] {1} (F2);
\end{tikzpicture}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\begin{tikzpicture}
\node (F1) at (0,0) [draw, shape=circle] {F1};
\node (B1) at (0,2.5) [draw, shape=circle] {B1};
\node (B2) at (2.5,2.5) [draw, shape=circle] {B2};
\node (F2) at (2.5,0) [draw, shape=circle] {F2};
\node (F3) at (2.5,-2.5) [draw, shape=circle] {F3};
\draw [-{Stealth[scale=3.0]}] (F1) -- node[below left] {2} (B1);
\draw [-{Stealth[scale=3.0]}] (F1) -- node[below left] {7} (B2);
\draw [-{Stealth[scale=3.0]}] (F2) -- node[above left] {6} (B1);
\draw [-{Stealth[scale=3.0]}] (F1) -- node[below left] {1} (F2);
\draw [-{Stealth[scale=3.0]}] (F2) -- node[right] {3} (B2);
\draw [-{Stealth[scale=3.0]}] (F3) -- node[right] {1} (F2);
\end{tikzpicture}
\end{minipage}%
}
\end{centering}
\end{figure}

0.5\textwidth, so naturally the\tcboxbecomes wider than\textwidthin total. – Torbjørn T. Dec 05 '17 at 11:07\tcbox{followed by a line break can add a space which moves the content to the right. TeX does take line breaks as spaces. To avoid this add a%to ignore the line break:\tcbox{%. – Martin Scharrer Dec 05 '17 at 11:30adjustboxpackage. – Martin Scharrer Dec 05 '17 at 11:31