Difference between revisions of "Mac Installation"

From Wiki
Jump to navigation Jump to search
m (formatting correct)
m (minor corrections)
Line 7: Line 7:
 
Naturally, there are other ways, but they are more for experienced Mac users and those comfortable with using the command line.
 
Naturally, there are other ways, but they are more for experienced Mac users and those comfortable with using the command line.
  
  * The simplest method is to use MacTeX, but as TeXLive you will not have the most recent binaries (generally frozen for a year).
+
* The simplest method is to use MacTeX, but as TeXLive you will not have the most recent binaries (generally frozen for a year).
 
   The advantage is that you get TeX et al, fonts and some nice utilities, including the editor TeXShop (highly recommended) which
 
   The advantage is that you get TeX et al, fonts and some nice utilities, including the editor TeXShop (highly recommended) which
 
   can run ConTeXt and TeX-Variants from within the editor without any knowledge of the command line.
 
   can run ConTeXt and TeX-Variants from within the editor without any knowledge of the command line.
 
   
 
   
 
  * ConTeXt Suite (Standalone) is recommended for those that wish to have the latest stable version, latest developmental version,
 
  * ConTeXt Suite (Standalone) is recommended for those that wish to have the latest stable version, latest developmental version,
   or wish to run several versions of ConTeXt side by side. The side to this approach is that you need some knowledge of how to use  
+
   or wish to run several versions of ConTeXt side by side. The downside to the side by side approach is that you need some
  the command line and how to set-up the paths in a Unix environment. Well, actually not that much if you use the editor TeXShop.
+
  knowledge of how to use the command line and how to set-up the paths in a Unix environment.  
 +
  Well, actually not that much if you use an editor or IDE, like TeXShop and TeXWorks.
 
   
 
   
 
  * ''For the best possible experience and ease of installation a combination of MacTeX and ConTeXt Suite is advised.''  
 
  * ''For the best possible experience and ease of installation a combination of MacTeX and ConTeXt Suite is advised.''  
Line 26: Line 27:
  
 
=== Installing MacTeX ===
 
=== Installing MacTeX ===
 
  
 
