I want to use marginfigure, but it is inserting space inline. Check out my minimal example:


Hello\begin{marginfigure}$2+2=4$\end{marginfigure}I'm new here.


enter image description here

As you can see, the "Hello I'm new here" is two different lines--I want a single line. Of course, one "solution" is to simply move the marginfigure; however, this is not an option for me.

1 Answer 1


The culprit appears to be the \FloatBarrier command (provided by the placeins package). If we remove the \FloatBarrier command from the code that generates the marginfigure, then no space is inserted:


% Remove \FloatBarrier from marginfigure definition
% to prevent unwanted spaces.
\makeatletter% so we can use @ commands
  %\FloatBarrier% removed because it adds unwanted white space
\makeatother% restore meaning of @


Hello\begin{marginfigure}$2+2=4$\end{marginfigure}I'm new here.

  • To make this work in Lyx, simply remove \makeatletter% so we can use @ commands and \makeatother% restore meaning of @ from the code and use everything else in between inside Document>Settings>LaTeX Preamble for Lyx.
    – Black Milk
    Oct 30, 2013 at 0:13
  • But is this simply a bug in tufte-latex, or is there some drawback to removing \FloatBarrier? Jan 9, 2019 at 22:47
  • Removing \FloatBarrier could allow LaTeX to place earlier figures after the margin figure so the numbering would appear out of sequence. You could remove \FloatBarrier and, if you notice there's a problem, write \FloatBarrier yourself in between paragraphs where it won't cause spacing problems.
    – godbyk
    Jan 10, 2019 at 3:52
  • Thank you godbyk... this is SO useful! (+1) Mar 9, 2019 at 2:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .