[XeTeX] Underfull \vbox warning when using `listings'

Joe Pleso joe.pleso at gmail.com
Sun Oct 25 21:03:55 CET 2009


> > I'm trying to list some source code using the package `listings'.
> > It works very good when the code is short. However, when the code is
> > long enough to cover at lease one whole page, XeLaTeX gives a
> > warning like this:
> >
> >         Underfull \vbox (badness 10000) has occurred while \output
> > is active [2]
>
> This is just a guess: before the code starts, put
>   \raggedbottom
> and after the code ends put
>   \flushbottom
>
> I suspect there's no stretchability between the lines of listings
> code, so there's no way that (Xe)TeX can exactly fill up the page like
> it wants to. (In a two-sided book, the goal is to have the textblock
> finish at the same position on each facing page.)
>
> Hope this works!
> Will

> >hi Will, it works! :)

As Will pointed out, the lack of stretchability is the problem. An
alternate solution is to stick some stretchability in manually with:

\lstset{lineskip=0pt plus 1fil}

Joe


More information about the XeTeX mailing list