[Mac OS X TeX] OzTeX 5.0b7 -- yet another teTeX/gs shell :)

Andrew Trevorrow andrew at trevorrow.com
Mon Jan 21 01:44:03 CET 2002



All you OzTeX deserters (yes, I know who you are :)) might like to
try the latest beta release:

   ftp://ftp.trevorrow.com/beta/oztex5b7.sit  (1.2Mb)

If OzTeX is running on OS X then it can call arbitrary Unix commands
and display the output in the OzTeX window.  This means you can run
all your favorite teTeX and Ghostscript programs from within OzTeX.
If you've been using TeXShop/TeXShell/TeXPalette please try the new
OzTeX and let me know how it compares.

To give you an idea of how it works, here are some extracts from
the "Calling Unix" file included in the above archive:

Unix commands can be added to the Tools menu by using a new type
of entry in the extra_tools list in your Local config file.
These examples show how to call teTeX and Ghostscript programs:

   extra_tools = |
   "unix,pdftex -fmt=pdflatex -int=nonstopmode %f,pdflatex,tex" |
   "unix,pdftex -fmt=pdftex -int=nonstopmode %f,pdftex,tex" |
   "unix,latex -int=nonstopmode %f,latex,tex" |
   "unix,tex -int=nonstopmode %f,tex,tex" |
   "unix,bibtex %b,bibtex,tex,aux" |
   "unix,perl -pi -e 's/\r/\n/g' %f; makeindex %f,makeindex,tex,idx" |
   "unix,ps2pdf -sPAPERSIZE=a4 %f,ps2pdf,ps" |
   "unix,~/bin/tex2pdf.sh %f,TeX-to-PDF,tex" -- $c

OzTeX automatically changes the current working directory to the
location of the input file before calling the Unix command.
It also substitutes %f with the input file name and %b with the
input file's base name; eg. foo if foo.tex is the input file.
Other rarely needed substitutions are %% = % and %c = comma.

Note that bibtex requires a base name.  Most programs should be
given a full name, especially if you want to run latex or pdflatex
on a file whose name ends in ".ltx".

Some teTeX programs, like makeindex, can only process input files
with Unix line endings, so to run these programs on Mac files you
can use Perl to translate the line endings, as in the above example.

If you want to do lots of commands in one step then just write a
shell script and call that.  The TeX-to-PDF item in the above
example runs a script containing these commands:

   #!/bin/sh -e
   basename=${1%.*}            # strip off any extension
   tex -int=nonstopmode $1
   dvips -Ppdf -o $basename.ps $basename.dvi
   ps2pdf -sPAPERSIZE=a4 $basename.ps
   open -a "Acrobat Reader 5.0" $basename.pdf

Don't forget you can assign command keys to your new menu items.
For example, to assign command-9 to the TeX-to-PDF item:

   command_keys = $c Tools,TeX-to-PDF,9

Some more tips...

The default shell invoked by OzTeX is tcsh.  Before executing your
command, tcsh will automatically execute the commands in ~/.tcshrc
or ~/.cshrc if either file exists.  If you'd prefer to use another
shell for some reason then put something like "unix_shell = zsh" in
your Local file (in this case ~/.zshenv is automatically executed).
If a simple name like zsh is specified then it must exist in /bin.
If the shell you want to use is somewhere else then specify the
full path; eg. "unix_shell = /usr/local/bin/bash".

Before calling a Unix command, OzTeX sets PATH to the directories
specified by the unix_path parameter.  The default setting assumes
you used Gerben Wierda's teTeX installer.  If you have a different
version of teTeX then you'll probably need to set unix_path to the
value returned by typing "echo $PATH" in Terminal.

Andrew
http://www.trevorrow.com

-----------------------------------------------------------------
To UNSUBSCRIBE, send email to <info at email.esm.psu.edu> with
"unsubscribe macosx-tex" (no quotes) in the body.
For additional HELP, send email to <info at email.esm.psu.edu> with
"help" (no quotes) in the body.
This list is not moderated, and I am not responsible for
messages posted by third parties.
-----------------------------------------------------------------




More information about the macostex-archives mailing list