Function: TeX-load-style

TeX-load-style is a byte-compiled function defined in tex.el.

Signature

(TeX-load-style STYLE)

Documentation

Search for and load each definition for STYLE in TeX-style-path.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex.el
(defun TeX-load-style (style)
  "Search for and load each definition for STYLE in `TeX-style-path'."
  (cond ((assoc style TeX-style-hook-list)) ; We already found it
        ((string-match "\\`\\(.+[/\\]\\)\\([^/\\]*\\)\\'" style) ;Complex path
         (let* ((dir (substring style (match-beginning 1) (match-end 1)))
                (style (substring style (match-beginning 2) (match-end 2)))
                (master-dir (if (stringp TeX-master)
                                (file-name-directory
                                 (file-relative-name TeX-master))
                              "./"))
                (TeX-style-path (append (list (expand-file-name
                                               TeX-auto-local dir)
                                              (expand-file-name
                                               TeX-auto-local master-dir)
                                              (expand-file-name
                                               TeX-style-local dir)
                                              (expand-file-name
                                               TeX-style-local master-dir))
                                        TeX-style-path)))
           (TeX-load-style style)))
        (t                              ;Relative path
         ;; Insert empty list to mark the fact that we have searched.
         (setq TeX-style-hook-list (cons (list style) TeX-style-hook-list))
         ;; Now check each element of the path
         (dolist (name TeX-style-path)
           (TeX-load-style-file (expand-file-name style name))))))