3

I'm trying to configure AUCTeX for LuaLaTeX, and compiling works fine with this additions in my .emacs:

(defun my-latex ()
  "Latex mode customizations"
  (auto-fill-mode t)
  (reftex-mode t)
  (TeX-engine-set "luatex")
  (setq TeX-electric-math (cons "$" "$") ) ; auto close dollars
  (setq TeX-electric-sub-and-superscript t) ; use _{} instead of _
  (setq font-latex-fontify-script 'multi-level) ; 2^2^2 as multiple scripts
  ;; Use zathura for previews
  (setq TeX-PDF-mode t)
  (setq TeX-source-correlate-mode t)
  (add-to-list 'TeX-view-program-selection '(output-pdf "Zathura"))
  ;; Hide some boilerplate
  (TeX-fold-mode 1)
  ;; Big faces for sections, chapters, etc.
  (set-face-attribute 'font-latex-sectioning-1-face nil
                      :foreground "#ffcc66" :height 1.5 :bold t)
  (set-face-attribute 'font-latex-sectioning-2-face nil
                      :foreground "#ffcc66" :height 1.2 :bold t)
  (set-face-attribute 'font-latex-sectioning-3-face nil
                      :foreground "#ffcc66" :height 1.2 :bold nil)
  )
(add-hook 'LaTeX-mode-hook 'my-latex)

But if I use preview-latex with C-c C-p C-s, it fails with error in process sentinel: Opening input file: No such file or directory, /tmp/_region_.prv/tmp20357KF2/preview.ps. The file that I'm trying to preview is

\documentclass[a4paper]{article}

\begin{document}
\section{Foo}
\begin{equation}
f = b^{4}
\end{equation}
\end{document}

What should I change in my .emacs to make latex-preview work? Ideally, with Unicode input.

  • 1
    Does loading the package luatex85 help? It does for me. – giordano May 22 '17 at 19:36
  • @giordano Totally! Works like a charm! If you want, please do a full answer so I can assign you the bounty. – RedPointyJackson May 23 '17 at 5:34
  • Good, but I'll first ask to @ArashEsbati if he wants to answer the question, because this is a trick of his ;-) – giordano May 23 '17 at 18:07
  • @giordano - Thanks for the offer, but go ahead for the bounty :-) Please mention that this issue is hopefully fixed with current preview on CTAN and texlive2017 or AUCTeX release 11.90.3. – Arash Esbati May 23 '17 at 20:50
  • @ArashEsbati do you want to expand the answer better explaining the origin of the issue? :-) – giordano May 24 '17 at 22:26
2
+100

Solution

There are incompatibilities between recent LuaTeX versions and the preview LaTeX package, but they can be fixed by loading the luatex85 package in your document.

Note however that this issue has been already fixed in upstream version of preview: the preview package load itself luatex85, if present, so that you don't have to do it manually in your documents. This fix will be available in TeX Live 2017 and the ELPA release of AUCTeX 11.90.3.

Background

Since LuaTeX started as a descendant of pdfTeX, it used the names of extended primitives provided by pdfTeX. preview supported LuaTeX out of the box as its detection mechanism for pdfTeX worked also for LuaTeX. Things changed with the advent of LuaTeX 0.85 where almost all the pdfTeX extended primitves with names \pdf... were renamed or removed.

LaTeX3 project provides a compatibility package luatex85 which redirects old pdfTeX primitives to new LuaTeX counterparts.

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.