Changes

Jump to navigation Jump to search
m
set PATH instead of sourcing setuptex
< [[ConTeXt MinimalsStandalone]]
This page describes an '''alternative ''' of installing [[ConTeXt MinimalsStandalone]] on Mac OS X. In particular it describes how to configure some GUI applications to work well with minimalsstandalone.
(For command-line gurus it It is '''enough ''' to follow the three steps described in [[ConTeXt MinimalsStandalone]]. Some instructions on this page may cause difficulties that are hard to overcome.)
==Mac newbie installation and configuration==
The following assumes that you want to use ConTeXt and you are a not inside unix UNIX world (otherwise, see before and after). It guides you to install ConTeXt minimal standalone installation under Mac in the typical Applications folder. Then it gives you some information
about how to configure [http://smultron.sourceforge.net/ Smultron] and [http://www.uoregon.edu/~koch/texshop/obtaining.html TeXShop] to work as an editor for ConTeXt.
Smultron is a macMac-only, open source text editor which is very easy to use and at the same time powerful (see also [http://en.wikipedia.org/wiki/Smultron]).
===ConTeXt installation===
1. Create a folder inside the Applications folder (in the Finder, press Command-Shift-A, Command-Shift-N) and name it “ConTeXtMinimals”“ConTeXtStandalone” (BEWARE: Installing in the Applications folder may cause permission problems!)
2. Open a Terminal window (i.e., open the Terminal.app in your Utilities folder: a little window pops up)
3. Type this:
<code> cd /Applications/ConTeXtMinimals/ ConTeXtStandalone </code>, which means “change directory to ConTeXtMinimals”ConTeXtStandalone”. Now you are working in the folder you have just created.
4. Type this:
<code> rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh .</code>
and press Enter/Return.
This calls <code> rsync</code>, a program which goes to the contextgarden site (--> you must be connected to internet) and downloads all the necessary filesdenoted file(s). To start, it simply downloads the little file <code> first-setup.sh</code>: this file shell script contains a set of instructions which allow for automatic downloads (e.g., it selects the right files depending on which platform you are).
To get the rest of the ConTeXt minimalsstandalone, you have to execute <code> first-setup.sh </code> this script by typing in Terminal
<code>./first-setup.sh</code>.
This will start the download and install process. Now (well, after a while) you have all the required files in the /Applications/ConTeXtMinimals ConTeXtStandalone folder.
===Configuring ConTeXT===
1. Open a text editor and create a file that has in it the following line:
<code>. /Applications/ConTeXtMinimalsConTeXtStandalone/tex/setuptex /Applications/ConTeXtMinimalsConTeXtStandalone/tex</code>. Save this file as “.bash_profile” (see '''Where to put files''', below). (BEWARE: That might overwrite an existing .bash_profile!) Note: this file will be hidden, so make sure that you save it in the right place before completing the SAVE command.
(There is a small utility for working with hidden files on the Mac called "Show/Hide Invisible Files": it is available at <code>http://www.macupdate.com/info.php/id/22318</code>.)You can find out more on [http://www.mac-how.net/ how to view hidden files on mac] on the official site of MacHow.
2. Create a new folder named “texmf-local” inside ConTeXtMinimalsConTeXtStandalone/tex.
3. Create another folder “web2c” inside this texmf-local folder.
4. Inside your ConTeXtMinimals ConTeXtStandalone folder, locate the file named <code>texmf.cnf</code> that is in tex/texmf/web2c. Copy this file to ConTeXtMinimalsConTeXtStandalone/tex/texmf-local/web2c. Open this new texmf.cnf file, find the line
HOMETEXMF TEXMFHOME = /nonexist
and replace it with the single line
HOMETEXMF TEXMFHOME = ~/texmf (WHY? Just use the newly created texmf-local and forget about the following steps! [[User:Hraban|Hraban]]Hraban)
Again, replace the line
with the single line
TEXMF = {$HOMETEXMFTEXMFHOME,!!$TEXMFPROJECT,!!$TEXMFFONTS,!!$TEXMFLOCAL,!!$TEXMFCONTEXT,!!$TEXMFEXTRA,!!$TEXMFMAIN}
(See '''Where to put files''' below. These instructions assume that your personal texmf folder is in your Home folder. If you want it elsewhere, be sure to adjust the instructions in section 4 above accordingly.)
5. In Terminal, type <code>luatools --generate</code> and press Enter/Return. 6. In Terminal, type <code>context --make</code> and press Enter/Return.
===Where to put files===
There are several places that this file may go. One possibility is in your Home folder.
You can also use the name ".profile".
''personal texmf''
===Smultron installation and configuration===
1. Smultron is a mac 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. "minimalsTexexecstandaloneTexexec"). Then, write in the text field at the bottom:
<pre>
#!/bin/sh bash  cd /Applications/ConTeXtMinimals/ . export PATH=/Applications/ConTeXtMinimalsConTeXtStandalone/tex/setuptex texmf-osx-64/Applications/ConTeXtMinimals/texcd %%dbin:$PATH
texexec %%p
</pre>
Texexec <code>texexec</code> 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-->minimalsTexexecstandaloneTexexec. This will generate a pdf file in the same folder of your .tex file.
6. If you want to experiment with LuaTeX (ConTeXt MkIV) simply add another command (you can name it e.g. "minimalsLuastandaloneLua") with this text in its text field:
<pre>
#!/bin/sh bashcd export PATH=/Applications/ConTeXtMinimals/ . /Applications/ConTeXtMinimalsConTeXtStandalone/tex/setuptex /Applicationstexmf-osx-64/ConTeXtMinimals/texcd %%dbin:$PATH
context %%p
</pre>
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 ConTeXt 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, [http://pdfview.sourceforge.net/ 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 Here we are not using the famous TeXShop editor, because it is slighlty slightly 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 ConTeXTStandalone 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 [http://wiki.contextgarden.net/Mac_Installation Mac installation]
===TeXShop installation and configuration===
TeXShop is a popular TeX editor for Mac OS X.
1. To install it, download the disk image from <code>http://www.uoregon.edu/~koch/texshop/obtaining.html</code> and put this app in the Applications folder alongside your ConTeXTMinimals ConTeXTStandalone folder.
2. Launch TeXShop. It will automatically create the necessary support files.
<pre>
#!/bin/bash
export PATH=/Applications/ConTeXtMinimalsConTeXtStandalone/tex/texmf-osx-intel/bin:$PATH
texexec "$1"
</pre>
4. SAVE this document in your Home folder in “Library/TeXShop/Engines/” AS “ConTeXt-MKII.engine”. (TeXShop offers the .engine file format). After you have saved the file, open Terminal, navigate to /Library/TeXShop/Engines in your Home folder using <code>cd ~/Library/TeXShop/Engines/</code>. Then, run <code>chmod +x ConTeXt-MKII.engine</code> .
<pre>
#!/bin/bash
export PATH=/Applications/ConTeXtMinimalsConTeXtStandalone/tex/texmf-osx-intel64/bin:$PATHexport TEXMFCACHE=/Applications/ConTeXtMinimalsConTeXtStandalone/tex/texmf-cache
context "$1"
</pre>
 
Please note that the directory might be called texmf-osx-64 on your computer.
6. Repeat steps 3 and 4 once more, by creating a file named “ConTeXt-XeTeX.engine” that contains the lines:
<pre>
#!/bin/bash
export PATH=/Applications/ConTeXtMinimalsConTeXtStandalone/tex/texmf-osx-intel64/bin:$PATH
texexec --xtx "$1"
</pre>
===Notes===
All the process requires that you have installed on your machine rsync, ruby and perl. But if you are on macosxMacOS X, Apple should already have provided it, so at 99% there should not be problems.
[[Category:Installation]]

Navigation menu