File: USAGE

package info (click to toggle)
mgp 1.13a+upstream20090219-11
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,128 kB
  • sloc: ansic: 32,387; sh: 4,295; lisp: 1,405; yacc: 945; lex: 264; makefile: 158; perl: 117; awk: 9
file content (302 lines) | stat: -rw-r--r-- 10,044 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

		 How to make .mgp files (cheat sheet)

		      Kazu Yamamoto (with Chaki)

			    March 14, 2001

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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, %leftfill, %rightfill
	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
argument 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 %tab, 
and then refers to the %default values. After that, 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 thick font
						(A horizontal line)
	text --- size 5% white thick font
	%fore yellow, size 4
	text --- size 4% yellow thick font 
	%vfont min
	text --- size 4% yellow standard 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 become valid. When there are two tabs at the head of the line, 
%tab 2 becomes valid, when there are three tabs at the head of the line 
%tab 3 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 delta icon.


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

	%page

	Emacs and friends

		Emacs
			20.7 is currently the main stream
			21 is coming
		Mule
			2.3 is most used
			Integrated to Emacs and XEmacs 
		XEmacs
			21.1 is most used
			21.2 is coming

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.

(1) If you cannot use "ghostscript":
    - make "tgif" create a GIF file for screen display
    - make "tgif" create an EPS file for printing out

(2) If you have "ghostscript":
    - craete an EPS file from a "tgif" obj file and use that for both cases

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

(1) 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:             GIF
Tgif.XpmToGif: xpmtoppm %s | ppmtogif -transparent black
Tgif.FontSizes:			8 10 12 14 16 18 20 24 26 32 40 48 64
Tgif.PreeditType:		overthespot
Tgif.InitialPrintInColor:      false
%%%%


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.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

(2) If you can "ghostscript":

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

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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

(3) Distributing presentation materials

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

If you want to bundle six pages into one, you could try this:
	pstops '6:0R@.33(0.5cm,26cm)+1R@.33(10.5cm,26cm)+2R@.33(0.5cm,18cm)+3R@.33(10.5cm,18cm)+4R@.33(0.5cm,10cm)+5R@.33(10.5cm,10cm)' input.ps > output.ps

"pstops" is included the "psutils"
package(ftp://ftp.dcs.ed.ac.uk/pub/ajcd).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

		     Tips for better presentation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


(1) Refrain from using "vfont", "xfont" and "tfont" directive
    directly.  Use "deffont" in preamble and "font" in body instead.
    This should allow people to view your presentation in all the
    configuration of the renderer.  (i.e. with/without FreeType,
    with/without VFlib)

(2) Use EPS files for vector image.

(3)Install the latest "ghostscript".  Configure so that it can
   generate grayscaled image as output.

(4) Before the actual presentation, go through the presentation in the
    same configuration as "the real thing".  It will make rendering
    faster.  (For the included EPS images, pixel image will be
    generated and be cached).  If you execute "mgp" with the "-F"
    option, "mgp" fetches and caches the next page so that it makes
    faster to visualize the next page.

(5) Check/practice the connection with the VGA projector.

(6) Practice your oral presentation well :-)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

			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.
e.g. the following code would do:

\documentstyle{article}
\pagestyle{empty}
\thispagestyle{empty}
\begin{document}
...formula...
\end{document}

- With dvips you can obtain .eps file for the dvi.

e.g. latex foo.tex ; dvips -f -E foo.dvi > foo.eps

- Include .eps file into your presentation as follows:

	%image "foo.eps" 0 width height

(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.

(1) If you can assume that the client-side has MagicPoint, you can
    paste a presentation file after processing that by "mgpembed"
    program.

(1.1) Merge images into presentation file, by using "mgpembed".
      "mgpembed" generates single archive-like presentation file,
      which includes images (encoded by "uuencode").

(1.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.

(2) If you cannot asuume that there's no MagicPoint at the client's
    site, you'll need to convert presentation into a html file.  Use
    the -D option for this.

(3) 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.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%