我的在doom-emacs下没有错(require 'ox-latex)
(setq org-export-latex-listings t)
(add-to-list 'org-latex-listings '("" “listings”))
(add-to-list 'org-latex-listings '("" “color”))
(add-to-list 'org-latex-packages-alist
'("" “xcolor” t))
(add-to-list 'org-latex-packages-alist
'("" “listings” t))
(add-to-list 'org-latex-packages-alist
'("" “indentfirst” t))
(add-to-list 'org-latex-packages-alist
'("" “geometry”))
(add-to-list 'org-latex-packages-alist
'("" “tikz”))
(add-to-list 'org-latex-packages-alist
'("" “fancyhdr”))
(add-to-list 'org-latex-packages-alist
'("" “tabularx” t))
(add-to-list 'org-latex-packages-alist
'("" “booktabs” t))
(add-to-list 'org-latex-classes
'(“ctexart”
“\documentclass[UTF8,a4paper,11pt]{ctexart}”
("\section{%s}" . “\section*{%s}”)
("\subsection{%s}" . “\subsection*{%s}”)
("\subsubsection{%s}" . “\subsubsection*{%s}”)
("\paragraph{%s}" . “\paragraph*{%s}”)
("\subparagraph{%s}" . “\subparagraph*{%s}”)
)
)
(add-to-list 'org-latex-classes
'(“ctexrep”
“\documentclass[UTF8,a4paper,11pt]{ctexrep}”
("\part{%s}" . “\part*{%s}”)
("\chapter{%s}" . “\chapter*{%s}”)
("\section{%s}" . “\section*{%s}”)
("\subsection{%s}" . “\subsection*{%s}”)
("\subsubsection{%s}" . “\subsubsection*{%s}”)
)
)
(add-to-list 'org-latex-classes
'(“my-report”
“\documentclass[UTF8,a4paper,11pt]{ctexrep}”
("\chapter{%s}" .
“{\ctexset{chapter={numbering=false}}\chapter{%s}}”)
("\section{%s}" . “\section*{%s}”)
("\subsection{%s}" . “\subsection*{%s}”)
("\subsubsection{%s}" . “\subsubsection*{%s}”)
("\paragraph{%s}" . “\paragraph*{%s}”)))
(add-to-list 'org-latex-classes
'(“ctexbook”
“\documentclass[UTF8,a4paper,11pt]{ctexbook}”
("\chapter{%s}" . “\chapter*{%s}”)
("\section{%s}" . “\section*{%s}”)
("\subsection{%s}" . “\subsection*{%s}”)
("\subsubsection{%s}" . “\subsubsection*{%s}”)
)
)
(add-to-list 'org-latex-classes
'(“beamer”
“\documentclass{beamer}
\usepackage[fontset=none,UTF8,a4paper,zihao=-4]{ctex}”
org-beamer-sectioning)
)
(setq org-latex-default-class “ctexart”)
(setq org-latex-pdf-process
'(“xelatex -interaction nonstopmode -output-directory %o %f”
“bibtex %b”
“xelatex -interaction nonstopmode -output-directory %o %f”
“xelatex -interaction nonstopmode -output-directory %o %f”))
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(add-hook 'LaTeX-mode-hook 'turn-on-cdlatex)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
(add-hook 'LaTeX-mode-hook 'outline-minor-mode)
(add-hook 'LaTeX-mode-hook 'auto-fill-mode)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'hide-body t)
(add-hook 'LaTeX-mode-hook 'TeX-fold-mode t)
(add-hook 'outline-minor-mode-hook
(lambda () (local-set-key “\C-o”
outline-mode-prefix-map)))
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq TeX-auto-untabify t)
(setq TeX-save-query nil )
(setq TeX-show-compilation t)
(setq TeX-clean-confirm t)
(setq TeX-source-correlate-mode t)
(setq TeX-source-correlate-method 'synctex)
(setq TeX-PDF-mode t)
(setq-default TeX-master nil)
(setq TeX-view-program-list
'((“Sumatra PDF”
("“E:/Program Files/SumatraPDF/SumatraPDF.exe” -reuse-instance "
(mode-io-correlate " -forward-search %b %n “) " %o”))))
(setq TeX-view-program-selection
'(((output-dvi style-pstricks) “dvips and start”)
(output-dvi “Yap”)
(output-pdf “Sumatra PDF”)
(output-html “start”)))
;; Open TeX error list after compilation
;; and show all warnings
(setq TeX-error-overview-open-after-TeX-run t)
(setq TeX-debug-warnings t)
(add-hook 'LaTeX-mode-hook (lambda()
(setq TeX-engine 'xetex)
(imenu-add-menubar-index)
(add-to-list 'TeX-command-list ‘(“XeLaTeX” "%`xelatex -shell-escape --synctex=1%(mode)%’ %t"
TeX-run-TeX nil t))
(setq TeX-command-default “XeLaTeX”)
(assq-delete-all 'output-pdf TeX-view-program-selection)
(add-to-list 'TeX-view-program-selection
'(output-pdf “Sumatra PDF”))))