;;; cleveref.el --- AUCTeX style file with support for cleveref.sty ;; Copyright (C) 1999 Free Software Foundation, Inc. ;; Author: Marcel ;; Maintainer: address@hidden ;; This file is part of AUCTeX. ;; AUCTeX is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; AUCTeX is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with AUCTeX; see the file COPYING. If not, write to the Free ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ;; 02110-1301, USA. ;;; Code: (TeX-add-style-hook "cleveref" (lambda () (TeX-add-symbols ;; The macros with label arguments '("cref" TeX-arg-label) '("Cref" TeX-arg-label) '("cref*" TeX-arg-label) '("Cref*" TeX-arg-label) '("crefrange" TeX-arg-label TeX-arg-label) '("Crefrange" TeX-arg-label TeX-arg-label) '("crefrange*" TeX-arg-label TeX-arg-label) '("Crefrange*" TeX-arg-label TeX-arg-label) '("cpageref" TeX-arg-label) '("Cpageref" TeX-arg-label) '("cpagerefrange" TeX-arg-label TeX-arg-label) '("Cpagerefrange" TeX-arg-label TeX-arg-label) '("namecref" TeX-arg-label) '("nameCref" TeX-arg-label) '("namecrefs" TeX-arg-label) '("nameCrefs" TeX-arg-label) '("lcnamecref" TeX-arg-label) '("lcnamecrefs" TeX-arg-label) '("labelcref" TeX-arg-label) '("labelcpageref" TeX-arg-label) '("crefalias" TeX-arg-counter "label's type") ;; And the other macros used for customization "crefdefaultlabelformat" "crefrangeconjunction" "crefrangepreconjunction" "crefrangepostconjunction" "crefpairconjunction" "crefmiddleconjunction" "creflastconjunction" "crefpairgroupconjunction" "crefmiddlegroupconjunction" "creflastgroupconjunction" "crefname" "Crefname" "creflabelformat" "crefrangelabelformat" "crefformat" "Crefformat" "crefrangeformat" "Crefrangeformat" "crefmultiformat" "Crefmultiformat" "crefrangemultiformat" "Crefrangemultiformat" "labelcrefformat" "labelcrefrangeformat" "labelcrefmultiformat" "labelcrefrangemultiformat") ;; Install completion for labels (setq TeX-complete-list (append '(("\\\\[cC]\\(ref\\|pageref\\)\\*?{\\([^{}\n\r\\%]*\\)" 2 LaTeX-label-list "}") ("\\\\[cC]\\(refrange\\|pagerefrange\\){\\([^{}\n\r\\%,]*\\)" 2 LaTeX-label-list "}{}") ("\\\\\\(name[cC]refs?\\|lcnamecrefs?\\|labelcref\\|labelcpageref\\){\\([^{}\n\r\\%,]*\\)" 2 LaTeX-label-list "}")) TeX-complete-list)) ;; Fontification (when (and (fboundp 'font-latex-add-keywords) (eq TeX-install-font-lock 'font-latex-setup)) (font-latex-add-keywords '(("cref" "*{") ("Cref" "*{") ("crefrange" "*{{") ("Crefrange" "*{{") ("cpageref" "*{") ("Cpageref" "*{") ("cpagerefrange" "*{{") ("Cpagerefrange" "*{{") ("namecref" "*{") ("nameCref" "*{") ("namecrefs" "*{") ("nameCrefs" "*{") ("lcnamecref" "*{") ("lcnamecrefs" "*{") ("labelcref" "*{") ("labelcpageref" "*{") ("crefalias" "*{{")) 'reference)))) (defvar LaTeX-cleveref-package-options '("sort" "nosort" "compress" "sort&compress" "capitalise" "nameinlink" "noabbrev") "Package options for the cleveref package.") ;;; cleveref.el ends here