From eec74ab1b27149ab09593a152f62d442ff13740c Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Mon, 14 Oct 2019 13:52:19 +0200 Subject: [PATCH] Added some configuration for LaTeX in Emacs --- .spacemacs | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.spacemacs b/.spacemacs index 25fde5b..470a2a4 100644 --- a/.spacemacs +++ b/.spacemacs @@ -301,14 +301,14 @@ It should only modify the values of Spacemacs settings." ;; Press `SPC T n' to cycle to the next theme in the list (works great ;; with 2 themes variants, one dark and one light) dotspacemacs-themes '(xresources + doom-vibrant + doom-nord spacemacs-dark doom-one doom-opera - doom-nord doom-dracula doom-molokai doom-peacock - doom-vibrant doom-sourcerer doom-spacegrey kaolin-dark @@ -487,7 +487,7 @@ It should only modify the values of Spacemacs settings." ;; :size-limit-kb 1000) ;; When used in a plist, `visual' takes precedence over `relative'. dotspacemacs-line-numbers '(:relative nil - :enabled-for-modes prog-mode) + :enabled-for-modes prog-mode) ;; Code folding method. Possible values are `evil' and `origami'. ;; (default 'evil) @@ -677,6 +677,9 @@ dump." ("ll" . flex-mode) ("s" . asm-mode) ("pl" . prolog-mode) ("l" . scheme-mode) ("vs" . glsl-mode) ("fs" . glsl-mode))) (push (cons (concat "\\." (car e) "\\'") (cdr e)) auto-mode-alist)) + (dolist (e '("service" "timer" "target" "mount" "automount" "slice" "socket" + "path" "netdev" "network" "link")) + (push (cons (concat "\\." e "\\'") 'conf-unix-mode) auto-mode-alist)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; shortcuts ; @@ -1006,6 +1009,30 @@ So a typical ID could look like \"Org-4nd91V40HI\"." ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; LaTeX ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defcustom tex-my-viewer + "xreader --fork -s -x \"emacsclient --eval '(progn (switch-to-buffer (file-name-nondirectory \"'\"'\"%{input}\"'\"'\")) (goto-line %{line}))'\"" + "PDF Viewer for TeX documents. You may want to fork the +viewer so that it detects when the same document is launched +twice, and persist when Emacs gets closed. + +Simple command: + + xreader --fork + +We can use + + emacsclient --eval '(progn (switch-to-buffer + (file-name-nondirectory \"%{input}\")) + (goto-line %{line}))' + +to reverse-search a pdf using SyncTeX. Note that the quotes and +double-quotes matter and must be escaped appropriately." + :safe 'stringp) + (add-hook 'doc-view-minor-mode-hook 'auto-revert-mode) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Qt ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;