5.6.4.2 Examining Package and Class Options
In LaTeX documents, style hooks can find the package names and those options given as optional argument(s) of '\usepackage' in LaTeX-provided-package-options.
Variable: LaTeX-provided-package-options
Buffer local variable holding alist of options provided to LaTeX packages. Each element is a cons cell (package . option-list). For example, its value will be
(("babel" . ("german"))
("geometry" . ("a4paper" "top=2cm" "left=2.5cm" "right=2.5cm"))
...)
You can examine whether there is a specific package-option pair by LaTeX-provided-package-options-member.
Function: LaTeX-provided-package-options-member package option
Return non-nil if option has been given to package. The value is actually the tail of the list of options given to package.
There are similar facilities for class names and those options given in \documentclass declaration.
Variable: LaTeX-provided-class-options
Buffer local variable holding alist of options provided to LaTeX classes. Each element is a cons cell (class . option-list). For example, its value will be
(("book" . ("a4paper" "11pt" "openany" "fleqn"))
...)
Function: LaTeX-provided-class-options-member class option
Return non-nil if option has been given to class. The value is actually the tail of the list of options given to class.
Function: LaTeX-match-class-option regexp
Check if a documentclass option matching regexp is active. Return first found class option matching regexp, or nil if not found.
These functions are also useful to implement customized predicate(s) in TeX-view-predicate-list. See Starting Viewers.