Hi Jason,

2016-03-06 13:37 GMT+01:00 Alexander,J <[email protected]>:
> Are there any functions provided by AUCTeX that allow one to check whether a 
> particular package is loaded?  I've written a yasnippet which inserts a 
> payoff matrix using the "game" environment as defined by sgame.sty or 
> sgamevar.sty -- except these two macro packages use slightly different 
> syntax. The first uses "&" as the column separator (just like tabular) but 
> the latter uses "\>". It would be nice to be able to automatically detect 
> which package was loaded via \usepackage so as to just do the right thing 
> without any further input from the user.

The list of loaded packages is hold in `TeX-active-styles', you want
to do something like

--8<---------------cut here---------------start------------->8---
(cond ((member "sgame" TeX-active-styles)
       ;; do something with "sgame" package
       )
      ((member "sgamevar" TeX-active-styles)
       ;; do something else with "sgamevar" package
       ))
--8<---------------cut here---------------end--------------->8---

Note that you can also test package options with
`LaTeX-provided-package-options-member' function, whose syntax is

    (LaTeX-provided-package-options-member PACKAGE OPTION)

but this isn't useful to test whether a package is loaded, just for its options.

Bye,
Mosè

_______________________________________________
auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex

Reply via email to