The following applies to usesrs who wish to use my set of tools to process
Cadabra notebooks on MacOSX.

0. REQUIREMENTS
---------------

1. MacOSX 10.4.x or later
2. TextMate : if you don't have this you can still use the tools (but with less
   ease) by using the scripts for Linux (see README-linux.txt).
3. GPC GNU Pascal complier (see note 3 below).
4. A patched version of Cadabra to allow % as a comment marker (see note 4 below).

1. USAGE
---------

1. Open a cadabra source document (eg. sample.cdbp) in TextMate.

2. Press apple-R

		A pdf preview window should pop up displaying the formatted Cadabra output.

		You can also highlight a section of the current text and press apple-R	
		This will display the output in a seprate window called "selected.pdf"

		WARNING : When you press apple-R the script will save your current
		document. You can always undo any changes in TextMate by pressing
		apple-Z.

2. INSTALLATION
----------------

1. Extract the contents of the archive,

		gunzip lcb-macosx-cdb.tar.gz
		tar xf lcb-macosx-cdb.tar
		cd lcb-macosx-cdb
			
2. Install the TextMate bundle by double clicking on the "Cadabra" icon or by typing

		cp -rf Cadabra.tmbundle ~/Library/Application\ Support/TextMate/Bundles/.
		
		(you might first need to create the TextMate/Bundles folder)
			
3. Copy the cadabra LaTeX class file to a place where TeX can find it, for example

		cp tex/* ~/tex/inputs/cadabra/.
			
4. Copy the shell scripts to somewhere on your path, for example

		cp sh/* ~/local/sh/.
		
5. Compile the pascal programs.

		cd src; make; cd ..
		
		note: this will create a new directory ~/pascal/units/
		
6. Copy the binaries to somewhere on your path, for example

		cp bin/* ~/local/bin/.

7. Open TextMate and then open the bundle editor (cntl-opt-apple C). 
   Click on the triangle pointing to Cadabra, then click on "Run Cadabra and LaTeX".
   This should reveal the shell script used to process the Cadabra source and produce the
   pdf output. Look closely at the first few lines. They should look like the following

	TM_cadabra=$HOME/local/bin/cadabra
	TM_cdbmerge=$HOME/local/bin/cdbmerge
	TM_cdbpreproc=$HOME/local/bin/cdbpreproc
	TM_cdbpstproc=$HOME/local/bin/cdbpstproc
	TM_latex=/usr/texbin/pdflatex

   Check that the paths to cadabra, cdbmerge, pdflatex, etc. are correct.

   if you have any doubts as to what the correct path should be, simply use the
   command "which" in a terminal window, for example

		which cadabra
		which pdflatex

   Note the output generated and then edit the script accordingly. You may need
	to make similar changes to the other commands. Note that for the changes to
	take effect you must frist close the bundle editor window.
		
3. NOTES
---------

1. The scripts do not properly process some Cababra commands, in particular
   @tree.

2. Don't use ; after any of the declaration statements, for example don't write
   @reset; Doing so will confuse the cdbmerge program and your output will not
   appear in the correct place.

3. MacOSX binaries for GPC pascal compiler for can be found here
	http://www.microbizz.nl/gpc.html and here
	http://users.monash.edu.au/~leo/software/pascal/index.html
	These are available as disk image and are very easy to install (but you will
	need an adminstrator password). Compiling fro source is possible but not
	really worth the effort.

4. The patch file for Cadabra-1.0 can be found in cadabra/patch. You will need to apply
	this to the sources and re-compile cadabra.
	
4. DISCLAIMER
-------------

TextMate is a commercial (but very reasonably priced) editor for MacOSX. The home page is
http://macromates.com/   (I have no commerical connection with the makers of TextMate).

---------------------------------------------------------------------------------------------
Leo Brewin
School of Mathematical Sciences
Monash University
Australia
http://users.monash.edu.au/~leo
