[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] How to apply different 'style-hook' for a document dependin
From: |
Tassilo Horn |
Subject: |
Re: [AUCTeX] How to apply different 'style-hook' for a document depending on option passed to a package? |
Date: |
Mon, 28 Oct 2013 12:00:32 +0100 |
User-agent: |
Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) |
Vladimir Lomov <address@hidden> writes:
Hi Vladimir,
> In other words: is it possible to apply different 'hook' files on a
> document depending on option passed to a package?
Long story short: i think up to 11.87, your style file can check the
value of `TeX-active-styles'. Package options are included in there,
too, so in your example it would contain "conf=set1". However, if you
have a document with
\usepackage[conf=set1]{bar}
\usepackage[conf=set2]{some-package}
it's not really obvious what option belongs to which package, so in case
2 used packages have the same options, you're basically out of luck.
The current AUCTeX version in git has been improved in that respect.
`TeX-active-styles' doesn't contain package options anymore. Instead,
there's a new variable `LaTeX-provided-package-options' which is an
alist associating with each used package the options given to it. So
the above example would result in
'(("bar" "conf=set1") ("some-package" "conf=set2"))
So your some-package.el style file could check the value of
`LaTeX-provided-package-options' to do whatever needs to be done
depending if conf=set1 or conf=set2.
HTH,
Tassilo