When i'm working in a LaTeX-File everything works as expected. Compilation and completion via company-auctex are working perfectly. However when i want to make use of any preview-functionality inside my editing buffer (For example with C-c C-p C-p "preview at point" there is no preview, but an error buffer that ends with

Preview-PDF2DSC finished at Mon Mar 26 10:30:58
Running `Preview-Ghostscript' with ``/usr/bin/rungs -dOutputFile\=\ 
(_region_.prv/tmp696XBB/pr1-\%d.png\) -q -dDELAYSAFER -dNOPAUSE - 
DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 -dGraphicsAlphaBits\=4 - 
sDEVICE\=png16m -r86.5414x86.6274''

Preview-Ghostscript exited abnormally with code 1 at Mon Mar 26 
Unable to read environment locale:exit now.

Preview-Ghostscript exited abnormally with code 1

Configuration and AucTeX-setup is just

(use-package auctex
  :defer t
  :ensure t)

Does anyone have an idea what to do? Is maybe something missing in my config?

Emacs Version: 25.3.1 AucTeX Version: 12.1.1 Ghostscript Version: 9.22

All help will be highly appreciated.

  • It seems that Ghostscript isn't happy due to missing locale value: Unable to read environment locale. Maybe you check and set that and try it again. – Arash Esbati Mar 26 '18 at 10:34
  • Thank you for your answer! Could you maybe tell me, how i would do that? – Tim Hilt Mar 26 '18 at 10:52
  • You can check the values by doing locale RET in a shell. For setting the values, I suggest you check the documentation of your distro and/or search the web. – Arash Esbati Mar 26 '18 at 13:07
  • It seems like kde has automatically set my locales to be de_EN.UTF8 because i'm in Germany but prefer english as my OS-Language! However i changed it to de_DE.UTF8 and now preview functionality works. Thanks for your guidance @ArashEsbati – Tim Hilt Mar 26 '18 at 15:25

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.