4

Sometimes options supported by a package are scattered all over a 100-page documentation rather than given in a list, and it is hard to understand if the package implements certain functionality.

Is there a universal way to list or print all options supported by a package? Something like

$ package --help
The 'package' package supports the following options:
draft
final
color
...

So that I know I can use

\usepackage[draft,color]{package}
  • By 'options' do you mean load-time options or settings or configuration macros? – Joseph Wright Jun 14 '21 at 09:32
  • To be honest, I don't know the difference between these 3 types. I mean those that are passed to \usepackage[...]{package} (and are most obvious for me) – homocomputeris Jun 14 '21 at 09:37
  • 1
    OK, so only package load options – Joseph Wright Jun 14 '21 at 09:41
  • Of course there is a way but it is up to the package's author as to how the documentation appears. Or are you asking for some program that goes through all the package codes and extracts their options? – Peter Wilson Jun 14 '21 at 17:18
  • I thought there might be some derived files that list the options or some default function to do it. For example, TeXstudio and TeXify IDEA somehow know which options can be autocompleted. – homocomputeris Jun 15 '21 at 15:08
  • AFAIK those auto-complete files are not generally derived automatically from .sty files, they are curated by the IDE developers. (I guess it would be possible to get a first approximation of the options a package supports by Ctrl+F-ing the source for \DeclareOption and its variant forms, but in the end there are many ways options can be defined [also via helper macros], so hunting them with a simple text search is not enough). – moewe Jun 16 '21 at 05:40

0 Answers0