1

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: enter image description here

with my code:

\begin{wrapfigure}{r}{0.1\textwidth}
  \vspace{-20pt}
  \begin{center}
    \includegraphics[width=0.48\textwidth]{simple_OTA_empty_added.png}
  \end{center}

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

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}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.