reftex-vars.el 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074
  1. ;;; reftex-vars.el --- configuration variables for RefTeX
  2. ;; Copyright (C) 1997-1999, 2001-2017 Free Software Foundation, Inc.
  3. ;; Author: Carsten Dominik <dominik@science.uva.nl>
  4. ;; Maintainer: auctex-devel@gnu.org
  5. ;; This file is part of GNU Emacs.
  6. ;; GNU Emacs is free software: you can redistribute it and/or modify
  7. ;; it under the terms of the GNU General Public License as published by
  8. ;; the Free Software Foundation, either version 3 of the License, or
  9. ;; (at your option) any later version.
  10. ;; GNU Emacs is distributed in the hope that it will be useful,
  11. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ;; GNU General Public License for more details.
  14. ;; You should have received a copy of the GNU General Public License
  15. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  16. ;;; Commentary:
  17. ;;; Code:
  18. (defvar reftex-tables-dirty)
  19. (eval-when-compile (require 'cl-lib))
  20. (eval-and-compile
  21. (defun reftex-set-dirty (symbol value)
  22. (setq reftex-tables-dirty t)
  23. (set symbol value)))
  24. ;; Define the two constants which are needed during compilation
  25. (eval-and-compile
  26. (defconst reftex-label-alist-builtin
  27. '(
  28. ;; Some aliases, mostly for backward compatibility
  29. (Sideways "Alias for -->rotating" (rotating))
  30. (AMSTeX "amsmath with eqref macro"
  31. ((nil ?e nil "~\\eqref{%s}")
  32. amsmath))
  33. ;; Individual package defaults
  34. (amsmath "AMS-LaTeX math environments"
  35. (("align" ?e nil nil eqnarray-like)
  36. ("gather" ?e nil nil eqnarray-like)
  37. ("multline" ?e nil nil t)
  38. ("flalign" ?e nil nil eqnarray-like)
  39. ("alignat" ?e nil nil alignat-like)
  40. ("xalignat" ?e nil nil alignat-like)
  41. ("xxalignat" ?e nil nil alignat-like)
  42. ("subequations" ?e nil nil t)))
  43. (endnotes "The \\endnote macro"
  44. (("\\endnote[]{}" ?N "en:" "~\\ref{%s}" 2
  45. (regexp "endnotes?" "notes?" "Anmerkung\\(en\\)?" "Anm\\."))))
  46. (fancybox "The Beqnarray environment"
  47. (("Beqnarray" ?e nil nil eqnarray-like)))
  48. (floatfig "The floatingfigure environment"
  49. (("floatingfigure" ?f nil nil caption)))
  50. (longtable "The longtable environment"
  51. (("longtable" ?t nil nil caption)))
  52. (picinpar "The figwindow and tabwindow environments"
  53. (("figwindow" ?f nil nil 1)
  54. ("tabwindow" ?f nil nil 1)))
  55. (rotating "Sidewaysfigure and table"
  56. (("sidewaysfigure" ?f nil nil caption)
  57. ("sidewaystable" ?t nil nil caption)))
  58. (sidecap "CSfigure and SCtable"
  59. (("SCfigure" ?f nil nil caption)
  60. ("SCtable" ?t nil nil caption)))
  61. (subfigure "Subfigure environments/macro"
  62. (("subfigure" ?f nil nil caption)
  63. ("subfigure*" ?f nil nil caption)
  64. ("\\subfigure[]{}" ?f nil nil 1)))
  65. (supertab "Supertabular environment"
  66. (("supertabular" ?t nil nil "\\tablecaption{")))
  67. (wrapfig "The wrapfig package"
  68. (("wrapfigure" ?f nil nil caption)
  69. ("wraptable" ?t nil nil caption)))
  70. (ctable "The ctable package"
  71. (("\\ctable[]{}{}{}" ?t "tab:" "~\\ref{%s}" 1 ("table" "Tabelle"))))
  72. (listings "The listings package"
  73. (("lstlisting" ?l "lst:" "~\\ref{%s}" nil (regexp "[Ll]isting"))))
  74. (minted "The minted package"
  75. (("minted" ?l "lst:" "~\\ref{%s}" nil (regexp "[Ll]isting"))))
  76. ;; The LaTeX core stuff
  77. (LaTeX "LaTeX default environments"
  78. (("section" ?s "%S" "~\\ref{%s}" (nil . t)
  79. (regexp "parts?" "chapters?" "chap\\." "sections?" "sect?\\."
  80. "paragraphs?" "par\\."
  81. "\\\\S" "\247" "Teile?" "Kapitel" "Kap\\." "Abschnitte?"
  82. "appendi\\(x\\|ces\\)" "App\\." "Anh\"?ange?" "Anh\\."))
  83. ("enumerate" ?i "item:" "~\\ref{%s}" item
  84. (regexp "items?" "Punkte?"))
  85. ("equation" ?e "eq:" "~(\\ref{%s})" t
  86. (regexp "equations?" "eqs?\\." "eqn\\." "Gleichung\\(en\\)?" "Gl\\."))
  87. ("eqnarray" ?e "eq:" nil eqnarray-like)
  88. ("figure" ?f "fig:" "~\\ref{%s}" caption
  89. (regexp "figure?[sn]?" "figs?\\." "Abbildung\\(en\\)?" "Abb\\."))
  90. ("figure*" ?f nil nil caption)
  91. ("table" ?t "tab:" "~\\ref{%s}" caption
  92. (regexp "tables?" "tab\\." "Tabellen?"))
  93. ("table*" ?t nil nil caption)
  94. ("\\footnote[]{}" ?n "fn:" "~\\ref{%s}" 2
  95. (regexp "footnotes?" "Fussnoten?"))
  96. ("any" ?\ " " "~\\ref{%s}" nil)
  97. ;; The label macro is hard coded, but it *could* be defined like this:
  98. ;;("\\label{*}" nil nil nil nil)
  99. ))
  100. ;; Texinfo
  101. (Texinfo "Texinfo default environments" nil))
  102. "The default label environment descriptions.
  103. Lower-case symbols correspond to a style file of the same name in the LaTeX
  104. distribution. Mixed-case symbols are convenience aliases.")
  105. (defconst reftex-cite-format-builtin
  106. '((default "Default macro \\cite{%l}"
  107. "\\cite[]{%l}")
  108. (natbib "The Natbib package"
  109. ((?\C-m . "\\cite[][]{%l}")
  110. (?t . "\\citet[][]{%l}")
  111. (?T . "\\citet*[][]{%l}")
  112. (?p . "\\citep[][]{%l}")
  113. (?P . "\\citep*[][]{%l}")
  114. (?e . "\\citep[e.g.][]{%l}")
  115. (?s . "\\citep[see][]{%l}")
  116. (?a . "\\citeauthor{%l}")
  117. (?A . "\\citeauthor*{%l}")
  118. (?y . "\\citeyear{%l}")
  119. (?n . "\\nocite{%l}")))
  120. (biblatex "The Biblatex package"
  121. ((?\C-m . "\\cite[][]{%l}")
  122. (?C . "\\cite*[][]{%l}")
  123. (?t . "\\textcite[][]{%l}")
  124. (?T . "\\textcite*[][]{%l}")
  125. (?p . "\\parencite[][]{%l}")
  126. (?P . "\\parencite*[][]{%l}")
  127. (?f . "\\footcite[][]{%l}")
  128. (?s . "\\smartcite[][]{%l}")
  129. (?u . "\\autocite[][]{%l}")
  130. (?U . "\\autocite*[][]{%l}")
  131. (?a . "\\citeauthor{%l}")
  132. (?A . "\\citeauthor*{%l}")
  133. (?i . "\\citetitle{%l}")
  134. (?I . "\\citetitle*{%l}")
  135. (?y . "\\citeyear{%l}")
  136. (?Y . "\\citeyear*{%l}")
  137. (?n . "\\nocite{%l}")))
  138. (amsrefs "The AMSRefs package"
  139. ((?\C-m . "\\cite{%l}")
  140. (?p . "\\cite{%l}")
  141. (?P . "\\cites{%l}")
  142. (?t . "\\ocite{%l}")
  143. (?T . "\\ocites{%l}")
  144. (?y . "\\ycite{%l}")
  145. (?Y . "\\ycites{%l}")
  146. (?a . "\\citeauthor{%l}")
  147. (?A . "\\citeauthory{%l}")
  148. (?f . "\\fullcite{%l}")
  149. (?F . "\\fullocite{%l}")
  150. (?n . "\\nocite{%l}")))
  151. (jurabib "The Jurabib package"
  152. ((?\C-m . "\\cite{%l}")
  153. (?c . "\\cite[][]{%l}")
  154. (?t . "\\citet{%l}")
  155. (?p . "\\citep{%l}")
  156. (?e . "\\citep[e.g.][]{%l}")
  157. (?s . "\\citep[see][]{%l}")
  158. (?u . "\\fullcite{%l}")
  159. (?i . "\\citetitle{%l}")
  160. (?a . "\\citeauthor{%l}")
  161. (?e . "\\citefield{}{%l}")
  162. (?y . "\\citeyear{%l}")
  163. (?f . "\\footcite{%l}")
  164. (?F . "\\footcite[][]{%l}")
  165. (?l . "\\footfullcite{%l}")))
  166. (bibentry "The Bibentry package"
  167. "\\bibentry{%l}")
  168. (harvard "The Harvard package"
  169. ((?\C-m . "\\cite[]{%l}")
  170. (?p . "\\cite[]{%l}")
  171. (?t . "\\citeasnoun{%l}")
  172. (?n . "\\citeasnoun{%l}")
  173. (?s . "\\possessivecite{%l}")
  174. (?e . "\\citeaffixed{%l}{?}")
  175. (?y . "\\citeyear{%l}")
  176. (?a . "\\citename{%l}")))
  177. (chicago "The Chicago package"
  178. ((?\C-m . "\\cite[]{%l}")
  179. (?t . "\\citeN[]{%l}")
  180. (?T . "\\shortciteN{%l}")
  181. (?p . "\\cite[]{%l}")
  182. (?P . "\\shortcite{%l}")
  183. (?a . "\\citeA{%l}")
  184. (?A . "\\shortciteA{%l}")
  185. (?y . "\\citeyear{%l}")))
  186. (astron "The Astron package"
  187. ((?\C-m . "\\cite[]{%l}")
  188. (?p . "\\cite[]{%l}" )
  189. (?t . "%2a (\\cite{%l})")))
  190. (author-year "Do-it-yourself Author-year"
  191. ((?\C-m . "\\cite{%l}")
  192. (?t . "%2a (%y)\\nocite{%l}")
  193. (?p . "(%2a %y\\nocite{%l})")))
  194. (locally "Full info in parenthesis"
  195. "(%2a %y, %j %v, %P, %e: %b, %u, %s %<)")
  196. (context
  197. "ConTeXt bib module"
  198. ((?\C-m . "\\cite[%l]")
  199. (?s . "\\cite[][%l]")
  200. (?n . "\\nocite[%l]")))
  201. )
  202. "Builtin versions of the citation format.
  203. The following conventions are valid for all alist entries:
  204. `?\C-m' should always point to a straight \\cite{%l} macro.
  205. `?t' should point to a textual citation (citation as a noun).
  206. `?p' should point to a parenthetical citation.")
  207. (defconst reftex-index-macros-builtin
  208. '((default "Default \\index and \\glossary macros"
  209. (("\\index{*}" "idx" ?i "" nil t)
  210. ("\\glossary{*}" "glo" ?g "" nil t)))
  211. (multind "The multind.sty package"
  212. (("\\index{}{*}" 1 ?i "" nil t)))
  213. (index "The index.sty package"
  214. (("\\index[]{*}" 1 ?i "" nil t)
  215. ("\\index*[]{*}" 1 ?I "" nil nil)))
  216. (Index-Shortcut "index.sty with \\shortindexingon"
  217. (("\\index[]{*}" 1 ?i "" nil t)
  218. ("\\index*[]{*}" 1 ?I "" nil nil)
  219. ("^[]{*}" 1 ?^ "" texmathp t)
  220. ("_[]{*}" 1 ?_ "" texmathp nil))))
  221. "Builtin stuff for `reftex-index-macros'.
  222. Lower-case symbols correspond to a style file of the same name in the LaTeX
  223. distribution. Mixed-case symbols are convenience aliases.")
  224. )
  225. ;; Configuration Variables and User Options for RefTeX ------------------
  226. (defgroup reftex nil
  227. "LaTeX label and citation support."
  228. :tag "RefTeX"
  229. :link '(url-link :tag "Home Page"
  230. "http://www.gnu.org/software/auctex/reftex.html")
  231. :link '(emacs-commentary-link :tag "Commentary in reftex.el" "reftex.el")
  232. :link '(custom-manual "(reftex)Top")
  233. :prefix "reftex-"
  234. :group 'tex)
  235. ;; Table of contents configuration --------------------------------------
  236. (defgroup reftex-table-of-contents-browser nil
  237. "A multifile table of contents browser."
  238. :group 'reftex)
  239. (defcustom reftex-include-file-commands '("include" "input")
  240. "LaTeX commands which input another file.
  241. The file name is expected after the command, either in braces or separated
  242. by whitespace."
  243. :group 'reftex-table-of-contents-browser
  244. :set 'reftex-set-dirty
  245. :type '(repeat string))
  246. (defcustom reftex-max-section-depth 12
  247. "Maximum depth of section levels in document structure.
  248. The default in standard LaTeX is 7, but there are packages for
  249. which this needs to be larger."
  250. :group 'reftex-table-of-contents-browser
  251. :type 'integer)
  252. ;; LaTeX section commands and level numbers
  253. (defcustom reftex-section-levels
  254. '(
  255. ("part" . 0)
  256. ("chapter" . 1)
  257. ("section" . 2)
  258. ("subsection" . 3)
  259. ("subsubsection" . 4)
  260. ("paragraph" . 5)
  261. ("subparagraph" . 6)
  262. ("addchap" . -1) ; KOMA-Script
  263. ("addsec" . -2) ; KOMA-Script
  264. ;;; ("minisec" . -7) ; KOMA-Script
  265. )
  266. "Commands and levels used for defining sections in the document.
  267. This is an alist with each element like (COMMAND-NAME . LEVEL).
  268. The car of each cons cell is the name of the section macro (without
  269. the backslash). The cdr is a number indicating its level. A negative
  270. level means the same level as the positive value, but the section will
  271. never get a number. The cdr may also be a function which will be called
  272. to after the section-re matched to determine the level.
  273. This list is also used for promotion and demotion of sectioning commands.
  274. If you are using a document class which has several sets of sectioning
  275. commands, promotion only works correctly if this list is sorted first
  276. by set, then within each set by level. The promotion commands always
  277. select the nearest entry with the correct new level."
  278. :group 'reftex-table-of-contents-browser
  279. :set 'reftex-set-dirty
  280. :type '(repeat
  281. (cons (string :tag "sectioning macro" "")
  282. (choice
  283. (number :tag "level " 0)
  284. (symbol :tag "function " my-level-func)))))
  285. (defcustom reftex-toc-max-level 100
  286. "The maximum level of toc entries which will be included in the TOC.
  287. Section headings with a bigger level will be ignored. In RefTeX, chapters
  288. are level 1, sections are level 2 etc.
  289. This variable can be changed from within the *toc* buffer with the `t' key."
  290. :group 'reftex-table-of-contents-browser
  291. :type 'integer)
  292. (defcustom reftex-part-resets-chapter nil
  293. "Non-nil means, \\part is like any other sectioning command.
  294. This means, part numbers will be included in the numbering of chapters, and
  295. chapter counters will be reset for each part.
  296. When nil (the default), parts are special, do not reset the chapter counter
  297. and also do not show up in chapter numbers."
  298. :group 'reftex-table-of-contents-browser
  299. :type 'boolean)
  300. (defcustom reftex-auto-recenter-toc 'frame
  301. "Non-nil means, turn automatic recentering of *TOC* window on.
  302. When active, the *TOC* window will always show the section you
  303. are currently working in. Recentering happens whenever Emacs is idle for
  304. more than `reftex-idle-time' seconds.
  305. Value t means, turn on immediately when RefTeX gets started. Then,
  306. recentering will work for any TOC window created during the session.
  307. Value `frame' (the default) means, turn automatic recentering on only while the
  308. dedicated TOC frame does exist, and do the recentering only in that frame. So
  309. when creating that frame (with `d' key in an ordinary TOC window), the
  310. automatic recentering is turned on. When the frame gets destroyed, automatic
  311. recentering is turned off again.
  312. This feature can be turned on and off from the menu
  313. \(Ref->Options)."
  314. :group 'reftex-table-of-contents-browser
  315. :type '(choice
  316. (const :tag "never" nil)
  317. (const :tag "always" t)
  318. (const :tag "in dedicated frame only" frame)))
  319. (defcustom reftex-toc-split-windows-horizontally nil
  320. "Non-nil means, create TOC window by splitting window horizontally."
  321. :group 'reftex-table-of-contents-browser
  322. :type 'boolean)
  323. (defcustom reftex-toc-split-windows-fraction .3
  324. "Fraction of the width or height of the frame to be used for TOC window.
  325. See also `reftex-toc-split-windows-horizontally'."
  326. :group 'reftex-table-of-contents-browser
  327. :type 'number)
  328. (defvar reftex-toc-split-windows-horizontally-fraction 0.5
  329. "This variable is obsolete, use `reftex-toc-split-windows-fraction' instead.")
  330. (defcustom reftex-toc-keep-other-windows t
  331. "Non-nil means, split the selected window to display the *toc* buffer.
  332. This helps to keep the window configuration, but makes the *toc* small.
  333. When nil, all other windows except the selected one will be deleted, so
  334. that the *toc* window fills half the frame."
  335. :group 'reftex-table-of-contents-browser
  336. :type 'boolean)
  337. (defcustom reftex-toc-include-file-boundaries nil
  338. "Non-nil means, include file boundaries in *toc* buffer.
  339. This flag can be toggled from within the *toc* buffer with the `F' key."
  340. :group 'reftex-table-of-contents-browser
  341. :type 'boolean)
  342. (defcustom reftex-toc-include-labels nil
  343. "Non-nil means, include labels in *toc* buffer.
  344. This flag can be toggled from within the *toc* buffer with the `l' key."
  345. :group 'reftex-table-of-contents-browser
  346. :type 'boolean)
  347. (defcustom reftex-toc-include-index-entries nil
  348. "Non-nil means, include index entries in *toc* buffer.
  349. This flag can be toggled from within the *toc* buffer with the `i' key."
  350. :group 'reftex-table-of-contents-browser
  351. :type 'boolean)
  352. (defcustom reftex-toc-confirm-promotion 2
  353. "Non-nil means, promotion/demotion commands first prompt for confirmation.
  354. If nil, the command is executed immediately. If this is an integer N,
  355. ask for confirmation only if N or more section commands are going to be
  356. changed."
  357. :group 'reftex-table-of-contents-browser
  358. :type '(choice
  359. (const :tag "Never" nil)
  360. (const :tag "Always" t)
  361. (number :tag "When more than N sections" :value 2)))
  362. (defcustom reftex-toc-include-context nil
  363. "Non-nil means, include context with labels in the *toc* buffer.
  364. Context will only be shown when labels are visible as well.
  365. This flag can be toggled from within the *toc* buffer with the `c' key."
  366. :group 'reftex-table-of-contents-browser
  367. :type 'boolean)
  368. (defcustom reftex-toc-follow-mode nil
  369. "Non-nil means, point in *toc* buffer will cause other window to follow.
  370. The other window will show the corresponding part of the document.
  371. This flag can be toggled from within the *toc* buffer with the `f' key."
  372. :group 'reftex-table-of-contents-browser
  373. :type 'boolean)
  374. (defcustom reftex-revisit-to-follow nil
  375. "Non-nil means, follow-mode will revisit files if necessary.
  376. If nil, follow-mode will be suspended for stuff in unvisited files."
  377. :group 'reftex-table-of-contents-browser
  378. :group 'reftex-referencing-labels
  379. :type 'boolean)
  380. (defcustom reftex-toc-mode-hook nil
  381. "Mode hook for `reftex-toc-mode'."
  382. :group 'reftex-table-of-contents-browser
  383. :type 'hook)
  384. ;; Label Support Configuration
  385. (defgroup reftex-label-support nil
  386. "Support for creation, insertion and referencing of labels in LaTeX."
  387. :group 'reftex)
  388. (defgroup reftex-defining-label-environments nil
  389. "Definition of environments and macros to do with label."
  390. :group 'reftex-label-support)
  391. (defcustom reftex-default-label-alist-entries
  392. '(amsmath endnotes fancybox floatfig longtable picinpar
  393. rotating sidecap subfigure supertab wrapfig
  394. listings minted ctable LaTeX)
  395. "Default label alist specifications. LaTeX should always be the last entry.
  396. The value of this variable is a list of symbols with associations in the
  397. constant `reftex-label-alist-builtin'. Check that constant for a full list
  398. of options."
  399. :group 'reftex-defining-label-environments
  400. :set 'reftex-set-dirty
  401. :type `(set
  402. :indent 4
  403. :inline t
  404. :greedy t
  405. ,@(mapcar
  406. (lambda (x)
  407. (list 'const :tag (concat (symbol-name (nth 0 x))
  408. ": " (nth 1 x))
  409. (nth 0 x)))
  410. reftex-label-alist-builtin)))
  411. (defcustom reftex-label-alist nil
  412. "Alist with information on environments for \\label-\\ref use.
  413. This doc string is easier to understand after reading the configuration
  414. examples in the manual. Looking at the builtin defaults in the constant
  415. `reftex-label-alist-builtin' may also be instructive.
  416. Set this variable to define additions and changes to the default. The only
  417. things you MUST NOT change is that `?s' is the type indicator for section
  418. labels, and SPC for the `any' label type. These are hard-coded at other
  419. places in the code.
  420. The value of the variable must be a list of items. Each item is a list
  421. itself and has the following structure:
  422. (ENV-OR-MACRO TYPE-KEY LABEL-PREFIX REFERENCE-FORMAT CONTEXT-METHOD
  423. (MAGIC-WORD ... ) TOC-LEVEL)
  424. Each list entry describes either an environment carrying a counter for use
  425. with \\label and \\ref, or a LaTeX macro defining a label as (or inside)
  426. one of its arguments. The elements of each list entry are:
  427. ENV-OR-MACRO
  428. Name of the environment (like \"table\") or macro (like \"\\\\myfig\").
  429. For macros, indicate the macro arguments for best results, as in
  430. \"\\\\myfig[]{}{}{*}{}\". Use square brackets for optional arguments,
  431. a star to mark the label argument, if any. The macro does not have to
  432. have a label argument - you could also use \\label{..} inside one of
  433. its arguments.
  434. Special names: `section' for section labels, `any' to define a group
  435. which contains all labels.
  436. This may also be a function to do local parsing and identify point to
  437. be in a non-standard label environment. The function must take an
  438. argument BOUND and limit backward searches to this value. It should
  439. return either nil or the position where the special environment starts.
  440. See the Info documentation for an example.
  441. Finally this may also be nil if the entry is only meant to change
  442. some settings associated with the type indicator character (see below).
  443. TYPE-KEY
  444. Type indicator character, like `?t', must be a printable ASCII character.
  445. The type indicator is a single character which defines a label type.
  446. Any label inside the environment or macro is assumed to belong to this
  447. type. The same character may occur several times in this list, to cover
  448. cases in which different environments carry the same label type (like
  449. `equation' and `eqnarray').
  450. If the type indicator is nil and the macro has a label argument {*},
  451. the macro defines neutral labels just like \\label. In this case
  452. the remainder of this entry is ignored.
  453. LABEL-PREFIX
  454. Label prefix string, like \"tab:\".
  455. The prefix is a short string used as the start of a label. It may be the
  456. empty string. The prefix may contain the following `%' escapes:
  457. %f Current file name with directory and extension stripped.
  458. %F Current file name relative to directory of master file.
  459. %m Master file name, directory and extension stripped.
  460. %M Directory name (without path) where master file is located.
  461. %u User login name, on systems which support this.
  462. %S A section prefix derived with variable `reftex-section-prefixes'.
  463. Example: In a file `intro.tex', \"eq:%f:\" will become \"eq:intro:\").
  464. REFERENCE-FORMAT
  465. Format string for reference insertion in buffer. `%s' will be replaced
  466. by the label.
  467. When the format starts with `~', the `~' will only be inserted if
  468. there is not already a whitespace before point.
  469. CONTEXT-METHOD
  470. Indication on how to find the short context.
  471. - If nil, use the text following the \\label{...} macro.
  472. - If t, use
  473. - the section heading for section labels.
  474. - text following the \\begin{...} statement of environments.
  475. (not a good choice for environments like eqnarray or enumerate,
  476. where one has several labels in a single environment).
  477. - text after the macro name (starting with the first arg) for macros.
  478. - If an integer, use the nth argument of the macro. As a special case,
  479. 1000 means to get text after the last macro argument.
  480. - If a string, use as regexp to search *backward* from the label. Context
  481. is then the text following the end of the match. E.g. setting this to
  482. \"\\\\\\\\caption[[{]\" will use the caption in a figure or table
  483. environment.
  484. \"\\\\\\\\begin{eqnarray}\\\\|\\\\\\\\\\\\\\\\\" works for eqnarrays.
  485. - If any of `caption', `item', `eqnarray-like', `alignat-like', this
  486. symbol will internally be translated into an appropriate regexp
  487. (see also the variable `reftex-default-context-regexps').
  488. - If a function, call this function with the name of the environment/macro
  489. as argument. On call, point will be just after the \\label macro. The
  490. function is expected to return a suitable context string. It should
  491. throw an exception (error) when failing to find context.
  492. As an example, here is a function returning the 10 chars following
  493. the label macro as context:
  494. (defun my-context-function (env-or-mac)
  495. (if (> (point-max) (+ 10 (point)))
  496. (buffer-substring (point) (+ 10 (point)))
  497. (error \"Buffer too small\")))
  498. Label context is used in two ways by RefTeX: For display in the label
  499. menu, and to derive a label string. If you want to use a different
  500. method for each of these, specify them as a dotted pair.
  501. E.g. `(nil . t)' uses the text after the label (nil) for display, and
  502. text from the default position (t) to derive a label string. This is
  503. actually used for section labels.
  504. MAGIC-WORDS
  505. List of magic words which identify a reference to be of this type.
  506. If the word before point is equal to one of these words when calling
  507. `reftex-reference', the label list offered will be automatically
  508. restricted to labels of the correct type.
  509. If the first element of this wordlist is the symbol `regexp', the
  510. strings are interpreted as regular expressions. RefTeX will add
  511. a \"\\\\W\" to the beginning and other stuff to the end of the regexp.
  512. TOC-LEVEL
  513. The integer level at which this environment should be added to the
  514. table of contents. See also `reftex-section-levels'. A positive
  515. value will number the entries mixed with the sectioning commands of
  516. the same level. A negative value will make unnumbered entries.
  517. Useful only for theorem-like environments, will be ignored for macros.
  518. When omitted or nil, no TOC entries will be made.
  519. If the type indicator characters of two or more entries are the same, RefTeX
  520. will use
  521. - the first non-nil format and prefix
  522. - the magic words of all involved entries.
  523. Any list entry may also be a symbol. If that has an association in
  524. `reftex-label-alist-builtin', the cddr of that association is spliced into the
  525. list. However, builtin defaults should normally be set with the variable
  526. `reftex-default-label-alist-entries'."
  527. :group 'reftex-defining-label-environments
  528. :set 'reftex-set-dirty
  529. :type
  530. `(repeat
  531. (choice :tag "Package or Detailed "
  532. :value ("" ?a nil nil nil nil)
  533. (list :tag "Detailed Entry"
  534. :value ("" ?a nil nil nil nil)
  535. (choice :tag "Environment or \\macro "
  536. (const :tag "Ignore, just use typekey" nil)
  537. (string "")
  538. (symbol :tag "Special parser" my-parser))
  539. (choice :tag "Type specification "
  540. (const :tag "unspecified, like in \\label" nil)
  541. (character :tag "Char " ?a))
  542. (choice :tag "Label prefix string "
  543. (const :tag "Default" nil)
  544. (string :tag "String" "lab:"))
  545. (choice :tag "Label reference format"
  546. (const :tag "Default" nil)
  547. (string :tag "String" "~\\ref{%s}"))
  548. (choice :tag "Context method "
  549. (const :tag "Default position" t)
  550. (const :tag "After label" nil)
  551. (number :tag "Macro arg nr" 1)
  552. (regexp :tag "Regexp" "")
  553. (const :tag "Caption in float" caption)
  554. (const :tag "Item in list" item)
  555. (const :tag "Eqnarray-like" eqnarray-like)
  556. (const :tag "Alignat-like" alignat-like)
  557. (symbol :tag "Function" my-func))
  558. (repeat :tag "Magic words" :extra-offset 2 (string))
  559. (option (choice :tag "Make TOC entry "
  560. (const :tag "No entry" nil)
  561. (integer :tag "Level" :value -3))))
  562. (choice
  563. :tag "Package"
  564. :value AMSTeX
  565. ,@(mapcar
  566. (lambda (x)
  567. (list 'const :tag (concat (symbol-name (nth 0 x)))
  568. (nth 0 x)))
  569. reftex-label-alist-builtin)))))
  570. (defcustom reftex-section-prefixes '((0 . "part:") (1 . "cha:") (t . "sec:"))
  571. "Prefixes for section labels.
  572. When the label prefix given in an entry in `reftex-label-alist' contains `%S',
  573. this list is used to determine the correct prefix string depending on the
  574. current section level.
  575. The list is an alist, with each entry of the form (KEY . PREFIX)
  576. Possible keys are sectioning macro names like `chapter', section levels
  577. \(as given in `reftex-section-levels'), and t for the default."
  578. :group 'reftex-defining-label-environments
  579. :type '(repeat
  580. (cons :value (0 . "")
  581. (choice
  582. (string :tag "macro name")
  583. (integer :tag "section level")
  584. (const :tag "default" t))
  585. (string :tag "Prefix"))))
  586. (defcustom reftex-default-context-regexps
  587. '((caption . "\\\\\\(rot\\|bi\\)?\\(sub\\)?caption\\(box\\)?\\*?[[{]")
  588. (item . "\\\\item\\(\\[[^]]*\\]\\)?")
  589. (eqnarray-like . "\\\\begin{%s}\\|\\\\\\\\")
  590. (alignat-like . "\\\\begin{%s}{[0-9]*}\\|\\\\\\\\"))
  591. "Alist with default regular expressions for finding context.
  592. The form (format regexp (regexp-quote environment)) is used to calculate
  593. the final regular expression - so %s will be replaced with the environment
  594. or macro."
  595. :group 'reftex-defining-label-environments
  596. :type '(repeat (cons (symbol) (regexp))))
  597. (defcustom reftex-trust-label-prefix nil
  598. "Non-nil means, trust the label prefix when determining label type.
  599. It is customary to use special label prefixes to distinguish different label
  600. types. The label prefixes have no syntactic meaning in LaTeX (unless
  601. special packages like fancyref are being used). RefTeX can and by
  602. default does parse around each label to detect the correct label type,
  603. but this process can be slow when a document contains thousands of
  604. labels. If you use label prefixes consistently, you may speed up
  605. document parsing by setting this variable to a non-nil value. RefTeX
  606. will then compare the label prefix with the prefixes found in
  607. `reftex-label-alist' and derive the correct label type in this way.
  608. Possible values for this option are:
  609. t This means to trust any label prefixes found.
  610. regexp If a regexp, only prefixes matched by the regexp are trusted.
  611. list List of accepted prefixes, as strings. The colon is part of
  612. the prefix, e.g. (\"fn:\" \"eqn:\" \"item:\").
  613. nil Never trust a label prefix.
  614. The only disadvantage of using this feature is that the label context
  615. displayed in the label selection buffer along with each label is
  616. simply some text after the label definition. This is no problem if you
  617. place labels keeping this in mind (e.g. *before* the equation, *at
  618. the beginning* of a fig/tab caption ...). Anyway, it is probably best
  619. to use the regexp or the list value types to fine-tune this feature.
  620. For example, if your document contains thousands of footnotes with
  621. labels fn:xxx, you may want to set this variable to the value \"^fn:$\" or
  622. \(\"fn:\"). Then RefTeX will still do extensive parsing for any
  623. non-footnote labels."
  624. :group 'reftex-defining-label-environments
  625. :type '(choice
  626. (const :tag "Always" t)
  627. (const :tag "Never" nil)
  628. (regexp)
  629. (repeat :tag "List"
  630. (string :tag "prefix (with colon)"))))
  631. (defcustom reftex-special-environment-functions nil
  632. "List of functions to be called when trying to figure out current environment.
  633. These are special functions to detect \"environments\" which do not
  634. start with \\begin and end with \\end. Some LaTeX packages seem to
  635. use such non-standard ways to set up environment-like constructs. The
  636. purpose of each function in this list is to detect if point is
  637. currently inside such a special \"environment\". If the environment
  638. carries a label, you must also set up an entry for it in
  639. `reftex-label-alist'.
  640. The function should check if point is currently in the special
  641. environment it was written to detect. If so, the function must return
  642. a cons cell (NAME . POSITION). NAME is the name of the environment
  643. detected and POSITION is the buffer position where the environment
  644. starts. The function must return nil on failure to detect the
  645. environment.
  646. The function must take an argument BOUND. If non-nil, BOUND is a
  647. boundary for backwards searches which should be observed.
  648. Here is an example. The LaTeX package linguex.sty defines list macros
  649. `\\ex.', `\\a.', etc for lists which are terminated by `\\z.' or an empty
  650. line.
  651. \\ex. \\label{ex:12} Some text in an exotic language ...
  652. \\a. \\label{ex:13} more stuff
  653. \\b. \\label{ex:14} still more stuff
  654. ... more text after the empty line terminating all lists
  655. And here is the setup for RefTeX:
  656. 1. Define a dummy environment for this in `reftex-label-alist'. Dummy means,
  657. make up an environment name even though it is not used with \\begin and
  658. \\end. Here we use \"linguex\" as this name.
  659. (setq reftex-label-alist
  660. \\='((\"linguex\" ?x \"ex:\" \"~\\\\ref{%s}\" nil (\"Example\" \"Ex.\"))))
  661. 2. Write a function to detect the list macros and the determinators as well.
  662. (defun my-detect-linguex-list (bound)
  663. (let ((pos (point)) p1)
  664. (save-excursion
  665. ;; Search for any of the linguex item macros at the beginning of a line
  666. (if (re-search-backward
  667. \"^[ \\t]*\\\\(\\\\\\\\\\\\(ex\\\\|a\\\\|b\\\\|c\\\\|d\\\\|e\\\\|f\\\\)g?\\\\.\\\\)\" bound t)
  668. (progn
  669. (setq p1 (match-beginning 1))
  670. ;; Make sure no empty line or \\z. is between us and the item macro
  671. (if (re-search-forward \"\\n[ \\t]*\\n\\\\|\\\\\\\\z\\\\.\" pos t)
  672. ;; Return nil because list was already closed
  673. nil
  674. ;; OK, we got it
  675. (cons \"linguex\" p1)))
  676. ;; Return nil for not found
  677. nil))))
  678. 3. Tell RefTeX to use this function
  679. (setq reftex-special-environment-functions \\='(my-detect-linguex-list))"
  680. :group 'reftex-defining-label-environments
  681. :type 'hook)
  682. ;; Label insertion
  683. (defgroup reftex-making-and-inserting-labels nil
  684. "Options on how to create new labels."
  685. :group 'reftex-label-support)
  686. (defcustom reftex-insert-label-flags '("s" "sft")
  687. "Flags governing label insertion. First flag DERIVE, second flag PROMPT.
  688. If DERIVE is t, RefTeX will try to derive a sensible label from context.
  689. A section label for example will be derived from the section heading.
  690. The conversion of the context to a valid label is governed by the
  691. specifications given in `reftex-derive-label-parameters'.
  692. If RefTeX fails to derive a label, it will prompt the user.
  693. If DERIVE is nil, the label generated will consist of the prefix and a
  694. unique number, like `eq:23'.
  695. If PROMPT is t, the user will be prompted for a label string. The prompt will
  696. already contain the prefix, and (if DERIVE is t) a default label derived from
  697. context. When PROMPT is nil, the default label will be inserted without
  698. query.
  699. So the combination of DERIVE and PROMPT controls label insertion. Here is a
  700. table describing all four possibilities:
  701. DERIVE PROMPT ACTION
  702. -------------------------------------------------------------------------
  703. nil nil Insert simple label, like eq:22 or sec:13. No query.
  704. nil t Prompt for label.
  705. t nil Derive a label from context and insert without query.
  706. t t Derive a label from context and prompt for confirmation.
  707. Each flag may be set to t, nil, or a string of label type letters
  708. indicating the label types for which it should be true. The strings work
  709. like character classes.
  710. Thus, the combination may be set differently for each label type. The
  711. default settings \"s\" and \"sft\" mean: Derive section labels from headings
  712. \(with confirmation). Prompt for figure and table labels. Use simple labels
  713. without confirmation for everything else.
  714. The available label types are: s (section), f (figure), t (table), i (item),
  715. e (equation), n (footnote), N (endnote), plus any definitions in
  716. `reftex-label-alist'."
  717. :group 'reftex-making-and-inserting-labels
  718. :type '(list (choice :tag "Derive label from context"
  719. (const :tag "always" t)
  720. (const :tag "never" nil)
  721. (string :tag "selected label types" ""))
  722. (choice :tag "Prompt for label string "
  723. :entry-format " %b %v"
  724. (const :tag "always" t)
  725. (const :tag "never" nil)
  726. (string :tag "selected label types" ""))))
  727. (defcustom reftex-string-to-label-function 'reftex-string-to-label
  728. "Function to turn an arbitrary string into a valid label.
  729. RefTeX's default function uses the variable `reftex-derive-label-parameters'."
  730. :group 'reftex-making-and-inserting-labels
  731. :type 'symbol)
  732. (defcustom reftex-translate-to-ascii-function 'reftex-latin1-to-ascii
  733. "Filter function to convert a string to ASCII.
  734. The function is used to process a context string before it is
  735. used to derive a label from it. The intended application is to
  736. convert ISO or Mule characters into something valid in labels.
  737. The default function removes the accents from Latin-1 characters.
  738. X-Symbol (>=2.6) sets this variable to the much more general
  739. `x-symbol-translate-to-ascii'."
  740. :group 'reftex-making-and-inserting-labels
  741. :type 'symbol)
  742. (defcustom reftex-derive-label-parameters '(3 20 t 1 "-"
  743. ("the" "on" "in" "off" "a" "for" "by" "of" "and" "is" "to") t)
  744. "Parameters for converting a string into a label.
  745. This variable is a list of the following items.
  746. NWORDS Number of words to use.
  747. MAXCHAR Maximum number of characters in a label string.
  748. INVALID nil: Throw away any words containing characters invalid in labels.
  749. t: Throw away only the invalid characters, not the whole word.
  750. ABBREV nil: Never abbreviate words.
  751. t: Always abbreviate words (see `reftex-abbrev-parameters').
  752. not t and not nil: Abbreviate words if necessary to shorten
  753. label string below MAXCHAR.
  754. SEPARATOR String separating different words in the label.
  755. IGNOREWORDS List of words which should not be part of labels.
  756. DOWNCASE t: Downcase words before using them."
  757. :group 'reftex-making-and-inserting-labels
  758. :type '(list (integer :tag "Number of words " 3)
  759. (integer :tag "Maximum label length " 20)
  760. (choice :tag "Invalid characters in words"
  761. (const :tag "throw away entire word" nil)
  762. (const :tag "throw away single chars" t))
  763. (choice :tag "Abbreviate words "
  764. (const :tag "never" nil)
  765. (const :tag "always" t)
  766. (const :tag "when label is too long" 1))
  767. (string :tag "Separator between words " "-")
  768. (repeat :tag "Ignore words"
  769. :entry-format " %i %d %v"
  770. (string :tag ""))
  771. (option (boolean :tag "Downcase words "))))
  772. (if (featurep 'xemacs)
  773. ;; XEmacs 21.5 doesn't have explicitly numbered matching groups,
  774. ;; so this list mustn't get any more items.
  775. (defconst reftex-label-regexps '("\\\\label{\\([^}]*\\)}"))
  776. (defcustom reftex-label-regexps
  777. '(;; Normal \\label{foo} labels
  778. "\\\\label{\\(?1:[^}]*\\)}"
  779. ;; keyvals [..., label = {foo}, ...] forms used by ctable,
  780. ;; listings, minted, ...
  781. "\\[[^][]\\{0,2000\\}\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?")
  782. "List of regexps matching \\label definitions.
  783. The default value matches usual \\label{...} definitions and
  784. keyval style [..., label = {...}, ...] label definitions. It is
  785. assumed that the regexp group 1 matches the label text, so you
  786. have to define it using \\(?1:...\\) when adding new regexps.
  787. When changed from Lisp, make sure to call
  788. `reftex-compile-variables' afterwards to make the change
  789. effective."
  790. :version "25.1"
  791. :set (lambda (symbol value)
  792. (set symbol value)
  793. (when (fboundp 'reftex-compile-variables)
  794. (reftex-compile-variables)))
  795. :group 'reftex-defining-label-environments
  796. :type '(repeat (regexp :tag "Regular Expression"))))
  797. (defcustom reftex-label-ignored-macros-and-environments nil
  798. "List of macros and environments to be ignored when searching for labels.
  799. The purpose is to ignore environments and macros that use keyval
  800. style label=foo arguments, but the label has a different meaning
  801. than a \\label{foo}. Standard \\label{...} definitions are never
  802. ignored.
  803. E.g., TikZ defines several macros/environments where [label=foo]
  804. defines the label to be printed at some node or edge, but it's
  805. not a label used for referencing.
  806. Note that this feature is only supported if you are using AUCTeX
  807. and the functions `TeX-current-macro' and
  808. `LaTeX-current-environment' are bound. Also note that this
  809. feature might slow down the reftex parsing process for large TeX
  810. files."
  811. :version "24.4"
  812. :group 'reftex-defining-label-environments
  813. :type '(repeat string))
  814. (defcustom reftex-label-illegal-re "[^-a-zA-Z0-9_+=:;,.]"
  815. "Regexp matching characters not valid in labels."
  816. :group 'reftex-making-and-inserting-labels
  817. :type '(regexp :tag "Regular Expression"))
  818. (defcustom reftex-abbrev-parameters '(4 2 "^aeiou" "aeiou")
  819. "Parameters for abbreviation of words.
  820. This variable is a list of the following items.
  821. MIN-CHARS Minimum number of characters remaining after abbreviation.
  822. MIN-KILL Minimum number of characters to remove when abbreviating words.
  823. BEFORE Character class before abbrev point in word.
  824. AFTER Character class after abbrev point in word."
  825. :group 'reftex-making-and-inserting-labels
  826. :type '(list
  827. (integer :tag "Minimum chars per word" 4)
  828. (integer :tag "Shorten by at least " 2)
  829. (string :tag "cut before char class " "^saeiou")
  830. (string :tag "cut after char class " "aeiou")))
  831. (defcustom reftex-format-label-function nil
  832. "Function which produces the string to insert as a label definition.
  833. Normally should be nil, unless you want to do something fancy.
  834. The function will be called with two arguments, the LABEL and the DEFAULT
  835. FORMAT, which usually is `\\label{%s}'. The function should return the
  836. string to insert into the buffer."
  837. :group 'reftex-making-and-inserting-labels
  838. :type '(choice (const nil) function))
  839. ;; Label referencing
  840. (defgroup reftex-referencing-labels nil
  841. "Options on how to reference labels."
  842. :group 'reftex-label-support)
  843. (eval-and-compile
  844. (defconst reftex-tmp
  845. '((const :tag "on" t)
  846. (const :tag "off" nil)
  847. (string :tag "Selected label types"))))
  848. (defcustom reftex-label-menu-flags '(t t nil nil nil nil t nil)
  849. "List of flags governing the label menu makeup.
  850. The flags are:
  851. TABLE-OF-CONTENTS Show the labels embedded in a table of context.
  852. SECTION-NUMBERS Include section numbers (like 4.1.3) in table of contents.
  853. COUNTERS Show counters. This just numbers the labels in the menu.
  854. NO-CONTEXT Non-nil means do NOT show the short context.
  855. FOLLOW Follow full context in other window.
  856. SHOW-COMMENTED Show labels from regions which are commented out.
  857. MATCH-IN-TOC Obsolete flag.
  858. SHOW FILES Show begin and end of included files.
  859. Each of these flags can be set to t or nil, or to a string of type letters
  860. indicating the label types for which it should be true. These strings work
  861. like character classes in regular expressions. Thus, setting one of the
  862. flags to \"sf\" makes the flag true for section and figure labels, nil
  863. for everything else. Setting it to \"^sf\" makes it the other way round.
  864. The available label types are: s (section), f (figure), t (table), i (item),
  865. e (equation), n (footnote), plus any definitions in `reftex-label-alist'.
  866. Most options can also be switched from the label menu itself - so if you
  867. decide here to not have a table of contents in the label menu, you can still
  868. get one interactively during selection from the label menu."
  869. :group 'reftex-referencing-labels
  870. :type
  871. `(list
  872. (choice :tag "Embed in table of contents " ,@reftex-tmp)
  873. (choice :tag "Show section numbers " ,@reftex-tmp)
  874. (choice :tag "Show individual counters " ,@reftex-tmp)
  875. (choice :tag "Hide short context " ,@reftex-tmp)
  876. (choice :tag "Follow context in other window " ,@reftex-tmp)
  877. (choice :tag "Show commented labels " ,@reftex-tmp)
  878. (choice :tag "Obsolete flag, Don't use. " ,@reftex-tmp)
  879. (choice :tag "Show begin/end of included files" ,@reftex-tmp)))
  880. (defcustom reftex-multiref-punctuation '((?, . ", ") (?- . "--") (?+ . " and "))
  881. "Punctuation strings for multiple references.
  882. When marking is used in the selection buffer to select several references,
  883. this variable associates the 3 marking characters `,-+' with prefix strings
  884. to be inserted into the buffer before the corresponding \\ref macro.
  885. This is used to string together whole reference sets, like
  886. `eqs. 1,2,3-5,6 and 7' in a single call to `reftex-reference'. See manual."
  887. :group 'reftex-referencing-labels
  888. :type '(repeat (cons (character) (string))))
  889. (defcustom reftex-ref-style-alist
  890. '(("Default" t
  891. (("\\ref" ?\C-m) ("\\pageref" ?p)))
  892. ("Varioref" "varioref"
  893. (("\\vref" ?v) ("\\vpageref" ?g) ("\\Vref" ?V) ("\\Ref" ?R)))
  894. ("Fancyref" "fancyref"
  895. (("\\fref" ?f) ("\\Fref" ?F)))
  896. ("Hyperref" "hyperref"
  897. (("\\autoref" ?a) ("\\autopageref" ?u)))
  898. ("Cleveref" "cleveref"
  899. (("\\cref" ?c) ("\\Cref" ?C) ("\\cpageref" ?d) ("\\Cpageref" ?D))))
  900. "Alist of reference styles.
  901. Each element is a list of the style name, the name of the LaTeX
  902. package associated with the style or t for any package, and an
  903. alist of macros where the first entry of each item is the
  904. reference macro and the second a key for selecting the macro when
  905. the macro type is being prompted for. (See also
  906. `reftex-ref-macro-prompt'.) The keys, represented as characters,
  907. have to be unique."
  908. :group 'reftex-referencing-labels
  909. :version "24.3"
  910. :type '(alist :key-type (string :tag "Style name")
  911. :value-type (group (choice :tag "Package"
  912. (const :tag "Any package" t)
  913. (string :tag "Name"))
  914. (repeat :tag "Macros"
  915. (group (string :tag "Macro")
  916. (character :tag "Key"))))))
  917. (defcustom reftex-ref-macro-prompt t
  918. "If non-nil, `reftex-reference' prompts for the reference macro."
  919. :group 'reftex-referencing-labels
  920. :version "24.3"
  921. :type 'boolean)
  922. (defcustom reftex-vref-is-default nil
  923. "Non-nil means, the varioref reference style is used as default.
  924. The value of this variable determines the default which is active
  925. when entering the selection process. Instead of nil or t, this
  926. may also be a string of type letters indicating the label types
  927. for which it should be true.
  928. This variable is obsolete, use `reftex-ref-style-default-list'
  929. instead."
  930. :group 'reftex-referencing-labels
  931. :type `(choice :tag "\\vref is default macro" ,@reftex-tmp))
  932. ;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
  933. (defcustom reftex-fref-is-default nil
  934. "Non-nil means, the fancyref reference style is used as default.
  935. The value of this variable determines the default which is active
  936. when entering the selection process. Instead of nil or t, this
  937. may also be a string of type letters indicating the label types
  938. for which it should be true.
  939. This variable is obsolete, use `reftex-ref-style-default-list'
  940. instead."
  941. :group 'reftex-referencing-labels
  942. :type `(choice :tag "\\fref is default macro" ,@reftex-tmp))
  943. ;;;###autoload(put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
  944. (defcustom reftex-ref-style-default-list '("Default")
  945. "List of reference styles to be activated by default.
  946. The order is significant and controls the order in which macros
  947. can be cycled in the buffer for selecting a label. The entries
  948. in the list have to match the respective reference style names
  949. used in the variable `reftex-ref-style-alist'."
  950. :group 'reftex-referencing-labels
  951. :version "24.3"
  952. :type `(set ,@(mapcar (lambda (x) (list 'const (car x)))
  953. reftex-ref-style-alist)))
  954. ;; Compatibility with obsolete variables.
  955. (when reftex-vref-is-default
  956. (cl-pushnew "Varioref" reftex-ref-style-default-list :test #'equal))
  957. (when reftex-fref-is-default
  958. (cl-pushnew "Fancyref" reftex-ref-style-default-list :test #'equal))
  959. (defcustom reftex-level-indent 2
  960. "Number of spaces to be used for indentation per section level."
  961. :group 'reftex-referencing-labels
  962. :type 'integer)
  963. ;;;###autoload(put 'reftex-level-indent 'safe-local-variable 'integerp)
  964. (defcustom reftex-guess-label-type t
  965. "Non-nil means, `reftex-reference' will try to guess the label type.
  966. To do that, RefTeX will look at the word before the cursor and compare it with
  967. the words given in `reftex-label-alist'. When it finds a match, RefTeX will
  968. immediately offer the correct label menu - otherwise it will prompt you for
  969. a label type. If you set this variable to nil, RefTeX will always prompt."
  970. :group 'reftex-referencing-labels
  971. :type 'boolean)
  972. ;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable (lambda (x) (memq x '(nil t))))
  973. (defcustom reftex-format-ref-function nil
  974. "Function which produces the string to insert as a reference.
  975. Normally should be nil, because the format to insert a reference
  976. can already be specified in `reftex-label-alist'.
  977. This hook also is used by the special commands to insert
  978. e.g. `\\vref' and `\\fref' references, so even if you set this,
  979. your setting will be ignored by the special commands.
  980. The function will be called with three arguments, the LABEL, the
  981. DEFAULT FORMAT, which normally is `~\\ref{%s}' and the REFERENCE
  982. STYLE. The function should return the string to insert into the
  983. buffer."
  984. :group 'reftex-referencing-labels
  985. :type '(choice (const nil) function))
  986. (defcustom reftex-select-label-mode-hook nil
  987. "Mode hook for `reftex-select-label-mode'."
  988. :group 'reftex-referencing-labels
  989. :type 'hook)
  990. ;; BibteX citation configuration ----------------------------------------
  991. (defgroup reftex-citation-support nil
  992. "Support for referencing bibliographic data with BibTeX."
  993. :group 'reftex)
  994. (defcustom reftex-bibliography-commands
  995. '("bibliography" "nobibliography" "setupbibtex\\[.*?database=" "addbibresource")
  996. "LaTeX commands which specify the BibTeX databases to use with the document."
  997. :group 'reftex-citation-support
  998. :type '(repeat string))
  999. (defvar reftex-bibfile-ignore-list nil) ; compatibility
  1000. (defcustom reftex-bibfile-ignore-regexps nil
  1001. "List of regular expressions to exclude files in \\bibliography{..}.
  1002. File names matched by these regexps will not be parsed by RefTeX.
  1003. Intended for files which contain only `@string' macro definitions and the
  1004. like, which are ignored by RefTeX anyway."
  1005. :group 'reftex-citation-support
  1006. :set 'reftex-set-dirty
  1007. :type '(repeat (regexp)))
  1008. (defcustom reftex-default-bibliography nil
  1009. "List of BibTeX database files which should be used if none are specified.
  1010. When `reftex-citation' is called from a document which has neither a
  1011. `\\bibliography{..}' statement nor a `thebibliography' environment,
  1012. RefTeX will scan these files instead. Intended for using `reftex-citation'
  1013. in non-LaTeX files. The files will be searched along the BIBINPUTS or TEXBIB
  1014. path."
  1015. :group 'reftex-citation-support
  1016. :type '(repeat (file)))
  1017. (defcustom reftex-sort-bibtex-matches 'reverse-year
  1018. "Sorting of the entries found in BibTeX databases by reftex-citation.
  1019. Possible values:
  1020. nil Do not sort entries.
  1021. `author' Sort entries by author name.
  1022. `year' Sort entries by increasing year.
  1023. `reverse-year' Sort entries by decreasing year."
  1024. :group 'reftex-citation-support
  1025. :type '(choice (const :tag "not" nil)
  1026. (const :tag "by author" author)
  1027. (const :tag "by year" year)
  1028. (const :tag "by year, reversed" reverse-year)))
  1029. (defcustom reftex-cite-format 'default
  1030. "The format of citations to be inserted into the buffer.
  1031. It can be a string or an alist or a symbol. In the simplest case this
  1032. is just the string \"\\cite{%l}\", which is also the default. See the
  1033. definition of `reftex-cite-format-builtin' for more complex examples.
  1034. If `reftex-cite-format' is a string, it will be used as the format.
  1035. In the format, the following percent escapes will be expanded.
  1036. %l The BibTeX label of the citation.
  1037. %a List of author names, see also `reftex-cite-punctuation'.
  1038. %2a Like %a, but abbreviate more than 2 authors like Jones et al.
  1039. %A First author name only.
  1040. %e Works like %a, but on list of editor names. (%2e and %E work a well)
  1041. It is also possible to access all other BibTeX database fields:
  1042. %b booktitle %c chapter %d edition %h howpublished
  1043. %i institution %j journal %k key %m month
  1044. %n number %N note %o organization %p pages
  1045. %P first page %r address %s school %u publisher
  1046. %U url %t title %v volume %y year
  1047. %B booktitle, abbreviated %T title, abbreviated
  1048. Usually, only %l is needed. The other stuff is mainly for the echo area
  1049. display, and for (setq reftex-comment-citations t).
  1050. %< as a special operator kills punctuation and space around it after the
  1051. string has been formatted.
  1052. A pair of square brackets indicates an optional argument, and RefTeX
  1053. will prompt for the values of these arguments.
  1054. Beware that all this only works with BibTeX database files. When
  1055. citations are made from the \\bibitems in an explicit thebibliography
  1056. environment, only %l is available.
  1057. If `reftex-cite-format' is an alist of characters and strings, the user
  1058. will be prompted for a character to select one of the possible format
  1059. strings.
  1060. In order to configure this variable, you can either set
  1061. `reftex-cite-format' directly yourself or set it to the SYMBOL of one of
  1062. the predefined styles. The predefined symbols are those which have an
  1063. association in the constant `reftex-cite-format-builtin'.
  1064. E.g.: (setq reftex-cite-format \\='natbib)"
  1065. :group 'reftex-citation-support
  1066. :type
  1067. `(choice
  1068. :format "%{%t%}: \n%[Value Menu%] %v"
  1069. (radio :tag "Symbolic Builtins"
  1070. :indent 4
  1071. :value default
  1072. ,@(mapcar
  1073. (lambda (x)
  1074. (list 'const :tag (concat (symbol-name (nth 0 x))
  1075. ": " (nth 1 x))
  1076. (nth 0 x)))
  1077. reftex-cite-format-builtin))
  1078. (string :tag "format string" "\\cite{%l}")
  1079. (repeat :tag "key-ed format strings"
  1080. :value ((?\r . "\\cite{%l}")
  1081. (?t . "\\cite{%l}") (?p . "\\cite{%l}"))
  1082. (cons (character :tag "Key character" ?\r)
  1083. (string :tag "Format string" "")))))
  1084. (defcustom reftex-cite-prompt-optional-args 'maybe
  1085. "Non-nil means, prompt for empty optional arguments in cite macros.
  1086. When an entry in `reftex-cite-format' is given with square brackets to
  1087. indicate optional arguments (for example \\cite[][]{%l}), RefTeX can
  1088. prompt for values. Possible values are:
  1089. nil Never prompt for optional arguments
  1090. t Always prompt
  1091. maybe Prompt only if `reftex-citation' was called with C-u prefix arg
  1092. Unnecessary empty optional arguments are removed before insertion into
  1093. the buffer. See `reftex-cite-cleanup-optional-args'."
  1094. :group 'reftex-citation-support
  1095. :type '(choice
  1096. (const :tag "Always" t)
  1097. (const :tag "When called with prefix arg" maybe)
  1098. (const :tag "Never" nil)))
  1099. (defcustom reftex-cite-cleanup-optional-args t
  1100. "Non-nil means, remove unnecessary empty optional arguments in cite macros.
  1101. The cite macros provided by some packages (for example
  1102. natbib) allow specifying two optional arguments, one for a prefix to
  1103. the citation, and a second for a postfix. When only one optional
  1104. argument is given, it is interpreted as postfix. When this option is
  1105. t, RefTeX removes unnecessary empty optional arguments from the cite
  1106. macro before insertion. For example, it will change
  1107. \\cite[][]{Jones} -> \\cite{Jones}
  1108. \\cite[][Chapter 1]{Jones} -> \\cite[Chapter 1]{Jones}
  1109. \\cite[see][]{Jones} -> \\cite[see][]{Jones}
  1110. \\cite[see][Chapter 1]{Jones} -> \\cite{Jones}
  1111. Is is possible that other packages have other conventions about which
  1112. optional argument is interpreted how - that is why this cleaning up
  1113. can be turned off."
  1114. :group 'reftex-citation-support
  1115. :type 'boolean)
  1116. (defcustom reftex-comment-citations nil
  1117. "Non-nil means add a comment for each citation describing the full entry.
  1118. The comment is formatted according to `reftex-cite-comment-format'."
  1119. :group 'reftex-citation-support
  1120. :type 'boolean)
  1121. (defcustom reftex-cite-comment-format
  1122. "%% %2a %y, %j %v, %P, %b, %e, %u, %s %<\n"
  1123. "Citation format used for commented citations. Must NOT contain %l.
  1124. See the variable `reftex-cite-format' for possible percent escapes."
  1125. :group 'reftex-citation-support
  1126. :type 'string)
  1127. (defcustom reftex-cite-view-format "%2a %y, %T, %B, %j %v:%P, %s %<"
  1128. "Citation format used to display citation info in the message area.
  1129. Must NOT contain %l. See the variable `reftex-cite-format' for
  1130. possible percent escapes."
  1131. :group 'reftex-citation-support
  1132. :group 'reftex-viewing-cross-references
  1133. :type 'string)
  1134. (defcustom reftex-cite-punctuation '(", " " \\& " " {\\it et al.}")
  1135. "Punctuation for formatting of name lists in citations.
  1136. This is a list of 3 strings.
  1137. 1. Normal names separator, like \", \" in Jones, Brown and Miller
  1138. 2. Final names separator, like \" and \" in Jones, Brown and Miller
  1139. 3. The \"et al\" string, like \" {\\it et al.}\" in Jones {\\it et al.}"
  1140. :group 'reftex-citation-support
  1141. :type '(list
  1142. (string :tag "Separator for names ")
  1143. (string :tag "Separator for last name in list")
  1144. (string :tag "string used as et al. ")))
  1145. (defcustom reftex-format-cite-function nil
  1146. "Function which produces the string to insert as a citation.
  1147. Normally should be nil, because the format to insert a reference can
  1148. already be specified in `reftex-cite-format'.
  1149. The function will be called with two arguments, the CITATION KEY and the
  1150. DEFAULT FORMAT, which is taken from `reftex-cite-format'. The function
  1151. should return the string to insert into the buffer."
  1152. :group 'reftex-citation-support
  1153. :type '(choice (const nil) function))
  1154. (defcustom reftex-select-bib-mode-hook nil
  1155. "Mode hook for reftex-select-bib-mode."
  1156. :group 'reftex-citation-support
  1157. :type 'hook)
  1158. (defcustom reftex-cite-key-separator ","
  1159. "String to be used for separating several keys in a \\cite macro."
  1160. :group 'reftex-citation-support
  1161. :version "24.3"
  1162. :type 'string)
  1163. (defcustom reftex-create-bibtex-header nil
  1164. "Header to insert in BibTeX files generated by RefTeX."
  1165. :group 'reftex-citation-support
  1166. :version "24.3"
  1167. :type '(choice (const :tag "No header" nil) string))
  1168. (defcustom reftex-create-bibtex-footer nil
  1169. "Footer to insert in BibTeX files generated by RefTeX."
  1170. :group 'reftex-citation-support
  1171. :version "24.3"
  1172. :type '(choice (const :tag "No footer" nil) string))
  1173. ;; Index Support Configuration
  1174. (defgroup reftex-index-support nil
  1175. "Support for viewing and editing the index."
  1176. :group 'reftex)
  1177. (defcustom reftex-support-index t
  1178. "Non-nil means, index entries are parsed as well.
  1179. Index support is resource intensive and the internal structure holding the
  1180. parsed information can become quite big. Therefore it can be turned off.
  1181. When this is nil and you execute a command which requires index support,
  1182. you will be asked for confirmation to turn it on and rescan the document."
  1183. :group 'reftex-index-support
  1184. :type 'boolean)
  1185. (defcustom reftex-index-special-chars '("!" "|" "@" "\"" "\\")
  1186. "Special characters in index entries. The value is a list of five strings.
  1187. These correspond to the makeindex keywords LEVEL ENCAP ACTUAL QUOTE ESCAPE."
  1188. :group 'reftex-index-support
  1189. :type '(list
  1190. (string :tag "LEVEL separator")
  1191. (string :tag "ENCAP char ")
  1192. (string :tag "ACTUAL char ")
  1193. (string :tag "QUOTE char ")
  1194. (string :tag "ESCAPE char ")))
  1195. (defcustom reftex-index-macros nil
  1196. "Macros which define index entries.
  1197. The structure is
  1198. \(MACRO INDEX-TAG KEY PREFIX EXCLUDE REPEAT)
  1199. MACRO is the macro. Arguments should be denoted by empty braces like
  1200. \\index[]{*}. Use square brackets to denote optional arguments. The star
  1201. marks where the index key is.
  1202. INDEX-TAG is a short name of the index. \"idx\" and \"glo\" are
  1203. reserved for the default index and the glossary. Other indices can be
  1204. defined as well. If this is an integer, the Nth argument of the macro
  1205. holds the index tag.
  1206. KEY is a character which is used to identify the macro for input with
  1207. \\[reftex-index]. ?i, ?I, and ?g are reserved for default index and glossary.
  1208. PREFIX can be a prefix which is added to the KEY part of the index entry.
  1209. If you have a macro \\newcommand{\\molec}[1]{#1\\index{Molecules!#1}}, this
  1210. prefix should be \"Molecules!\". See the manual for details.
  1211. EXCLUDE can be a function. If this function exists and returns a non-nil
  1212. value, the index entry at point is ignored. This was implemented to support
  1213. the (deprecated) `^' and `_' shortcuts in the LaTeX2e `index' package.
  1214. REPEAT, if non-nil, means the index macro does not typeset the entry in
  1215. the text, so that the text has to be repeated outside the index macro.
  1216. Needed for `reftex-index-selection-or-word' and for indexing from the
  1217. phrase buffer.
  1218. The final entry may also be a symbol if this entry has a association
  1219. in the variable `reftex-index-macros-builtin' to specify the main
  1220. indexing package you are using. Valid values are currently
  1221. default The LaTeX default - unnecessary to specify this one
  1222. multind The multind.sty package
  1223. index The index.sty package
  1224. index-shortcut The index.sty packages with the ^ and _ shortcuts.
  1225. Should not be used - only for old documents.
  1226. Note that AUCTeX sets these things internally for RefTeX as well, so
  1227. with a sufficiently new version of AUCTeX, you should not set the
  1228. package here."
  1229. :group 'reftex-index-support
  1230. :set 'reftex-set-dirty
  1231. :type `(list
  1232. (repeat
  1233. :inline t
  1234. (list :value ("" "idx" ?a "" nil)
  1235. (string :tag "Macro with args")
  1236. (choice :tag "Index Tag "
  1237. (string)
  1238. (integer :tag "Macro arg Nr" :value 1))
  1239. (character :tag "Access Key ")
  1240. (string :tag "Key Prefix ")
  1241. (symbol :tag "Exclusion hook ")
  1242. (boolean :tag "Repeat Outside ")))
  1243. (option
  1244. :tag "Package:"
  1245. (choice :tag "Package"
  1246. :value index
  1247. ,@(mapcar
  1248. (lambda (x)
  1249. (list 'const :tag (concat (symbol-name (nth 0 x))
  1250. ": " (nth 1 x))
  1251. (nth 0 x)))
  1252. reftex-index-macros-builtin)))))
  1253. (defcustom reftex-index-default-macro '(?i "idx")
  1254. "The default index macro for \\[reftex-index-selection-or-word].
  1255. This is a list with (MACRO-KEY DEFAULT-TAG).
  1256. MACRO-KEY: Character identifying an index macro - see `reftex-index-macros'.
  1257. DEFAULT-TAG: This is the tag to be used if the macro requires a TAG argument.
  1258. When this is nil and a TAG is needed, RefTeX will ask for it.
  1259. When this is the empty string and the TAG argument of the index
  1260. macro is optional, the TAG argument will be omitted."
  1261. :group 'reftex-index-support
  1262. :type '(list
  1263. (character :tag "Character identifying default macro")
  1264. (choice :tag "Default index tag "
  1265. (const nil)
  1266. (string))))
  1267. (defcustom reftex-index-default-tag "idx"
  1268. "Default index tag.
  1269. When working with multiple indexes, RefTeX queries for an index tag when
  1270. creating index entries or displaying a specific index. This variable controls
  1271. the default offered for these queries. The default can be selected with RET
  1272. during selection or completion. Valid values of this variable are:
  1273. nil Do not provide a default index
  1274. \"tag\" The default index tag given as a string, e.g. \"idx\".
  1275. last The last used index tag will be offered as default."
  1276. :group 'reftex-index-support
  1277. :type '(choice
  1278. (const :tag "no default" nil)
  1279. (const :tag "last used " last)
  1280. (string :tag "index tag " "idx")))
  1281. (defcustom reftex-index-math-format "$%s$"
  1282. "Format of index entries when copied from inside math mode.
  1283. When `reftex-index-selection-or-word' is executed inside TeX math mode,
  1284. the index key copied from the buffer is processed with this format string
  1285. through the `format' function. This can be used to add the math delimiters
  1286. \(e.g. `$') to the string.
  1287. Requires the `texmathp.el' library which is part of AUCTeX."
  1288. :group 'reftex-index-support
  1289. :type 'string)
  1290. (defcustom reftex-index-phrase-file-extension ".rip"
  1291. "File extension for the index phrase file.
  1292. This extension will be added to the base name of the master file."
  1293. :group 'reftex-index-support
  1294. :type 'string)
  1295. (defcustom reftex-index-phrases-logical-and-regexp " *&& *"
  1296. "Regexp matching the `and' operator for index arguments in phrases file.
  1297. When several index arguments in a phrase line are separated by this
  1298. operator, each part will generate an index macro. So each match of
  1299. the search phrase will produce *several* different index entries.
  1300. Note: make sure this does no match things which are not separators.
  1301. This logical `and' has higher priority than the logical `or' specified in
  1302. `reftex-index-phrases-logical-or-regexp'."
  1303. :group 'reftex-index-support
  1304. :type 'regexp)
  1305. (defcustom reftex-index-phrases-logical-or-regexp " *|| *"
  1306. "Regexp matching the `or' operator for index arguments in phrases file.
  1307. When several index arguments in a phrase line are separated by this
  1308. operator, the user will be asked to select one of them at each match
  1309. of the search phrase. The first index arg will be the default - a
  1310. number key 1-9 must be pressed to switch to another.
  1311. Note: make sure this does no match things which are not separators.
  1312. The logical `and' specified in `reftex-index-phrases-logical-or-regexp'
  1313. has higher priority than this logical `or'."
  1314. :group 'reftex-index-support
  1315. :type 'regexp)
  1316. (defcustom reftex-index-phrases-search-whole-words t
  1317. "Non-nil means phrases search will look for whole words, not subwords.
  1318. This works by requiring word boundaries at the beginning and end of
  1319. the search string. When the search phrase already has a non-word-char
  1320. at one of these points, no word boundary is required there."
  1321. :group 'reftex-index-support
  1322. :type 'boolean)
  1323. (defcustom reftex-index-phrases-case-fold-search t
  1324. "Non-nil means, searching for index phrases will ignore case."
  1325. :group 'reftex-index-support
  1326. :type 'boolean)
  1327. (defcustom reftex-index-verify-function nil
  1328. "A function which is called at each match during global indexing.
  1329. If the function returns nil, the current match is skipped."
  1330. :group 'reftex-index-support
  1331. :type '(choice
  1332. (const :tag "No verification" nil)
  1333. (function)))
  1334. (defcustom reftex-index-phrases-skip-indexed-matches nil
  1335. "Non-nil means, skip matches which appear to be indexed already.
  1336. When doing global indexing from the phrases buffer, searches for some
  1337. phrases may match at places where that phrase was already indexed. In
  1338. particular when indexing an already processed document again, this
  1339. will even be the norm. When this variable is non-nil, RefTeX checks if
  1340. the match is inside an index macro argument, or if an index macro is directly
  1341. before or after the phrase. If that is the case, that match will
  1342. be ignored."
  1343. :group 'reftex-index-support
  1344. :type 'boolean)
  1345. (defcustom reftex-index-phrases-wrap-long-lines nil
  1346. "Non-nil means, when indexing from the phrases buffer, wrap lines.
  1347. Inserting indexing commands in a line makes the line longer - often
  1348. so long that it does not fit onto the screen. When this variable is
  1349. non-nil, newlines will be added as necessary before and/or after the
  1350. indexing command to keep lines short. However, the matched text
  1351. phrase and its index command will always end up on a single line."
  1352. :group 'reftex-index-support
  1353. :type 'boolean)
  1354. (defcustom reftex-index-phrases-sort-prefers-entry nil
  1355. "Non-nil means when sorting phrase lines, the explicit index entry is used.
  1356. Phrase lines in the phrases buffer contain a search phrase, and
  1357. sorting is normally based on these. Some phrase lines also have
  1358. an explicit index argument specified. When this variable is non-nil,
  1359. the index argument will be used for sorting."
  1360. :group 'reftex-index-support
  1361. :type 'boolean)
  1362. (defcustom reftex-index-phrases-sort-in-blocks t
  1363. "Non-nil means, empty and comment lines separate phrase buffer into blocks.
  1364. Sorting will then preserve blocks, so that lines are re-arranged only
  1365. within blocks."
  1366. :group 'reftex-index-support
  1367. :type 'boolean)
  1368. (defcustom reftex-index-section-letters "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1369. "The letters which denote sections in the index.
  1370. Usually these are all capital letters. Don't use any downcase letters.
  1371. Order is not significant, the index will be sorted by whatever the sort
  1372. function thinks is correct.
  1373. In addition to these letters, RefTeX will create a group `!' which
  1374. contains all entries sorted below the lowest specified letter.
  1375. In the index buffer, pressing any of these capital letters or `!' will jump
  1376. to that section."
  1377. :group 'reftex-index-support
  1378. :type '(string :tag "Capital letters"))
  1379. (defcustom reftex-index-include-context nil
  1380. "Non-nil means, display the index definition context in the index buffer.
  1381. This flag may also be toggled from the index buffer with the `c' key."
  1382. :group 'reftex-index-support
  1383. :type 'boolean)
  1384. (defcustom reftex-index-follow-mode nil
  1385. "Non-nil means, point in *Index* buffer will cause other window to follow.
  1386. The other window will show the corresponding part of the document.
  1387. This flag can be toggled from within the *Index* buffer with the `f' key."
  1388. :group 'reftex-table-of-contents-browser
  1389. :type 'boolean)
  1390. ;; Viewing Cross References
  1391. (defgroup reftex-viewing-cross-references nil
  1392. "Displaying cross references and citations."
  1393. :group 'reftex)
  1394. (defcustom reftex-view-crossref-extra nil
  1395. "Macros which can be used for the display of cross references.
  1396. This is used when `reftex-view-crossref' is called with point in an
  1397. argument of a macro. Note that crossref viewing for citations,
  1398. references (both ways) and index entries is hard-coded. This variable
  1399. is only to configure additional structures for which cross-reference
  1400. viewing can be useful. Each entry has the structure
  1401. \(MACRO-RE SEARCH-RE HIGHLIGHT).
  1402. MACRO-RE is matched against the macro. SEARCH-RE is the regexp used
  1403. to search for cross references. `%s' in this regexp is replaced with
  1404. with the macro argument at point. HIGHLIGHT is an integer indicating
  1405. which subgroup of the match should be highlighted."
  1406. :group 'reftex-viewing-cross-references
  1407. :type '(repeat (group (regexp :tag "Macro Regexp ")
  1408. (string :tag "Search Regexp ")
  1409. (integer :tag "Highlight Group"))))
  1410. (defcustom reftex-auto-view-crossref t
  1411. "Non-nil means, initially turn automatic viewing of crossref info on.
  1412. Automatic viewing of crossref info normally uses the echo area.
  1413. Whenever point is idle for more than `reftex-idle-time' seconds on the
  1414. argument of a \\ref or \\cite macro, and no other message is being
  1415. displayed, the echo area will display information about that cross
  1416. reference. You can also set the variable to the symbol `window'. In
  1417. this case a small temporary window is used for the display.
  1418. This feature can be turned on and off from the menu
  1419. \(Ref->Options)."
  1420. :group 'reftex-viewing-cross-references
  1421. :type '(choice (const :tag "off" nil)
  1422. (const :tag "in Echo Area" t)
  1423. (const :tag "in Other Window" window)))
  1424. (defcustom reftex-idle-time 1.2
  1425. "Time (secs) Emacs has to be idle before automatic crossref display is done.
  1426. Applies also to toc recentering."
  1427. :group 'reftex-viewing-cross-references
  1428. :type 'number)
  1429. (defcustom reftex-revisit-to-echo nil
  1430. "Non-nil means, automatic citation display will revisit files if necessary.
  1431. When nil, citation display in echo area will only be active for cached
  1432. entries and for BibTeX database files with live associated buffers."
  1433. :group 'reftex-viewing-cross-references
  1434. :type 'boolean)
  1435. (defcustom reftex-cache-cite-echo t
  1436. "Non-nil means, echoed information for cite macros is cached.
  1437. The information displayed in the echo area for cite macros is
  1438. cached and even saved along with the parsing information. The
  1439. cache survives document scans. In order to clear it, use M-x
  1440. reftex-reset-mode <RET>."
  1441. :group 'reftex-viewing-cross-references
  1442. :type 'boolean)
  1443. (defcustom reftex-display-copied-context-hook nil
  1444. "Normal hook which is run before context is displayed anywhere.
  1445. Designed for X-Symbol, but may have other uses as well."
  1446. :group 'reftex-viewing-cross-references
  1447. :group 'reftex-referencing-labels
  1448. :type 'hook)
  1449. ;; Finding Files --------------------------------------------------------
  1450. (defgroup reftex-finding-files nil
  1451. "Finding files on search paths."
  1452. :group 'reftex)
  1453. (defcustom reftex-texpath-environment-variables '("TEXINPUTS")
  1454. "List of specifications how to retrieve the search path for TeX files.
  1455. Several entries are possible.
  1456. - If an element is the name of an environment variable, its content is used.
  1457. - If an element starts with an exclamation mark, it is used as a command
  1458. to retrieve the path. A typical command with the kpathsearch library would
  1459. be `!kpsewhich -show-path=.tex'.
  1460. - Otherwise the element itself is interpreted as a path.
  1461. Multiple directories can be separated by the system dependent `path-separator'.
  1462. Directories ending in `//' or `!!' will be expanded recursively.
  1463. See also `reftex-use-external-file-finders'."
  1464. :group 'reftex-finding-files
  1465. :set 'reftex-set-dirty
  1466. :type '(repeat (string :tag "Specification")))
  1467. (defcustom reftex-bibpath-environment-variables '("BIBINPUTS" "TEXBIB")
  1468. "List of specifications how to retrieve search path for .bib database files.
  1469. Several entries are possible.
  1470. - If an element is the name of an environment variable, its content is used.
  1471. - If an element starts with an exclamation mark, it is used as a command
  1472. to retrieve the path. A typical command with the kpathsearch library would
  1473. be `!kpsewhich -show-path=.bib'.
  1474. - Otherwise the element itself is interpreted as a path.
  1475. Multiple directories can be separated by the system dependent `path-separator'.
  1476. Directories ending in `//' or `!!' will be expanded recursively.
  1477. See also `reftex-use-external-file-finders'."
  1478. :group 'reftex-citation-support
  1479. :group 'reftex-finding-files
  1480. :set 'reftex-set-dirty
  1481. :type '(repeat (string :tag "Specification")))
  1482. (defcustom reftex-file-extensions '(("tex" . (".tex" ".ltx"))
  1483. ("bib" . (".bib")))
  1484. "Association list with file extensions for different file types.
  1485. This is a list of items, each item is like: (TYPE . (DEF-EXT OTHER-EXT ...))
  1486. TYPE: File type like \"bib\" or \"tex\".
  1487. DEF-EXT: The default extension for that file type, like \".tex\" or \".bib\".
  1488. OTHER-EXT: Any number of other valid extensions for this file type.
  1489. When a files is searched and it does not have any of the legal extensions,
  1490. we try the default extension first, and then the naked file name.
  1491. If you are using AUCTeX, you also need to add new extensions to
  1492. TeX-file-extensions."
  1493. :group 'reftex-finding-files
  1494. :type '(repeat (cons (string :tag "File type")
  1495. (repeat (string :tag "Extension")))))
  1496. (defcustom reftex-try-all-extensions nil
  1497. "Non-nil means, try all extensions listed in `reftex-file-extensions'.
  1498. When searching for a file, LaTeX uses only the default extension. However,
  1499. if you are working with a noweb system that produces the .tex files from
  1500. some other file, and you want RefTeX to scan the web file instead of the
  1501. tex file, you need to set this option. You also need to make the noweb
  1502. extension the default extension, i.e. the first in the list in
  1503. `reftex-file-extensions'.
  1504. Note that if you are using external file finders, this option has no effect."
  1505. :group 'reftex-finding-files
  1506. :type 'boolean)
  1507. (defcustom reftex-search-unrecursed-path-first t
  1508. "Non-nil means, search all specified directories before trying recursion.
  1509. Thus, in a path \".//:/tex/\", search first \"./\", then \"/tex/\" and then
  1510. all subdirectories of \"./\". If this option is nil, the subdirectories of
  1511. \"./\" are searched before \"/tex/\". This is mainly for speed - most of the
  1512. time the recursive path is for the system files and not for the user files.
  1513. Set this to nil if the default makes RefTeX finding files with equal names
  1514. in wrong sequence."
  1515. :group 'reftex-finding-files
  1516. :type 'boolean)
  1517. (defcustom reftex-use-external-file-finders nil
  1518. "Non-nil means, use external programs to find files.
  1519. Normally, RefTeX searches the paths given in the environment variables
  1520. TEXINPUTS and BIBINPUTS to find TeX files and BibTeX database files.
  1521. With this option turned on, it calls an external program specified in the
  1522. option `reftex-external-file-finders' instead. As a side effect,
  1523. the variables `reftex-texpath-environment-variables' and
  1524. `reftex-bibpath-environment-variables' will be ignored."
  1525. :group 'reftex-finding-files
  1526. :type 'boolean)
  1527. (defcustom reftex-external-file-finders '(("tex" . "kpsewhich -format=.tex %f")
  1528. ("bib" . "kpsewhich -format=.bib %f"))
  1529. "Association list with external programs to call for finding files.
  1530. Each entry is a cons cell (TYPE . PROGRAM).
  1531. TYPE is either \"tex\" or \"bib\". PROGRAM is the external program to use with
  1532. any arguments. %f will be replaced by the name of the file to be found.
  1533. Note that these commands will be executed directly, not via a shell.
  1534. Only relevant when `reftex-use-external-file-finders' is non-nil."
  1535. :group 'reftex-finding-files
  1536. :type '(repeat (cons (string :tag "File type")
  1537. (string :tag "Program "))))
  1538. ;; Tuning the parser ----------------------------------------------------
  1539. (defgroup reftex-optimizations-for-large-documents nil
  1540. "Configuration of parser speed and memory usage."
  1541. :group 'reftex)
  1542. (defcustom reftex-keep-temporary-buffers 1
  1543. "Non-nil means, keep buffers created for parsing and lookup.
  1544. RefTeX sometimes needs to visit files related to the current document.
  1545. We distinguish files visited for
  1546. PARSING: Parts of a multifile document loaded when (re)-parsing the document.
  1547. LOOKUP: BibTeX database files and TeX files loaded to find a reference,
  1548. to display label context, etc.
  1549. The created buffers can be kept for later use, or be thrown away immediately
  1550. after use, depending on the value of this variable:
  1551. nil Throw away as much as possible.
  1552. t Keep everything.
  1553. 1 Throw away buffers created for parsing, but keep the ones created
  1554. for lookup.
  1555. If a buffer is to be kept, the file is visited normally (which is potentially
  1556. slow but will happen only once).
  1557. If a buffer is to be thrown away, the initialization of the buffer depends
  1558. upon the variable `reftex-initialize-temporary-buffers'."
  1559. :group 'reftex-optimizations-for-large-documents
  1560. :type '(choice
  1561. (const :tag "Throw away everything" nil)
  1562. (const :tag "Keep everything" t)
  1563. (const :tag "Keep lookup buffers only" 1)))
  1564. (defcustom reftex-initialize-temporary-buffers nil
  1565. "Non-nil means do initializations even when visiting file temporarily.
  1566. When nil, RefTeX may turn off find-file hooks and other stuff to briefly
  1567. visit a file.
  1568. When t, the full default initializations are done (find-file-hook etc.).
  1569. Instead of t or nil, this variable may also be a list of hook functions to
  1570. do a minimal initialization."
  1571. :group 'reftex-optimizations-for-large-documents
  1572. :type '(choice
  1573. (const :tag "Read files literally" nil)
  1574. (const :tag "Fully initialize buffers" t)
  1575. (repeat :tag "Hook functions" :value (nil)
  1576. (function-item))))
  1577. (defcustom reftex-no-include-regexps '("\\.pstex_t\\'")
  1578. "List of regular expressions to exclude certain input files from parsing.
  1579. If the name of a file included via \\include or \\input is matched by any
  1580. of the regular expressions in this list, that file is not parsed by RefTeX."
  1581. :group 'reftex-optimizations-for-large-documents
  1582. :type '(repeat (regexp)))
  1583. (defcustom reftex-enable-partial-scans nil
  1584. "Non-nil means, re-parse only 1 file when asked to re-parse.
  1585. Re-parsing is normally requested with a `C-u' prefix to many RefTeX commands,
  1586. or with the `r' key in menus. When this option is t in a multifile document,
  1587. we will only parse the current buffer, or the file associated with the label
  1588. or section heading near point in a menu. Requesting re-parsing of an entire
  1589. multifile document then requires a `C-u C-u' prefix or the capital `R' key
  1590. in menus."
  1591. :group 'reftex-optimizations-for-large-documents
  1592. :type 'boolean)
  1593. (defcustom reftex-allow-automatic-rescan t
  1594. "Non-nil means, RefTeX may rescan the document when this seems necessary.
  1595. Currently this applies only to rescanning after label insertion, when
  1596. the new label cannot be inserted correctly into the internal label
  1597. list."
  1598. :group 'reftex-optimizations-for-large-documents
  1599. :type 'boolean)
  1600. (defcustom reftex-save-parse-info nil
  1601. "Non-nil means, save information gathered with parsing in a file.
  1602. The file MASTER.rel in the same directory as MASTER.tex is used to save the
  1603. information. When this variable is t,
  1604. - accessing the parsing information for the first time in an editing session
  1605. will read that file (if available) instead of parsing the document.
  1606. - exiting Emacs or killing a buffer in `reftex-mode' will cause a new version
  1607. of the file to be written."
  1608. :group 'reftex-optimizations-for-large-documents
  1609. :type 'boolean)
  1610. (defcustom reftex-parse-file-extension ".rel"
  1611. "File extension for the file in which parser information is stored.
  1612. This extension is added to the base name of the master file."
  1613. :group 'reftex-optimizations-for-large-documents
  1614. :type 'string)
  1615. (defcustom reftex-use-multiple-selection-buffers nil
  1616. "Non-nil means use a separate selection buffer for each label type.
  1617. These buffers are kept from one selection to the next and need not to be
  1618. created for each use - so the menu generally comes up faster. The
  1619. selection buffers will be erased (and therefore updated) automatically
  1620. when new labels in its category are added. See the variable
  1621. `reftex-auto-update-selection-buffers'."
  1622. :group 'reftex-optimizations-for-large-documents
  1623. :group 'reftex-referencing-labels
  1624. :type 'boolean)
  1625. (defcustom reftex-auto-update-selection-buffers t
  1626. "Non-nil means, selection buffers will be updated automatically.
  1627. When a new label is defined with `reftex-label', all selection buffers
  1628. associated with that label category are emptied, in order to force an
  1629. update upon next use. When nil, the buffers are left alone and have to be
  1630. updated by hand, with the `g' key from the label selection process.
  1631. The value of this variable will only have any effect when
  1632. `reftex-use-multiple-selection-buffers' is non-nil."
  1633. :group 'reftex-optimizations-for-large-documents
  1634. :group 'reftex-referencing-labels
  1635. :type 'boolean)
  1636. ;; Fontification and Faces ----------------------------------------------
  1637. (defgroup reftex-fontification-configurations nil
  1638. "Options concerning the faces used in RefTeX."
  1639. :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces)
  1640. :group 'reftex)
  1641. (defcustom reftex-use-fonts t
  1642. "Non-nil means, use fonts in *toc* and selection buffers.
  1643. Font-lock must be loaded as well to actually get fontified display.
  1644. When changing this option, a rescan may be necessary to activate the change."
  1645. :group 'reftex-fontification-configurations
  1646. :type 'boolean)
  1647. (defcustom reftex-refontify-context 1
  1648. "Non-nil means, re-fontify the context in the label menu with font-lock.
  1649. This slightly slows down the creation of the label menu. It is only necessary
  1650. when you definitely want the context fontified.
  1651. This option may have 3 different values:
  1652. nil Never refontify.
  1653. t Always refontify.
  1654. 1 Refontify when absolutely necessary, e.g. when old versions of X-Symbol.
  1655. The option is ignored when `reftex-use-fonts' is nil."
  1656. :group 'reftex-fontification-configurations
  1657. :group 'reftex-referencing-labels
  1658. :type '(choice
  1659. (const :tag "Never" nil)
  1660. (const :tag "Always" t)
  1661. (const :tag "When necessary" 1)))
  1662. (defcustom reftex-highlight-selection 'cursor
  1663. "Non-nil mean, highlight selected text in selection and *toc* buffers.
  1664. Normally, the text near the cursor is the selected text, and it is
  1665. highlighted. This is the entry most keys in the selection and *toc*
  1666. buffers act on. However, if you mainly use the mouse to select an
  1667. item, you may find it nice to have mouse-triggered highlighting
  1668. instead or as well. The variable may have one of these values:
  1669. nil No highlighting.
  1670. cursor Highlighting is cursor driven.
  1671. mouse Highlighting is mouse driven.
  1672. both Both cursor and mouse trigger highlighting.
  1673. Changing this variable requires rebuilding the selection and *toc* buffers
  1674. to become effective (keys `g' or `r')."
  1675. :group 'reftex-fontification-configurations
  1676. :type '(choice
  1677. (const :tag "Never" nil)
  1678. (const :tag "Cursor driven" cursor)
  1679. (const :tag "Mouse driven" mouse)
  1680. (const :tag "Mouse and Cursor driven." both)))
  1681. (defcustom reftex-cursor-selected-face 'highlight
  1682. "Face name to highlight cursor selected item in toc and selection buffers.
  1683. See also the variable `reftex-highlight-selection'."
  1684. :group 'reftex-fontification-configurations
  1685. :type 'symbol)
  1686. (defcustom reftex-mouse-selected-face 'secondary-selection
  1687. "Face name to highlight mouse selected item in toc and selection buffers.
  1688. See also the variable `reftex-highlight-selection'."
  1689. :group 'reftex-fontification-configurations
  1690. :type 'symbol)
  1691. (defcustom reftex-file-boundary-face 'font-lock-comment-face
  1692. "Face name for file boundaries in selection buffer."
  1693. :group 'reftex-fontification-configurations
  1694. :type 'symbol)
  1695. (defcustom reftex-label-face 'font-lock-constant-face
  1696. "Face name for labels in selection buffer."
  1697. :group 'reftex-fontification-configurations
  1698. :type 'symbol)
  1699. (defcustom reftex-section-heading-face 'font-lock-function-name-face
  1700. "Face name for section headings in toc and selection buffers."
  1701. :group 'reftex-fontification-configurations
  1702. :type 'symbol)
  1703. (defcustom reftex-toc-header-face 'font-lock-comment-face
  1704. "Face name for the header of a toc buffer."
  1705. :group 'reftex-fontification-configurations
  1706. :type 'symbol)
  1707. (defcustom reftex-bib-author-face 'font-lock-keyword-face
  1708. "Face name for author names in bib selection buffer."
  1709. :group 'reftex-fontification-configurations
  1710. :type 'symbol)
  1711. (defcustom reftex-bib-year-face 'font-lock-comment-face
  1712. "Face name for year in bib selection buffer."
  1713. :group 'reftex-fontification-configurations
  1714. :type 'symbol)
  1715. (defcustom reftex-bib-title-face 'font-lock-function-name-face
  1716. "Face name for article title in bib selection buffer."
  1717. :group 'reftex-fontification-configurations
  1718. :type 'symbol)
  1719. (defcustom reftex-bib-extra-face 'font-lock-comment-face
  1720. "Face name for bibliographic information in bib selection buffer."
  1721. :group 'reftex-fontification-configurations
  1722. :type 'symbol)
  1723. (defcustom reftex-select-mark-face 'bold
  1724. "Face name for marked entries in the selection buffers."
  1725. :group 'reftex-fontification-configurations
  1726. :type 'symbol)
  1727. (defcustom reftex-index-header-face 'font-lock-comment-face
  1728. "Face name for the header of an index buffer."
  1729. :group 'reftex-fontification-configurations
  1730. :type 'symbol)
  1731. (defcustom reftex-index-section-face 'font-lock-function-name-face
  1732. "Face name for the start of a new letter section in the index."
  1733. :group 'reftex-fontification-configurations
  1734. :type 'symbol)
  1735. (defcustom reftex-index-tag-face 'font-lock-keyword-face
  1736. "Face name for index names (for multiple indices)."
  1737. :group 'reftex-fontification-configurations
  1738. :type 'symbol)
  1739. (defcustom reftex-index-face 'font-lock-constant-face
  1740. "Face name for index entries."
  1741. :group 'reftex-fontification-configurations
  1742. :type 'symbol)
  1743. (defcustom reftex-pre-refontification-functions nil
  1744. "X-Symbol specific hook.
  1745. Functions get two arguments, the buffer from where the command started and a
  1746. symbol indicating in what context the hook is called."
  1747. :group 'reftex-fontification-configurations
  1748. :type 'hook)
  1749. ;; Miscellaneous configurations -----------------------------------------
  1750. (defgroup reftex-miscellaneous-configurations nil
  1751. "Collection of further configurations."
  1752. :group 'reftex)
  1753. (defcustom reftex-extra-bindings nil
  1754. "Non-nil means, make additional key bindings on startup.
  1755. These extra bindings are located in the users `C-c letter' map.
  1756. Note that this variable needs to be set before reftex is loaded."
  1757. :group 'reftex-miscellaneous-configurations
  1758. :type 'boolean)
  1759. (defcustom reftex-plug-into-AUCTeX nil
  1760. "Plug-in flags for AUCTeX interface.
  1761. This variable is a list of 5 boolean flags. When a flag is non-nil,
  1762. RefTeX will
  1763. - supply labels in new sections and environments (flag 1)
  1764. - supply arguments for macros like `\\label'. (flag 2)
  1765. - supply arguments for macros like `\\ref'. (flag 3)
  1766. - supply arguments for macros like `\\cite'. (flag 4)
  1767. - supply arguments for macros like `\\index'. (flag 5)
  1768. You may also set the variable itself to t or nil in order to turn all
  1769. plug-ins on or off, respectively.
  1770. \\<LaTeX-mode-map>Supplying labels in new sections and environments applies when creating
  1771. sections with \\[LaTeX-section] and environments with \\[LaTeX-environment].
  1772. Supplying macro arguments applies when you insert such a macro interactively
  1773. with \\[TeX-insert-macro].
  1774. See the AUCTeX documentation for more information.
  1775. RefTeX uses `fset' to take over the function calls. Changing the variable
  1776. may require a restart of Emacs in order to become effective."
  1777. :group 'reftex-miscellaneous-configurations
  1778. :group 'LaTeX
  1779. :type '(choice
  1780. (const :tag "No plug-ins" nil)
  1781. (const :tag "All possible plug-ins" t)
  1782. (list
  1783. :tag "Individual choice"
  1784. :value (t t t t t)
  1785. (boolean :tag "supply label in new sections and environments")
  1786. (boolean :tag "supply argument for macros like `\\label' ")
  1787. (boolean :tag "supply argument for macros like `\\ref' ")
  1788. (boolean :tag "supply argument for macros like `\\cite' ")
  1789. (boolean :tag "supply argument for macros like `\\index' "))))
  1790. (defcustom reftex-allow-detached-macro-args nil
  1791. "Non-nil means, allow arguments of macros to be detached by whitespace.
  1792. When this is t, `aaa' will be considered as argument of \\bb in the following
  1793. construct: \\bbb [xxx] {aaa}."
  1794. :group 'reftex-miscellaneous-configurations
  1795. :type 'boolean)
  1796. (defcustom reftex-load-hook nil
  1797. "Hook which is being run when loading reftex.el."
  1798. :group 'reftex-miscellaneous-configurations
  1799. :type 'hook)
  1800. (defcustom reftex-mode-hook nil
  1801. "Hook which is being run when turning on RefTeX mode."
  1802. :group 'reftex-miscellaneous-configurations
  1803. :type 'hook)
  1804. (provide 'reftex-vars)
  1805. ;;; reftex-vars.el ends here