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

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
var/
elpa/
etc/
eln-cache/
*~
.last-package-update-day
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
;;(require 'flymake)
;;(require 'flymake)
;;(defun flymake-get-tex-args (file-name)
;;(list "pdflatex"
;;(list "-file-line-error" "-draftmode" "-interaction=nonstopmode" file-name)))
;;(defun flymake-get-tex-args (file-name)
;;(list "pdflatex"
;;(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 ()
;;(outline-minor-mode 1))
;;(defun turn-on-outline-minor-mode ()
;;(outline-minor-mode 1))
;;(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
;;(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
;;(require 'tex-site)
;;(autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t)
;;(autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil)
;;(autoload 'reftex-citation "reftex-cite" "Make citation" nil)
;;(autoload 'reftex-index-phrase-mode "reftex-index" "Phrase Mode" t)
;;(add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
;; (add-hook 'reftex-load-hook 'imenu-add-menubar-index)
;;(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
;;(require 'tex-site)
;;(autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t)
;;(autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil)
;;(autoload 'reftex-citation "reftex-cite" "Make citation" nil)
;;(autoload 'reftex-index-phrase-mode "reftex-index" "Phrase Mode" t)
;;(add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
;; (add-hook 'reftex-load-hook 'imenu-add-menubar-index)
;;(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
;;(setq LaTeX-eqnarray-label "eq"
;;LaTeX-equation-label "eq"
;;LaTeX-figure-label "fig"
;;LaTeX-table-label "tab"
;;LaTeX-myChapter-label "chap"
;;TeX-auto-save t
;;TeX-newline-function 'reindent-then-newline-and-indent
;;TeX-parse-self t
;;TeX-style-path
;;'("style/" "auto/"
;;"/usr/share/emacs21/site-lisp/auctex/style/"
;;"/var/lib/auctex/emacs21/"
;;"/usr/local/share/emacs/site-lisp/auctex/style/")
;;LaTeX-section-hook
;;'(LaTeX-section-heading
;;LaTeX-section-title
;;LaTeX-section-toc
;;LaTeX-section-section
;;LaTeX-section-label))
;;(setq LaTeX-eqnarray-label "eq"
;;LaTeX-equation-label "eq"
;;LaTeX-figure-label "fig"
;;LaTeX-table-label "tab"
;;LaTeX-myChapter-label "chap"
;;TeX-auto-save t
;;TeX-newline-function 'reindent-then-newline-and-indent
;;TeX-parse-self t
;;TeX-style-path
;;'("style/" "auto/"
;;"/usr/share/emacs21/site-lisp/auctex/style/"
;;"/var/lib/auctex/emacs21/"
;;"/usr/local/share/emacs/site-lisp/auctex/style/")
;;LaTeX-section-hook
;;'(LaTeX-section-heading
;;LaTeX-section-title
;;LaTeX-section-toc
;;LaTeX-section-section
;;LaTeX-section-label))
;; Better configuration but rquires pdf-tools
;; Better configuration but rquires pdf-tools
(use-package pdf-tools
:ensure t
:config
(pdf-tools-install)
(setq-default pdf-view-display-size 'fit-page)
(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-r") 'isearch-backward)
;(add-hook 'pdf-view-mode-hook (lambda ()
; (bms/pdf-midnite-amber))) ; automatically turns on midnight-mode for pdfs
(add-hook 'pdf-view-mode-hook 'pdf-tools-enable-minor-modes)
)
(use-package pdf-tools
:ensure t
:config
(pdf-tools-install)
(setq-default pdf-view-display-size 'fit-page)
(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-r") 'isearch-backward)
;(add-hook 'pdf-view-mode-hook (lambda ()
; (bms/pdf-midnite-amber))) ; automatically turns on midnight-mode for pdfs
(add-hook 'pdf-view-mode-hook 'pdf-tools-enable-minor-modes)
)
(use-package auctex-latexmk
:ensure t
:config
(auctex-latexmk-setup)
(setq auctex-latexmk-inherit-TeX-PDF-mode t))
(use-package auctex-latexmk
:ensure t
:config
(auctex-latexmk-setup)
(setq auctex-latexmk-inherit-TeX-PDF-mode t))
(use-package reftex
:ensure t
:defer t
:config
(setq reftex-cite-prompt-optional-args t)) ;; Prompt for empty optional arguments in cite
(use-package reftex
:ensure t
:defer t
:config
(setq reftex-cite-prompt-optional-args t)) ;; Prompt for empty optional arguments in cite
;;(use-package auto-dictionary
;; :ensure t
;; :init(add-hook 'flyspell-mode-hook (lambda () (auto-dictionary-mode 1))))
;;(use-package auto-dictionary
;; :ensure t
;; :init(add-hook 'flyspell-mode-hook (lambda () (auto-dictionary-mode 1))))
(use-package company-auctex
:ensure t
:init (company-auctex-init))
(use-package org-ref
:ensure t)
(use-package tex
:ensure auctex
:mode ("\\.tex\\'" . latex-mode)
:config (progn
(setq TeX-source-correlate-mode t)
(setq TeX-source-correlate-method 'synctex)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
;;(setq-default TeX-master "paper.tex")
(setq-default TeX-master "0_front_matter.tex")
(setq reftex-plug-into-AUCTeX t)
(pdf-tools-install)
(setq TeX-view-program-selection '((output-pdf "PDF Tools"))
TeX-source-correlate-start-server t)
;; Update PDF buffers after successful LaTeX runs
(add-hook 'TeX-after-compilation-finished-functions
'TeX-revert-document-buffer)
(add-hook 'LaTeX-mode-hook
(lambda ()
(reftex-mode t)
;;(flyspell-mode t)
))
))
(use-package company-auctex
:ensure t
:init (company-auctex-init))
(use-package tex
:ensure auctex
:mode ("\\.tex\\'" . latex-mode)
:config (progn
(setq TeX-source-correlate-mode t)
(setq TeX-source-correlate-method 'synctex)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
;;(setq-default TeX-master "paper.tex")
(setq-default TeX-master "0_front_matter.tex")
(setq reftex-plug-into-AUCTeX t)
(pdf-tools-install)
(setq TeX-view-program-selection '((output-pdf "PDF Tools"))
TeX-source-correlate-start-server t)
;; Update PDF buffers after successful LaTeX runs
(add-hook 'TeX-after-compilation-finished-functions
'TeX-revert-document-buffer)
(add-hook 'LaTeX-mode-hook
(lambda ()
(reftex-mode t)
;;(flyspell-mode t)
))
))