* [http://www.tug.org/mactex/ Download and follow the instructions from the MacTeX site] (Installer larger than 2GB, instructions for slower internet connections on the site of MacTeX)
 
* [http://www.tug.org/mactex/ Download and follow the instructions from the MacTeX site] (Installer larger than 2GB, instructions for slower internet connections on the site of MacTeX)
Line 38: Line 38:
 
If you wish to use "ConTeXt Suite" from the command line you can use the Mac tutorial in the Mac section under [[ConTeXt Standalone|ConTeXt Suite]] or
 
If you wish to use "ConTeXt Suite" from the command line you can use the Mac tutorial in the Mac section under [[ConTeXt Standalone|ConTeXt Suite]] or
  
  Use the tutorial below that is more Mac OSX centric.  We do use the command line program Terminal of Mac OSX as it poses the easiest way to get things done. But, do not worry as the process is straight foreword and you can just copy and paste the commands into the Terminal!  
+
  Use the tutorial below that is more Mac OSX centric.  We do use the command line program Terminal of Mac OSX as it poses
 +
the easiest way to get things done. But, do not worry as the process is straight foreword and you can just copy and paste
 +
the commands into the Terminal!  
  
+
=== Using the Commandline ===
 +
 
 +
If you do not what a command tool is, do not worry. It is simple a program in which commands are entered as text and then executed. Mac OS comes with two tools for entering command lines the Terminal and a X11 environment X11 or Xquartz, depending on which Mac OSX version you are running. These programs can be found in the Utilities-folder of the Applications-Folder.
 +
 
 +
Once you have started one of the programs, all you have to do is enter a command and press the RETURN-key and the command will be executed.
  
 
=== Single user installation ===
 
=== Single user installation ===
Line 50: Line 56:
 
In the Terminal after each command you have to press the RETURN-key.
 
In the Terminal after each command you have to press the RETURN-key.
  
* Start the Terminal you will find it in the Utility-folder in the Applications-folder.
+
* Start the Terminal you will find it in the Utilities-folder in the Applications-folder.
  
 
* Create the folder/directory ''context'' in your ''HOME folder'':
 
* Create the folder/directory ''context'' in your ''HOME folder'':
Line 71: Line 77:
 
When the installation process is finished you will see a message telling you that you have to initialize ConTeXt each time you want to run ConTeXt or to add the path to your PATH-variable of your shell. You can ignore this message if you are going to use TeXShop. Setting-up TeXShop is described below..
 
When the installation process is finished you will see a message telling you that you have to initialize ConTeXt each time you want to run ConTeXt or to add the path to your PATH-variable of your shell. You can ignore this message if you are going to use TeXShop. Setting-up TeXShop is described below..
  
For easier your connivance you can copy all the command in this block and hit RETURN:
+
For easier your connivance you can copy all the commands in this block, paste it into the Terminal and hit RETURN:
 
  mkdir $HOME/context
 
  mkdir $HOME/context
 
  rsync -av rsync://contextgarden.net/minimals/setup/first-setup.sh .
 
  rsync -av rsync://contextgarden.net/minimals/setup/first-setup.sh .
 
  sh ./first-setup.sh --modules=all --engine=luatex
 
  sh ./first-setup.sh --modules=all --engine=luatex
 
  
 
=== Alterantive ConTeXt Versions ===
 
=== Alterantive ConTeXt Versions ===
Line 98: Line 103:
  
 
You can install different versions of ConTeXt next to each other. All you need to do is create a new directory for this version and follow the instructions above using the name of the directory instead of the name ''context''.
 
You can install different versions of ConTeXt next to each other. All you need to do is create a new directory for this version and follow the instructions above using the name of the directory instead of the name ''context''.
BEWARE: If you use the command line you have to set up the paths for your shell. If you use TeXShop you have to set-up engines for TeXShop for each version, this process in describe below in the section ''Creating and Installing a TeXShop Engine''   
+
BEWARE: If you use the command line you have to set up the paths for your shell. If you use TeXShop you have to set-up engines for TeXShop for each version, this process is describe below in the section ''Creating and Installing a TeXShop Engine''   
  
 
=== Keeping ConTeXt Up-To-Date ===
 
=== Keeping ConTeXt Up-To-Date ===
Line 114: Line 119:
 
   
 
   
 
If you are using a different version then use the use the appropriate options for first-setup.sh!!
 
If you are using a different version then use the use the appropriate options for first-setup.sh!!
 
  
 
=== System-wide installation ===
 
=== System-wide installation ===
Line 145: Line 149:
  
 
By default only the beta version is installed, If you want a more stable version or third party content then look at the section ''Alterantive ConTeXt Versions'' above. All you need to do is add the option to the installation command in this section.
 
By default only the beta version is installed, If you want a more stable version or third party content then look at the section ''Alterantive ConTeXt Versions'' above. All you need to do is add the option to the installation command in this section.
 
  
  
 
== TeXShop and TeXworks ==
 
== TeXShop and TeXworks ==
  
Typically, both editors work out of the box with MacTeX, but if you are using version earlier than those shipped with MacTeX 2011 (TeXShop 2.42) you need to configure engines for ConTeXt manually.
+
Typically, both editors work out of the box with MacTeX, but if you are using a version earlier than those shipped with MacTeX 2011 (TeXShop 2.42) you need to configure engines for ConTeXt manually.
  
 
=== TeXShop ===
 
=== TeXShop ===
Line 177: Line 180:
 
   
 
   
 
===== Creating an ''Engine'' for TeXShop =====
 
===== Creating an ''Engine'' for TeXShop =====
 +
 
Actually, ''engine'' is somewhat misleading. In TeXShop an ''engine'' is a script that contains commands that are use to typeset your documents. TeXShop comes with many engines set up to run TeX, LaTeX, Xe(La)TeX and ConTeXt MKII and MKIV that have been installed via MacTeX.
 
Actually, ''engine'' is somewhat misleading. In TeXShop an ''engine'' is a script that contains commands that are use to typeset your documents. TeXShop comes with many engines set up to run TeX, LaTeX, Xe(La)TeX and ConTeXt MKII and MKIV that have been installed via MacTeX.
  
Line 204: Line 208:
 
  set path= (/Users/username/context/tex/texmf-osx-64/bin  $path /usr/local/bin)
 
  set path= (/Users/username/context/tex/texmf-osx-64/bin  $path /usr/local/bin)
 
  If you installed in a different location then change /Users/username/context/ to the location where you
 
  If you installed in a different location then change /Users/username/context/ to the location where you
  installed ConTeXt standalone. ''Do not forget to change username in the line above to your actual username!!''  
+
installed ConTeXt standalone. ''Do not forget to change username in the line above to your actual username!!''  
  
 
* save the file again
 
* save the file again
Line 251: Line 255:
  
 
* In the other window navigate to the Applications-folder and to where TeXShop was installed.
 
* In the other window navigate to the Applications-folder and to where TeXShop was installed.
  If you installed via MacTeX Applications->TeX->TexShop
+
  If you installed via MacTeX you will find it in Applications->TeX->TexShop
 
   
 
   
 
* Open the folder containing the default engines for TeXShop
 
* Open the folder containing the default engines for TeXShop
Line 265: Line 269:
  
 
Do not forget that you have to also copy your own copy of the newly created engine to your own ''Engine''-folder!!
 
Do not forget that you have to also copy your own copy of the newly created engine to your own ''Engine''-folder!!
 
  
  

Revision as of 14:15, 15 October 2013

< Installation | TeX Distributions >

Introduction

For getting ConTeXt onto a Mac there are basically two routes to take. MacTeX (TeXLive distribution made especially for Mac OSX) and the ConTeXt Suite (Standalone), recommended for all those that want the most current versions or latest developments in ConTeXt.

Naturally, there are other ways, but they are more for experienced Mac users and those comfortable with using the command line.

* The simplest method is to use MacTeX, but as TeXLive you will not have the most recent binaries (generally frozen for a year).
 The advantage is that you get TeX et al, fonts and some nice utilities, including the editor TeXShop (highly recommended) which
 can run ConTeXt and TeX-Variants from within the editor without any knowledge of the command line.

* ConTeXt Suite (Standalone) is recommended for those that wish to have the latest stable version, latest developmental version,
 or wish to run several versions of ConTeXt side by side. The downside to the side by side approach is that you need some  
 knowledge of how to use the command line and how to set-up the paths in a Unix environment. 
 Well, actually not that much if you use an editor or IDE, like TeXShop and TeXWorks.

* For the best possible experience and ease of installation a combination of MacTeX and ConTeXt Suite is advised. 

MacTeX

The easiest way to install ConTeXt on Mac OSX is to use the the MacTeX distribution. MacTeX is a TeXLive distribution modified especially for use on Mac OSX. It will install every thing you need to run ConTeXt, TeX, LaTeX, Xe(La)TeX, along with the editors TeXShop and TeXWorks, the TeX Live Utility for managing updates, fonts and many other goodies.

As MacTeX is a TeXLive distribution all binaries are generally frozen for a year. If you wish to have a more current version or the latest beta version of ConTeXt you should consider, also installing the "ConTeXt Suite" often called "Standalone ConTeXt".

After installing MacTeX all you need to do is set up TeXShop to use ConTeXt, see below the section on TeXShop.

Installing MacTeX

  • You can also buy a TeXLive DVD (if you are a member of a TeX user group you often get it for free).


Standalone ConTeXt

The "ConTeXt Suite" distribution is the recommended way to use ConTeXt on any OS. If you wish to use "ConTeXt Suite" from the command line you can use the Mac tutorial in the Mac section under ConTeXt Suite or

Use the tutorial below that is more Mac OSX centric.  We do use the command line program Terminal of Mac OSX as it poses
the easiest way to get things done. But, do not worry as the process is straight foreword and you can just copy and paste
the commands into the Terminal! 

Using the Commandline

If you do not what a command tool is, do not worry. It is simple a program in which commands are entered as text and then executed. Mac OS comes with two tools for entering command lines the Terminal and a X11 environment X11 or Xquartz, depending on which Mac OSX version you are running. These programs can be found in the Utilities-folder of the Applications-Folder.

Once you have started one of the programs, all you have to do is enter a command and press the RETURN-key and the command will be executed.

Single user installation

As "ConTeXt Suite" is self contained it is best and should be installed inside of a folder of its own. so decide where you want it to be installed. We recommend that you put it a folder called context inside your HOME folder.

This tutorial will install ConTeXt MKIV with all modules, for other options or versions see the section below Alterantive ConTeXt Versions.

In the Terminal after each command you have to press the RETURN-key.

  • Start the Terminal you will find it in the Utilities-folder in the Applications-folder.
  • Create the folder/directory context in your HOME folder:
mkdir $HOME/context

Do not worry if nothing seems to happens. Your directory(UniX jargon for folder) has been created.

  • Switch to the directory
cd $HOME/context
  • Download the installation script first-setup.sh
rsync -av rsync://contextgarden.net/minimals/setup/first-setup.sh .
  • download the latest developmental ConTeXt MKIV distribution and make formats:
 sh ./first-setup.sh --modules=all --engine=luatex

This takes a long time, so go have a coffee. You will see a lot messages which you can disregard.

When the installation process is finished you will see a message telling you that you have to initialize ConTeXt each time you want to run ConTeXt or to add the path to your PATH-variable of your shell. You can ignore this message if you are going to use TeXShop. Setting-up TeXShop is described below..

For easier your connivance you can copy all the commands in this block, paste it into the Terminal and hit RETURN:

mkdir $HOME/context
rsync -av rsync://contextgarden.net/minimals/setup/first-setup.sh .
sh ./first-setup.sh --modules=all --engine=luatex

Alterantive ConTeXt Versions

By default, the suite installs ConTeXt beta.

  • If you want the stable version of ConTeXt, you can use
sh ./first-setup.sh --context=current --engine=luatex

By default, the suite does not install modules and other third party content.

  • If you want the modules, you can use
sh ./first-setup.sh --modules=all --engine=luatex
  • If you want to have MKII the do not use the engine option
sh ./first-setup.sh --modules=all --engine=luatex

Multiple ConTeXt Versions

You can install different versions of ConTeXt next to each other. All you need to do is create a new directory for this version and follow the instructions above using the name of the directory instead of the name context. BEWARE: If you use the command line you have to set up the paths for your shell. If you use TeXShop you have to set-up engines for TeXShop for each version, this process is describe below in the section Creating and Installing a TeXShop Engine

Keeping ConTeXt Up-To-Date

ConTeXt is constantly being improved and expanded if you want to have the latest version of ConTeXt you will need to regularly update your installation. This has to be done from within the Terminal.

Start the Terminal and switch to the folder where ConTeXt was installed:

cd $HOME/context

Download the installation script:

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

Install the latest version:

sh ./first-setup.sh --modules=all --engine=luatex

If you are using a different version then use the use the appropriate options for first-setup.sh!!

System-wide installation

A system wide installation is only recommended for experienced users. You will need administrator rights on the Mac as only administrators are allowed to install programs in the Applications folder.

Start the Terminal you will find it in the Utility-folder in the Applications-folder.

Switch to the Application folder:

cd /Applications

Create the folder for ConTeXt

mkdir context
 

Switch to the "ConTeXt" folder

cd context

Download the installation script

rsync -av rsync://contextgarden.net/minimals/setup/first-setup.sh .

Then run that script to download the whole distribution and make formats:

sudo sh ./first-setup.sh

You will be prompted for you password. Enter your login password and hit return.

This takes a long time, so go have a coffee.

When the installation process is finished you will see a message telling you that you have to initialize ConTeXt each time you want to run ConTeXt or to add the path to your PATH-variable of your shell. You can ignore this message if you are going to use TeXShop. Setting-up TeXShop is described below..

By default only the beta version is installed, If you want a more stable version or third party content then look at the section Alterantive ConTeXt Versions above. All you need to do is add the option to the installation command in this section.


TeXShop and TeXworks

Typically, both editors work out of the box with MacTeX, but if you are using a version earlier than those shipped with MacTeX 2011 (TeXShop 2.42) you need to configure engines for ConTeXt manually.

TeXShop

TeXShop is a good Editor for all variants of TeX and ConTeXt. It offers:

  • Syntax highlighting.
  • A viewer for your typeset PDFs.
  • has templates and you can create your own
  • command completions
  • multiple file encodings

If you install "ConTeXt Suite" or want to use "TeXLive" in parallel with "ConTeXt Suite"s you have to create new engines for "TeXShop", so that you can run your versions of "ConTeXt" directly from within "TeXShop".

Setting-Up TeXShop for ConTeXt Single User Installation

TeXShop installs support files for every user in the folder TeXShop in the users Library folder of the users HOME folder. They are installed first when the user runs TexShop for the first time.

Making UTF-8 Default File Encoding

ConTeXt uses UTF-8 as its default encoding, so it is best to make this the default encoding for your files. You can also choose which ever encoding you wish. You can, also, set the file encoding when it is saved. TeXShop will automatically recognize the file encoding of existing files and use that when saving the file.

  • Start TeXShop. If TeXShop was installed with MacTeX you can find it in the folder TeX in your Application folder.
  • Make TeXshop use utf-8 as its standard encoding for files
Choose the TeXShop->Preferences Menu 
In the dialog window that comes up look for Encodings Field and choose UTF-8 
Close the Dialog window

Creating an Engine for TeXShop

Actually, engine is somewhat misleading. In TeXShop an engine is a script that contains commands that are use to typeset your documents. TeXShop comes with many engines set up to run TeX, LaTeX, Xe(La)TeX and ConTeXt MKII and MKIV that have been installed via MacTeX.

If you want to use ConTeXt Suite you will have to create an TeXShop-engine.

If you have not run TeXShop start it so that the support files for TeXShop are installed for you.

Since in the newer versions of MacOS the users Library-folder is hidden and not accessible from within TeXShop we will use the terminal for simplicity reasons. If you wish you can access the your Library-folder from the Finder and navigate to the Engines-folder inside of the TeXShop-folder inside your Library-folder and choose a ConTeXt-engine.

  • Start the Terminal you will find it in the Utility-folder in the Applications-folder
  • find what your username is if you do not know it already

who am i the first word of the result is your username

  • Open the standard MKIV engine for TeXShop enter
open -a TeXShop $HOME/Library/TeXShop/Engines/ConTeXt\ \(LuaTeX\).engine

This will open the file in TeXShop and switch to TeXShop

  • Save the engine with a new Name "ConTeXt Suite":
 option click on the File menue 
 choose "Save As …"
 change (LuaTeX) in the Name field to Suite
 hit return
 
  • change the set path line to:
set path= (/Users/username/context/tex/texmf-osx-64/bin  $path /usr/local/bin)
If you installed in a different location then change /Users/username/context/ to the location where you
installed ConTeXt standalone. Do not forget to change username in the line above to your actual username!! 
  • save the file again
use either the file menu or cmd-s
  • close the window
use either the file menu or cmd-w

You can know use your new engine by choosing it from the Pop-up Menu of your document window.

If you want other options or use MKII then create a new engine and change the line containing mtxrun accordingly.

In the manual for TeXShop you can find instructions for making your engine the the default engine or how to have TeXShop use your engine no matter which engine is set on a file by file basis.

Setting-Up TeXShop for ConTeXt Suite System-Wide Installation

Making a decent tutorial for setting-up TeXShop for a ConTeXt Suite system-wide installation is kind of difficult, because TeXShop installs support files for each user which become unique to each user after it has been started for the first time by the user. The problem is how get the needed engine/s for the ConTeXt Suite into the user support files.

You can put the engine in into the application bundle of TeXShop, so that it will be installed for every user the first time they run TeXShop or a new version of TeXShop is run. Of course you have to the engine into the application bundle of each update to TeXShop!

  • Start TeXShop
  • create a new document

use the File-Menu or use cmd-N

  • save the engine
 use the File-Menu or use cmd-S
 
 In the dialog window change the name of the file to ConTeXt Suite.engine or whatever!
 In the lower part of the dialog change the file format to Plain Text
  • enter the following content into the document:
 #!/bin/tcsh
 set path= (/Users/quayjay/context/tex/texmf-osx-64/bin  $path /usr/local/bin)
 mtxrun --script context --autogenerate --synctex=1 "$1"
 
  • Save the engine

use the File-Menu or use cmd-S

  • Quit TeXShop
  • Open 2 windows in the finder
  • In one window and navigate to where you saved the engine
  • In the other window navigate to the Applications-folder and to where TeXShop was installed.
If you installed via MacTeX you will find it in Applications->TeX->TexShop

  • Open the folder containing the default engines for TeXShop

press: shift-cmd-G in the dialog enter: TeXShop.app/Contents/Resources/TeXShop/Engines

  • copy the engine from the other window using 'option'-drag
 You will be ask for an administrator password: enter it!
  • close the windows

'IMPORTANT:' The newly created engine will not be installed if a user has already run TeXShop! If a user has already run TeXShop then the newly created engine must copied to their Engine-folder inside of their TeXShop-folder inside their Library-folder!!

Do not forget that you have to also copy your own copy of the newly created engine to your own Engine-folder!!


TeXworks

If you install ConTeXt in your Applications Folder, you have to create a new engine.

Go to your preferences inside TeXworks.

In Typesetting Menu, in Processing tools, add a new engine. In Name, type what you want. In Program : /Applications/ConText/tex/texmf-osx-64/bin/texmfstart In Arguments :

*texexec as the first argument
*$fullname as the second argument
*$synctexoption as the third argument.

Skim (PDF viewer)

Unless you are using TeXshop or TeXworks with built-in viewers, the recommended PDF viewer with SyncTeX support and auto-refresh on Mac OS X is Skim.

More Links