Open source LaTeX of Pharo By Example book - translated to brazilian Portuguese
Smalltalk Ruby C# Shell
Switch branches/tags
Nothing to show
Pull request Compare This branch is 98 commits behind SquareBracketAssociates:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Admin Script to convert OmniGraffle to png Jan 27, 2010
Alien alien chapter start Sep 14, 2010
Announcements first pass on announcement Jul 16, 2011
BasicClasses Small fixes to make all PBE1 tests green. May 10, 2011
BasicWidgets learned how to comment inline Sep 9, 2011
Block comment block chapter Sep 5, 2011
Collections Small fixes to make all PBE1 tests green. May 10, 2011
Concurrency Convert graffle figures to 300dpi png Jan 27, 2010
Coral first draft of coral Jun 30, 2011
Crude adding sven oroginal paper May 24, 2011
Encodings encodings draft seed Aug 8, 2011
Environment Large number of corrections from Max Leske in PBE1 and Exceptions cha… Mar 11, 2010
Exceptions cleaning block chapter Aug 17, 2011
FAQ Small fixes to make all PBE1 tests green. May 10, 2011
FileSystem two complement start Jul 4, 2011
FirstApp Large number of corrections from Max Leske in PBE1 and Exceptions cha… Mar 11, 2010
Float Changed nicolas email address to the gmail one. ifrance is dead 30 da… Apr 29, 2011
Glamour The chapter is now 99.5% done. All the pictures have been redone. The… Sep 7, 2011
Gofer adding some cool scripts to fetch packages from a project Aug 23, 2011
Installer Convert graffle figures to 300dpi png Jan 27, 2010
LDAP doing a pass on opal Jun 25, 2011
LittleNumbers Merge branch 'master' of github.com:SquareBracketAssociates/PharoByEx… Aug 1, 2011
Magma changed all label macros (\figlabel etc) Aug 16, 2009
Messages take out a period in an expression example. Jul 14, 2011
Metacello Edits and comments from Andrew while on holiday Sep 8, 2011
Metaclasses balance braces. Jul 13, 2011
Model Small fixes to make all PBE1 tests green. May 10, 2011
Mondrian minor changes. I will continue to work on it a bit later Sep 7, 2011
Monticello Small fixes to make the book compile and avoid undefined references Jun 26, 2011
Morphic Large number of corrections from Max Leske in PBE1 and Exceptions cha… Mar 11, 2010
Omnibrowser cleaning block chapter Aug 17, 2011
Opal fix some stuff, rewrite and comment Jul 15, 2011
PetitParser Small fix from Jannik Sep 1, 2011
Preface cleaning block chapter Aug 17, 2011
Profiling finish the chapter Profiling Sep 1, 2011
QuickTour Large number of corrections from Max Leske in PBE1 and Exceptions cha… Mar 11, 2010
Reef some feedback from esteban Jun 29, 2011
Reflection Small fixes to make all PBE1 tests green. May 10, 2011
Regex Small fixes to make all PBE1 tests green. May 10, 2011
RewriteRules info for when I will start to write a chapter Jan 13, 2011
SUnit Large number of corrections from Max Leske in PBE1 and Exceptions cha… Mar 11, 2010
Seaside Large number of corrections from Max Leske in PBE1 and Exceptions cha… Mar 11, 2010
Settings new screenshot with 1.3 Jul 21, 2011
Sockets minor comment Sep 6, 2011
Streams Convert graffle figures to 300dpi png Jan 27, 2010
Syntax Long list of errata from Erwann Wernli corrected Sep 18, 2009
Traits starting trait chapter Apr 19, 2011
VMClassFormat two complement start Jul 4, 2011
VMInstallation fixing version numbers Jun 14, 2011
VMIntro first chapter Jun 11, 2011
WillNotBeDone Fixing compilation Apr 16, 2011
figures adding expanders Aug 24, 2011
.gitignore ignore test files May 10, 2011
.svnignore Updated .svnignore Sep 18, 2009
Makefile Testing instructions May 10, 2011
PBE-Omnibus.bbl bbl; LOGs; TODOs Aug 12, 2009
PBE-Omnibus.tex figures in FAQ Sep 25, 2009
PBE-TO-DO.txt Small fixes to make all PBE1 tests green. May 10, 2011
PBE1.bbl Final small formatting fixes Aug 28, 2009
PBE1.tex first cut at FileSystem Feb 15, 2010
PBE2.tex Removed Omnibrowser Sep 7, 2011
PForInterprise.tex cleaning block chapter Aug 17, 2011
PVM.tex Little numbers Jun 20, 2011
README.markdown Testing instructions May 10, 2011
common.tex learned how to comment inline Sep 9, 2011
commonDemo.tex remove noisy tags; left TO-DO tags Jun 30, 2009
contributors.txt Adds the list of contributors Sep 21, 2010
errata.txt Syntax errors to be fixed Oct 23, 2010
examples.rb examples timestamp Sep 30, 2009
history.sh history Jul 15, 2009
history.txt preparing test version of omnibus for lulu Aug 12, 2009
pbe1-examples.txt Fix minus sign in listings for copy-paste May 16, 2010
pbe2-examples.txt Fix minus sign in listings for copy-paste May 16, 2010

