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
#+BEGIN_SRC emacs-lisp
;; Org
(with-eval-after-load 'org
(add-to-list 'org-structure-template-alist
'("s" "#+BEGIN_SRC ?\n\n#+END_SRC")
'("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC")
))
(setq org-ellipsis " ↴")
(setq org-src-fontify-natively t)
(setq org-src-window-setup 'current-window)
(setq org-latex-toc-command "\\newpage \\tableofcontents \\newpage")
(use-package org
:custom
(org-directory (concat (getenv "HOME") "/documents/org"))
(org-ellipsis " ↴")
(org-latex-toc-command "\\newpage \\tableofcontents \\newpage")
(org-return-follows-link t)
(org-src-fontify-natively t)
(org-src-window-setup 'current-window)
)
;; Enable syntax highlighting when exporting to .pdf
;; Include latex-exporter
(with-eval-after-load 'ox-latex
;; Add minted to the list of packages to insert in every LaTeX header
;; Load latex exporter
(use-package ox-latex
: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"))
;; 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
(setq org-latex-pdf-process
(mapcar
(lambda (s)
(if (not (string-match-p "-shell-escape" s))
(replace-regexp-in-string "%latex " "%latex -shell-escape " s)
s))
org-latex-pdf-process)))
(setq org-directory (concat (getenv "HOME") "/documents/org"))
(setq org-return-follows-link t)
(if (not (string-match-p "-shell-escape" s))
(replace-regexp-in-string "%latex " "%latex -shell-escape " s)
s))
org-latex-pdf-process))
)
#+END_SRC
** Tabs

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

@ -1,6 +1,6 @@
# -*- mode: snippet -*-
# name: elisp
# key: el
# key: <el
# --
#+BEGIN_SRC emacs-lisp
$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