[plt-scheme] slatex cygwin woes

From: Dave Herman (dherman at ccs.neu.edu)
Date: Sun Feb 26 14:46:45 EST 2006

Oops, I forgot to mention the most elaborate part of the workaround! 
This is a hack I came up with years ago, and it works around the problem 
that PLT Scheme can't seem to call `system*' on a 16-bit program.

Create the following C file, and call it latex.c:

     #include <stdio.h>

     #define FILE "pdfetex"

     int main(int argc, char **argv)
       char *new_argv[256];
       int i;

       new_argv[0] = "latex";
       for (i = 1; argv[i]; i++) {
         new_argv[i] = argv[i];
       new_argv[i] = NULL;

       execvp(FILE, new_argv);
       return 0;

Now run `gcc -o latex.exe latex.c' to compile it, and put this 
executable somewhere in your path so that it overrides any other latex 
executables. Now slatex will use this as the latex executable instead of 
the standard 16-bit latex.exe.


Dave Herman wrote:
> For posterity, here's the solution that finally (at long last (and after 
> much cursing (and general misery (*sniffle*)))) worked for me.
>     1. Run the cygwin installer and get the latest version of everything 
> and install it.
>     2. Now run the cygwin installer *again*, and completely UNINSTALL 
> all tetex packages (it's up to you whether you want to uninstall all 
> packages that depend on it as well--you're going to reinstall it in a 
> minute anyway).
>     3. Run the cygwin installer *yet again*, and this time INSTALL all 
> tetex packages. Note that for some reason it thinks some of them are 
> already there. They aren't!! You must choose REINSTALL for those that it 
> incorrectly thinks are already there, e.g., tetex-bin and tetex-base.
> Now latex should be correctly working again, and slatex should be able 
> to run it out-of-the-box with no issues. Hopefully.
> Dave
> Dave Herman wrote:
>> When I try to use slatex in Windows XP, it pops up an error message 
>> box with the following error:
>>     16 bit MS-DOS Subsystem
>>     C:\WINDOWS\system32\ntvdm.exe
>>     Error while setting up environment for the application. Choose 
>> 'Close' to terminate the application.
>>     [Close] [Ignore]
>> I haven't the foggiest idea how to go about debugging this problem. 
>> Slatex has always given me problems under Windows, but I believe that 
>> Cygwin now at least comes with a latex binary that it can find without 
>> trouble (I used to have to write a fake latex.exe wrapper in C first). 
>> But I've never seen this problem before.
>> Thanks,
>> Dave
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.