LOCAL SWITCHER

CLAUS GERHARDT

Date: January 6, 2009.

Contents

Contents
 1.  Introduction
 2.  Setting the TEX path
 3.  Running texconfig-sys and fmtuitl-sys
 4.  Setting the TEX man path
 5.  Scripts menu
 6.  Requirements
 7.  Installation
 8.  Installation of TEXLive
 9.  Switcher
 10.  Download Links
 11.  Links

1. Introduction

Local Switcher allows to switch between several tex sources by setting a symlink texprograms in your home directory to the new tex source. The tex sources that are in prinicple available for the switches are „texlive/year“, „texlive2005“, and „tetex“, i.e., they are offered as possible options to switch to. Before Local Switcher takes any action to set the new symlink, which would also include removing the old symlink, it first checks, if the new tex source is available on your hard disk, i.e., it checks if the supposed source directory for the symlink exists. If this is not the case an error message will occur, but no action will have taken place.

Setting a symlink in your home directory requires no password before the old symlink will be removed and the new one will be set.

After you made the switch you can easily revoke it, since Local Switcher checks your current tex source at start up, stores this information, and you can simply switch back to the original state. If you use it for the first time you will see an error message that it couldn’t detect the symlink.

Notice that shouldn’t have a folder or file named texprograms
in your home directory besides that particular symlink. Local
Switcher would remove that file or directory before it sets the
new symlink!

The buttons are self-explanatory, the one named „texdoc“ calls the corresponding shell script through an Applescript where the search will always take place in the tex tree of the currently active tex.

2. Setting the TEX path

In order that TeXShop or your shell scripts know of the new tex path you have to define it in TeXShop’s preferences

/Users/yourname/texprograms

where „yourname“ is your user name for your account in its short form. It won’t be necessary to change this path when the tex source is switched!

Shell scripts that are started by an Applescript through the „do shell script“ command are also unaware of that particular path and have to be given special instructions to use this path. I use the tcsh shell for my shell scripts, setting their paths to

set path=  ( $home/texprograms /usr/local/bin /usr/bin /bin
/sbin )

will suffice to make them work.

A special bin folder containing my shell scripts with the corresponding path is part of this distribution. Place this bin folder in

~/Library/Flashmode

to use these shell scripts in the new setting.

The system wide path to tex will in general differ from your local tex path. But this would be only relevant for those using the command line, unless you are making special local provisions.

However, when you run „texdoc“ or „kpsewhich“ by pushing the corresponding buttons in Local Switcher then you don’t have to worry about this.

Gerben Wierda’s TeXLive distribution is not available for switching.

3. Running texconfig-sys and fmtuitl-sys

If you want to run „texconfig-sys“ and „fmtutil-sys“ for a particular tex source, first set the symlink to that tex source with the help of Local Switcher, then, push the button „texconfig paper + fmtutil-sys“ to run texconfig

texconfig-sys paper a4 (or letter)

and to create or recreate all format files system wide. This method doesn’t require that the system wide tex path points to the same tex source or does exist at all. You will be asked for administrator password.

Yokupsecawnhicchhe“cka wnhdicehnteforrinmgate.gfi.le,spadreflautseexd.f bmyt“p.ushing the button
”                         ”

4. Setting the TEX man path

Similar to the setting of a symlink „texprograms“ , Local Switcher also sets a symlink „texmanpages“ in the home directory which points to the man pages of the currently active TEX distribution.

There are several ways to use this information. The easiest and most comfortable one is to install the freely available application „ManOpen“ by Carl Lindberg. The current version number is „2.5.1“. You can download it from ManOpen.

In conjunction with ManOpen the symlink „texmanpages“ can be used in two ways:

  1. Install ManOpen in the Applications folder and the unix binary „openman“, which is part of the ManOpen distribution, in
    ~/Library/Flashmode/bin

    create these folders, if they don’t already exist.

    Then the correct TEX man pages can be consulted by pressing the button „Open Man“ in Local Switcher and entering the search term in the dialogue window. The corresponding man page will then be displayed in the application ManOpen. Adjust its preferences to your taste.

  2. The second method is completely independent from the first and uses only the application ManOpen and not its unix binary. In ManOpen’s preferences one can specify which additional paths should be considered by using a standard „Select folder dialog“. However, selecting
    ~/texmanpages

    this way would immediately result in an expansion of the symlink, i.e., the added path would be the original path to the currently active man pages, and after switching the tex source, and hence the man path, one would have to add the new path again.

    If you have a Property List Editor installed, e.g., Apple’s own Property List Editor, that comes with the Developer package, then you could edit ManOpen’s plist file, which is named „org.clindberg.ManOpen.plist“ and located in

    ~/Library/Preferences

    When editing the plist file replace the value for the variable „ManPath“ by

    /usr/local/man:/usr/share/man:/usr/X11R6/man:/Users/yourName/texmanpages

    where as usual „yourName“ represents the short form of your user name. Then the symlink will not be expanded, and whenever you switch the tex source, ManOpen will always search the correct man pages.

Using ManOpen to display the man pages is more comfortable than using the Terminal, since ManOpen offers some formatting options.

However, you can also use the Terminal to display the man pages
by selecting the item ”man in terminal“ in the Scripts menu, or
simply by pressing its key equivalent ”cmd-m“.

5. Scripts menu

The Scripts menu contains triggers for some useful scripts. Some of the scripts call subroutines or shell scripts that are supposed to be stored in

~/Library/Flashmode

I therefore recommend to install and start the application Flashmode first, since then the folder Flashmode, or more precisely, a link to it will be installed in

~/Library

The item „kpsewhich open“ in Scripts menu calls the subroutine „kpsewhich_open“ in

~/Library/Flashmode/Applescripts-modular

to open a document found by kpsewhich in an editor of your choice. Presently the editor is defined to be „BBEdit“ , but you can replace the name by one of your choice in the subroutine.

Notice that the  kpsewhich“ triggers also offer the choice to open
the found file in”either BBEdit or TeXShop.

6. Requirements

Local Switcher is a universal application and will run on an intelMac or on a PowerMac, setting the path to the tex binaries correctly. However it requires OS 10.4 or better.

This overview can also be accessed through the help menu of Local Switcher.

7. Installation

Install the folder Local-Switcher wherever you want. I usually drag the icon of the application „Local Switcher“ in the Dock.

8. Installation of TEXLive

Local Switcher offers a one click installation of TEXLive from TEXLive’s iso image, see the detailed instructions in Local Switcher’s menu „Install TeXLive.“

Notice that for the installation of texlive2007 and earlier ’Local Switcher pre2008’, i.e., Local Switcher version 1.6 has to be used. Local Switcher pre2008 is also part of the bundle TEXHelpers.

9. Switcher

There also is a version „Switcher“ for defining a global symlink

/usr/local/texprograms

to the tex source which requires administrator privileges. However, I recommend using „Local Switcher“ for an individual user.

10. Download Links

Here are the download links for Local Switcher, version 1.7, and Switcher, version 1.1.

Local Switcher is part of the bundle TEXHelpers that contains in addition Flashmode and pdfselect. I recommend to download the bundle TEXHelpers.

11. Links

Home page, Flashmode, TEXHelpers, TEX Switcher, pdfselect, TEX Scripts, Books, Preprints, Former Students, Veranstaltungen, Lecture Notes

Ruprecht-Karls-Universitδt, Institut fόr Angewandte Mathematik, Im Neuenheimer Feld 294, 69120 Heidelberg, Germany

URL: http://www.math.uni-heidelberg.de/studinfo/gerhardt/