auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: best practice for writing optional code


From: Ikumi Keita
Subject: Re: best practice for writing optional code
Date: Mon, 02 Nov 2020 01:58:42 +0900

Hi Yvon,

>>>>> Yvon Henel <yvon.henel@yvon-henel.fr> writes:
> My problem is that the LaTeX package has options which determine which
> LaTeX commands will be available in the document.

> Is there a best practice to do so? Are there already some functions
> for ensuring that a certain option has been passed to a LaTeX package?

Sure. `LaTeX-provided-package-options-member' is probably what you want.
The usage is
(LaTeX-provided-package-options-member "PACKAGE-NAME" "OPTION")
. This form returns non-nil if \usepackage contains the specified OPTION
for the PACKAGE-NAME. For example, ocg-p.el has the following code:
----------------------------------------------------------------------
   (when (LaTeX-provided-package-options-member "ocg-p" "ocgtabular")
     (LaTeX-add-environments
     ...
----------------------------------------------------------------------

Regards,
Ikumi Keita



reply via email to

[Prev in Thread] Current Thread [Next in Thread]