Attribution. You must attribute the work in the manner specified by the author or
licensor (but not in any way that suggests that they endorse you or your use of the work).
Share Alike. If you alter, transform, or build upon this work, you may distribute
the resulting work only under the same, similar or a compatible license.
For any reuse or distribution, you must make clear to others the license terms of
this work. The best way to do this is with a link to this web page.
Any of the above conditions can be waived if you get permission from the copyright holder.
Nothing in this license impairs or restricts the author's moral rights.

Disclaimer

Your fair dealing and other rights are in no way affected by the above.
This is a human-readable summary of the Legal Code (the full license).

File structure

The main file is SBE.tex. Chapters are in subdirectories.
You can latex either the entire book, or each individual chapter.
Each chapter file starts and ends with the same incantation
which will optionally include macros or end the document if it is
latexed individually.

Use the \ct{} macro for in-line code.
Use the {method} {classdef} {example} and {script} environments for
multi-line code.

If you add a new chapter:

please be sure to include it from SBE.tex.

Remember to include its /figures/ subdirectory in the graphicspath,
which is set in the preamble to SBE.tex. Don't forget the trailing /

Please make sure the chapter compiles with latex both from the main book
and as a separate chapter.

Set the svn:ignore property on the chapter's directory. The command to do
this is svn propset svn:ignore -F .svnignore

IMPORTANT: Please check out a fresh copy of the book and compile the book
to verify that you have added all the dependent files (e.g., figures).

Makefile

To build the PDF of the book, simply run "make" in the Book folder.
Be sure you have texlive installed (see below).

Printing

The book has been reformatted to 6"x9" (for Lulu). If you want to print any
part of the book, you will find that printing 2 up at 140% works well.

Testing

Tests are automatically generated from the LaTeX sources.

Grab a recent Squeak image and move it to the folder Squeak book folder. Do not use a 1-click image, since the actual image should be located at the same level as the SBE.tex file.

To run the tests, load the package SBE-Testing from the following SqueakSource project:

This will automatically extract and run the tests in the LaTeX sources of the Squeak by Example book. It will also load the hands-on exercises, and check that they are working. (Some tests may also be included from the dependent hands-on packages.)

This will parse (using Regex) the SBE.tex to locate the included chapter files, parse each chapter file to search for @TEST annotations, generate test case classes for each chapter with tests in a new category SBE-GeneratedTests, and generate a test method (numbered by the line number in the chapter) for each test found. (NB: Any old generated tests are removed before new ones are generated.) Finally, by sending "runTests", a TestRunner is opened on the new category, and all those tests are run.

The generated tests can be removed by evaluating "SBEmain removeOldTestCategory". This is done automatically whenever you do "SBEmain new runTests".

LaTeX version

Please use at least texlive 2005.
http://www.tug.org/texlive/
If you are using TeXshop or another GUI, be sure to set the path to the tex executables. E.g., in TeXShop>Preferences>Engine set the path to:
/usr/local/texlive/2005/bin/powerpc-darwin

For intel macs you will need texlive 2007. The path should be
/usr/local/texlive/2007/bin/i386-darwin

OmniGraffle files

Please be sure to use Lucida Sans, not Helvetica, or you may have problems
uploading the PDF to Lulu. See the font embedding FAQ on lulu.com
See more detailed instructions in Cover/README.txt

Style files

To inform latex about the location of local style files, set the following environment variable (tcsh):

NB: You may need to logout and login again after creating or modifying this file.
Note colon at end of TEXINPUTS that means "append current value here"
(eg local has higher priority). Double slash means search recursively.

Bibliography

The bibliography file scg.bib is available from a separate git repository:

git clone git@scg.unibe.ch:scgbib

Alternatively, you can check out a read-only version as follows:

git clone git://scg.unibe.ch/scgbib

You should separately check out this file and link it in wherever it is needed.