Browse Source

Update org variables to use-package, add org snippet

master
Riyyi 4 years ago
parent
commit
e20f7494fc
  1. 50
      .emacs.d/config.org
  2. 2
      .emacs.d/snippets/org-mode/el
  3. 7
      .emacs.d/snippets/org-mode/source

50
.emacs.d/config.org

@ -651,37 +651,37 @@ File auto-saves, backups, tramps.
** Org ** Org
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
;; Org (use-package org
(with-eval-after-load 'org :custom
(add-to-list 'org-structure-template-alist (org-directory (concat (getenv "HOME") "/documents/org"))
'("s" "#+BEGIN_SRC ?\n\n#+END_SRC") (org-ellipsis " ↴")
'("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC") (org-latex-toc-command "\\newpage \\tableofcontents \\newpage")
)) (org-return-follows-link t)
(org-src-fontify-natively t)
(setq org-ellipsis " ↴") (org-src-window-setup 'current-window)
(setq org-src-fontify-natively t) )
(setq org-src-window-setup 'current-window)
(setq org-latex-toc-command "\\newpage \\tableofcontents \\newpage")
;; Enable syntax highlighting when exporting to .pdf ;; Enable syntax highlighting when exporting to .pdf
;; Include latex-exporter ;; Load latex exporter
(with-eval-after-load 'ox-latex (use-package ox-latex
;; Add minted to the list of packages to insert in every LaTeX header :ensure nil ; ox-latex.el is part of org
:after org
:custom
;; Define how minted is added to source code blocks
(org-latex-listings 'minted)
(org-latex-minted-options '(("frame" "lines") ("linenos=true")))
:config
;; Add minted package to every LaTeX header
(add-to-list 'org-latex-packages-alist '("" "minted")) (add-to-list 'org-latex-packages-alist '("" "minted"))
;; Define how minted is added to source code
(setq org-latex-listings 'minted)
(setq org-latex-minted-options
'(("frame" "lines") ("linenos=true")))
;; Append -shell-escape to every element in org-latex-pdf-process ;; Append -shell-escape to every element in org-latex-pdf-process
(setq org-latex-pdf-process (setq org-latex-pdf-process
(mapcar (mapcar
(lambda (s) (lambda (s)
(if (not (string-match-p "-shell-escape" s)) (if (not (string-match-p "-shell-escape" s))
(replace-regexp-in-string "%latex " "%latex -shell-escape " s) (replace-regexp-in-string "%latex " "%latex -shell-escape " s)
s)) s))
org-latex-pdf-process))) org-latex-pdf-process))
)
(setq org-directory (concat (getenv "HOME") "/documents/org"))
(setq org-return-follows-link t)
#+END_SRC #+END_SRC
** Tabs ** Tabs

2
.emacs.d/snippets/org-mode/el

@ -1,6 +1,6 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# name: elisp # name: elisp
# key: el # key: <el
# -- # --
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
$0 $0

7
.emacs.d/snippets/org-mode/source

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: source
# key: <s
# --
#+BEGIN_SRC ${1:language}
$0
#+END_SRC
Loading…
Cancel
Save