		 How to make .mgp files (cheat sheet)

		      Kazu Yamamoto (with Chaki)

			  September 4, 1998


All .mgp commands start with "%". After making sure that
/usr/X11R6/lib/X11/mgp/default.mgp exists, add the following line to
the beginning of the .mgp file.

	%include default.mgp

This determines the default style. Each page begins with "%page".

	%page

	TITLE

	Body

MagicPoint is line oriented. Don't write anything in the first line
because the default style uses the first line for making space at the
top of the screen. The second line is the title of the page. The third
line is transformed into a horizontal line. The fourth line on becomes
the body.

When there is a "%" at the beginning of a line, the rest of the line
becomes a command. Multiple commands separated by "," can be written
in a single line. To make the size 7% of the screen and the foreground
color yellow, one would write:

	%size 7, fore yellow
	This line is big and yellow.

Any line that starts with "%" won't show up on the screen nor will it
be counted as a line. The following parameters can be used to change
how a line looks.

	text color			%fore
	background color		%back
	text size			%size
	text placement			%center, %left, %right
	space between characters	%hgap
	space between lines		%vgap
	Font				%font

There are a few others, but this should be enough for now. The
parameters of default.mgp are set as follows:

	%default 1 leftfill, size 2, fore "white", back "black", font "thick"
	%default 2 size 7, vgap 10, prefix " "
	%default 3 size 2, bar "gray70", vgap 10
	%default 4 size 5, fore "white", vgap 30, prefix " ", font "standard"

%default set the parameters for the line specified in the first
argment to the values specified the second and later argments. In the
first line, the size is 2% and in the second line the size is set to
7%. Parameters set in previous lines are valid unless
overwritten. Therefore, the text in the second line will be white.

When MagicPoint shows a particular line, it first refers to the
%default values. Then it refers to the values set within the
body. Values of the previous line remain valid unless set otherwise.

Let's take a look at the following example:

	%page
						(A space of 2%)
	TITLE --- size 7% color white and in gothic font
						(horizontal line)
	text --- size 5% white gothic font
	%fore yellow, size 4
	text --- size 4% yellow gothic font 
	%vfont min
	text --- size 4% yellow mincho font 

%tab is a command that directly associates with the line. In
default.mgp it is set as follows:

	%tab 1 size 5, vgap 40, prefix "  ", icon box green 50
	%tab 2 size 4, vgap 40, prefix "      ", icon arc yellow 50
	%tab 3 size 3, vgap 40, prefix "            ", icon delta3 white 40

When there is a singular tab at the head of the line, the values of
%tab override the current values and become valid. When there are two
tabs at the head of the line, %tab2 becomes valid, when there are
three tabs at the head of the line %tab3 becomes valid and so on.

In other words,
1 tab means text size 5% and the line starts with spaces and green box icon.
2 tabs mean text size 4% and the line starts with spaces and yellow arc icon. 
3 tabs mean text size 3% and the line starts with spaces and white delta3 icon.

By using this, it's easy to itemize. Let's take a look at an example:

	%page

	Emacs and friends

		Emacs
			19 is currently the main stream
			20 has been released
		Mule
			2.3 is most used
			Integrated to Emacs and XEmacs 
		XEmacs
			19 is the English version
			20 is the International version

To find out more about the other commands, take a look at SYNTAX or
sample/*.mgp.

			    Life with tgif


MagicPoint cannot display tgif objs but there is a way to sort of get
around this.

	If you cannot use ghostscript:
	- make tgif create a GIF file for screen display
	- make tgif create an EPS file for printing out
	If you have ghostscript:
	- craete EPS file from tgif "obj" file and use that for both cases

If you cannot use ghostscript:

The image created by tgif is displayed "as is" on MagicPoint's screen.
This is pretty sad when fonts aren't displayed clearly when viewing
with tgif. Either Mincho or Gothic font is provided for 14, 16, 24,
and 26 dot. So it's possible to give xrdb something like the
following, and then make tgif create a GIF file.

Tgif*Background: black
Tgif*Foreground: white
Tgif*WhereToPrint: EPS
Tgif*InitialFontSize: 16
Tgif*InitialKanjiFont: Gothic
Tgif*FontSizes: 14 16 24 26
Tgif*NihongoFonts: \
	-*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
	Ryumin-Light-EUC-H, Ryumin, \
	H, false, 24, 26 \n\
	-*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
	GothicBBB-Medium-EUC-H, Gothic, \
	H, false, 16, 18 \n\
	-*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
	Ryumin-Light-EUC-V, Ryumin-V, \
	V, false, 24, 26 \n\
	-*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
	GothicBBB-Medium-EUC-V, Gothic-V, \
	V, false, 16, 18

EPS files can be created just by typing:
	tgif -print -eps *.obj
This is convenient when you have a whole lot of files.

However, some files might not get the right colors using this way. If
you find any files that don't have the right colors, try manually
creating the EPS file using tgif.

If corresponding filename.eps exists for filename.{gif,jpg,...}, mgp2ps
uses filename.eps when creating a PS file.

If you want to bundle two pages into one, you could try this:
	pstops '2:0R@.5(2cm,26cm)+1R@.5(2cm,13cm)' input.ps > output.ps

If you can ghostscript:

Generate eps file, again by using
	tgif -print -eps *.obj
command.

Paste the eps file into your presentation by adding
	%image "foobaa.eps"
then, mgp will render the eps file on-the-fly, by invoking ghostscript.
mgp2ps will properly include the eps file into the output.


			Mathematical Formulas

There are, at least, three way to include mathematical formulas in 
.mgp file.

(1) TeX
- Obtain .dvi file for the expression with TeX.
- With dvipr you can obtain .eps file for the dvi.
- Include .eps file into your presentation as follows:

	%image "foo.eps"

(2) eqn/troff
- Obtain .ps file for the expression with eqn/troff.
- Convert .ps file to .eps file. (e.g. pstoepsi)
- Include .eps file into your presentation as follows:

	%image "foo.eps"

(3) Bitmap (not recommended)
- Obtain .ps file for the expression with TeX or eqn/troff.
- Convert .ps file to .pnm file.(e.g. pstopnm)
- Convert .pnm file to .pbm file (e.g. pnmcrop)
- Include .pbm file into your presentation as follows:

	%image "foo.pbm"


			Pasting foils onto the web

If you wish to paste your magicpoint presentation, you have three options.

If you can assume that the client-side has magicpoint, you can paste
a presentation file after processing that by "mgpembed" program.
	1. Merge images into presentation file, by using "mgpembed".
	   mgpembed generates single archive-like presentation file, which
	   includes images (encoded by uuencode).
	2. Paste the generated file onto the web, under name "foo.mgp".
Client side (Browser) needs to be configured as follows:
- Define "helper application" for extention ".mgp" as,
	mgp -g 400x300 -S <filename>
You can specify any screeen size as you want.  Here, -S is REALLY important
for security, since magicpoint presentation can include arbitrary shell
command.  -S option disables invocation of any external process from
magicpoint.
If you need to configure content-type for ".mgp", use
"application/x-magicpoint".  I believe "text/plain" would be a last resort.

If you cannot asuume that there's no magicpoint at the client's site,
you'll need to convert presentation into html file.  use mgp -D for this.

You may convert your presentation as postscript file, after processing it
with "mgp2ps".   It would be nice if you would like nobody to reuse your
work at ease.
