# caption under image too short

I want to put an image completely to the right of my document. However when I want the caption under it, the caption breaks in the middle and appears in parts under the image. But I want this caption to be just as long as the image. It looks like this now:

with my code:

\begin{wrapfigure}{r}{0.1\textwidth}
\vspace{-20pt}
\begin{center}
\end{center}

\caption{schematic of simple OTA}
\label{fig:schematic_simple}
\vspace{-10pt}
\end{wrapfigure}

• Welcome to TeX.SX! Please always add a minimal but working example to you question, not only a code snippet. This would help us to reproduce the problem and quickly find a solution. Apr 27 '19 at 12:50
• Apr 27 '19 at 12:51
• The size reserved to the image is too short (0.1\textwidth) that is, 10% of the text width. Inscrease it. Apr 27 '19 at 12:51

It should be noted that while wrapfig requires a width, if the specified width is less than the width of the image, it will use the larger value. Although in this case, it seems that the caption was using the specified width instead.

I added the \hrule to prevent the image from climbing above the text area.

\documentclass{article}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{lipsum}% MWE only
%\usepackage{showframe}
\begin{document}
\hrule height0pt %only needed for top of page
\begin{wrapfigure}{r}{0.48\textwidth}
\vspace{-\intextsep}%
\includegraphics[width=\linewidth]{example-image}
\caption{schematic of simple OTA}
\label{fig:schematic_simple}
\vspace{-\intextsep}%
\end{wrapfigure}
\lipsum[1-4]
\end{document}