My code goes like this:
\begin{figure}[H]
\centering
\begin{tikzpicture}[scale=.8]
%*****************************************************************************************************************************
% C Í R C U L O S
\tkzDefPoint(0,0){A}
\tkzDefPoint(6,0){B}
\tkzLabelPoints(A,B)
\tkzDrawPoints(A,B)
\tkzDrawCircle[R](A,3cm)
\tkzDrawCircle[R](B,1.5cm)
\path[name path = R1] (0,0) circle (3cm);
\path[name path = r1] (6,0) circle (1.5cm);
\path[name path = R2] (0,0) --++ (-3,-3);
\path[name path = r2] (6,0) --++ (-1.5,-1.5);
%*****************************************************************************************************************************
% R A D I O S
\path[name intersections={of=R1 and R2, by={R}}];
\path[name intersections={of=r1 and r2, by={r}}];
\draw[->] (0,0) -- (R) node[midway,sloped,above] {$R$};
\draw[->] (6,0) -- (r) node[midway,sloped,above] {$r$};
%*****************************************************************************************************************************
% D I S T A N C I A S
\draw[<->] (0,4) -- (6,4) node[midway,fill=white] {$D$};
\tkzExtSimilitudeCenter(A,3)(B,1.5)
\tkzGetPoint{I}
\tkzDefTangent[from with R=I](A,3cm)
\tkzGetPoints{C}{D}
\tkzDefTangent[from with R=I](B,1.5cm)
\tkzGetPoints{C'}{D'}
\draw (C) -- (C');
\draw (D) -- (D');
\end{tikzpicture}
\caption{}
\label{fig:massmann}
\end{figure}
My tikzpicture was too wide, so I scaled it down to make it fit inside the document. However, what I get is this:
The figure name is the reference to know where the center is. As you can see, I'm using \centering, but my figure is not centered. I tried \begin{center}\end{center}, but it didn't work either. What can I do to center my figure?
Thanks in advance!
\draw[red] (current bounding box.north east) -- (current bounding box.north west) -- (current bounding box.south west) -- (current bounding box.south east) -- cycle;
at the end of yourtikzpicture
and you will see that the whole box will indeed be centered on the page. The bounding box is just extending further to the right than expected which makes your image appear off center.pgfinterruptboundingbox
(as also suggested for example here: tex.stackexchange.com/a/130209/134144 and here: tex.stackexchange.com/a/304905/134144) and place it around\tkzExtSimilitudeCenter
as in\begin{pgfinterruptboundingbox} \tkzExtSimilitudeCenter(A,3)(B,1.5) \end{pgfinterruptboundingbox}
.pgfinterruptboundingbox
environment and you can keep this invisible point just like it is.