Skip to content

Instantly share code, notes, and snippets.

@yig
Created May 17, 2016 04:39
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save yig/70bd3293fb7b452f5807967a40fe0c2e to your computer and use it in GitHub Desktop.
Save yig/70bd3293fb7b452f5807967a40fe0c2e to your computer and use it in GitHub Desktop.
Eliminate white space around wrapfigure environments in LaTeX.
%% The typical answer for how to eliminate white space in wrapfigure doesn't work for me (I'm using a SIGGRAPH style sheet):
%% http://tex.stackexchange.com/questions/111393/too-much-space-around-wrap-figure
%% Instead, let's just offset the image.
%% The horizontal white space is \columnsep and the vertical white space is \intextsep.
%% Subtract them from the column width and offset the image accordingly.
%% How to move an image:
%% http://tex.stackexchange.com/questions/107340/how-to-shift-graphics-adjust-placement-of-figure-with-includegraphics
\begin{wrapfigure}[11]{R}{1in - .75\columnsep}
%\centering
\vspace{-\intextsep}
\hspace*{-.75\columnsep}\includegraphics[width=1in]{path/to/image}
\end{wrapfigure}
@yig
Copy link
Author

yig commented Oct 5, 2018

This trick won't widen a caption, if your inset figure has one.

@alecjacobson
Copy link

@yig, do you have a solution for captions?

@alecjacobson
Copy link

I found an old solution I'd even commented on in the past:
https://tex.stackexchange.com/a/106146/13600

@LexxaRRioo
Copy link

Thanks a lot! I spent around 3 hours searching and finally found solution. It works!

@YonghaoYue
Copy link

Wow, this is very helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment