Changed configuration

This commit is contained in:
Eduardo Cueto-Mendoza 2024-06-19 06:47:13 +01:00
parent 8c0110d884
commit 8c0416231d
2 changed files with 94 additions and 90 deletions

3
.gitignore vendored
View File

@ -1,6 +1,7 @@
var/ var/
elpa/ elpa/
etc/ etc/
eln-cache/
*~ *~
.last-package-update-day .last-package-update-day
init.el init.el

181
Emacs.org
View File

@ -915,110 +915,113 @@ This will install the [[https://github.com/theia-ide/typescript-language-server]
#+begin_src emacs-lisp #+begin_src emacs-lisp
;;(require 'flymake) ;;(require 'flymake)
;;(defun flymake-get-tex-args (file-name) ;;(defun flymake-get-tex-args (file-name)
;;(list "pdflatex" ;;(list "pdflatex"
;;(list "-file-line-error" "-draftmode" "-interaction=nonstopmode" file-name))) ;;(list "-file-line-error" "-draftmode" "-interaction=nonstopmode" file-name)))
;;(add-hook 'LaTeX-mode-hook 'flymake-mode) ;;(add-hook 'LaTeX-mode-hook 'flymake-mode)
;;(defun turn-on-outline-minor-mode () ;;(defun turn-on-outline-minor-mode ()
;;(outline-minor-mode 1)) ;;(outline-minor-mode 1))
;;(add-hook 'LaTeX-mode-hook 'turn-on-outline-minor-mode) ;;(add-hook 'LaTeX-mode-hook 'turn-on-outline-minor-mode)
;;(add-hook 'latex-mode-hook 'turn-on-outline-minor-mode) ;;(add-hook 'latex-mode-hook 'turn-on-outline-minor-mode)
;;(setq outline-minor-mode-prefix "\C-c \C-o") ; Or something else ;;(setq outline-minor-mode-prefix "\C-c \C-o") ; Or something else
;;(require 'tex-site) ;;(require 'tex-site)
;;(autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t) ;;(autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t)
;;(autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil) ;;(autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil)
;;(autoload 'reftex-citation "reftex-cite" "Make citation" nil) ;;(autoload 'reftex-citation "reftex-cite" "Make citation" nil)
;;(autoload 'reftex-index-phrase-mode "reftex-index" "Phrase Mode" t) ;;(autoload 'reftex-index-phrase-mode "reftex-index" "Phrase Mode" t)
;;(add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode ;;(add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
;; (add-hook 'reftex-load-hook 'imenu-add-menubar-index) ;; (add-hook 'reftex-load-hook 'imenu-add-menubar-index)
;;(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ;;(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
;;(setq LaTeX-eqnarray-label "eq" ;;(setq LaTeX-eqnarray-label "eq"
;;LaTeX-equation-label "eq" ;;LaTeX-equation-label "eq"
;;LaTeX-figure-label "fig" ;;LaTeX-figure-label "fig"
;;LaTeX-table-label "tab" ;;LaTeX-table-label "tab"
;;LaTeX-myChapter-label "chap" ;;LaTeX-myChapter-label "chap"
;;TeX-auto-save t ;;TeX-auto-save t
;;TeX-newline-function 'reindent-then-newline-and-indent ;;TeX-newline-function 'reindent-then-newline-and-indent
;;TeX-parse-self t ;;TeX-parse-self t
;;TeX-style-path ;;TeX-style-path
;;'("style/" "auto/" ;;'("style/" "auto/"
;;"/usr/share/emacs21/site-lisp/auctex/style/" ;;"/usr/share/emacs21/site-lisp/auctex/style/"
;;"/var/lib/auctex/emacs21/" ;;"/var/lib/auctex/emacs21/"
;;"/usr/local/share/emacs/site-lisp/auctex/style/") ;;"/usr/local/share/emacs/site-lisp/auctex/style/")
;;LaTeX-section-hook ;;LaTeX-section-hook
;;'(LaTeX-section-heading ;;'(LaTeX-section-heading
;;LaTeX-section-title ;;LaTeX-section-title
;;LaTeX-section-toc ;;LaTeX-section-toc
;;LaTeX-section-section ;;LaTeX-section-section
;;LaTeX-section-label)) ;;LaTeX-section-label))
;; Better configuration but rquires pdf-tools ;; Better configuration but rquires pdf-tools
(use-package pdf-tools (use-package pdf-tools
:ensure t :ensure t
:config :config
(pdf-tools-install) (pdf-tools-install)
(setq-default pdf-view-display-size 'fit-page) (setq-default pdf-view-display-size 'fit-page)
(setq pdf-annot-activate-created-annotations t) (setq pdf-annot-activate-created-annotations t)
(define-key pdf-view-mode-map (kbd "C-s") 'isearch-forward) (define-key pdf-view-mode-map (kbd "C-s") 'isearch-forward)
(define-key pdf-view-mode-map (kbd "C-r") 'isearch-backward) (define-key pdf-view-mode-map (kbd "C-r") 'isearch-backward)
;(add-hook 'pdf-view-mode-hook (lambda () ;(add-hook 'pdf-view-mode-hook (lambda ()
; (bms/pdf-midnite-amber))) ; automatically turns on midnight-mode for pdfs ; (bms/pdf-midnite-amber))) ; automatically turns on midnight-mode for pdfs
(add-hook 'pdf-view-mode-hook 'pdf-tools-enable-minor-modes) (add-hook 'pdf-view-mode-hook 'pdf-tools-enable-minor-modes)
) )
(use-package auctex-latexmk (use-package auctex-latexmk
:ensure t :ensure t
:config :config
(auctex-latexmk-setup) (auctex-latexmk-setup)
(setq auctex-latexmk-inherit-TeX-PDF-mode t)) (setq auctex-latexmk-inherit-TeX-PDF-mode t))
(use-package reftex (use-package reftex
:ensure t :ensure t
:defer t :defer t
:config :config
(setq reftex-cite-prompt-optional-args t)) ;; Prompt for empty optional arguments in cite (setq reftex-cite-prompt-optional-args t)) ;; Prompt for empty optional arguments in cite
;;(use-package auto-dictionary ;;(use-package auto-dictionary
;; :ensure t ;; :ensure t
;; :init(add-hook 'flyspell-mode-hook (lambda () (auto-dictionary-mode 1)))) ;; :init(add-hook 'flyspell-mode-hook (lambda () (auto-dictionary-mode 1))))
(use-package company-auctex (use-package org-ref
:ensure t :ensure t)
:init (company-auctex-init))
(use-package tex (use-package company-auctex
:ensure auctex :ensure t
:mode ("\\.tex\\'" . latex-mode) :init (company-auctex-init))
:config (progn
(setq TeX-source-correlate-mode t) (use-package tex
(setq TeX-source-correlate-method 'synctex) :ensure auctex
(setq TeX-auto-save t) :mode ("\\.tex\\'" . latex-mode)
(setq TeX-parse-self t) :config (progn
;;(setq-default TeX-master "paper.tex") (setq TeX-source-correlate-mode t)
(setq-default TeX-master "0_front_matter.tex") (setq TeX-source-correlate-method 'synctex)
(setq reftex-plug-into-AUCTeX t) (setq TeX-auto-save t)
(pdf-tools-install) (setq TeX-parse-self t)
(setq TeX-view-program-selection '((output-pdf "PDF Tools")) ;;(setq-default TeX-master "paper.tex")
TeX-source-correlate-start-server t) (setq-default TeX-master "0_front_matter.tex")
;; Update PDF buffers after successful LaTeX runs (setq reftex-plug-into-AUCTeX t)
(add-hook 'TeX-after-compilation-finished-functions (pdf-tools-install)
'TeX-revert-document-buffer) (setq TeX-view-program-selection '((output-pdf "PDF Tools"))
(add-hook 'LaTeX-mode-hook TeX-source-correlate-start-server t)
(lambda () ;; Update PDF buffers after successful LaTeX runs
(reftex-mode t) (add-hook 'TeX-after-compilation-finished-functions
;;(flyspell-mode t) 'TeX-revert-document-buffer)
)) (add-hook 'LaTeX-mode-hook
)) (lambda ()
(reftex-mode t)
;;(flyspell-mode t)
))
))