README.markdown

Pharo by Example

This is the LaTeX source repository of the Pharo by Example books 1 and 2.

The public web site of the books is: http://pharobyexample.org/

All the source repos live here: http://github.com/SquareBracketAssociates/

See PBE-TO-DO.txt for status of tasks for PBE 1 and 2.

Contributing

To contribute to the book or to a translation project, please:

To start a new translation project:


License

This work is licensed under Creative Commons Attribution-ShareAlike 3.0 Unported http://creativecommons.org/licenses/by-sa/3.0/

You are free:

  • to Share -- to copy, distribute and transmit the work
  • to Remix -- to adapt the work

Under the following conditions:

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 PBE1.tex (resp. PBE2.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 PBE1.tex.
  • Remember to include its /figures/ subdirectory in the graphicspath, which is set in the preamble to PBE1.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 Pharo image and move it to the folder Pharo book folder. Do not use a 1-click image, since the actual image should be located at the same level as the PBE1.tex file.

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

MCHttpRepository
    location: 'http://www.squeaksource.com/PharoByExample'
    user: ''
    password: ''

Then evaluate the following expression in a workspace:

PBEmain new runTests

For PBE2, instead run:

PBE2main new runTests

This will automatically extract and run the tests in the LaTeX sources of the Pharo 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 PBE1.tex (resp. PBE2.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 PBE-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.

How to write tests in LaTeX

A sample test in the BasicClasses looks like this:

=\begin{code}{@TEST}
=a1 := { { 'harry' } } .
=a2 := a1 shallowCopy.
=(a1 at: 1) at: 1 put: 'sally'.
=(a2 at: 1) at: 1 --> 'sally'
=\end{code}

The "print it" invocation (-->) will generate an assertion.

The generated source code looks like this:

=test204
=	a1 := { { 'harry' } } .
=	a2 := a1 shallowCopy.
=	(a1 at: 1) at: 1 put: 'sally'.
=	self assert: [ (a2 at: 1) at: 1  ] value printString = '''sally'''

You may also silently declare or initialize variables immediately after @TEST, and you may now place comments after the test string:

=\begin{code}{@TEST |a b|}
=a := b := 'hello'.
=a == b --> true "two variables but one object"
=\end{code}

The generated testCase subclass is PBEBasicClassesTestCase.

The generated tests can be removed by evaluating "PBEmain removeOldTestCategory". This is done automatically whenever you do "PBEmain 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):

setenv TEXINPUTS ./local//:../local//:
	or (bash):
export TEXINPUTS=./local//:../local//:

If you are using a GUI like TeXshop, you must set the environment variable in ~/.MacOSX/environment.plist :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>TEXINPUTS</key>
	<string>./local//:../local//:</string>
</dict>
</plist>

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.