Prerequisites
Before you begin, you should be sure that
the programming language
Python 2 is available on your machine.
I cannot tell you how to achieve this if it is not already there,
but I can tell you that the home page for Python is
Be sure to get Python 2! Python 3 is
a very different language (don't ask me how or above all why) and the files for
PiScript will
not run under it. If you think that's weird, you are in good
company.
I can only hope that Python 2 stays around as long as I live,
because changing to Python 3 will be extremely painful.
There are different ways to run Python
on a file. Under UNIX flavours, the simplest way is
to type python (filename) in a terminal window.
You should also have a proper version of TEX available.
With flavours of UNIX, this usually comes
automatically
You should also have a program that views PostScript files.
With UNIX, the best choice by far is
You can find lots of helpful information about
your options at the
Advanced TEX configuration
You may well find the default TEX environment unsatisfactory.
The most obvious problem is that the output
from the command "tex" is extraordinarily verbose.
On UNIX machines, you can suppress this bavardage
by redirecting output in the command. To do
this in the default configuration,
change the command string from "tex" to one of these:
"tex >& /dev/null"
"tex > /dev/null"
"tex > 2>/dev/null"
"tex > /dev/null 2>/dev/null"
These suppress either standard output or error output or both.
Some experiment might be necessary to see what works
in your environment.
I do not see how suppression can be done
easily on machines running Windows,
at least not in a flexible manner.
The file TexConfig.py,
which assumes the standard LaTeX environment,
is the one used by default, but you might well
want to change your configuration
from time to time. You can do this
in any drawing program with the command settexenv,
naming your TEX configuration file.
I advise making up
a custom collection of TEX configuration files
for different purposes. For example, much of the time
I myself prefer a heavier weight for text
in diagrams, and I use BoldMathTexConfig.py
with the command settexenv("BoldMathTexConfig").
There are three parts to the TEX environment.
One is the TEX command actually run.
For example, it can be "tex" or "latex".
But it also includes a prefix and a postfix.
The point is that when you place a TEX string, say "$y=x$",
TEX will first input the prefix, then the string, and after that the postfix.
In a very simple example, LATEX would be run on the file
\documentclass[12pt]{article}
\pagestyle{empty}
\begin{document}
% --------------
$y=x$
% --------------
\end{document}
The postfix is very simple and not very important.
But the prefix as well as the TEX command
are important and not so simple.
The simplest choices for the command are either
tex or latex, but
they have the drawback that every time you
insert TEX you will get copious TEX output.
On UNIX systems, this can be dealt with by adding >& /dev/null
to the command, so that TEX output all goes off into outer space.
This is good if you are confident of your TEX, bad if not.
Incidentally, if you do shoot TEX messages off into outer space,
but your TEX is in error, you will see silent halts
when you run PiScript
on your file. When this happens, just press
Return, posssibly a few times. And then change the tex command, which
you can do either in your program with the command @settexcommand@
or in a local configuration file using the texenv
command. This is explained in the
manual for PiScript.
The prefix is much more complicated.
The defaults supplied are minimal, and you should probably
not truncate them. But you may easily add to them.
All choices at this point are not final, since as is explained elsewhere
they may be overridden in a local TEX configuration file.
WARNING: It is important
to save your customized configuration files
in some directory where they will
not be overwritten or lost when you update
PiScript. You will want to reuse them
when updating PiScript.