Skip to content

Latest commit

 

History

History
183 lines (125 loc) · 5.59 KB

INSTALL.adoc

File metadata and controls

183 lines (125 loc) · 5.59 KB

Installing TeX2page

Get the TeX2page distribution from GitHub:

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

This produces a directory called tex2page, which contains, among other things, the files

tex2page.rkt
tex2page.lisp
tex2page.tex
tex2page.sty

Put copies of (or link to) the files tex2page.tex and tex2page.sty in a directory that is in your TEXINPUTS path.

Optional: Copy the file man/man1/tex2page.1 to the man1 subdirectory of a directory in your MANPATH.

Configuring TeX2page for your machine

Out of the box, the script tex2page.rkt works in Racket; and the script tex2page.lisp works in whatever Common Lisp the environment variable LISP is set to (if LISP is not set, ECL is assumed).

You may put these scripts in your PATH, possibly renaming whichever of them you prefer to tex2page. (tex2page is softlinked to tex2page.rkt in the distribution.)

In general, type

./configure --help

to see the list of dialects the configure script supports. (So you don’t get overwhelmed, you will also be shown some suggestions tailored to your machine.)

If your dialect D is mentioned, type

./configure --dialect=D

This will create a tex2page configured for your dialect. You may put in your PATH. (For Windows, a batch file tex2page.bat is also created in some instances.)

If you use Common Lisp, you can avoid configuration by setting the environment variable LISP to one of: abcl, allegro, clasp, clisp, clozure, cmucl, ecl (default), mkcl, sbcl. This makes tex2page.lisp equivalent to whatever

./configure --dialect=$LISP

would have produced.

Racket and Common Lisp

Although TeX2page works out of the box for Racket and Common Lisp, you can still “configure” for them, e.g.,

./configure --dialect=racket
./configure --dialect=sbcl

The first merely copies tex2page.rkt to tex2page. Similarly, the second copies tex2page.lisp to tex2page, but also embeds LISP to be sbcl.

In addition, the “dialect” sbcl-compiled is also supported.

./configure --dialect=sbcl-compiled

creates a tex2page that is a compiled version of TeX2page for SBCL. It may be a bit faster.

Scmxlate

Note that configure may use Scmxlate, available at https://github.com/ds26gte/scmxlate. If you have Git and are connected to the Internet, configure will automatically fetch Scmxlate unless it finds it’s already installed on your system.

Configuration for Racket, Guile and the Common Lisps doesn’t require Scmxlate. If you’re on a Unix-like environment blessed with lots of GNU software, e.g., Linux and Cygwin, chances are you already have or can easily install one of these Schemes or Lisps. configure --help will tell you if you can exploit this situation and avoid Scmxlate altogether.

If your dialect is not supported, or configure fails for whatever reason, you can invoke Scmxlate directly. First ensure that Scmxlate is installed on your system. Note down the pathname of the file scmxlate.scm in the unpacked scmxlate directory.

Start your Scheme or Common Lisp in the tex2page directory; then explicitly load the file scmxlate.scm, using its correct pathname. E.g.,

(load "/usr/local/lib/scmxlate/scmxlate.scm")

You will be asked a couple of questions about your setup. A choice of answers will be provided, so you don’t have to be too creative. When Scmxlate finishes, you will be left with a tex2page that is tailormade for your system.

Can’t create a working script file?

If you are unable to create a script file to put in your PATH, you may simply load tex2page directly into your Scheme, and then call the Scheme procedure tex2page on your source document, e.g.,

(load "tex2page")
(tex2page "jobname.tex")

Image generation

(Skip this section if you’re not running Windows.)

The image generation subprocess in TeX2page uses Ghostscript. The TeX2page code stores the name of the Ghostscript executable name in the variable *ghostscript*. For Unix, this value is "gs", which is pretty standard. If you’re using Windows, check that the value assigned to *ghostscript* is correct for you.

Generating the documentation

The TeX2page documentation is provided in the TeX file index.tex. To get a PDF version of the document run, first ensure that the file story.log exists. If it does not, run

luatex story

and supply

\end

at TeX’s interactive prompt. Then do

luatex index
makeindex index
bibtex index
luatex index
luatex index

The multiple runs of TeX are needed to resolve cross-references.

TeXs other than LuaTeX

If you’re using a TeX other than LuaTeX (e.g., XeTeX), use --shell-escape so that MetaPost can be called on one of the illustrations. The first TeX run may fail due to missing files. Type s at the TeX prompt to force XeTeX to continue.

If the MetaPost executable is named mp on your system (e.g., MiKTeX), you may need to create an mpost batch file that calls mp. If the shell escape doesn’t work on your TeX for some reason, explicitly call

mpost lambda
epstopdf lambda-1.eps

after the first TeX run.

HTML documentation

To get an HTML version of the document, run

tex2page index

a few times. Since .tex2page.hdir is set to docs, the HTML is created in the docs subdirectory. (This also serves as a check that TeX2page is indeed correctly installed on your machine.)

As with TeX, multiple runs of tex2page are needed to resolve cross-references, but each run of tex2page will explicitly tell you if another run is necessary.

The WWW copy of the HTML documentation is at http://ds26gte.github.io/tex2page/index.html.