sarabander / sicp-pdf

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

Code page breaks around figure weirdly #12

Closed marksherman closed 9 years ago

marksherman commented 9 years ago

on written page 331 (pdf page 359), a code example from the previous page (330) breaks across the page break. At the top of page 331, there is a figure, which includes code. The last few lines of the text code are separated by the figure code, and it is difficult to read.

Is the answer possibly in disallowing blocks of code to be broken across pages? Or prevent figures from being inserted into blocks of code?

Screen shot below shows the bottom of page 330 and the top of page 331, including the figure 3.6, and the in-text code split around it. There is also a footnote on page 330, further complicating the read.

The definition of make-withdraw spans the bottom of page 330 and 331, and is interrupted by footnote 14 AND Figure 3.6.

screen shot 2015-03-27 at 10 29 28 am

sarabander commented 9 years ago

Sorry for the delay, I solved the immediate issue by relocating a line of Latex code and produced the new PDF.

There are more pages where code or text still breaks uncomfortably. During the redesign in 2013 I spent weeks trying to make page breaks in good places. The automatic paginator couldn't always do a satisfactory job.

This kind of problem would benefit from a more sophisticated algorithm with good hindsight and foresight. Understanding Scheme's pretty-printing conventions and making aesthetic judgements would be a bonus.

marksherman commented 9 years ago

Thank you for your response! We greatly appreciate all of your effort (I'm an instructor of a course right now, and the whole class loves the pdf.)

I totally agree- sometimes the latex algorithms do their best, but they just don't have artistic judgement.

sarabander commented 9 years ago

Great, thanks for your help finding things to improve.