[tex-live] Hints about checking for win32 compatibility for fragmaster perl script

Reinhard Kotucha reinhard.kotucha at web.de
Fri Feb 11 23:42:32 CET 2011

On 11 February 2011 Agustin Martin wrote:

 > 2011/2/7 T T <t34www at googlemail.com>:
 > > On 4 February 2011 17:40, Agustin Martin <agustin6martin at gmail.com> wrote:
 > >> On Fri, Feb 04, 2011 at 01:58:09AM +0100, Reinhard Kotucha wrote:
 > >>> On 3 February 2011 Agustin Martin wrote:
 > >>>  > Since texlive bundles the script with some stuff in a binary file,
 > >>>  > I wonder if the above will (work|be enough) and if there are more
 > >>>  > win32 (info about other operating system is also welcome)
 > >>>  > incompatibilities I should worry about.
 > >
 > > FYI, miktex ships ghostscript under name 'mgs.exe'.  Dunno, if you
 > > want to bother about this or you expect miktex users to install gs
 > > separately (they have to install perl anyway), but just so you know.
 > Thanks for the info.
 > Currently, fragmaster can be directly used under TeX live only because
 > TeX live provides a wrapper for it. Otherwise user would need to
 > install perl and ghostscript explicitly, or at least some sort of
 > personal wrappers.
 > For miktex, something similar can be done by user, besides installing
 > a real perl. A gswin32c wrapper to mgs.exe may help. Suggestions for
 > robust and portable gs selection code are of course welcome.
 > There is another potential problem under miktex, fragmaster uses
 > epstopdf (indeed borrowed gs selection code from it) perl script.
 > However, miktex seems to ship a different epstopdf written by
 > Christian Schenk in C++. Hope they are syntax compatible.

Hi Agustin,
it claims so, at least:

/* This program reimplements the epstopdf Perl script written by
   Sebastian Rahtz. */

Since you only need --outfile, I don't expect problems.  This option
is supported, according to the sources in the MiKTeX svn repository.
I don't know whether Christian's option parser is as sloppy as Perl's
getopt::long regarding single or double hyphens, but maybe someone
could try

  epstopdf --version

under MiKTeX and tell you whether it works.

 > I think I will add a README.win32 file explaining how to try a
 > modified fragmaster under TeX live and what can be done to play with
 > miktex. Something like:
 > ------------- 8< ---------------Cut here --------------------------------
 > Some notes about using fragmaster under usual win32 distributions
 > =================================================================
 > TeX live:
 > =========
 > fragmaster is already part of TeX live and should, if fragmaster
 > package is installed, run out-of-the-box.
 > If your fragmaster version is outdated, try first to update it
 > from the network using TeX live package manager.
 > In case that does not help, you can replace fragmaster.pl shipped
 > with TeX live (%texlive% below means e.g. C:\texlive\2009).
 > *Never* replace "%texlive%\bin\win32\fragmaster.exe, that is just
 > a binary wrapper to actual script. Real script is installed under
 > "%texlive%\texmf-dist\scripts\fragmaster\fragmaster.pl". Make a
 > backup copy of shipped script and put your replacement there.
 > New invocations to fragmaster should run new script.

If people really want to install the script manually, it's easier if
you provide a zip file which can be extracted in a TDS tree.  People
can then decide whether they want to extract it in TEXMFDIST,
TEXMFLOCAL, or TEXMFHOME.  And you don't have to explain so much.

There is a directory CTAN/tex-archive/install which contains
TDS-compliant scripts.

 > miktex:
 > =======
 > You will need to install perl to use fragmaster under miktex.
 > Also, miktex ships win32 ghostscript under a non-standard name
 > mgs.exe, while fragmaster expects standard gswin32c.exe for win32.
 > You can either install another ghostscript with standard name
 > or use some sort of win32 wrapper, something like
 > -- 8< ----- gswin32c.bat -------------------
 > path_to_miktex_gs\mgs.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
 > -- 8< --------------------------------------

If you don't want to support anything older than w2k (TeX Live
doesn't, don't know about MiKTeX), you can write %* instead of 
%1 %2 %3 %4 %5 %6 %7 %8 %9.  This allows more than 9 arguments.

On the other hand it's probably easier to ask users to simply install
Ghostscript.  They have to install Perl anyway and both come with an
InstallShield installer where they just have to press the 'continue'
button several times.  I suppose that Windows users don't read
installation instructions anyway.

If you really want fragmaster to be portable, the best thing you can
do is to re-write it in texlua.  This sounds more difficult than it
actually is.  You obviously don't use any features of Perl which are
not supported by texlua too, and your script isn't very complex.

texlua has kpathsea built-in, hence the script could locate mgs.exe
itself.  texlua scripts are started by the same wrappers as Perl
scripts in TeX Live, I suppose that the MiKTeX installer has to
associate the extension "tlu" with the texlua binary, if it's not done

 > Call fragmaster as "perl fragmaster.pl"

This is only necessary if Perl isn't installed properly (copied from
another machine instead).  If you install Perl using the installer,
the extension ".pl" is associated with the Perl executable in the
registry and you can call fragmaster directly without specifying the
extension or the Perl executable, just as on Unix.


Reinhard Kotucha                                      Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                              mailto:reinhard.kotucha at web.de
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.

More information about the tex-live mailing list