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

2025-09-03 Thread Ikumi Keita
Hi 越,

> yueqr  writes:
> Emacs works as what we expect, many thanks for your guide.

Thank you for the feedback. I'll close this bug.

>> AUCTeX doesn't have these four options. Why do you have them? Perhaps
>> some other package(s) offer them?
> I'm not sure whether the question is important for you, but the answer of the
> question will be not important and silly. For thanks for you help, I'd like to
> told you it's a poor and silly guy without cs knowledge and not have a habbit
> about consult documents of package, but try to fix on what had happen, and
> sillily trust the llm will be helped.

Ah, then some generative AI like ChatGPT, Copilot or Gemini told you
the false advices, I see. Thanks, I realize that they are not so good at
tuning AUCTeX.

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



___
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex


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

2025-08-31 Thread Arash Esbati
Hi Keita,

Ikumi Keita  writes:

>> 越千仞  writes:
>
>>   ;; 或者更细致地,为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? 

For the sake of completeness, AUCTeX has:

,[ C-h v preview-LaTeX-command RET ]
| preview-LaTeX-command is a variable defined in ‘preview.el’.
| 
| Its value is
| ("%`%l \"\\nonstopmode\\nofiles\\PassOptionsToPackage{"
|  ("," . preview-required-option-list)
|  "}{preview}\\AtBeginDocument{\\ifx\\ifPreview\\undefined"
|  preview-default-preamble
|  "\\fi}\"%' \"\\detokenize{\" %(t-filename-only) \"}\"")
| 
| Command used for starting a preview.
| See description of ‘TeX-command-list’ for details.
| 
|   This variable may be risky if used as a file-local variable.
|   You can customize this variable.
|
`

note the lower `p'.

Best, Arash



___
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex


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

2025-08-31 Thread Ikumi Keita
Hi 越,

> 越千仞  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



___
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex


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

2025-08-30 Thread 越千仞
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:
;;;---*---Code:UTF8---*---
(use-package cdlatex
  :after tex
  :straight (:host github :repo "cdominik/cdlatex" )
  )

(use-package tex
  :straight
  auctex
  :hook(
  (LaTeX-mode . cdlatex-mode)
  (LaTeX-mode . reftex-mode)
  (LaTeX-mode . outline-minor-mode)
  (LaTeX-mode . TeX-fold-mode)
  (LaTeX-mode . yas-minor-mode)
  (LaTeX-mode . TeX-source-correlate-mode)
  )
  :config
  (setq TeX-auto-save t)
  (setq TeX-parse-self t)
  (setq-default TeX-master)
  (setq TeX-engine 'xetex)

  (setq TeX-PDF-mode t)
  (setq TeX-source-correlate-mode t)
  (setq TeX-source-correlate-method 'synctex)
  (setq TeX-debug-commands t)

  (eval-after-load "tex"
'(progn
   (add-to-list 'TeX-command-list
'("XeLaTeX" "xelatex -synctex=1 -shell-escape %t"
TeX-run-command t t :help "Run XeLaTeX") t)))
  ;; 设置 XeLaTeX 编译命令
  (setq LaTeX-command "xelatex -synctex=1 -shell-escape")
  ;; 或者更细致地,为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"))

  (setq TeX-output-extension "pdf")
  (setq TeX-view-program-selection '((output-pdf "Sioyek")))


  :custom
  (LaTeX-preview-setup t)
  (preview-supports-image-type 'dvipng)
  (reftex-plug-into-AUCTeX t)
)


(provide 'init_latex)
 ;;; init_latex.el ends here

Emacs  : GNU Emacs 30.2 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.18.4)
 of 2025-08-14
Package: 14.1.0

Run buffer contents:

Running `Preview-LaTeX' on `Modern c' with ``pdfxelatex -ini
-interaction=nonstopmode "&pdfxelatex" prv_Modern_c.ini
 
"\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}"
"\input" "\detokenize{" \"Modern\ c.tex\" "}"''
/bin/sh: line 1: pdfxelatex: command not found

TeX Output exited abnormally with code 127 at Fri Aug 29 00:48:03
Running `Preview-LaTeX' on `~/Documents/notes/computer/_region_' with
``pdfxelatex -synctex=1 -shell-escape  -file-line-error   --synctex=1
"\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}"
"\input" "\detokenize{" _region_.tex "}"''
/bin/sh: line 1: pdfxelatex: command not found

TeX Output exited as expected with code 127 at Fri Aug 29 00:48:03
LaTeX: LaTeX found no preview images


current state:
==
(setq
 AUCTeX-version "14.1.0"
 LaTeX-command-style '((""
"%(PDF)%(latex) %(file-line-error) %(extraopts) %(output-dir) %S%(PDFout)")
  )
 image-types '(svg webp png gif tiff jpeg xpm xbm pbm)
 preview-image-type 'png
 preview-image-creators '((dvipng
  (open preview-gs-open preview-dvipng-process-setup)
  (place preview-gs-place) (close preview-dvipng-close))
 (png (open preview-gs-open) (place preview-gs-place)
  (close preview-gs-close))
 (jpeg (open preview-gs-open) (place preview-gs-place)
  (close preview-gs-close))
 (pnm (open preview-gs-open) (place preview-gs-place)
  (close preview-gs-close))
 (tiff (open preview-gs-open) (place preview-gs-place)
  (close preview-gs-close))
 )
 preview-dvipng-image-type 'png
 preview-dvipng-command "dvipng -picky -noghostscript %d -o
%m/prev%%03d.png"
 preview-pdf2dsc-command "pdf2dsc %(O?pdf) %m/preview.dsc"
 preview-gs-command "/usr/bin/rungs"
 preview-gs-options '("-q" "-dDELAYSAFER" "-dNOPAUSE" "-DNOPLATFONTS"
"-dPrinted"
 "-dTextAlphaBits=4" "-dGraphicsAlphaBits=4")
 preview-gs-image-type-alist '((png png "-sDEVICE=png16m")
  (dvipng png "-sDEVICE=png16m")
  (jpeg jpeg "-sDEVICE=jpeg")
  (pnm pbm "-sDEVICE=pnmraw")
  (tiff tiff "-sDEVICE=tiff12nc"))
 preview-fast-conversion t
 preview-prefer-TeX-bb nil
 preview-dvips-command "dvips -Pwww -i -E %d -o %m/preview.000"
 preview-fast-dvips-command "dvips -Pwww %d -o %m/preview.ps"
 preview-scale-function 'preview-scale-from-face
 preview-LaTeX-command '("%`%l
\"\\nonstopmode\\nofiles\\PassOptionsToPackage{"
("," . preview-required-option-list)
"}{preview}\\AtBeginDocument{\\ifx\\ifPreview\\undefined"
preview-default-preamble
"\\fi}\"%' \"\\detokenize{\" %(t-filename-only) \"}\"")
 preview-required-option-list '("active" "tightpage" "auctex"
(preview-preserve-counters "counters"))
 preview-preserve-counters nil
 preview-default-option-list '("displaymath" "floats" "graphics" "textmath"
  "sections" "footnotes")
 preview-default-preamble '("\\RequirePackage["
   ("," . preview-default-opti