I'm using the latest version of MikTeX, Ubuntu 19.04 and Emacs 26.1. Whenever I try to use inline preview (with any region, section, or environment that has inline math), I get the following error:

TeX Output exited as expected with code 1 at Mon May 13 20:01:20
Running `Preview-PDF2DSC' with ``pdf2dsc _region_.pdf _region_.prv/tmpQWkzKT/preview.dsc''

Preview-PDF2DSC killed at Mon May 13 20:01:20
LaTeX: Wrong type argument: number-or-marker-p, nil

and the preview job quits. When I enable debugging, with M-x toggle-debug-on-error, I get the following output:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  signal(wrong-type-argument (number-or-marker-p nil))
  preview-reraise-error(#<process Preview-LaTeX>)
  preview-TeX-inline-sentinel(#<process Preview-LaTeX> "Preview-LaTeX")
  TeX-command-sentinel(#<process Preview-LaTeX> "exited abnormally with code 1\n")

I've tried the answer posted in this link but my preview-gs-command variable is already set to usr/bin/gs, which I think is sufficient.

Please let me know where I can find a fix to this.

  • Welcome to TeX.SX! Not quite sure this is the same error, but it seems that preview can't work with current MiKTeX, because “the log output from MiKTeX does not provide, looking at the log (...), mandatory information to locate the position in the buffer to put the generated image.“ If you want to be sure, you can maybe ask the AUCTeX developers. – frougon May 23 at 19:45

Your Answer

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

Browse other questions tagged or ask your own question.