 ;;; lang/latex/config.el -*- lexical-binding: t; -*-
-
-(defvar +latex-bibtex-file ""
-  "File AUCTeX (specifically RefTeX) uses to search for citations.")
 
 (defvar +latex-indent-level-item-continuation 4
   "Custom indentation level for items in enumeration-type environments")
-
-;;
-;; Plugins
-;;
 
 ;; sp's default rules are obnoxious, so disable them
 (provide 'smartparens-latex)

                             company-auctex-environments))
                          company-backends)))))

(def-package! company-reftex
  :when (featurep! :completion company)
  :after reftex
  :config
  (set-company-backend! 'reftex-mode 'company-reftex-labels 'company-reftex-citations))

;; Nicely indent lines that have wrapped when visual line mode is activated
(def-package! adaptive-wrap
  :hook (LaTeX-mode . adaptive-wrap-prefix-mode)
  :init (setq-default adaptive-wrap-extra-indent 0))

  (setq-default TeX-master nil)
  ;; Display the output of the latex commands in a popup.
  (set-popup-rule! " output\\*$" :size 15)
  ;; TeX Folding
  (add-hook 'TeX-mode-hook #'TeX-fold-mode))

(after! latex
  (setq LaTeX-section-hook ; Add the toc entry to the sectioning hooks.
