Difference between revisions of "ConTeXt Standalone/Mac Installation"

From Wiki
Jump to navigation Jump to search
(New page: < ConTeXt Minimals This page describes an alternative of installing ConTeXt Minimals on Mac OS X. In particular it describes how to configure some GUI applications to work well wi...)
 
m (adde category)
Line 100: Line 100:
  
 
All the process requires that you have installed on your machine rsync, ruby and perl. But if you are on macosx, Apple should already have provided it, so at 99% there should not be problems.
 
All the process requires that you have installed on your machine rsync, ruby and perl. But if you are on macosx, Apple should already have provided it, so at 99% there should not be problems.
 +
 +
[[Category:Installation]]

Revision as of 13:05, 28 November 2008

< ConTeXt Minimals

This page describes an alternative of installing ConTeXt Minimals on Mac OS X. In particular it describes how to configure some GUI applications to work well with minimals.

(For command-line gurus it is enough to follow the three steps described in ConTeXt Minimals.)

Mac newbie installation and configuration

The following assumes that you want to use ConTeXt and you are a not inside unix world (otherwise, see before and after). It guides you to install ConTeXt minimal installation under Mac in the typical Applications folder. Then it gives you some information about how to configure Smultron and TeXShop to work as an editor for ConTeXt. Smultron is a mac-only, open source text editor which is very easy to use and at the same time powerful (see also [1]).

ConTeXt installation

1. Create a folder inside your Applications folder and name it "ConTeXtMinimals"

2. Open a Terminal window (i.e. go under Utilities and open the Terminal app: a little window pops up)

3. type this: cd /Applications/ConTeXtMinimals/ it means "change directory": now we are working under the folder we have created

4. type this: rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh .

we have called rsync, a program which goes on the contexgarden site (--> you must be connected to internet) and download all the necessary files for us. Here, it simply downloads the little file first-setup.sh: it contains a set of instructions which allow for automatic downloads (e.g. it selects the right files depending on which platform you are). So you have now to type in Terminal ./first-setup.sh in order to execute it. As a consequence of running such a file, a big (but not so big) download and install process starts.

Now (well, after a while) we have all the required files into the /Applications/ConTeXtMinimals folder

Smultron installation and configuration

1. Smultron is a mac application. To install it, simply download the dmg and put the app under the Applications folder (as usual)

2. Open Smultron and go under Tools-->Handle Commands-->Show Commands Window

3. The resulting window allows you to define some commands which can be executed by Smultron. Substantially, this means that Smultron opens for you a Terminal, types the code you want and presses return.

4. Create a new command by pressing the "New Command" button and type a name (e.g. "minimalsTexexec"). Then, write in the text field at the bottom:

#!/bin/sh 

cd /Applications/ConTeXtMinimals/ 
. /Applications/ConTeXtMinimals/tex/setuptex /Applications/ConTeXtMinimals/tex
cd %%d
texexec %%p

Texexec is the command you should call from the Terminal to run ConTeXt. Now Smultron can do it for you.

5. Write your ConTeXt file with Smultron and save it. When you want to compile it, simply go under Tools-->Commands-->Other-->minimalsTexexec. This will generate a pdf file in the same folder of your .tex file.

6. If you want to experiment with LuaTeX simply add another command (you can name it e.g. "minimalsLua") with this text in its text field:

#!/bin/sh 
cd /Applications/ConTeXtMinimals/ 
. /Applications/ConTeXtMinimals/tex/setuptex /Applications/ConTeXtMinimals/tex
cd %%d
context %%p

6b. If you explore the Commands window, you will see that clicking under the Shortcut tab you can insert a shortcut

6c. If you want to see what ConTeXs is telling you (which is fundamental in case of unexpected behaviors) you can select Tools-->Handle Commands-->Show Command Result Window. This will open a window mirroring the content of the Terminal (i.e. what ConTeXt is communicating you)

7. If you want an automatic update of the pdf you are workin on you can use another mac app, pdfview. You have simply to install it, open your pdf file and choose the automatic update option. Every time you recompile form Smultron (or by another editor), it updates the displayed pdf

We are not using the famous TeXShop editor, because it is slighlty more complicated and typically you grab it bundled with a TeX distribution (like MacTeX), and opportunely configured. By using Smultron, we have created a completely autonomous and lightweight ConTeXTMinimals installation which can work aside MacTeX/TeXShop installation. More, by pdfview we have auto update, which is one of the very relevant feature of TeXShop (If you do not know about all this stuff, see Mac installation

TeXShop installation and configuration

1. TeXShop is a popular TeX editor for Mac OS X. To install it, download the disk image and put the app under the Applications folder (as usual)

2. Launch TeXShop. It will automatically create support files in your home folder. This will be the place where the TeXShop engine for ConTeXt Minimals will be located.

3. Create an empty text document with your favorite text editor or TeXShop. Then, insert this text in the document:

#!/bin/bash
source /Applications/ConTeXtMinimals/tex/setuptex /Applications/ConTeXtMinimals/tex
texexec "$1"

4. Save this document under "Library/TeXShop/Engines/" in your home folder and name it "ConTeXt Minimals.engine".

4a. chmod +x the "ConTeXt Minimals" file.

5. Close all open documents in TeXShop, open a new one and select "ConTeXt Minimals" in the list next to the "Typeset" button in the toolbar. This will instruct TeXShop to use this engine to compose your documents.

6. Edit your ConTeXt document with TeXShop. When you want to typeset it, simply hit Command-T or go under Composition-->Composer. This will generate a PDF file in the same folder of your .tex file.

Notes

All the process requires that you have installed on your machine rsync, ruby and perl. But if you are on macosx, Apple should already have provided it, so at 99% there should not be problems.