|
|
|
|
@ -816,13 +816,13 @@ |
|
|
|
|
#+END_SRC |
|
|
|
|
*** LaTeX export |
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
|
(add-to-list 'org-latex-classes |
|
|
|
|
'("amsart" "\\documentclass[11pt]{amsart}" |
|
|
|
|
("\\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 |
|
|
|
|
; '("amsart" "\\documentclass[11pt]{amsart}" |
|
|
|
|
; ("\\section{%s}" . "\\section*{%s}") |
|
|
|
|
; ("\\subsection{%s}" . "\\subsection*{%s}") |
|
|
|
|
; ("\\subsubsection{%s}" . "\\subsubsection*{%s}") |
|
|
|
|
; ("\\paragraph{%s}" . "\\paragraph*{%s}") |
|
|
|
|
; ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) |
|
|
|
|
#+END_SRC |
|
|
|
|
*** Source blocks |
|
|
|
|
Add template for a source block in emacs-lisp. This is useful for |
|
|
|
|
@ -966,6 +966,12 @@ |
|
|
|
|
(setq org-crypt-key "C86A9E7675295C62") |
|
|
|
|
#+END_SRC |
|
|
|
|
|
|
|
|
|
*** ox-export |
|
|
|
|
Load ox-hugo |
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
|
(with-eval-after-load 'ox |
|
|
|
|
(require 'ox-hugo)) |
|
|
|
|
#+END_SRC |
|
|
|
|
** elisp |
|
|
|
|
*** Paredit |
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
|
@ -1028,61 +1034,63 @@ |
|
|
|
|
#+END_SRC |
|
|
|
|
*** Setup ~latex-mode~ |
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
|
(eval-after-load 'latex |
|
|
|
|
'(progn |
|
|
|
|
(font-lock-add-keywords 'latex-mode |
|
|
|
|
`((,(rx "$") 0 'font-latex-sedate-face t)) t) |
|
|
|
|
|
|
|
|
|
(define-key-alist LaTeX-mode-map |
|
|
|
|
'(("M-S-SPC" . TeX-insert-braces) |
|
|
|
|
("C-c C-v" . wilder/TeX-insert-reference) |
|
|
|
|
("C-M-<return>" . wilder/TeX-insert-align-dwim) |
|
|
|
|
;; unbind return - NOTE it is important to unbind |
|
|
|
|
;; <return> and not RET. If we unbind RET then C-m won't work |
|
|
|
|
;; either. |
|
|
|
|
("<return>" . (lambda() (interactive) (insert "\\"))) |
|
|
|
|
("S-<return>" . (lambda() (interactive) (insert "|"))) |
|
|
|
|
("C-c C-." . LaTeX-mark-environment) |
|
|
|
|
("C-c C-k" . (lambda (r-begin r-end) |
|
|
|
|
(interactive "r") |
|
|
|
|
(add-delimiter "_{" "}" r-begin r-end))) |
|
|
|
|
("C-c C-i" . (lambda (r-begin r-end) |
|
|
|
|
(interactive "r") |
|
|
|
|
(add-delimiter "^{" "}" r-begin r-end))) |
|
|
|
|
("M-|" . (lambda (r-begin r-end) |
|
|
|
|
(interactive "r") |
|
|
|
|
(add-delimiter "|" "|" r-begin r-end))) |
|
|
|
|
("M-," . (lambda (r-begin r-end) |
|
|
|
|
(interactive "r") |
|
|
|
|
(add-delimiter ", " ", " r-begin r-end))) |
|
|
|
|
("M-\"" . (lambda (r-begin r-end) |
|
|
|
|
(interactive "r") |
|
|
|
|
(add-delimiter "“" "”" r-begin r-end))) |
|
|
|
|
|
|
|
|
|
;; This is the rationale: C-M-SPC starts inline math C-M-RET starts display math |
|
|
|
|
|
|
|
|
|
("C-M-SPC" . (lambda (r-begin r-end) (interactive "r") (add-delimiter "$" "$" r-begin r-end))) |
|
|
|
|
("C-c C-d" . wilder/TeX-insert-todonote) |
|
|
|
|
("C-M-d" . kill-sexp) |
|
|
|
|
("C-M-i" . down-list) ;; -i stands for /in/ |
|
|
|
|
("C-M-o" . up-list) ;; -o stands for /out/ |
|
|
|
|
("<f4>" . ( lambda() (interactive) (message "Use C-c C-c"))) |
|
|
|
|
("C-c C-c" . ( lambda() (interactive) (compile "/home/jacopods/scripts/latex-mk")) ) |
|
|
|
|
("~" . wilder/TeX-replace-tilde) |
|
|
|
|
("C-o" . wilder/open-line-and-indent) |
|
|
|
|
;; Force moves around to be more “semantic” |
|
|
|
|
("C-v" . goto-next-comment-line) |
|
|
|
|
("M-v" . goto-previous-comment-line) |
|
|
|
|
("C-S-v" . backward-paragraph))) |
|
|
|
|
|
|
|
|
|
(mapcar (lambda (ch) |
|
|
|
|
(define-key LaTeX-mode-map (kbd ch) 'insert-char-with-padding)) |
|
|
|
|
'("=" "≠" ">" "<" "≥" "≤" "⇒" "∩" "∪" "∨" "∧" "×" "⊂" "⊃")) |
|
|
|
|
|
|
|
|
|
;; Move around commands in the Right Way™ |
|
|
|
|
(modify-syntax-entry ?\\ "w" LaTeX-mode-syntax-table) |
|
|
|
|
(setq subword-forward-regexp "\\W*\\(\\([\\\\[:upper:]]*\\W?\\)[[:lower:][:digit:]]*\\)") |
|
|
|
|
(setq subword-backward-regexp "\\(\\(\\W\\|[[:lower:][:digit:]]\\)\\([\\\\[:upper:]]+\\W*\\)\\|\\W\\w+\\)"))) |
|
|
|
|
(eval-after-load 'latex |
|
|
|
|
'(progn |
|
|
|
|
(font-lock-add-keywords 'latex-mode |
|
|
|
|
`((,(rx "$") 0 'font-latex-sedate-face t)) t) |
|
|
|
|
(defface font-latex-special-comment-face '((t (:foreground "#2aa198"))) "Cyan") |
|
|
|
|
(font-lock-add-keywords 'latex-mode '(("^% \\([^*].*\\)" 1 'font-latex-special-comment-face t))) |
|
|
|
|
|
|
|
|
|
(define-key-alist LaTeX-mode-map |
|
|
|
|
'(("M-S-SPC" . TeX-insert-braces) |
|
|
|
|
("C-c C-v" . wilder/TeX-insert-reference) |
|
|
|
|
("C-M-<return>" . wilder/TeX-insert-align-dwim) |
|
|
|
|
;; unbind return - NOTE it is important to unbind |
|
|
|
|
;; <return> and not RET. If we unbind RET then C-m won't work |
|
|
|
|
;; either. |
|
|
|
|
("<return>" . (lambda() (interactive) (insert "\\"))) |
|
|
|
|
("S-<return>" . (lambda() (interactive) (insert "|"))) |
|
|
|
|
("C-c C-." . LaTeX-mark-environment) |
|
|
|
|
("C-c C-k" . (lambda (r-begin r-end) |
|
|
|
|
(interactive "r") |
|
|
|
|
(add-delimiter "_{" "}" r-begin r-end))) |
|
|
|
|
("C-c C-i" . (lambda (r-begin r-end) |
|
|
|
|
(interactive "r") |
|
|
|
|
(add-delimiter "^{" "}" r-begin r-end))) |
|
|
|
|
("M-|" . (lambda (r-begin r-end) |
|
|
|
|
(interactive "r") |
|
|
|
|
(add-delimiter "|" "|" r-begin r-end))) |
|
|
|
|
("M-," . (lambda (r-begin r-end) |
|
|
|
|
(interactive "r") |
|
|
|
|
(add-delimiter ", " ", " r-begin r-end))) |
|
|
|
|
("M-\"" . (lambda (r-begin r-end) |
|
|
|
|
(interactive "r") |
|
|
|
|
(add-delimiter "“" "”" r-begin r-end))) |
|
|
|
|
|
|
|
|
|
;; This is the rationale: C-M-SPC starts inline math C-M-RET starts display math |
|
|
|
|
|
|
|
|
|
("C-M-SPC" . (lambda (r-begin r-end) (interactive "r") (add-delimiter "$" "$" r-begin r-end))) |
|
|
|
|
("C-c C-d" . wilder/TeX-insert-todonote) |
|
|
|
|
("C-M-d" . kill-sexp) |
|
|
|
|
("C-M-i" . down-list) ;; -i stands for /in/ |
|
|
|
|
("C-M-o" . up-list) ;; -o stands for /out/ |
|
|
|
|
("<f4>" . ( lambda() (interactive) (message "Use C-c C-c"))) |
|
|
|
|
("C-c C-c" . ( lambda() (interactive) (compile "/home/jacopods/scripts/latex-mk")) ) |
|
|
|
|
("~" . wilder/TeX-replace-tilde) |
|
|
|
|
("C-o" . wilder/open-line-and-indent) |
|
|
|
|
;; Force moves around to be more “semantic” |
|
|
|
|
("C-v" . goto-next-comment-line) |
|
|
|
|
("M-v" . goto-previous-comment-line) |
|
|
|
|
("C-S-v" . backward-paragraph))) |
|
|
|
|
|
|
|
|
|
(mapcar (lambda (ch) |
|
|
|
|
(define-key LaTeX-mode-map (kbd ch) 'insert-char-with-padding)) |
|
|
|
|
'("=" "≠" ">" "<" "≥" "≤" "⇒" "∩" "∪" "∨" "∧" "×" "⊂" "⊃")) |
|
|
|
|
|
|
|
|
|
;; Move around commands in the Right Way™ |
|
|
|
|
(modify-syntax-entry ?\\ "w" LaTeX-mode-syntax-table) |
|
|
|
|
(setq subword-forward-regexp "\\W*\\(\\([\\\\[:upper:]]*\\W?\\)[[:lower:][:digit:]]*\\)") |
|
|
|
|
(setq subword-backward-regexp "\\(\\(\\W\\|[[:lower:][:digit:]]\\)\\([\\\\[:upper:]]+\\W*\\)\\|\\W\\w+\\)"))) |
|
|
|
|
#+END_SRC |
|
|
|
|
|
|
|
|
|
*** Require |
|
|
|
|
|