The command

texexec --once --texutil --engine=xetex --interface=en --nonstop tmp.tex'

gives the following error message when called from Emacs, but not when called from Terminal:

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in require': /opt/local/share/texmf-local/scripts/context/ruby/base/switch.rb:501: invalid multibyte escape: /\xFF/ (SyntaxError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:inrequire' from /opt/local/share/texmf-local/scripts/context/ruby/texexec.rb:11:in `'

The offending piece of code is

value.gsub(/\xFF/o, ' ')

At this point, I'll be grateful for everything from what to do to make the code run from Emacs, to a patch to the code.

PATH, LANG, LC, and LC_ALL are the same in both Emacs and Terminal.

  • How are you running this command? From one of the many Emacs shells? Via M-!? M-x compile (which is likely what I'd suggest)?
    – Chris
    Jan 6 '14 at 13:10
  • texexec is a shell command that compiles ConTeXt documents. ConTeXt is an exension of TeX. I would prefer to call this command from auc-tex, which is an Emacs package for TeX/LaTeX/ConTeXt editing. It would be silly to call it from M-x compile. Calling it from M-! gives the same error message as above. Again, this works fine if called from the Terminal app.
    – roffe
    Jan 6 '14 at 16:26
  • I am familiar with both ConTeXt and texexec. I don't see what is silly about running this command via M-x compile; you're compiling something. In any case, if it doesn't work via M-x compile the question isn't relevant. Have you tried?
    – Chris
    Jan 6 '14 at 16:28
  • 1
    I edited line 501 of switch.rb from \xFF to \0xFF and it worked. A bug report has been filed.
    – roffe
    Jan 7 '14 at 10:22
  • 1
    Please, write your solution as answer and accept it. This will mark the problem as solved in the overview.
    – Tobias
    Jan 7 '14 at 16:39

See Unable to run ConTeXt (pdfTeX) after upgrading to Mac OS X 10.9 Mavericks. The problem has been fixed in ConTeXt version 2013.10.20 07:09 already. I committed the patch also to TeX Live (but I'm not sure where your TeX distribution comes from).

  • 3
    Should we dupe, then?
    – Joseph Wright
    Jan 12 '14 at 11:57
  • I leave the decision up to you, the experienced ones. All three questions point to the same problem and fall into the category of "bug reports" that will remain relevant until everyone upgrades to a patched TL 2013 or TL 2014. (It is not clear to me which question could be treated as a duplicate of which.) Jan 14 '14 at 15:15
  • There is also (an even older) tex.stackexchange.com/questions/140629/… Jan 14 '14 at 15:19
  • The sentence "This question has been asked before and already has an answer" isn't quite accurate though. The last link seems to be the first question in chronological order. Jan 14 '14 at 15:38
  • 1
    We have the occasional 'reverse dupe': sometimes later question just turns out to be better than an earlier one.
    – Joseph Wright
    Jan 14 '14 at 17:44

I edited line 501 of switch.rb from \xFF to \0xFF and it worked. A bug report has been filed.

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