How to raise a wrapfig a bit up above the introduction (first) section title?
- User
How to raise a wrapfig a bit up above the introduction (first) section title?
- Assistant
Ah! You want a wrapfig (from the wrapfig package in LaTeX) to start slightly above the section title, instead of the default behavior where it aligns with the text immediately following the section title. This is tricky because wrapfig usually wraps text, and LaTeX doesn’t let floats overlap section titles by default. But there are a few ways to achieve it. Here’s a clean approach:
- Use a negative vspace before the wrapfigure latexCopiar código\documentclass{article} \usepackage{wrapfig} \usepackage{lipsum} % for dummy text
\begin{document}
\section{Introduction}
\vspace{-2em} % move the figure up by 2em \begin{wrapfigure}{r}{0.4\textwidth} \centering \rule{0.38\textwidth}{5cm} % placeholder for your figure \caption{My figure} \end{wrapfigure}