I am trying to center the caption of a figure in latex.
\begin{wrapfigure}{r}{0.50 \textwidth}
\vspace{-20pt}
\begin{center}
\resizebox{0.5\linewidth}{!}{ \subimport{./Figures/}{vector.tex}}
\vspace{-10pt}
\captionsetup{margin=1.8cm}
\caption{Graphic representation of vectors}
\label{fig:vectors}
\end{center}
\vspace{-10pt}
\end{wrapfigure}
and my figure is done in another file as follows
\documentclass[float=false, crop=false]{standalone}
\usepackage[subpreambles=true]{standalone}
\usepackage{import}
\begin{document}
\begin{tikzpicture}
\draw[thin,gray!40] (-2,-2) grid (2,2);
\draw[line width=2pt,blue,-stealth](0,0)--(1,1) node[anchor=south west]{$\boldsymbol{}$};
\draw[line width=2pt,red,-stealth](-2,0)--(-1,1) node[anchor=south west]{$\boldsymbol{}$};
\draw[line width=2pt,green,-stealth](-1,-1)--(-2,-2) node[anchor=north east]{$\boldsymbol{}$};
\draw[line width=2pt,magenta,-stealth](2,0)--(1,-1) node[anchor=north east]{$\boldsymbol{}$};
\end{tikzpicture}
\end{document}
I would like to have the caption center and the figure a little bit larger so the figure is larger of the caption. I also would like that the text continues around the figure and not only in the left part of the figure.
Thanks
Best Answer
like this?
note:
tikzpicture
astex
file can not be scaled by\resizebox
. if you like increase it size, you should usescale
in image code or include image as pdf file and than useincludegraphics[width=<length>]{<path>/<image name>}
.or you mean to have caption in centering justification?
for above caption i use