C  Configuring TeX2page

TeX2page is available on GitHub.

git clone https://github.com/ds26gte/tex2page

produces a directory called tex2page, which contains, among other files: the Racket file tex2page.rkt, the Common Lisp file tex2page.lisp, 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 (Common Lisp)

If you run a Common Lisp on a Unix, you can use the supplied script tex2page.lisp after setting the environment variable LISP to the name of your Lisp implementation. Put tex2page.lisp in your PATH. You may rename it to tex2page.

Set LISP to abcl for ABCL [1], allegro for Allegro [22], clisp for CLISP [18], clozure for Clozure [8], cmucl for CMUCL [9], ecl for ECL [29], mkcl for MKCL [3], and sbcl for SBCL [43].

The top few lines in tex2page.lisp contain the lines that invoke Lisp — if they don’t already address your particular Lisp implementation, you may need to add a line based on your Lisp’s command line options.

TeX2page out of the box (Racket)

If you run Racket [39] on a Unix (including Mac OS X and Cygwin [23]), setup is minimal. Simply put a copy of (or link to) the Scheme file tex2page.rkt in a directory in your PATH environment variable. You may rename it to tex2page.

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

When explicit configuration is needed

In general, you need to configure TeX2page so it runs on your system. Even in cases where the supplied script runs “out of the box” for your setup, it may still be a good idea to do an explicit configuration.

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.

(i) Type ./configure ‑‑help at your OS command line to get the list of dialects supported. If your dialect D is one of them,

(ii) Type ./configure ‑‑dialect=D

If all goes well, this will create tex2page, a version of TeX2page that’s suited to D. Put it in your PATH.

TeX2page is known to configure for the Scheme dialects Chez [44], Chicken [7], Gambit [11], Gauche [25], Guile [12], and Racket [39]; and the Common Lisp implementations ABCL, Allegro, CLISP, Clozure, CMUCL, ECL, and SBCL.

Using Scmxlate directly

The ./configure ‑‑dialect=D approach above essentially takes care to call Scmxlate (if needed) 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.rkt 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 tex2page that is tailormade for your system.

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.