From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: preview embedded latex fragments error with my settings Date: Mon, 26 Mar 2018 23:55:48 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------58415E0E0DEF2C3098041E78" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0UTW-0004wg-Tv for emacs-orgmode@gnu.org; Mon, 26 Mar 2018 11:56:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0UTT-0005Aw-Kp for emacs-orgmode@gnu.org; Mon, 26 Mar 2018 11:55:59 -0400 Received: from mail-pg0-x22a.google.com ([2607:f8b0:400e:c05::22a]:44867) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0UTT-0005AX-4c for emacs-orgmode@gnu.org; Mon, 26 Mar 2018 11:55:55 -0400 Received: by mail-pg0-x22a.google.com with SMTP id v26so4911578pge.11 for ; Mon, 26 Mar 2018 08:55:54 -0700 (PDT) Received: from [0.0.0.0] ([119.28.89.243]) by smtp.gmail.com with ESMTPSA id s63sm29719423pfe.6.2018.03.26.08.55.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 08:55:52 -0700 (PDT) Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: org-mode This is a multi-part message in MIME format. --------------58415E0E0DEF2C3098041E78 Content-Type: multipart/alternative; boundary="------------92CDED6BEE5898F54A3D560F" --------------92CDED6BEE5898F54A3D560F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit I have following settings to make org-mode export to PDF works better, like export with src block syntax highlighting with "minted", and support Chinese export with latex package "ctex" and specify default font etc all stuffs. I used to disabled org-mode startup preview latex fragments. Today I use [C-c C-x C-l] to preview latex fragments, it raised error (I shorten the error stack manuallyfor easy to read): ``` Debugger entered--Lisp error: (error "File \"/tmp/orgtexhCLnu9.dvi\" wasn’t produced.  Please adjust ‘dvisvgm’ part of ‘org-preview-latex-process-alist’.")   signal(error ("File \"/tmp/orgtexhCLnu9.dvi\" wasn’t produced.  Please adjust ‘dvisvgm’ part of ‘org-preview-latex-process-alist’."))   error("File \"/tmp/orgtexhCLnu9.dvi\" wasn't produced.  Please adjust `dvisvgm' part of `org-preview-latex-process-alist'.")   (if (org-file-newer-than-p output time) nil (error (format "File %S wasn't produced%s" output err-msg)))   (let* ((base-name (file-name-base source)) (full-name (file-truename source)) (out-dir (or (file-name-directory source) "./")) (output (expand-file-name (concat base-name "." ext) out-dir)) (time (current-time)) (err-msg (if (stringp err-msg) (concat ".  " err-msg) ""))) (let ((wconfig (current-window-configuration))) (unwind-protect (progn (cond ((functionp process) (funcall process (shell-quote-argument source))) ((consp process) (let ((log-buf (and log-buf (get-buffer-create log-buf))) (spec (append spec (list (cons 98 (shell-quote-argument base-name)) (cons 102 (shell-quote-argument source)) (cons 70 (shell-quote-argument full-name)) (cons 111 (shell-quote-argument out-dir)) (cons 79 (shell-quote-argument output)))))) (let ((--dolist-tail-- process)) (while --dolist-tail-- (let ((command (car --dolist-tail--))) (shell-command (format-spec command spec) log-buf) (setq --dolist-tail-- (cdr --dolist-tail--))))) (if log-buf (progn (save-current-buffer (set-buffer log-buf) (compilation-mode)))))) (t (error "No valid command to process %S%s" source err-msg)))) (set-window-configuration wconfig))) (if (org-file-newer-than-p output time) nil (error (format "File %S wasn't produced%s" output err-msg))) output)   org-compile-file("/tmp/orgtexhCLnu9.tex" ("latex -interaction nonstopmode -output-directory %o %f") "dvi" "Please adjust `dvisvgm' part of `org-preview-latex-process-alist'." #)   (let* ((err-msg (format "Please adjust `%s' part of `org-preview-latex-process-alist'." processing-type)) ...... (let ((--dolist-tail-- post-clean)) (while --dolist-tail-- (let ((e (car --dolist-tail--))) (if (file-exists-p (concat texfilebase e)) (progn (delete-file (concat texfilebase e)))) (setq --dolist-tail-- (cdr --dolist-tail--))))) image-output-file))   org-create-formula-image("$\\LaTeX$" "/home/stardiviner/Org/Projects/Programming Projects/ltximg/org-ltximg_033e468d0c9a55db5895a459bfaa279c4e322eb9.svg" (:foreground default :background default :scale 2.0 :html-foreground "Black" :html-background "Transparent" :html-scale 2.5 :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")) forbuffer dvisvgm)   (if (file-exists-p movefile) nil (org-create-formula-image value movefile options forbuffer processing-type))   (let* ((processing-info (cdr (assq processing-type org-preview-latex-process-alist))) (face (face-at-point)) (fg (let ((color (plist-get org-format-latex-options :foreground))) (if (and forbuffer (eq color 'auto)) (face-attribute face :foreground nil 'default) color)))..... (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type)))   (let ((block-type (eq type 'latex-environment)) (value (org-element-property :value context)) (beg (org-element-property :begin context)) (end (save-excursion (goto-char (org-element-property :end context))......(goto-char beg) (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type))))   (progn (let ((block-type (eq type 'latex-environment)) (value (org-element-property :value context))...... (setq cnt (1+ cnt)) (if msg (progn (message msg cnt))) (goto-char beg) (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type)))))   (if (memq type '(latex-environment latex-fragment)) (progn (let ((block-type (eq type 'latex-environment)) (value (org-element-property :value context)) (beg (org-element-property :begin context))..... (t (error "Unknown conversion process %s for LaTeX fragments" processing-type))))))   (let* ((context (org-element-context)) (type (org-element-type context))) (if (memq type '(latex-environment latex-fragment)) (progn (let ((block-type (eq type 'latex-environment))...... (setq cnt (1+ cnt)) (if msg (progn (message msg cnt))) (goto-char beg) (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type)))))))   (if (and overlays (eq (get-char-property (point) 'org-overlay-type) 'org-latex-overlay)) nil (let* ((context (org-element-context)) (type (org-element-type context)))..... (goto-char beg) (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type))))))))   (while (re-search-forward math-regexp end t) (if (and overlays (eq (get-char-property (point) 'org-overlay-type) 'org-latex-overlay)) nil (let* ((context (org-element-context))......... (setq cnt (1+ cnt)) (if msg (progn (message msg cnt))) (goto-char beg) (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type))))))))))   (if (eq processing-type 'verbatim) nil (let* ((math-regexp "\\$\\|\\\\[([]\\|^[ \11]*\\\\begin{[A-Za-z0-9*]+}") (cnt 0) checkdir-flag) (goto-char (or beg (point-min))) (if (and overlays (memq processing-type '(dvipng imagemagick))) (progn (overlay-recenter (or end (point-max))))).....(goto-char beg) (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type)))))))))))   org-format-latex("ltximg/org-ltximg" 160825 160845 "/home/stardiviner/Org/Projects/Programming Projects/" overlays "Creating images for section..." forbuffer dvisvgm)   (let ((file (buffer-file-name (buffer-base-buffer)))) (org-format-latex (concat org-preview-latex-image-directory "org-ltximg") beg end (if (or (not file) (file-remote-p file)) temporary-file-directory default-directory) 'overlays msg 'forbuffer org-preview-latex-default-process))   (let (beg end msg)..... 'overlays msg 'forbuffer org-preview-latex-default-process)) (message (concat msg "done")))   (save-excursion (let (beg end msg) (cond ((or (equal arg '(16)) (and (equal arg '(4)) (progn (defvar org-called-with-limited-levels) (defvar org-outline-regexp) (defvar outline-regexp) (defvar org-outline-regexp-bol) (let* ((org-called-with-limited-levels t) (org-outline-regexp (org-get-limited-outline-regexp)) (outline-regexp org-outline-regexp)..... beg end (if (or (not file) (file-remote-p file)) temporary-file-directory default-directory) 'overlays msg 'forbuffer org-preview-latex-default-process)) (message (concat msg "done"))))   (catch 'exit (save-excursion (let (beg end msg) (cond ((or (equal arg '(16)) (and (equal arg '(4)) (progn (defvar org-called-with-limited-levels) (defvar org-outline-regexp).....(org-format-latex (concat org-preview-latex-image-directory "org-ltximg") beg end (if (or (not file) (file-remote-p file)) temporary-file-directory default-directory) 'overlays msg 'forbuffer org-preview-latex-default-process)) (message (concat msg "done"))))))   (if (display-graphic-p) (progn (catch 'exit (save-excursion (let (beg end msg) (cond ((or (equal arg '(16)) (and (equal arg '(4)) (progn (defvar org-called-with-limited-levels) (defvar org-outline-regexp) (defvar outline-regexp) (defvar org-outline-regexp-bol)..... (progn (message "LaTeX fragment images removed from section") (throw 'exit nil)) (setq msg "Creating images for section...")))))) (let ((file (buffer-file-name (buffer-base-buffer)))) (org-format-latex (concat org-preview-latex-image-directory "org-ltximg") beg end (if (or (not file) (file-remote-p file)) temporary-file-directory default-directory) 'overlays msg 'forbuffer org-preview-latex-default-process)) (message (concat msg "done")))))))   org-toggle-latex-fragment(nil)   funcall-interactively(org-toggle-latex-fragment nil)   call-interactively(org-toggle-latex-fragment nil nil)   command-execute(org-toggle-latex-fragment) ``` The attachment is a simple config that you can reproduce this problem. --------------92CDED6BEE5898F54A3D560F Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

I have following settings to make org-mode export to PDF works better, like export with src block syntax highlighting with "minted", and support Chinese export with latex package "ctex" and specify default font etc all stuffs.

I used to disabled org-mode startup preview latex fragments. Today I use [C-c C-x C-l] to preview latex fragments, it raised error (I shorten the error stack manually for easy to read):

```

Debugger entered--Lisp error: (error "File \"/tmp/orgtexhCLnu9.dvi\" wasn’t produced.  Please adjust ‘dvisvgm’ part of ‘org-preview-latex-process-alist’.")
  signal(error ("File \"/tmp/orgtexhCLnu9.dvi\" wasn’t produced.  Please adjust ‘dvisvgm’ part of ‘org-preview-latex-process-alist’."))
  error("File \"/tmp/orgtexhCLnu9.dvi\" wasn't produced.  Please adjust `dvisvgm' part of `org-preview-latex-process-alist'.")
  (if (org-file-newer-than-p output time) nil (error (format "File %S wasn't produced%s" output err-msg)))
  (let* ((base-name (file-name-base source)) (full-name (file-truename source)) (out-dir (or (file-name-directory source) "./")) (output (expand-file-name (concat base-name "." ext) out-dir)) (time (current-time)) (err-msg (if (stringp err-msg) (concat ".  " err-msg) ""))) (let ((wconfig (current-window-configuration))) (unwind-protect (progn (cond ((functionp process) (funcall process (shell-quote-argument source))) ((consp process) (let ((log-buf (and log-buf (get-buffer-create log-buf))) (spec (append spec (list (cons 98 (shell-quote-argument base-name)) (cons 102 (shell-quote-argument source)) (cons 70 (shell-quote-argument full-name)) (cons 111 (shell-quote-argument out-dir)) (cons 79 (shell-quote-argument output)))))) (let ((--dolist-tail-- process)) (while --dolist-tail-- (let ((command (car --dolist-tail--))) (shell-command (format-spec command spec) log-buf) (setq --dolist-tail-- (cdr --dolist-tail--))))) (if log-buf (progn (save-current-buffer (set-buffer log-buf) (compilation-mode)))))) (t (error "No valid command to process %S%s" source err-msg)))) (set-window-configuration wconfig))) (if (org-file-newer-than-p output time) nil (error (format "File %S wasn't produced%s" output err-msg))) output)
  org-compile-file("/tmp/orgtexhCLnu9.tex" ("latex -interaction nonstopmode -output-directory %o %f") "dvi" "Please adjust `dvisvgm' part of `org-preview-latex-process-alist'." #<buffer *Org Preview LaTeX Output*>)
  (let* ((err-msg (format "Please adjust `%s' part of `org-preview-latex-process-alist'." processing-type)) ...... (let ((--dolist-tail-- post-clean)) (while --dolist-tail-- (let ((e (car --dolist-tail--))) (if (file-exists-p (concat texfilebase e)) (progn (delete-file (concat texfilebase e)))) (setq --dolist-tail-- (cdr --dolist-tail--))))) image-output-file))
  org-create-formula-image("$\\LaTeX$" "/home/stardiviner/Org/Projects/Programming Projects/ltximg/org-ltximg_033e468d0c9a55db5895a459bfaa279c4e322eb9.svg" (:foreground default :background default :scale 2.0 :html-foreground "Black" :html-background "Transparent" :html-scale 2.5 :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")) forbuffer dvisvgm)
  (if (file-exists-p movefile) nil (org-create-formula-image value movefile options forbuffer processing-type))
  (let* ((processing-info (cdr (assq processing-type org-preview-latex-process-alist))) (face (face-at-point)) (fg (let ((color (plist-get org-format-latex-options :foreground))) (if (and forbuffer (eq color 'auto)) (face-attribute face :foreground nil 'default) color)))..... (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type)))
  (let ((block-type (eq type 'latex-environment)) (value (org-element-property :value context)) (beg (org-element-property :begin context)) (end (save-excursion (goto-char (org-element-property :end context))......(goto-char beg) (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type))))
  (progn (let ((block-type (eq type 'latex-environment)) (value (org-element-property :value context))...... (setq cnt (1+ cnt)) (if msg (progn (message msg cnt))) (goto-char beg) (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type)))))
  (if (memq type '(latex-environment latex-fragment)) (progn (let ((block-type (eq type 'latex-environment)) (value (org-element-property :value context)) (beg (org-element-property :begin context))..... (t (error "Unknown conversion process %s for LaTeX fragments" processing-type))))))
  (let* ((context (org-element-context)) (type (org-element-type context))) (if (memq type '(latex-environment latex-fragment)) (progn (let ((block-type (eq type 'latex-environment))...... (setq cnt (1+ cnt)) (if msg (progn (message msg cnt))) (goto-char beg) (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type)))))))
  (if (and overlays (eq (get-char-property (point) 'org-overlay-type) 'org-latex-overlay)) nil (let* ((context (org-element-context)) (type (org-element-type context)))..... (goto-char beg) (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type))))))))
  (while (re-search-forward math-regexp end t) (if (and overlays (eq (get-char-property (point) 'org-overlay-type) 'org-latex-overlay)) nil (let* ((context (org-element-context))......... (setq cnt (1+ cnt)) (if msg (progn (message msg cnt))) (goto-char beg) (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type))))))))))
  (if (eq processing-type 'verbatim) nil (let* ((math-regexp "\\$\\|\\\\[([]\\|^[ \11]*\\\\begin{[A-Za-z0-9*]+}") (cnt 0) checkdir-flag) (goto-char (or beg (point-min))) (if (and overlays (memq processing-type '(dvipng imagemagick))) (progn (overlay-recenter (or end (point-max))))).....(goto-char beg) (delete-region beg end) (insert (org-format-latex-as-mathml value block-type prefix dir))) (t (error "Unknown conversion process %s for LaTeX fragments" processing-type)))))))))))
  org-format-latex("ltximg/org-ltximg" 160825 160845 "/home/stardiviner/Org/Projects/Programming Projects/" overlays "Creating images for section..." forbuffer dvisvgm)
  (let ((file (buffer-file-name (buffer-base-buffer)))) (org-format-latex (concat org-preview-latex-image-directory "org-ltximg") beg end (if (or (not file) (file-remote-p file)) temporary-file-directory default-directory) 'overlays msg 'forbuffer org-preview-latex-default-process))
  (let (beg end msg)..... 'overlays msg 'forbuffer org-preview-latex-default-process)) (message (concat msg "done")))
  (save-excursion (let (beg end msg) (cond ((or (equal arg '(16)) (and (equal arg '(4)) (progn (defvar org-called-with-limited-levels) (defvar org-outline-regexp) (defvar outline-regexp) (defvar org-outline-regexp-bol) (let* ((org-called-with-limited-levels t) (org-outline-regexp (org-get-limited-outline-regexp)) (outline-regexp org-outline-regexp)..... beg end (if (or (not file) (file-remote-p file)) temporary-file-directory default-directory) 'overlays msg 'forbuffer org-preview-latex-default-process)) (message (concat msg "done"))))
  (catch 'exit (save-excursion (let (beg end msg) (cond ((or (equal arg '(16)) (and (equal arg '(4)) (progn (defvar org-called-with-limited-levels) (defvar org-outline-regexp).....(org-format-latex (concat org-preview-latex-image-directory "org-ltximg") beg end (if (or (not file) (file-remote-p file)) temporary-file-directory default-directory) 'overlays msg 'forbuffer org-preview-latex-default-process)) (message (concat msg "done"))))))
  (if (display-graphic-p) (progn (catch 'exit (save-excursion (let (beg end msg) (cond ((or (equal arg '(16)) (and (equal arg '(4)) (progn (defvar org-called-with-limited-levels) (defvar org-outline-regexp) (defvar outline-regexp) (defvar org-outline-regexp-bol)..... (progn (message "LaTeX fragment images removed from section") (throw 'exit nil)) (setq msg "Creating images for section...")))))) (let ((file (buffer-file-name (buffer-base-buffer)))) (org-format-latex (concat org-preview-latex-image-directory "org-ltximg") beg end (if (or (not file) (file-remote-p file)) temporary-file-directory default-directory) 'overlays msg 'forbuffer org-preview-latex-default-process)) (message (concat msg "done")))))))
  org-toggle-latex-fragment(nil)
  funcall-interactively(org-toggle-latex-fragment nil)
  call-interactively(org-toggle-latex-fragment nil nil)
  command-execute(org-toggle-latex-fragment)
