2

I want to add a figure at the right of the text like in the figure. I have used the wrapfigure option but a blank space appears at the bottom of the figure. The code I am using is the following:

\begin{wrapfigure}{r}{0.45\linewidth}
\centering
\includegraphics[width=0.35\textwidth]{baseDeDatos/images/spectrogram3.png}
\caption{log-espectrograma de un fragmento de voz.}
\label{fig:espectrograma}
\end{wrapfigure}

How can a delete this white space avoiding the linebreak between "paso a" and "paso"

Thanks.

the figure

Bernard
  • 271,350
  • 2
    Welcome to TeX SX! You can use the number of narrow lines as an optional argument of wrapfigure. If you can't make it work, please post a compilable code reproducing the problem. Note that, in general, this environment doesn't work well near a list environment. – Bernard Aug 30 '19 at 19:17
  • 1
    Keep in mind that wrapfigure assumes that every line of text take \baselineskip and counts the number of lines. One solution is to add \WFclear to the text, but it starts a new paragraph. Another is to overlay anything which takes up extra space (such as the entire itemize) with lines of blank text (see wrapspacer from https://tex.stackexchange.com/questions/390520/have-titlerule-not-overlap-wrapfigure/390544?s=5%7C0.0000#390544). – John Kormylo Aug 30 '19 at 20:51

1 Answers1

0

I've added the [lineheight] argument to the wrapfigure environment. I'm not sure whether this is a good solution since I'm not a LaTeX professional, but at least it worked for me (not very well, because I haven't managed to remove the blank space at the top of the figure, but the bottom blank space was deleted). This is how my figure had looked before adding the argument:

\begin{wrapfigure}{R}{0.5\textwidth}
  \centering
  \includegraphics[width=0.48\textwidth]{images/some_name.png}
  \caption{caption}
\end{wrapfigure}

enter image description here

and this is how it looks after:

\begin{wrapfigure}[14]{R}{0.5\textwidth}
  \centering
  \includegraphics[width=0.48\textwidth]{images/some_name.png}
  \caption{Caption}
\end{wrapfigure}

enter image description here

UPD 1

I've managed to also remove the top blank space. The command \vspace{} helps:

\begin{wrapfigure}[12]{R}{0.5\textwidth}
  \centering
  \vspace{-25pt}
  \includegraphics[width=0.48\textwidth]{images/some_name.png}
  \caption{Caption}
\end{wrapfigure}

The code above produces

enter image description here