[Tex/LaTex] \RequirePackage without option clashes because of the package loading order

colorincompatibilityoption-clashpackage-optionspackage-writing

I am writing a package which requires the xcolor package with table option.
It is loaded in the package with

\PassOptionsToPackage{table}{xcolor}
\RequirePackage{xcolor}

which works if my package is loaded after the user loaded xcolor itself. However if my package is loaded before the user loads xcolor, the user gets an option clash.

I can not load xcolor at the beginning of the document. In that case more or less the whole package can only be loaded at the beginning of the document.

How can/should this be solved?

Best Answer

try

\RequirePackage{colortbl}
\RequirePackage{xcolor}

instead. xcolor does the same with the option table