i have a main.Tex file. In main there are text subfiles.
\subfile{Pregunta1.tex}
\subfile{Pregunta2.tex}
\subfile{Pregunta3.tex}
\subfile{Pregunta4.tex}
I want to put an image surrounded by text in the subfiles. The issue is, there is written this in subfile Pregunta2.tex:
...se puede hacer conectándolo a la simulación; esto se denomina \textit{Hardware-in-the-loop} (\textbf{HIL}).\begin{wrapfigure}{r}{.3\textwidth}
\centering
\includegraphics[width=.27\textwidth]{images/RTHIL.jpg}
\caption{This is the image.}
\end{wrapfigure}
\textbf{Las simulaciones eléctricas en tiempo real con HIL tienen muchas ventajas.} Una de ellas es que, para...
When i press recompile (in overleaf) with subfile open everything is ok (but only compiles that subfile).
But trying to recompile from the main open (so it shows all the document), happens that the image is behind the text.

I am using overleaf.
if someone can help me, would appreciate that. Sorry about my grammar, hope could be understood.
Best regards

