 ;; company-math
 ;; Completion backends for unicode math symbols and latex tags
 (use-package company-math
-  :config
-  (add-hook 'TeX-mode-hook (lambda ()
-                             (setq-local company-backends
-                                         (append '((company-math-symbols-latex company-latex-commands))
-                                                 company-backends)))))
+  :after (company tex)
+  :hook (TeX-mode-hook . (lambda ()
+			   (setq-local company-backends
+				       (append '((company-math-symbols-latex company-latex-commands))
+					       company-backends)))))
+
 
 ;; beginend
 ;; Redefine M-< and M-> for some modes

;; org-bullets
;; Show bullets in org-mode as UTF-8 characters
(use-package org-bullets
  :config
  (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))

;; undo-tree
;; Treat undo history as a tree

  :defer t
  :config
  ;; Run prog mode hooks for bibtex

  ;; Use a modern BibTeX dialect
  (bibtex-set-dialect 'biblatex))
  ;; Run prog mode hooks for bibtex
  :hook (bibtex-mode-hook . (lambda () (run-hooks 'prog-mode-hook))))

;; reftex
;; TeX cross-reference management
