Background
The PDF index can be built two ways:
- Auto-generated (default):
latexmk runs makeindex -l <base>.idx (see scripts/latexmkrc) producing <base>.ind, which mitpress/mit.cls inputs via \printindex{<base>} → \@input{<base>.ind}.
- Hand-edited: if
\UseHandEditedIndex{} is set in the preamble, mit.cls instead inputs hand-paginated.ind (mitpress/mit.cls:1292), a manually page-break-corrected copy of the index.
The hand-edited path exists because, for the printed book, makeindex's automatic column/page breaks aren't good enough — the index is hand-paginated just before sending the PDF to MIT Press.
Current state / problem
- The committed
latex_pdf/hand-paginated.ind is obsolete — the index has improved since it was made, so forcing it via \UseHandEditedIndex{} shipped a stale index on every build.
- It also blocked the Python edition PDF:
\UseHandEditedIndex{} lives in the shared preamble, so SICP_EDITION=py would try to \@input{hand-paginated.ind} (absent in latex_pdf_py/), and do.sh clean() would mv a non-existent file.
Change
The default build now uses the auto-generated <base>.ind (the \UseHandEditedIndex{} line in javascript/latexContent.js is commented out). A reference copy of the old hand-edited file is kept as latex_pdf/hand-paginated-example.ind so the expected format is visible.
Manual hand-pagination workflow (pre-MIT-Press, JS edition only)
When preparing the final print PDF:
- Build once to generate a fresh
latex_pdf/sicpjs.ind (the improved auto index).
- Copy it to
latex_pdf/hand-paginated.ind and hand-edit the page breaks / column balance (see hand-paginated-example.ind for the format).
- Uncomment
\UseHandEditedIndex{} in javascript/latexContent.js.
- Rebuild the PDF (
yarn pdf). The build now uses your hand-edited index.
- Revert the
latexContent.js change after producing the print PDF so normal builds stay on the auto index.
Notes:
hand-paginated.ind is per-edition and lives in the edition's latex_pdf*/ dir. do.sh clean() keeps any hand-paginated*.ind there — matched by filename, committed or not — while wiping the generated artifacts, so an in-progress hand-edited index survives a clean.
- This is a JS-edition concern; the Python edition has no hand-paginated index.
Background
The PDF index can be built two ways:
latexmkrunsmakeindex -l <base>.idx(seescripts/latexmkrc) producing<base>.ind, whichmitpress/mit.clsinputs via\printindex{<base>}→\@input{<base>.ind}.\UseHandEditedIndex{}is set in the preamble,mit.clsinstead inputshand-paginated.ind(mitpress/mit.cls:1292), a manually page-break-corrected copy of the index.The hand-edited path exists because, for the printed book,
makeindex's automatic column/page breaks aren't good enough — the index is hand-paginated just before sending the PDF to MIT Press.Current state / problem
latex_pdf/hand-paginated.indis obsolete — the index has improved since it was made, so forcing it via\UseHandEditedIndex{}shipped a stale index on every build.\UseHandEditedIndex{}lives in the shared preamble, soSICP_EDITION=pywould try to\@input{hand-paginated.ind}(absent inlatex_pdf_py/), anddo.sh clean()wouldmva non-existent file.Change
The default build now uses the auto-generated
<base>.ind(the\UseHandEditedIndex{}line injavascript/latexContent.jsis commented out). A reference copy of the old hand-edited file is kept aslatex_pdf/hand-paginated-example.indso the expected format is visible.Manual hand-pagination workflow (pre-MIT-Press, JS edition only)
When preparing the final print PDF:
latex_pdf/sicpjs.ind(the improved auto index).latex_pdf/hand-paginated.indand hand-edit the page breaks / column balance (seehand-paginated-example.indfor the format).\UseHandEditedIndex{}injavascript/latexContent.js.yarn pdf). The build now uses your hand-edited index.latexContent.jschange after producing the print PDF so normal builds stay on the auto index.Notes:
hand-paginated.indis per-edition and lives in the edition'slatex_pdf*/dir.do.sh clean()keeps anyhand-paginated*.indthere — matched by filename, committed or not — while wiping the generated artifacts, so an in-progress hand-edited index survives aclean.