Subject: Re: bug#79332: 14.1.0; Running 'preview-Latex' with ```pdfxelatex```

From: Ikumi Keita <[email-masked]>
Date: Sun, 31 Aug 2025 19:59:11 +0900

Hi 越,

>>>>> 越千仞 <[email-masked]> writes:
> Auctex works well while compiling with `C-c, C-c', but try to use
> 'pdfxelatex' in preview process. I guess this may due to my config with
> tex-mode, and Gemini could not make it works well.  May  I get some help?
> THX!

[...]

> And my init_latex.el is as fellow:
>   ;; 设置 XeLaTeX 编译命令
>   (setq LaTeX-command "xelatex -synctex=1 -shell-escape")

I suppose you intend to force XeLaTeX usage.

>   (preview-supports-image-type 'dvipng)

This doesn't work because xelatex produces pdf file, not dvi file.
Comment out those two customizations and try the following (after you
restart the emacs session).
(1) After you open your XeLaTeX document, open the menu
    "Command"->"TeXing Options" and select "Use XeTeX engine"
(2) Type C-c C-c (for ordinary typeset) or C-c C-p C-d (for preview-latex).

If it does the trick, Change the default value of `TeX-engine' from
`default' to `xetex' via
M-x customize-option RET TeX-engine RET
. Then the customization will persist across emacs sessions.

>   ;; 或者更细致地，为PDF输出的预览指定
>   (setq LaTeX-command-for-section-preview '("LaTeX"))

>   ;; 为 AUCTeX 的预览功能显式指定编译命令
>   (setq Preview-LaTeX-command "latex -synctex=1 -shell-escape")
>   ;; 强制预览使用 XeLaTeX 方案
>   (setq TeX-command-run-scheme '((_region_ . "XeLaTeX")))
>   ;; 或者更通用的设置 (但可能影响其他模式)
>   (setq TeX-command-run-scheme '("XeLaTeX"))

AUCTeX doesn't have these four options. Why do you have them? Perhaps
some other package(s) offer them?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW