Skip to content

Instantly share code, notes, and snippets.

@jfbu
Last active June 21, 2017 08:06
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/87e5bcfcc64c4199a942be1d5d51c608 to your computer and use it in GitHub Desktop.
Save jfbu/87e5bcfcc64c4199a942be1d5d51c608 to your computer and use it in GitHub Desktop.
\documentclass{article}
\newenvironment{foo}{}{}
\begin{document}
\begin{foo}
\noindent\begin{minipage}{\linewidth}
bar!
\end{minipage}
\end{foo}
There is blank line above me.
\end{document}
@jfbu
Copy link
Author

jfbu commented Jun 21, 2017

@davidcarlisle, thanks. Indeed pinging does not work and I don't get pings from your comments here either.

I see now clearer: with the -1sp, the first space remains at end of line (creating an overfull hbox), which is not as bad as moving it to next line, as it would then create a way underfull last line. (an empty one actually as the space is removed, being at its start)

With the full width, there is a way underfull (empty) last line. As the \unskip removed only one space, the first one makes TeX start a new line even though it will be discarded next.

Well this is very surprising nevertheless, because one could have thought that it was perfectly legitimate too to leave a trailing space at end of full last line, making it slightly overfull. This does look to me as a deficiency of TeX's handling of spaces at end of a paragraph, but I have not digged into tex.web

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