This seems like a problem that should be well known and easy to fix, but I can't find any information about it. I decided to look in to ConTeXt, and I've hit a couple of stumbling blocks (but one is far more annoying than the other, so I'll focus on that one here).

I've installed ConTeXt and SciTE on two of my computers following the instructions at http://wiki.contextgarden.net/Windows_Installation:_ConTeXt_Suite_with_SciTe. One machine runs Windows 7 x64, the other x86. One has Evince installed, and the other does not (instead it has Adobe Reader right now).

On the 64-bit machine with Evince, when I build a file using mtxrun, it launches evince three times (evince doesn't open a file), produces output like it's actually doing the build process, and then opens Evince three more times. So the result of building is always 6 Evince instances, all with no file loaded.

On the 32-bit machine with Adobe Reader, when I try using mtxrun, it sits for a very long while (presumably while Adobe Reader loads) and I get "An internal error occurred." from Adobe Reader three times. Then it builds, and then it sits for a while longer and I get "An internal error occurred" from Adobe Reader three more times.

So, for some reason, it appears to be launching the default PDF reader 3 times at the beginning and 3 times at the end, and I suspect calling them in some invalid way (with a bad file?) that results in Evince just not opening anything and Adobe Reader crashing. If I open the PDF it produced manually it looks fine.

I'm building from SciTE and mtxrun should be set up to use MKIV/LuaTeX. I'm thinking this is a configuration problem with LuaTeX, but I don't know enough to investigate this myself and no one else seems to be having the same problem (even though it does the same thing on both of my computers).

My other issue is that despite following the instructions I linked to I can't get SciTE to syntax highlight. I mention it only in case someone knows a problem with those instuctions, otherwise this isn't a big issue for me because I'll probably end up using a different text editor anyway.


After fiddling around a bit, I managed to answer my own question.

This behavior is because of the --autopdf option passed to mtxrun, which in theory will force a PDF reader with the output file to close and then reopen it, so that it'll show the latest version. It seems to be broken, though, or at least it works with neither Acrobat nor Evince. I removed that option from the build by opening site-context.properties in SciTE's folder and removing $(name.flag.pdfopen) from the end of the name.context.run= line.

That makes it so that it won't annoyingly launch our PDF reader multiple times, but we also lose the convenience of having the PDF launch automatically after building. I think it's better from a design standpoint to have the build system launch the PDF anyway, rather than the mtxrun command, so let's do that.

The SciTE configuration that comes with ConTeXt is already set up to open the generated PDF in GhostScript's viewer (e.g. when you press ctrl-2 with a TeX file open). This is a little odd to me, because GhostScript's viewer is, frankly speaking, fugly, and recent versions of the standard Windows GhostScript package don't even include it (resulting in an error message when you tell SciTE to show you the file). I'm working on figuring out how to get it to use a different viewer right now.

|improve this answer|||||
  • 1
    Which version of ConTeXt are you using (you can see that using the output of context --version). On my system (today's beta), context only calls pdfopen once at the end of all the required runs. (I am on linux, but the code is same for linux and windows, so there should not be multiple calls to pdfopen). What happens if you run context --autopdf filename from command line. – Aditya Apr 5 '12 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.