Skip to content

Instantly share code, notes, and snippets.

@jfbu
Created June 20, 2017 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfbu/2f3d04414359f716f98ea64dac91eb0e to your computer and use it in GitHub Desktop.
Save jfbu/2f3d04414359f716f98ea64dac91eb0e to your computer and use it in GitHub Desktop.
illustration of a peculiarity of TeX paragraph building
\documentclass{article}
\usepackage{mwe}
\begin{document}
% or anything filling the line with less than inter-word space shrinkability
\noindent\rule{\linewidth}{1pt} % <-- we deliberately leave a space token here
\begin{figure}[htbp]
\centering
% only by way of example, close to real life examples
\includegraphics[height=1cm]{example-image-a}
\caption{Hello, is there extra space above figure env?}
\end{figure}
\noindent\rule{\linewidth}{1pt}
\begin{figure}[htbp]
\centering
\includegraphics[height=1cm]{example-image-a}
\caption{This one doesn't have any...}
\end{figure}
\end{document}
@jfbu
Copy link
Author

jfbu commented Jun 21, 2017

for example with

AAAAAAAA  AAAAAAAA  AAAAAAAA  AAAAAAAA  AAAAAAAA IIII.
\begin{figure}[htbp]
  \centering
  x
  \caption{Hello, is there extra space above figure env?}
\end{figure} {} {}

and the modified sphack, there is no issue.

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