MagicPoint Toolbox


MagicPoint is a free program for doing presentations with a laptop and a beamer. As it is based on X11, it runs primarily on Unix/Linux platforms. This site collects some tips and tricks that let you get more out of this powerful program and make its use easier.

Contents


Emacs-Mode

Although MagicPoint ships with an Emacs mode mgp-mode.el, that mode is targeted at Emacs experts. Thus I have written an alternative mode mgp-mode-cd.el with the following features: For an installation just download the file mgp-mode-cd.el (Version 1.9 from 2012/07/05) and follow the instructions in the header.

Please note that this mode uses the mgp "-U" (unsecure) option for previewing; if you have an older version of mgp that does not have this command line switch, simply remove it from the MGP/Options menu in the entry MGP Command.


True-Type Fonts

A typical Unix or Linux installation does not include True-Type fonts (TTF). However, it is still possible to use TTF's with MagicPoint: For the last option you can use the Type1 fonts shipped with LaTeX. The conversion can be done with FontForge. Here is the recipe for setting up MagicPoint with the LaTeX Type1 fonts:
  1. convert all PFB fonts in /usr/share/texmf/fonts/type1/urw/ that you like (I use ncntrsbk and courier; most people prefer times to ncntrsbk) to TTF and name them reasonably, eg. cour.ttf for Courier and courb.ttf for Courier-Bold.
  2. Put these fonts in a custom directory, eg. /usr/local/share/fonts/truetype/
  3. make the font directory known in ~/.mgprc with the entry: tfdir "/usr/local/share/fonts/truetype"
  4. Define convenient font name mappings with the %deffont tfont command in the header of your mgp file.
Note that it might be necessary to experiment with different charset parameters after the tfont directive in ~/.mgprc in order to get 8bit characters displayed correctly.

Embedding Math Formula

With MagicPoint's %filter directive it is possible to embed LaTeX code. Just download the script latex2eps and use it in the mgp-file as follows:
%filter "latex2eps eqn4"
\begin{displaymath}
\kappa \;=\; \frac{1}{d} \sum_{i=1}^n {p_i}^2 \;+\; \frac{d-1}{d\cdot n}
\end{displaymath}
%endfilter
%newimage -zoom 380 "eqn4.eps"
Please note that the %filter directive only works in connection with the "-U" (unsecure) option of mgp. For the actual presentation you should specify the "-S" (secure) option to save the unnecessary background run of the filter scripts.

The script latex2eps has two nice features:


Rescaling a Presentation

If you are using the "-zoom" option in presentations you will find that the image size is different on different screen resolutions. As the screen resolution of the beamer might be a surprise in some situations, I have written the script mgpresize for quickly adjusting presentation files.

Eg. if you have prepared your talk for a resolution of 1024x768 and the beamer only supports 800x600, you can use the following command for saving the situation:

mgpresize -s 0.75 mytalk.mgp > mytalk-800x600.mgp
Please note that this rescaling is unecessary when you use the options "-xscrzoom" or "-yscrzoom".

Generating Postscript

MagicPoint ships with the program mgp2ps for Postscript conversion (use the option "-e latin1" if your file contains European characters like Umlauts!). mgp2ps has some limitations:
  1. Other TTF-fonts than "times.ttf" and "cour.ttf" are not recognized.
  2. The PS output contains minor bugs.
  3. It does not support page numbering and page footers.
Here is how to overcome these limitations:
  1. To make mgp2ps recognize your TTF-fonts and substitute them with the appropriate standard Postscript font, you must modify the source file print.c: add your desired mappings in the "#ifdef FREETYPE" section of the structure "fontmap[]". I have added the following mappings:
    { CTL_TFONT, ASCII, "schlbk.ttf",	"NewCenturySchlbk-Roman" },
    { CTL_TFONT, ASCII, "schlbki.ttf",	"NewCenturySchlbk-Italic" },
    { CTL_TFONT, ASCII, "schlbkbd.ttf",	"NewCenturySchlbk-Bold" },
    { CTL_TFONT, ASCII, "schlbkbi.ttf",	"NewCenturySchlbk-BoldItalic" },
    { CTL_TFONT, ASCII, "swiss.ttf",	"Helvetica" },
    { CTL_TFONT, ASCII, "swissi.ttf",	"Helvetica-Oblique" },
    { CTL_TFONT, ASCII, "swissbd.ttf",	"Helvetica-Bold" },
    { CTL_TFONT, ASCII, "swissbi.ttf",	"Helvetica-BoldOblique" },
      
  2. Before version 1.11a, mgp2ps produced unequal vertical space between lines. If you still use an older version of mgp2ps you can fix it with
    mgp2ps -e latin1 infile.mgp | sed 's/([^)]*) calcy/(Q) calcy/'
      
  3. For adding page numbers and footers try the script pspage. Sample usage:
    mgp2ps -e latin1 infile.mgp | pspage -l -rtext "Presentation Page %p"
      
Here is a script makeps4mgp that combines the following operations:

Generating PDF Presentation Files

Since version 1.11a there is a somewhat hidden way to generate a PDF presentation file from an mgp file. This file can be used with Acrobat Reader for an online presentation (press CTL-L in Acrobat Reader) which enables you to deliver your talk regardless of the operating system at hand.

The trick is to use the "-c" and "-m" options of mgp2ps, which create color output and emulate the %pause directives with multiple pages. I have written a little script mgp2pdf that includes all necessary steps.


Usage on MacOS X

Since version 1.11a, MagicPoint also runs on MacOS X. You will however need to install the following software first: Although Apple's X11 includes xft2 support, I have not yet obtained satisfying results with it. Thus I would recommend to use freetype and the following configure options:
./configure --enable-locale --disable-xft
  
It seems that mgp has problems guessing the screen dimensions on MacOS X, so that it is a good idea to give them explicitly with the "-g" option. As the top Aqua menu occupies some space, the y-dimension needs to be reduced a little, on my iBook (1024x768 screen resolution) I use
mgp -g 1024x720 ...
  

Contact

All comments or suggestions are welcome and can be sent to
"christoph ( dot ) dalitz ( at ) hs-niederrhein ( dot ) de"


Back to Home Page