-
Notifications
You must be signed in to change notification settings - Fork 8
/
latex-setting.el
42 lines (39 loc) · 1.44 KB
/
latex-setting.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
;; -*- coding: utf-8 -*-
;; File: latex-setting.el -- latex for presentation or html
;;
;; Author: Denny(https://www.dennyzhang.com/contact)
;;
;; Copyright 2020, https://DennyZhang.com
;; Created:2008-10-01
;; Updated: Time-stamp: <2020-02-03 15:37:47>
;; --8<-------------------------- separator ------------------------>8--
;; hacking latex export for showing Chinese characters
(add-hook 'org-export-latex-final-hook 'update-orgbeam-latex)
;;(add-to-list 'org-export-latex-default-packages-alist '("" "CJKutf8" t))
(defun update-orgbeam-latex()
(interactive)
(goto-char (point-min))
(replace-string "usepackage{hyperref}" "usepackage{CJKutf8}" nil (point-min) (point-max))
(goto-char (point-min))
(replace-string "begin{document}
" "begin{document}
\\begin{CJK}{UTF8}{gkai}
" nil (point-min) (point-max))
(goto-char (point-min))
(replace-string "
\\end{document}" "
\\end{CJK}
\\end{document}" nil (point-min) (point-max))
)
;; \\begin{CJK}{UTF8}{song}
;; \\begin{CJK}{UTF8}{gkai}
(setq org-beamer-frame-default-options "[allowframebreaks]")
;; --8<-------------------------- separator ------------------------>8--
;; skip generating table of contents
(setq org-export-latex-format-toc-function 'org-export-latex-format-toc-stumb)
(defun org-export-latex-format-toc-stumb (depth) "")
;; --8<-------------------------- separator ------------------------>8--
(setq ps-paper-type 'a4
ps-font-size 16.0
ps-print-header nil
ps-landscape-mode nil)