wdbibtex.LaTeX.is_package_used#

LaTeX.is_package_used(p)[source]#

Returns if the package is used.

Returns False if the package is not used while True if the package is used without option. If the package is used with option(s), returns List of option(s).

Parameters:
pstr

Package name to find.

Returns:
bool or list

False if the package is not used. True if the package is used without option. List of option(s) if the package is used with option(s).

Examples

>>> import wdbibtex
>>> tx = wdbibtex.LaTeX()
>>> tx.add_package('cite')
>>> tx.is_package_used('cite')
True
>>> tx.add_package('graphicx', 'dvipdfmx')
>>> tx.is_package_used('graphicx')
['dvipdfmx']
>>> tx.is_package_used('xcolor')
False
>>> print(tx.packages)
\usepackage{cite}
\usepackage[dvipdfmx]{graphicx}