Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Adaptation to Kindle format #1

Merged
merged 3 commits into from

2 participants

@gavrie

Hi,

I did some quick hacking on your texinfo version of SICP to adapt it to the Kindle.
The standard PDF is not very Kindle-friendly. I made the pages smaller with less text; adapted it to the screen aspect ratio; and removed page numbers.

This is by all means a quick hack, but I thought this could be useful to others as well.

Regards,

Gavrie

Gavrie Phili... and others added some commits
@sarabander
Owner
@gavrie

Hi Andres,

Thanks for your suggestions!
I'll definitely look into them, and let you know if I make any improvements.

Regards,

-- Gavrie

@sarabander sarabander merged commit 58ae231 into sarabander:master
@sarabander
Owner

Hi Gavrie,

I've been doing some work on your Kindle adaption. Here is a preliminary version with just the first chapter reformatted: https://github.com/sarabander/sicp-pocket

Cheers,
Andres

@gavrie
@sarabander
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 21, 2011
  1. First shot at Kindle mode

    Gavrie Philipson authored
  2. More kindle hacks

    Gavrie Philipson authored
  3. Edited README via GitHub

    gavrie authored
This page is out of date. Refresh to see the latest.
Showing with 32 additions and 3 deletions.
  1. +6 −1 README
  2. +3 −0  src/sicp.texi
  3. +23 −2 src/texinfo.tex
View
7 README
@@ -4,4 +4,9 @@ Typography and layout are improved for better on-screen legibility.
It is based on Neil Van Dyke's Texinfo version: http://www.neilvandyke.org/sicp-texi/
-Official SICP page with HTML version: http://mitpress.mit.edu/sicp/
+Official SICP page with HTML version: http://mitpress.mit.edu/sicp/
+
+Adapted to Kindle format by Gavrie Philipson:
+* Page size matches the 600*800 screen aspect ratio of the Kindle
+* Page numbers have been removed
+* Size of text is larger and closer to standard Kindle ebooks
View
3  src/sicp.texi
@@ -1,5 +1,6 @@
\input texinfo
@input utopia
+@kindle
@comment **********************************************************
@setfilename sicp
@settitle Structure and Interpretation of Computer Programs, 2e
@@ -132,6 +133,8 @@ based on @url{http://www.neilvandyke.org/sicp-texi/, 2.neilvandyke4} (January 10
@end titlepage
@everyheading @| @| @thispage
+@headingsoff
+
@c to suppress the black boxes after overfull lines:
@finalout
View
25 src/texinfo.tex
@@ -253,7 +253,7 @@
\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
\newdimen\cornerlong \cornerlong=1pc
\newdimen\cornerthick \cornerthick=.3pt
-\newdimen\topandbottommargin \topandbottommargin=.75in
+\newdimen\topandbottommargin \topandbottommargin=0in
% Output a mark which sets \thischapter, \thissection and \thiscolor.
% We dump everything together because we only have one kind of mark.
@@ -754,7 +754,8 @@
% @endpage starts a new page without restarting footnote counter from zero % new def added by A.R
%
-\def\endpage{\par\vfill\par\penalty -20000}
+%\def\endpage{\par\vfill\par\penalty -20000}
+\def\endpage{}
% @exdent text....
% outputs text on separate line in roman font, starting at standard page margin
@@ -9184,6 +9185,26 @@
{11.5in}{8.8in}%
}}
+% Use @kindle for Kindle formatting (based on smallbook)
+\def\kindle{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \textleading = 20pt
+ %
+ % Parameters in order: 1) textheight; 2) textwidth;
+ % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
+ % 7) physical page height; 8) physical page width.
+ \internalpagesizes{7.5in}{5.5in}%
+ {-0.75in}{-0.75in}%
+ {0pt}{0pt}%
+ {8in}{6in}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .5cm
+}}
+
% Use @smallbook to reset parameters for 7x9.25 trim size.
\def\smallbook{{\globaldefs = 1
\parskip = 2pt plus 1pt
Something went wrong with that request. Please try again.