sarabander / sicp-pdf

SICP PDF with Texinfo and LaTeX source
http://sicpebook.wordpress.com/
4.26k stars 537 forks source link

! LaTeX Error: Too many unprocessed floats. #5

Closed mssun closed 10 years ago

mssun commented 10 years ago

I use XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Arch Linux) to compile the latest sicp.tex with ./texi-to-latex.pl sicp.texi ; xelatex sicp.tex. There is an error:

Overfull \hbox (8.2933pt too wide) in paragraph at lines 20689--20696
[]\EU1/LinuxBiolinumO(0)/bx/n/10.95 Exercise 3.73: \EU1/LinuxLibertineO(0)/m/n/
10.95 We can model electrical circuits using streams

! LaTeX Error: Too many unprocessed floats.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.20697 \begin{figure}[tb]
sarabander commented 10 years ago

Looks like TeX Live 2013 behaves a little differently than mine (TeX Live 2012/Debian). Or the newer Libertine fonts have slightly different metrics. I noticed I have smaller overfull:

Overfull \hbox (6.75995pt too wide) in paragraph at lines 20689--20696
[]\EU1/LinuxBiolinumO(0)/bx/n/10.95 Exercise 3.73: \EU1/LinuxLibertineO(0)/m/n/
10.95 We can model electrical circuits using streams

Somewhere a figure doesn't fit any more and the remaining figures pile up in the queue. Try to change the page geometry in sicp.tex. Starting on the line 68 is \usepackage[..]{geometry} declaration. Enlarge textwidth and textheight a bit, see what happens.

You could also insert \clearpage right before figure 3.33 on line 20696. Recompile with xelatex sicp.tex so that sicp.tex won't be overwritten.

If no luck, please share your sicp.log in Gist so I can see the error context and hunt down the offending figure.

mssun commented 10 years ago

I added 1mm to the textwidth and textheight as you said. It works fine now. Thank you. Maybe we should modify the source code to fit the new TeX Live or font.

sarabander commented 10 years ago

Glad to hear it worked.

I put the dimension change suggestion as a comment in the preamble.tex. I tried to recompile with larger width and height: even a tiny 0.2mm addition resulted in completely different page breaks. All the hard work steering the page breaks to good spots would be gone. So I keep the original dimensions for now. This also means that it's hard to recreate the current pagination with different software mix.

Maybe finding the offending figures and changing their dimensions in sicp.texi would be another solution. The Texinfo command for image inclusion has a dimension, for example:

@center @image{fig/chap1/Fig1.1g,31mm,,,.pdf}

The 31mm here means width. If we could find the overweight figures, we could make them a bit smaller and see what happens.

Thanks for pointing out the problem.

mssun commented 10 years ago

I tried to figure out the overweight figures, and found that Figure 3.32, 3.33, 3.34, 3.32,5, 3.37, 3.38 have the problem. If I comment these figures, the compilation is successful. Then I change the width to a smaller number. But the errors still come out.

sarabander commented 10 years ago

The culprit might be found even before 3.32. For example, 3.29 looks suspiciously big, and 3.31 looks very wide.

mssun commented 10 years ago

I reviewed the figures before 3.32. I found that the figures after 3.15 cannot be shown. I think 3.12-3.15 may cause the problem.

sarabander commented 10 years ago

That seems logical, 3.12-3.15 look as if they just barely fit vertically. I think I remember having trouble with them, why else are there \enlargethispage{\baselineskip} directives in the source. You could experiment reducing the width of the four figures from 72mm to 70mm or even less, height will reduce proportionally.