```


The attachment is a simple config that you can reproduce this problem.

--------------92CDED6BEE5898F54A3D560F-- --------------58415E0E0DEF2C3098041E78 Content-Type: text/x-emacs-lisp; name="reproduce-config.el" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="reproduce-config.el" (setq org-preview-latex-default-process 'dvisvgm) ; generate SVG for better image. (setq org-latex-image-default-width "2.0\\linewidth") (setq org-format-latex-options (plist-put org-format-latex-options :scale 2.0)) ; adjust LaTeX preview image size. (setq org-format-latex-options (plist-put org-format-latex-options :html-scale 2.5)) ; adjust HTML exporting LaTeX image size. ;;; Org export to LaTeX default headers. ;; set LaTeX default font (setq org-format-latex-header (concat org-format-latex-header "\n" "\\setmainfont{DejaVu Sans}")) (setq org-format-latex-header (concat org-format-latex-header "\n" "\\setsansfont{DejaVu Serif}")) (setq org-format-latex-header (concat org-format-latex-header "\n" "\\setmonofont{DejaVu Sans Mono}")) ;;; export to PDF with src blocks syntax highlighting. (setq org-latex-listings 'minted) (add-to-list 'org-latex-packages-alist '("" "minted")) (setq org-latex-minted-options '(("frame" "lines") ("linenos" "true") ; enable number lines ;; ("frame" "single") ; box frame ("escapeinside" "$$") ; escape to LaTeX between the two characters specified in $$. ("mathescape" "true") ; escape and interrupt math in src block ("texcomments" "true") ; enable LaTeX code inside comments ("numbersep" "5pt") ; gap between numbers and start of line ("framesep" "2mm") ; distance between frame and content ;; ("fontsize" "??") ; font size in code block ("breaklines" "true") )) ;; (add-to-list 'org-latex-minted-langs '(clojure "Clojure")) ;; (add-to-list 'org-latex-pdf-process ;; "latexmk -shell-escape -bibtex -xelatex -g -f %f") ;;; Org-mode export to -> Chinese TeX (ctex) -> PDF ;;; set default LaTeX engine to xetex (setq-default TeX-engine 'xetex) (add-to-list 'org-latex-packages-alist '("" "ctex")) (setq org-format-latex-header (concat org-format-latex-header "\n" "\\usepackage[utf8]{ctex}")) ;; (setq org-format-latex-header ;; (concat org-format-latex-header "\n" "\\usepackage{xeCJK}")) ;;; set latex to xelatex engine. (setq org-latex-pdf-process '("xelatex -8bit --shell-escape -interaction=nonstopmode -output-directory %o %f" "xelatex -8bit --shell-escape -interaction=nonstopmode -output-directory %o %f" "xelatex -8bit --shell-escape -interaction=nonstopmode -output-directory %o %f")) ;; specify src block syntax highlighting color scheme (setq org-format-latex-header (concat org-format-latex-header "\n" "\\usemintedstyle{manni}")) ;; set src block (setq org-format-latex-header (concat org-format-latex-header "\n" "\\lstset{frame=shadowbox, numbers=left, numberstyle= \\tiny, keywordstyle= \\color{ blue!70},commentstyle=\\color{red!50!green!50!blue!50}, rulesepcolor= \\color{ red!20!green!20!blue!20}")) ;;; support for export Chinese LaTeX to PDF (setf org-latex-default-packages-alist (remove '("AUTO" "inputenc" t ("pdflatex")) org-latex-default-packages-alist)) ;;; set font for Chinese (setq org-format-latex-header (concat org-format-latex-header "\n" "\\usepackage{fontspec}")) (setq org-format-latex-header (concat org-format-latex-header "\n" "\\setCJKmainfont[scale=0.6]{WenQuanYi Micro Hei}")) (setq org-format-latex-header (concat org-format-latex-header "\n" "\\setCJKsansfont{WenQuanYi Micro Hei}")) (setq org-format-latex-header (concat org-format-latex-header "\n" "\\setCJKmonofont{WenQuanYi Micro Hei Mono}")) ;; set PDF file default font size. (Chinese) (setq org-format-latex-header (replace-regexp-in-string "documentclass{article}" "documentclass[fontsize=5pt]{article}" org-format-latex-header)) ;; Chinese linebreak (setq org-format-latex-header (concat org-format-latex-header "\n" "\\XeTeXlinebreaklocale \"zh\"")) (setq org-format-latex-header (concat org-format-latex-header "\n" "\\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt")) ;; CJKulem (setq org-format-latex-header (concat org-format-latex-header "\n" "\\usepackage{CJKulem}")) ;; page style (add-to-list 'org-latex-packages-alist '("" "fancyhdr")) (setq org-format-latex-header (concat org-format-latex-header "\n" "\\pagestyle{fancy}")) --------------58415E0E0DEF2C3098041E78--