D  Downloading and installing TeX2page

Go to the TeX2page website to download the TeX2page distribution. (The download link immediately follows the title.)

TeX2page is distributed as a gzipped tar file, tex2page.tar.gz. Unpacking it produces a directory called tex2page, which contains, among other files, the Scheme file tex2page, the plain TeX file tex2page.tex, and the LaTeX package tex2page.sty.

Put copies of (or links to) the files tex2page.tex and tex2page.sty in a directory that is mentioned in your TEXINPUTS environment variable.

TeX2page out of the box

If you run MzScheme [12] on Unix (or Cygwin), setup is minimal. Simply put a copy of (or link to) the Scheme file tex2page in a directory in your PATH environment variable.

If you run MzScheme on Windows, copy the supplied batchfile tex2page.bat to your PATH, and edit its contents so it contains the correct pathnames to your MzScheme executable and tex2page file.

Note also that the MzScheme distribution (as also its superset DrScheme) already bundle a pre-configured tex2page script.

Using Scmxlate to configure TeX2page

For dialects other than MzScheme, you need to configure TeX2page so it runs on your system.

Using ./configure

This method may not always work but is so easy that it’s worth a try. It should work for most dialects on Unix.

1. Type ./configure --help at your OS command line to get the list of dialects supported.* If your dialect D is one of them,

2. Type ./configure --dialect=D

If all goes well, this will create my-tex2page, a version of tex2page for your system.

Note: If you are on a Unix-like environment blessed with lots of GNU software, chances are you already have or can easily install the GNU extension language Guile [13]. Examples of such systems are Linux, Mac OS X, and Cygwin [7]. On such systems, simply type

./configure --dialect=guile 

Using Scmxlate directly

The ./configure --dialect=D approach essentially takes care to call Scmxlate as described in this section, but unfortunately it may not work for some dialects or operating systems. In such cases, you can manually call Scmxlate, which isn’t really all that tedious.

First ensure that Scmxlate is installed on your system. Note down the pathname of the file scmxlate.scm in the unpacked scmxlate directory.

Optionally, edit the file scmxlate-tex2page in the tex2page directory. (Leaving it as is is just fine.) Possible insertions are:

(scmxlate-compile #t)

(define *ghostscript* "pathname-of-your-ghostscript-program")

The first produces a compiled version of tex2page. The second lets you supply the correct pathname for the Ghostscript executable. (TeX2page will guess the Ghostscript pathname, but there is a possibility it guesses wrong on Windows.)

Start your Scheme (or Common Lisp) in the tex2page directory. Load the file scmxlate.scm from the scmxlate distribution, using the correct relative or full pathname of scmxlate.scm. For example,

(load "/home/dorai/share/scmxlate/scmxlate.scm")

(assuming you unpacked Scmxlate in /home/dorai/share). You will be asked a couple of questions about your setup. A choice of answers will be provided, so you don’t need to be too creative. When Scmxlate finishes, you will be left with a version of tex2page called my-tex2page, tailormade for your system.

Installation in PATH

On Unix, put a copy of (or link to) my-tex2page in a directory in your PATH. You may wish to rename it to tex2page.

On Windows, a batch file called tex2page.bat is also created. Move it to a directory in your PATH. Edit the contents of tex2page.bat so that the pathnames it refers to are correct.

Can’t create or don’t want a tex2page script?

If the configuration process cannot create an appropriate script file for you to put in your PATH, or if you prefer working within Scheme anyway instead of at the OS command-line, you can still use TeX2page. Simply load your configured tex2page Scheme file (i.e., my-tex2page) directly into your Scheme, and then call the Scheme procedure tex2page on your source document. E.g.,

(load "my-tex2page")
(tex2page "tex2page-doc.tex")


* TeX2page is known to run on the Scheme dialects MzScheme, Bigloo [40], Chicken [46], Gambit [11], Gauche [24], Guile, MIT Scheme [32], Petite Chez Scheme [2], Pocket Scheme [18], Scheme 48 [25], SCM [23], Scsh [41], STklos [15], and SXM [9]; on the Common Lisp implementations CLISP [19], CMUCL [5], and SBCL [38]; on Unix and Windows (including Cygwin).